pub struct FundUseCases { /* private fields */ }Implementations§
Source§impl FundUseCases
impl FundUseCases
pub fn new(repo: Arc<dyn FundRepository>) -> Self
Sourcepub async fn create_working_capital_or_reserve(
&self,
acp_id: Uuid,
kind: FundKind,
name: String,
) -> Result<Fund, AppError>
pub async fn create_working_capital_or_reserve( &self, acp_id: Uuid, kind: FundKind, name: String, ) -> Result<Fund, AppError>
Crée un fonds de roulement ou de réserve (pas de vote qualifié
requis à ce niveau — la réserve légale reste gouvernée par
Acp::assert_reserve_fund_compliant, ADR-0012).
Sourcepub async fn create_earmarked_fund(
&self,
acp_id: Uuid,
name: String,
purpose: String,
target_amount: Decimal,
majority_used: MajorityType,
) -> Result<Fund, AppError>
pub async fn create_earmarked_fund( &self, acp_id: Uuid, name: String, purpose: String, target_amount: Decimal, majority_used: MajorityType, ) -> Result<Fund, AppError>
Crée un fonds affecté (thésaurisation), en exigeant la majorité des
gros travaux (2/3, Art. 3.88) — appliquée par Fund::new_earmarked.
Sourcepub async fn contribute(
&self,
fund_id: Uuid,
amount: Decimal,
) -> Result<Fund, AppError>
pub async fn contribute( &self, fund_id: Uuid, amount: Decimal, ) -> Result<Fund, AppError>
Alimente un fonds existant.
Sourcepub async fn record_expense(
&self,
fund_id: Uuid,
expense_work_ref: &str,
ag_override_status: Option<ResolutionStatus>,
) -> Result<(), AppError>
pub async fn record_expense( &self, fund_id: Uuid, expense_work_ref: &str, ag_override_status: Option<ResolutionStatus>, ) -> Result<(), AppError>
Vérifie qu’une dépense imputée à fund_id correspond à son objet —
sauf si une décision d’AG adoptée l’autorise explicitement
(ag_override_status).
Sourcepub async fn reassign(
&self,
fund_id: Uuid,
new_purpose: String,
amount: Option<Decimal>,
resolution_id: Uuid,
resolution_status: ResolutionStatus,
) -> Result<FundReassignment, AppError>
pub async fn reassign( &self, fund_id: Uuid, new_purpose: String, amount: Option<Decimal>, resolution_id: Uuid, resolution_status: ResolutionStatus, ) -> Result<FundReassignment, AppError>
Réaffecte tout ou partie du solde d’un fonds affecté vers une autre
fin, sur décision d’AG adoptée. Persiste le fonds mis à jour ET
l’audit trail (fund_reassignments).
pub async fn get(&self, fund_id: Uuid) -> Result<Fund, AppError>
pub async fn list_for_acp(&self, acp_id: Uuid) -> Result<Vec<Fund>, AppError>
pub async fn list_reassignments( &self, fund_id: Uuid, ) -> Result<Vec<FundReassignment>, AppError>
Auto Trait Implementations§
impl !RefUnwindSafe for FundUseCases
impl !UnwindSafe for FundUseCases
impl Freeze for FundUseCases
impl Send for FundUseCases
impl Sync for FundUseCases
impl Unpin for FundUseCases
impl UnsafeUnpin for FundUseCases
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<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>
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.