ConvocationRepository

Trait ConvocationRepository 

Source
pub trait ConvocationRepository: Send + Sync {
    // Required methods
    fn create<'life0, 'life1, 'async_trait>(
        &'life0 self,
        convocation: &'life1 Convocation,
    ) -> Pin<Box<dyn Future<Output = Result<Convocation, String>> + 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<Convocation>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_meeting_id<'life0, 'async_trait>(
        &'life0 self,
        meeting_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Convocation>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_building<'life0, 'async_trait>(
        &'life0 self,
        building_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_organization<'life0, 'async_trait>(
        &'life0 self,
        organization_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_status<'life0, 'async_trait>(
        &'life0 self,
        organization_id: Uuid,
        status: ConvocationStatus,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_pending_scheduled<'life0, 'async_trait>(
        &'life0 self,
        now: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_needing_reminder<'life0, 'async_trait>(
        &'life0 self,
        now: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update<'life0, 'life1, 'async_trait>(
        &'life0 self,
        convocation: &'life1 Convocation,
    ) -> Pin<Box<dyn Future<Output = Result<Convocation, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn count_by_building<'life0, 'async_trait>(
        &'life0 self,
        building_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn count_by_status<'life0, 'async_trait>(
        &'life0 self,
        organization_id: Uuid,
        status: ConvocationStatus,
    ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

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

Create a new convocation

Source

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

Find convocation by ID

Source

fn find_by_meeting_id<'life0, 'async_trait>( &'life0 self, meeting_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Convocation>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find convocation by meeting ID

Source

fn find_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find all convocations for a building

Source

fn find_by_organization<'life0, 'async_trait>( &'life0 self, organization_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find all convocations for an organization

Source

fn find_by_status<'life0, 'async_trait>( &'life0 self, organization_id: Uuid, status: ConvocationStatus, ) -> Pin<Box<dyn Future<Output = Result<Vec<Convocation>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find convocations by status

Source

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

Find convocations scheduled to be sent (status = Scheduled and scheduled_send_date <= now)

Source

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

Find sent convocations that need reminder (sent but 3 days before meeting, reminder not sent yet)

Source

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

Update convocation

Source

fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete convocation

Source

fn count_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count convocations by building

Source

fn count_by_status<'life0, 'async_trait>( &'life0 self, organization_id: Uuid, status: ConvocationStatus, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count convocations by status

Implementors§