Skip to main content

FundRepository

Trait FundRepository 

Source
pub trait FundRepository: Send + Sync {
    // Required methods
    fn create<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fund: &'life1 Fund,
    ) -> Pin<Box<dyn Future<Output = Result<Fund, 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<Fund>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_acp_id<'life0, 'async_trait>(
        &'life0 self,
        acp_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Fund>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fund: &'life1 Fund,
    ) -> Pin<Box<dyn Future<Output = Result<Fund, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_reassignment<'life0, 'life1, 'async_trait>(
        &'life0 self,
        reassignment: &'life1 FundReassignment,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_reassignments<'life0, 'async_trait>(
        &'life0 self,
        fund_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<FundReassignment>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

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

Persist a freshly created fund.

Source

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

Look up a fund by its primary key.

Source

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

List all funds belonging to an ACP (all three natures combined).

Source

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

Persist balance/purpose changes (contribution, reassignment).

Source

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

Append a reassignment to the audit trail. Never mutated afterward (append-only, like SyndicResponse — cf. AppError::ResponseImmutable precedent).

Source

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

List the reassignment history of a fund, most recent first.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§