koprogo_api/application/ports/
call_for_funds_repository.rs1use crate::domain::entities::CallForFunds;
2use async_trait::async_trait;
3use uuid::Uuid;
4
5#[async_trait]
6pub trait CallForFundsRepository: Send + Sync {
7 async fn create(&self, call_for_funds: &CallForFunds) -> Result<CallForFunds, String>;
9
10 async fn find_by_id(&self, id: Uuid) -> Result<Option<CallForFunds>, String>;
12
13 async fn find_by_building(&self, building_id: Uuid) -> Result<Vec<CallForFunds>, String>;
15
16 async fn find_by_organization(
18 &self,
19 organization_id: Uuid,
20 ) -> Result<Vec<CallForFunds>, String>;
21
22 async fn update(&self, call_for_funds: &CallForFunds) -> Result<CallForFunds, String>;
24
25 async fn delete(&self, id: Uuid) -> Result<bool, String>;
27
28 async fn find_overdue(&self) -> Result<Vec<CallForFunds>, String>;
30}