pub trait PaymentRepository: Send + Sync {
Show 19 methods
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
payment: &'life1 Payment,
) -> Pin<Box<dyn Future<Output = Result<Payment, 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<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_stripe_payment_intent_id<'life0, 'life1, 'async_trait>(
&'life0 self,
stripe_payment_intent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_idempotency_key<'life0, 'life1, 'async_trait>(
&'life0 self,
organization_id: Uuid,
idempotency_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, 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<Payment>, 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<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
status: TransactionStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_building_and_status<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: TransactionStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_pending<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_failed<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
payment: &'life1 Payment,
) -> Pin<Box<dyn Future<Output = Result<Payment, 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_total_paid_for_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_paid_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_paid_for_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_owner_payment_stats<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<PaymentStats, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_building_payment_stats<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<PaymentStats, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
payment: &'life1 Payment,
) -> Pin<Box<dyn Future<Output = Result<Payment, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
payment: &'life1 Payment,
) -> Pin<Box<dyn Future<Output = Result<Payment, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new payment
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Payment>, 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<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find payment by ID
Sourcefn find_by_stripe_payment_intent_id<'life0, 'life1, 'async_trait>(
&'life0 self,
stripe_payment_intent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_stripe_payment_intent_id<'life0, 'life1, 'async_trait>(
&'life0 self,
stripe_payment_intent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find payment by Stripe payment intent ID
Sourcefn find_by_idempotency_key<'life0, 'life1, 'async_trait>(
&'life0 self,
organization_id: Uuid,
idempotency_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_idempotency_key<'life0, 'life1, 'async_trait>(
&'life0 self,
organization_id: Uuid,
idempotency_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find payment by idempotency key (prevents duplicate charges)
Sourcefn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, 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<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all payments for an owner
Sourcefn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all payments for a building
Sourcefn find_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, 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<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all payments for an expense
Sourcefn find_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, 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<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all payments for an organization
Sourcefn find_by_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
status: TransactionStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_status<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
status: TransactionStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find payments by status
Sourcefn find_by_building_and_status<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: TransactionStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_building_and_status<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: TransactionStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find payments by status and building
Sourcefn find_pending<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_pending<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find pending payments (for background processing)
Sourcefn find_failed<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_failed<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find failed payments (for retry or analysis)
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
payment: &'life1 Payment,
) -> Pin<Box<dyn Future<Output = Result<Payment, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
payment: &'life1 Payment,
) -> Pin<Box<dyn Future<Output = Result<Payment, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update payment
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 payment (soft delete recommended in production)
Sourcefn get_total_paid_for_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_paid_for_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total amount paid for an expense (sum of succeeded payments)
Sourcefn get_total_paid_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_paid_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total amount paid by owner (sum of succeeded payments)
Sourcefn get_total_paid_for_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_paid_for_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total amount paid for building (sum of succeeded payments)
Sourcefn get_owner_payment_stats<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<PaymentStats, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_owner_payment_stats<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<PaymentStats, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get payment statistics for owner
Sourcefn get_building_payment_stats<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<PaymentStats, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_building_payment_stats<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<PaymentStats, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get payment statistics for building