pub struct AcpUseCases { /* private fields */ }Implementations§
Source§impl AcpUseCases
impl AcpUseCases
pub fn new( repository: Arc<dyn AcpRepository>, organization_repository: Arc<dyn OrganizationRepository>, ) -> Self
Sourcepub async fn create_acp(
&self,
caller: &AcpCaller,
dto: CreateAcpDto,
) -> Result<AcpResponseDto, AppError>
pub async fn create_acp( &self, caller: &AcpCaller, dto: CreateAcpDto, ) -> Result<AcpResponseDto, AppError>
Crée une ACP. Admin only.
Sourcepub async fn find_acp(&self, acp_id: Uuid) -> Result<Option<Acp>, AppError>
pub async fn find_acp(&self, acp_id: Uuid) -> Result<Option<Acp>, AppError>
Récupère une ACP sans scope check (usage interne — scope_guard helper #603).
Retourne Ok(None) si l’ACP n’existe pas.
Sourcepub async fn get_acp(
&self,
caller: &AcpCaller,
id: Uuid,
) -> Result<AcpResponseDto, AppError>
pub async fn get_acp( &self, caller: &AcpCaller, id: Uuid, ) -> Result<AcpResponseDto, AppError>
Récupère une ACP par id, avec scope guard.
Sourcepub async fn list_acps(
&self,
caller: &AcpCaller,
) -> Result<Vec<AcpResponseDto>, AppError>
pub async fn list_acps( &self, caller: &AcpCaller, ) -> Result<Vec<AcpResponseDto>, AppError>
Liste les ACPs visibles pour l’appelant.
Sourcepub async fn list_acps_with_metrics(
&self,
caller: &AcpCaller,
) -> Result<Vec<AcpAvecMetriquesDto>, AppError>
pub async fn list_acps_with_metrics( &self, caller: &AcpCaller, ) -> Result<Vec<AcpAvecMetriquesDto>, AppError>
Les ACP du périmètre, avec leurs métriques.
Sert la table « Mes ACP » du tableau de bord syndic : blocs, lots
encodés et déclarés, somme des quotités. Le cloisonnement est celui de
list_acps — caller.list_scope() —, donc un syndic ne voit que les
ACP de son cabinet et un copropriétaire que les siennes.
Sourcepub async fn update_acp(
&self,
caller: &AcpCaller,
id: Uuid,
dto: UpdateAcpDto,
) -> Result<AcpResponseDto, AppError>
pub async fn update_acp( &self, caller: &AcpCaller, id: Uuid, dto: UpdateAcpDto, ) -> Result<AcpResponseDto, AppError>
Met à jour une ACP. Admin only.
Sourcepub async fn archive_acp(
&self,
caller: &AcpCaller,
id: Uuid,
) -> Result<(), AppError>
pub async fn archive_acp( &self, caller: &AcpCaller, id: Uuid, ) -> Result<(), AppError>
Archive (=DELETE physique en v0.1.0) une ACP. Admin only.
Sourcepub async fn assert_can_see_acp(
&self,
caller: &AcpCaller,
acp_id: Uuid,
) -> Result<(), AppError>
pub async fn assert_can_see_acp( &self, caller: &AcpCaller, acp_id: Uuid, ) -> Result<(), AppError>
Public scope-check used by Story 1.3 scope_guard middleware.
Loads the ACP by id then delegates to assert_scope.
Refuses with AcpNotInScope if the ACP does not exist (no
resource-existence leak across cabinets).
Auto Trait Implementations§
impl !RefUnwindSafe for AcpUseCases
impl !UnwindSafe for AcpUseCases
impl Freeze for AcpUseCases
impl Send for AcpUseCases
impl Sync for AcpUseCases
impl Unpin for AcpUseCases
impl UnsafeUnpin for AcpUseCases
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
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>
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 more