pub struct OwnerContributionUseCases { /* private fields */ }Implementations§
Source§impl OwnerContributionUseCases
impl OwnerContributionUseCases
pub fn new(repository: Arc<dyn OwnerContributionRepository>) -> Self
Sourcepub async fn create_contribution(
&self,
organization_id: Uuid,
owner_id: Uuid,
unit_id: Option<Uuid>,
description: String,
amount: f64,
contribution_type: ContributionType,
contribution_date: DateTime<Utc>,
account_code: Option<String>,
) -> Result<OwnerContribution, String>
pub async fn create_contribution( &self, organization_id: Uuid, owner_id: Uuid, unit_id: Option<Uuid>, description: String, amount: f64, contribution_type: ContributionType, contribution_date: DateTime<Utc>, account_code: Option<String>, ) -> Result<OwnerContribution, String>
Create a new owner contribution (appel de fonds)
Sourcepub async fn record_payment(
&self,
contribution_id: Uuid,
payment_date: DateTime<Utc>,
payment_method: ContributionPaymentMethod,
payment_reference: Option<String>,
) -> Result<OwnerContribution, String>
pub async fn record_payment( &self, contribution_id: Uuid, payment_date: DateTime<Utc>, payment_method: ContributionPaymentMethod, payment_reference: Option<String>, ) -> Result<OwnerContribution, String>
Record payment for a contribution
Sourcepub async fn get_contribution(
&self,
contribution_id: Uuid,
) -> Result<Option<OwnerContribution>, String>
pub async fn get_contribution( &self, contribution_id: Uuid, ) -> Result<Option<OwnerContribution>, String>
Get contribution by ID
Sourcepub async fn get_contributions_by_organization(
&self,
organization_id: Uuid,
) -> Result<Vec<OwnerContribution>, String>
pub async fn get_contributions_by_organization( &self, organization_id: Uuid, ) -> Result<Vec<OwnerContribution>, String>
Get all contributions for an organization
Sourcepub async fn get_contributions_by_owner(
&self,
owner_id: Uuid,
) -> Result<Vec<OwnerContribution>, String>
pub async fn get_contributions_by_owner( &self, owner_id: Uuid, ) -> Result<Vec<OwnerContribution>, String>
Get all contributions for an owner
Sourcepub async fn get_outstanding_contributions(
&self,
owner_id: Uuid,
) -> Result<Vec<OwnerContribution>, String>
pub async fn get_outstanding_contributions( &self, owner_id: Uuid, ) -> Result<Vec<OwnerContribution>, String>
Get outstanding (unpaid) contributions for an owner
Sourcepub async fn get_overdue_contributions(
&self,
owner_id: Uuid,
) -> Result<Vec<OwnerContribution>, String>
pub async fn get_overdue_contributions( &self, owner_id: Uuid, ) -> Result<Vec<OwnerContribution>, String>
Get overdue contributions for an owner
Auto Trait Implementations§
impl Freeze for OwnerContributionUseCases
impl !RefUnwindSafe for OwnerContributionUseCases
impl Send for OwnerContributionUseCases
impl Sync for OwnerContributionUseCases
impl Unpin for OwnerContributionUseCases
impl !UnwindSafe for OwnerContributionUseCases
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.