pub struct CallForFundsUseCases { /* private fields */ }Implementations§
Source§impl CallForFundsUseCases
impl CallForFundsUseCases
pub fn new( call_for_funds_repository: Arc<dyn CallForFundsRepository>, owner_contribution_repository: Arc<dyn OwnerContributionRepository>, unit_owner_repository: Arc<dyn UnitOwnerRepository>, ) -> Self
Sourcepub async fn create_call_for_funds(
&self,
organization_id: Uuid,
building_id: Uuid,
title: String,
description: String,
total_amount: f64,
contribution_type: ContributionType,
call_date: DateTime<Utc>,
due_date: DateTime<Utc>,
account_code: Option<String>,
created_by: Option<Uuid>,
) -> Result<CallForFunds, String>
pub async fn create_call_for_funds( &self, organization_id: Uuid, building_id: Uuid, title: String, description: String, total_amount: f64, contribution_type: ContributionType, call_date: DateTime<Utc>, due_date: DateTime<Utc>, account_code: Option<String>, created_by: Option<Uuid>, ) -> Result<CallForFunds, String>
Create a new call for funds
Sourcepub async fn get_call_for_funds(
&self,
id: Uuid,
) -> Result<Option<CallForFunds>, String>
pub async fn get_call_for_funds( &self, id: Uuid, ) -> Result<Option<CallForFunds>, String>
Get a call for funds by ID
Sourcepub async fn list_by_building(
&self,
building_id: Uuid,
) -> Result<Vec<CallForFunds>, String>
pub async fn list_by_building( &self, building_id: Uuid, ) -> Result<Vec<CallForFunds>, String>
List all calls for funds for a building
Sourcepub async fn list_by_organization(
&self,
organization_id: Uuid,
) -> Result<Vec<CallForFunds>, String>
pub async fn list_by_organization( &self, organization_id: Uuid, ) -> Result<Vec<CallForFunds>, String>
List all calls for funds for an organization
Sourcepub async fn send_call_for_funds(
&self,
id: Uuid,
) -> Result<CallForFunds, String>
pub async fn send_call_for_funds( &self, id: Uuid, ) -> Result<CallForFunds, String>
Mark call for funds as sent and generate individual owner contributions This is the key operation that automatically creates contributions for all owners
Sourcepub async fn cancel_call_for_funds(
&self,
id: Uuid,
) -> Result<CallForFunds, String>
pub async fn cancel_call_for_funds( &self, id: Uuid, ) -> Result<CallForFunds, String>
Cancel a call for funds
Sourcepub async fn get_overdue_calls(&self) -> Result<Vec<CallForFunds>, String>
pub async fn get_overdue_calls(&self) -> Result<Vec<CallForFunds>, String>
Get all overdue calls for funds
Auto Trait Implementations§
impl Freeze for CallForFundsUseCases
impl !RefUnwindSafe for CallForFundsUseCases
impl Send for CallForFundsUseCases
impl Sync for CallForFundsUseCases
impl Unpin for CallForFundsUseCases
impl !UnwindSafe for CallForFundsUseCases
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> Chain<T> for T
impl<T> Chain<T> for T
§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.