pub struct PaymentReminderUseCases { /* private fields */ }Implementations§
Source§impl PaymentReminderUseCases
impl PaymentReminderUseCases
pub fn new( reminder_repository: Arc<dyn PaymentReminderRepository>, expense_repository: Arc<dyn ExpenseRepository>, owner_repository: Arc<dyn OwnerRepository>, ) -> Self
Sourcepub async fn create_reminder(
&self,
dto: CreatePaymentReminderDto,
) -> Result<PaymentReminderResponseDto, String>
pub async fn create_reminder( &self, dto: CreatePaymentReminderDto, ) -> Result<PaymentReminderResponseDto, String>
Create a new payment reminder
Sourcepub async fn get_reminder(
&self,
id: Uuid,
) -> Result<Option<PaymentReminderResponseDto>, String>
pub async fn get_reminder( &self, id: Uuid, ) -> Result<Option<PaymentReminderResponseDto>, String>
Get reminder by ID
Sourcepub async fn list_by_expense(
&self,
expense_id: Uuid,
) -> Result<Vec<PaymentReminderResponseDto>, String>
pub async fn list_by_expense( &self, expense_id: Uuid, ) -> Result<Vec<PaymentReminderResponseDto>, String>
List all reminders for an expense
Sourcepub async fn list_by_owner(
&self,
owner_id: Uuid,
) -> Result<Vec<PaymentReminderResponseDto>, String>
pub async fn list_by_owner( &self, owner_id: Uuid, ) -> Result<Vec<PaymentReminderResponseDto>, String>
List all reminders for an owner
Sourcepub async fn list_by_organization(
&self,
organization_id: Uuid,
) -> Result<Vec<PaymentReminderResponseDto>, String>
pub async fn list_by_organization( &self, organization_id: Uuid, ) -> Result<Vec<PaymentReminderResponseDto>, String>
List all reminders for an organization
Sourcepub async fn list_active_by_owner(
&self,
owner_id: Uuid,
) -> Result<Vec<PaymentReminderResponseDto>, String>
pub async fn list_active_by_owner( &self, owner_id: Uuid, ) -> Result<Vec<PaymentReminderResponseDto>, String>
List active (non-paid, non-cancelled) reminders for an owner
Sourcepub async fn mark_as_sent(
&self,
id: Uuid,
dto: MarkReminderSentDto,
) -> Result<PaymentReminderResponseDto, String>
pub async fn mark_as_sent( &self, id: Uuid, dto: MarkReminderSentDto, ) -> Result<PaymentReminderResponseDto, String>
Mark reminder as sent
Sourcepub async fn mark_as_opened(
&self,
id: Uuid,
) -> Result<PaymentReminderResponseDto, String>
pub async fn mark_as_opened( &self, id: Uuid, ) -> Result<PaymentReminderResponseDto, String>
Mark reminder as opened (email opened)
Sourcepub async fn mark_as_paid(
&self,
id: Uuid,
) -> Result<PaymentReminderResponseDto, String>
pub async fn mark_as_paid( &self, id: Uuid, ) -> Result<PaymentReminderResponseDto, String>
Mark reminder as paid
Sourcepub async fn cancel_reminder(
&self,
id: Uuid,
dto: CancelReminderDto,
) -> Result<PaymentReminderResponseDto, String>
pub async fn cancel_reminder( &self, id: Uuid, dto: CancelReminderDto, ) -> Result<PaymentReminderResponseDto, String>
Cancel a reminder
Sourcepub async fn escalate_reminder(
&self,
id: Uuid,
_dto: EscalateReminderDto,
) -> Result<Option<PaymentReminderResponseDto>, String>
pub async fn escalate_reminder( &self, id: Uuid, _dto: EscalateReminderDto, ) -> Result<Option<PaymentReminderResponseDto>, String>
Escalate a reminder to next level
Sourcepub async fn add_tracking_number(
&self,
id: Uuid,
dto: AddTrackingNumberDto,
) -> Result<PaymentReminderResponseDto, String>
pub async fn add_tracking_number( &self, id: Uuid, dto: AddTrackingNumberDto, ) -> Result<PaymentReminderResponseDto, String>
Add tracking number to a reminder (for registered letters)
Sourcepub async fn find_pending_reminders(
&self,
) -> Result<Vec<PaymentReminderResponseDto>, String>
pub async fn find_pending_reminders( &self, ) -> Result<Vec<PaymentReminderResponseDto>, String>
Find all pending reminders (to be sent)
Sourcepub async fn find_reminders_needing_escalation(
&self,
) -> Result<Vec<PaymentReminderResponseDto>, String>
pub async fn find_reminders_needing_escalation( &self, ) -> Result<Vec<PaymentReminderResponseDto>, String>
Find reminders needing escalation (sent >15 days ago)
Sourcepub async fn get_recovery_stats(
&self,
organization_id: Uuid,
) -> Result<PaymentRecoveryStatsDto, String>
pub async fn get_recovery_stats( &self, organization_id: Uuid, ) -> Result<PaymentRecoveryStatsDto, String>
Get payment recovery statistics for an organization
Sourcepub async fn find_overdue_expenses_without_reminders(
&self,
organization_id: Uuid,
min_days_overdue: i64,
) -> Result<Vec<OverdueExpenseDto>, String>
pub async fn find_overdue_expenses_without_reminders( &self, organization_id: Uuid, min_days_overdue: i64, ) -> Result<Vec<OverdueExpenseDto>, String>
Find overdue expenses without reminders (for automated detection)
Sourcepub async fn bulk_create_reminders(
&self,
dto: BulkCreateRemindersDto,
) -> Result<BulkCreateRemindersResponseDto, String>
pub async fn bulk_create_reminders( &self, dto: BulkCreateRemindersDto, ) -> Result<BulkCreateRemindersResponseDto, String>
Bulk create reminders for all overdue expenses
Sourcepub async fn process_automatic_escalations(&self) -> Result<i32, String>
pub async fn process_automatic_escalations(&self) -> Result<i32, String>
Process automatic escalations (called by cron job)
Auto Trait Implementations§
impl Freeze for PaymentReminderUseCases
impl !RefUnwindSafe for PaymentReminderUseCases
impl Send for PaymentReminderUseCases
impl Sync for PaymentReminderUseCases
impl Unpin for PaymentReminderUseCases
impl !UnwindSafe for PaymentReminderUseCases
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.