Skip to main content

TechnicalSpecRepository

Trait TechnicalSpecRepository 

Source
pub trait TechnicalSpecRepository: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        spec: &'life1 TechnicalSpec,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        spec_id: Uuid,
        status: &'life1 str,
        updated_at: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_id<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TechnicalSpec>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_for_acp<'life0, 'async_trait>(
        &'life0 self,
        acp_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TechnicalSpec>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save_signature<'life0, 'life1, 'async_trait>(
        &'life0 self,
        sig: &'life1 TechnicalSpecSignature,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_signatures_for_spec<'life0, 'async_trait>(
        &'life0 self,
        spec_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TechnicalSpecSignature>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

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

Persist a freshly minted spec (Draft).

Source

fn update_status<'life0, 'life1, 'async_trait>( &'life0 self, spec_id: Uuid, status: &'life1 str, updated_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update a spec’s mutable workflow attributes (status / updated_at). Used by the workflow transitions (submit, mark_approved). The repository implementation MUST NOT allow title / description / version edits — those happen exclusively via bump_version which goes through save on a brand-new row.

Source

fn find_by_id<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<TechnicalSpec>, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

List all specs for an ACP, newest first.

Source

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

Persist an append-only signature. The DB UNIQUE constraint on (spec_id, signatory_user_id, role) means a duplicate insert will surface as AppError::SignatureAlreadyExists (the impl translates the SQL conflict).

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§