Skip to main content

SqliteAccountsPayableRepository

Struct SqliteAccountsPayableRepository 

Source
pub struct SqliteAccountsPayableRepository { /* private fields */ }
Available on crate feature sqlite only.

Implementations§

Trait Implementations§

Source§

impl AccountsPayableRepository for SqliteAccountsPayableRepository

Source§

fn create_bill(&self, input: CreateBill) -> Result<Bill>

Create a new bill
Source§

fn get_bill(&self, id: Uuid) -> Result<Option<Bill>>

Get bill by ID
Source§

fn get_bill_by_number(&self, number: &str) -> Result<Option<Bill>>

Get bill by number
Source§

fn update_bill(&self, id: Uuid, input: UpdateBill) -> Result<Bill>

Update a bill
Source§

fn list_bills(&self, filter: BillFilter) -> Result<Vec<Bill>>

List bills with filter
Source§

fn delete_bill(&self, id: Uuid) -> Result<()>

Delete a bill (only if draft)
Source§

fn approve_bill(&self, id: Uuid) -> Result<Bill>

Approve a bill
Source§

fn cancel_bill(&self, id: Uuid) -> Result<Bill>

Cancel a bill
Source§

fn dispute_bill(&self, id: Uuid) -> Result<Bill>

Mark bill as disputed
Source§

fn get_bill_items(&self, bill_id: Uuid) -> Result<Vec<BillItem>>

Get bill items
Source§

fn add_bill_item(&self, bill_id: Uuid, item: CreateBillItem) -> Result<BillItem>

Add item to bill
Source§

fn remove_bill_item(&self, item_id: Uuid) -> Result<()>

Remove item from bill
Source§

fn count_bills(&self, filter: BillFilter) -> Result<u64>

Count bills
Source§

fn get_overdue_bills(&self) -> Result<Vec<Bill>>

Get overdue bills
Source§

fn get_bills_due_soon(&self, days: i32) -> Result<Vec<Bill>>

Get bills due soon (within days)
Source§

fn create_payment(&self, input: CreateBillPayment) -> Result<BillPayment>

Create a payment
Source§

fn get_payment(&self, id: Uuid) -> Result<Option<BillPayment>>

Get payment by ID
Source§

fn get_payment_by_number(&self, number: &str) -> Result<Option<BillPayment>>

Get payment by number
Source§

fn list_payments(&self, filter: BillPaymentFilter) -> Result<Vec<BillPayment>>

List payments with filter
Source§

fn void_payment(&self, id: Uuid) -> Result<BillPayment>

Void a payment
Source§

fn clear_payment(&self, id: Uuid) -> Result<BillPayment>

Mark payment as cleared
Source§

fn get_payment_allocations( &self, payment_id: Uuid, ) -> Result<Vec<PaymentAllocation>>

Get payment allocations
Source§

fn get_payments_for_bill(&self, bill_id: Uuid) -> Result<Vec<BillPayment>>

Get payments for bill
Source§

fn count_payments(&self, filter: BillPaymentFilter) -> Result<u64>

Count payments
Source§

fn create_payment_run(&self, input: CreatePaymentRun) -> Result<PaymentRun>

Create a payment run
Source§

fn get_payment_run(&self, id: Uuid) -> Result<Option<PaymentRun>>

Get payment run by ID
Source§

fn list_payment_runs(&self, filter: PaymentRunFilter) -> Result<Vec<PaymentRun>>

List payment runs with filter
Source§

fn approve_payment_run(&self, id: Uuid, approved_by: &str) -> Result<PaymentRun>

Approve payment run
Source§

fn process_payment_run(&self, id: Uuid) -> Result<PaymentRun>

Process payment run
Source§

fn cancel_payment_run(&self, id: Uuid) -> Result<PaymentRun>

Cancel payment run
Source§

fn get_payment_run_bills(&self, run_id: Uuid) -> Result<Vec<Bill>>

Get bills in payment run
Source§

fn get_aging_summary(&self) -> Result<ApAgingSummary>

Get AP aging summary
Source§

fn get_supplier_summary( &self, supplier_id: Uuid, ) -> Result<Option<SupplierApSummary>>

Get AP summary by supplier (None if supplier is not found)
Source§

fn get_total_outstanding(&self) -> Result<Decimal>

Get total AP outstanding
Source§

fn create_bills_batch( &self, inputs: Vec<CreateBill>, ) -> Result<BatchResult<Bill>>

Create multiple bills
Source§

fn get_bills_batch(&self, ids: Vec<Uuid>) -> Result<Vec<Bill>>

Get multiple bills by ID
Source§

impl Debug for SqliteAccountsPayableRepository

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more