Skip to main content

SqliteInvoiceRepository

Struct SqliteInvoiceRepository 

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

Implementations§

Trait Implementations§

Source§

impl Debug for SqliteInvoiceRepository

Source§

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

Formats the value using the given formatter. Read more
Source§

impl InvoiceRepository for SqliteInvoiceRepository

Source§

fn create(&self, input: CreateInvoice) -> Result<Invoice>

Create a new invoice
Source§

fn get(&self, id: InvoiceId) -> Result<Option<Invoice>>

Get invoice by ID
Source§

fn get_by_number(&self, invoice_number: &str) -> Result<Option<Invoice>>

Get invoice by invoice number
Source§

fn update(&self, id: InvoiceId, input: UpdateInvoice) -> Result<Invoice>

Update an invoice
Source§

fn list(&self, filter: InvoiceFilter) -> Result<Vec<Invoice>>

List invoices with filter
Source§

fn for_customer(&self, customer_id: CustomerId) -> Result<Vec<Invoice>>

Get invoices for a customer
Source§

fn for_order(&self, order_id: OrderId) -> Result<Vec<Invoice>>

Get invoices for an order
Source§

fn delete(&self, id: InvoiceId) -> Result<()>

Delete an invoice (only if draft)
Source§

fn send(&self, id: InvoiceId) -> Result<Invoice>

Send invoice to customer
Source§

fn mark_viewed(&self, id: InvoiceId) -> Result<Invoice>

Mark invoice as viewed
Source§

fn record_payment( &self, id: InvoiceId, payment: RecordInvoicePayment, ) -> Result<Invoice>

Record a payment on the invoice
Source§

fn void(&self, id: InvoiceId) -> Result<Invoice>

Void an invoice
Source§

fn write_off(&self, id: InvoiceId) -> Result<Invoice>

Write off an invoice as uncollectible
Source§

fn dispute(&self, id: InvoiceId) -> Result<Invoice>

Mark invoice as disputed
Source§

fn add_item( &self, invoice_id: InvoiceId, item: CreateInvoiceItem, ) -> Result<InvoiceItem>

Add item to invoice
Source§

fn update_item( &self, item_id: Uuid, item: CreateInvoiceItem, ) -> Result<InvoiceItem>

Update an invoice item
Source§

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

Remove item from invoice
Source§

fn get_items(&self, invoice_id: InvoiceId) -> Result<Vec<InvoiceItem>>

Get items for invoice
Source§

fn recalculate(&self, id: InvoiceId) -> Result<Invoice>

Recalculate invoice totals
Source§

fn get_overdue(&self) -> Result<Vec<Invoice>>

Get overdue invoices
Source§

fn count(&self, filter: InvoiceFilter) -> Result<u64>

Count invoices matching filter
Source§

fn create_batch( &self, inputs: Vec<CreateInvoice>, ) -> Result<BatchResult<Invoice>>

Create multiple invoices - partial success allowed
Source§

fn create_batch_atomic( &self, inputs: Vec<CreateInvoice>, ) -> Result<Vec<Invoice>>

Create multiple invoices - atomic (all-or-nothing)
Source§

fn update_batch( &self, updates: Vec<(InvoiceId, UpdateInvoice)>, ) -> Result<BatchResult<Invoice>>

Update multiple invoices - partial success allowed
Source§

fn update_batch_atomic( &self, updates: Vec<(InvoiceId, UpdateInvoice)>, ) -> Result<Vec<Invoice>>

Update multiple invoices - atomic (all-or-nothing)
Source§

fn delete_batch(&self, ids: Vec<InvoiceId>) -> Result<BatchResult<Uuid>>

Delete multiple invoices - partial success allowed
Source§

fn delete_batch_atomic(&self, ids: Vec<InvoiceId>) -> Result<()>

Delete multiple invoices - atomic (all-or-nothing)
Source§

fn get_batch(&self, ids: Vec<InvoiceId>) -> Result<Vec<Invoice>>

Get multiple invoices by ID

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