NoticeRepository

Trait NoticeRepository 

Source
pub trait NoticeRepository: Send + Sync {
Show 15 methods // Required methods fn create<'life0, 'life1, 'async_trait>( &'life0 self, notice: &'life1 Notice, ) -> Pin<Box<dyn Future<Output = Result<Notice, 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<Notice>, 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<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_published_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_pinned_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_type<'life0, 'async_trait>( &'life0 self, building_id: Uuid, notice_type: NoticeType, ) -> Pin<Box<dyn Future<Output = Result<Vec<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_category<'life0, 'async_trait>( &'life0 self, building_id: Uuid, category: NoticeCategory, ) -> Pin<Box<dyn Future<Output = Result<Vec<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_status<'life0, 'async_trait>( &'life0 self, building_id: Uuid, status: NoticeStatus, ) -> Pin<Box<dyn Future<Output = Result<Vec<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_author<'life0, 'async_trait>( &'life0 self, author_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_expired<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Notice>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn update<'life0, 'life1, 'async_trait>( &'life0 self, notice: &'life1 Notice, ) -> Pin<Box<dyn Future<Output = Result<Notice, 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<(), 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_published_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_pinned_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;
}
Expand description

Repository port for Notice aggregate

Required Methods§

Source

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

Create a new notice

Source

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

Find notice by ID

Source

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

Find all notices for a building

Source

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

Find all published notices for a building (visible to members)

Source

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

Find all pinned notices for a building (important announcements)

Source

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

Find notices by type (Announcement, Event, LostAndFound, ClassifiedAd)

Source

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

Find notices by category (General, Maintenance, Social, Security, etc.)

Source

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

Find notices by status (Draft, Published, Archived, Expired)

Source

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

Find all notices created by an author (Owner)

Source

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

Find all expired notices for a building (for auto-archiving)

Source

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

Update an existing notice

Source

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

Delete a notice

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 total notices for a building

Source

fn count_published_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 published notices for a building

Source

fn count_pinned_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 pinned notices for a building

Implementors§