Skip to main content

SyndicResponseRepository

Trait SyndicResponseRepository 

Source
pub trait SyndicResponseRepository: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        response: &'life1 SyndicResponse,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_for_ticket<'life0, 'async_trait>(
        &'life0 self,
        ticket_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SyndicResponse>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_overdue_tickets<'life0, 'async_trait>(
        &'life0 self,
        now: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn mark_ticket_escalated<'life0, 'async_trait>(
        &'life0 self,
        ticket_id: Uuid,
        escalated_at: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, response: &'life1 SyndicResponse, ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist a freshly minted response. Implementation MUST NOT attempt UPDATE ... ON CONFLICT — the table is append-only and the DB trigger guards against any subsequent mutation (INV-23).

Source

fn list_for_ticket<'life0, 'async_trait>( &'life0 self, ticket_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<SyndicResponse>, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List every response attached to a ticket, oldest first (audit order).

Source

fn find_overdue_tickets<'life0, 'async_trait>( &'life0 self, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the ids of tickets whose SLA deadline (sla_due_at) is past now AND that have not been escalated yet (sla_escalated_at IS NULL). Cron entry point.

Source

fn mark_ticket_escalated<'life0, 'async_trait>( &'life0 self, ticket_id: Uuid, escalated_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Mark a ticket as SLA-escalated. Idempotent: if the column already carries a timestamp, the implementation SHOULD leave it untouched (audit fidelity — first event wins).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§