pub trait PaymentReminderRepository: Send + Sync {
Show 18 methods
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
reminder: &'life1 PaymentReminder,
) -> Pin<Box<dyn Future<Output = Result<PaymentReminder, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_status<'life0, 'async_trait>(
&'life0 self,
status: ReminderStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_organization_and_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
status: ReminderStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_pending_reminders<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_reminders_needing_escalation<'life0, 'async_trait>(
&'life0 self,
cutoff_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_latest_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_active_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_by_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(ReminderStatus, i64)>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_owed_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_penalties_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_overdue_expenses_without_reminders<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
min_days_overdue: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, i64, f64)>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
reminder: &'life1 PaymentReminder,
) -> Pin<Box<dyn Future<Output = Result<PaymentReminder, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_dashboard_stats<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(f64, f64, Vec<(ReminderLevel, i64)>), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Repository trait for payment reminder persistence operations
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
reminder: &'life1 PaymentReminder,
) -> Pin<Box<dyn Future<Output = Result<PaymentReminder, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
reminder: &'life1 PaymentReminder,
) -> Pin<Box<dyn Future<Output = Result<PaymentReminder, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new payment reminder
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find a reminder by ID
Sourcefn find_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all reminders for a specific expense
Sourcefn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all reminders for a specific owner
Sourcefn find_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all reminders for an organization
Sourcefn find_by_status<'life0, 'async_trait>(
&'life0 self,
status: ReminderStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_status<'life0, 'async_trait>(
&'life0 self,
status: ReminderStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all reminders with a specific status
Sourcefn find_by_organization_and_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
status: ReminderStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_organization_and_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
status: ReminderStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all reminders with a specific status for an organization
Sourcefn find_pending_reminders<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_pending_reminders<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all pending reminders that should be sent (status = Pending)
Sourcefn find_reminders_needing_escalation<'life0, 'async_trait>(
&'life0 self,
cutoff_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_reminders_needing_escalation<'life0, 'async_trait>(
&'life0 self,
cutoff_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all sent reminders that need escalation (sent > 15 days ago)
Sourcefn find_latest_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_latest_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find the latest reminder for a specific expense
Sourcefn find_active_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_active_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<PaymentReminder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all active (non-paid, non-cancelled) reminders for an owner
Sourcefn count_by_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(ReminderStatus, i64)>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_by_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(ReminderStatus, i64)>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get statistics: count reminders by status for an organization
Sourcefn get_total_owed_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_owed_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get statistics: total amount owed by organization
Sourcefn get_total_penalties_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_penalties_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get statistics: total penalties by organization
Sourcefn find_overdue_expenses_without_reminders<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
min_days_overdue: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, i64, f64)>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_overdue_expenses_without_reminders<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
min_days_overdue: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, i64, f64)>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get overdue expenses without reminders (for automated detection) Returns list of (expense_id, owner_id, days_overdue, amount)
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
reminder: &'life1 PaymentReminder,
) -> Pin<Box<dyn Future<Output = Result<PaymentReminder, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
reminder: &'life1 PaymentReminder,
) -> Pin<Box<dyn Future<Output = Result<PaymentReminder, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a reminder
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a reminder
Sourcefn get_dashboard_stats<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(f64, f64, Vec<(ReminderLevel, i64)>), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_dashboard_stats<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(f64, f64, Vec<(ReminderLevel, i64)>), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get payment recovery dashboard data for an organization Returns: (total_owed, total_penalties, reminder_count_by_level)