pub struct AgeRequestUseCases {
pub repo: Arc<dyn AgeRequestRepository>,
}Fields§
§repo: Arc<dyn AgeRequestRepository>Implementations§
Source§impl AgeRequestUseCases
impl AgeRequestUseCases
pub fn new(repo: Arc<dyn AgeRequestRepository>) -> Self
Sourcepub async fn create(
&self,
organization_id: Uuid,
created_by: Uuid,
dto: CreateAgeRequestDto,
) -> Result<AgeRequestResponseDto, String>
pub async fn create( &self, organization_id: Uuid, created_by: Uuid, dto: CreateAgeRequestDto, ) -> Result<AgeRequestResponseDto, String>
Crée une nouvelle demande d’AGE (B17-1)
Sourcepub async fn get(
&self,
id: Uuid,
organization_id: Uuid,
) -> Result<AgeRequestResponseDto, String>
pub async fn get( &self, id: Uuid, organization_id: Uuid, ) -> Result<AgeRequestResponseDto, String>
Récupère une demande par son ID
Sourcepub async fn list_by_building(
&self,
building_id: Uuid,
organization_id: Uuid,
) -> Result<Vec<AgeRequestResponseDto>, String>
pub async fn list_by_building( &self, building_id: Uuid, organization_id: Uuid, ) -> Result<Vec<AgeRequestResponseDto>, String>
Liste les demandes d’un bâtiment
Sourcepub async fn open(
&self,
id: Uuid,
organization_id: Uuid,
requester_id: Uuid,
) -> Result<AgeRequestResponseDto, String>
pub async fn open( &self, id: Uuid, organization_id: Uuid, requester_id: Uuid, ) -> Result<AgeRequestResponseDto, String>
Ouvre une demande pour signatures publiques (Draft → Open)
Sourcepub async fn add_cosignatory(
&self,
id: Uuid,
organization_id: Uuid,
dto: AddCosignatoryDto,
) -> Result<AgeRequestResponseDto, String>
pub async fn add_cosignatory( &self, id: Uuid, organization_id: Uuid, dto: AddCosignatoryDto, ) -> Result<AgeRequestResponseDto, String>
Ajoute un cosignataire à la demande (B17-2) Calcule automatiquement si le seuil 1/5 est atteint
Sourcepub async fn remove_cosignatory(
&self,
id: Uuid,
owner_id: Uuid,
organization_id: Uuid,
) -> Result<AgeRequestResponseDto, String>
pub async fn remove_cosignatory( &self, id: Uuid, owner_id: Uuid, organization_id: Uuid, ) -> Result<AgeRequestResponseDto, String>
Retire un cosignataire
Sourcepub async fn submit_to_syndic(
&self,
id: Uuid,
organization_id: Uuid,
requester_id: Uuid,
) -> Result<AgeRequestResponseDto, String>
pub async fn submit_to_syndic( &self, id: Uuid, organization_id: Uuid, requester_id: Uuid, ) -> Result<AgeRequestResponseDto, String>
Soumet la demande au syndic (Reached → Submitted) - B17-3 Démarre le délai de 15j (Art. 3.87 §2 CC)
Sourcepub async fn syndic_response(
&self,
id: Uuid,
organization_id: Uuid,
dto: SyndicResponseDto,
) -> Result<AgeRequestResponseDto, String>
pub async fn syndic_response( &self, id: Uuid, organization_id: Uuid, dto: SyndicResponseDto, ) -> Result<AgeRequestResponseDto, String>
Le syndic répond à la demande (accept ou reject) - B17-3
Sourcepub async fn trigger_auto_convocation(
&self,
id: Uuid,
organization_id: Uuid,
) -> Result<AgeRequestResponseDto, String>
pub async fn trigger_auto_convocation( &self, id: Uuid, organization_id: Uuid, ) -> Result<AgeRequestResponseDto, String>
Déclenche l’auto-convocation si le délai syndic est dépassé (B17-3) Peut être appelé manuellement ou par un job de fond
Sourcepub async fn withdraw(
&self,
id: Uuid,
organization_id: Uuid,
requester_id: Uuid,
) -> Result<AgeRequestResponseDto, String>
pub async fn withdraw( &self, id: Uuid, organization_id: Uuid, requester_id: Uuid, ) -> Result<AgeRequestResponseDto, String>
Retire la demande
Sourcepub async fn process_expired_deadlines(&self) -> Result<usize, String>
pub async fn process_expired_deadlines(&self) -> Result<usize, String>
Job de fond : vérifie et expire les demandes dont le délai syndic est dépassé (B17-3)
Auto Trait Implementations§
impl Freeze for AgeRequestUseCases
impl !RefUnwindSafe for AgeRequestUseCases
impl Send for AgeRequestUseCases
impl Sync for AgeRequestUseCases
impl Unpin for AgeRequestUseCases
impl UnsafeUnpin for AgeRequestUseCases
impl !UnwindSafe for AgeRequestUseCases
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.