pub struct PostgresPaymentRepository { /* private fields */ }Expand description
PostgreSQL implementation of PaymentRepository
Implementations§
Trait Implementations§
Source§impl PaymentRepository for PostgresPaymentRepository
impl PaymentRepository for PostgresPaymentRepository
Source§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 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
Source§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_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
Source§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_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
Source§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_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)
Source§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_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
Source§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_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
Source§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_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
Source§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_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
Source§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_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
Source§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_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
Source§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_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)
Source§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 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)
Source§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 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
Source§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 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)
Source§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_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)
Source§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_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)
Source§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_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)
Auto Trait Implementations§
impl Freeze for PostgresPaymentRepository
impl !RefUnwindSafe for PostgresPaymentRepository
impl Send for PostgresPaymentRepository
impl Sync for PostgresPaymentRepository
impl Unpin for PostgresPaymentRepository
impl !UnwindSafe for PostgresPaymentRepository
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.