Skip to main content

SqliteGeneralLedgerRepository

Struct SqliteGeneralLedgerRepository 

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

Implementations§

Trait Implementations§

Source§

impl Debug for SqliteGeneralLedgerRepository

Source§

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

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

impl GeneralLedgerRepository for SqliteGeneralLedgerRepository

Source§

fn create_account(&self, input: CreateGlAccount) -> Result<GlAccount>

Create a GL account
Source§

fn get_account(&self, id: Uuid) -> Result<Option<GlAccount>>

Get account by ID
Source§

fn get_account_by_number( &self, account_number: &str, ) -> Result<Option<GlAccount>>

Get account by account number
Source§

fn update_account(&self, id: Uuid, input: UpdateGlAccount) -> Result<GlAccount>

Update account
Source§

fn list_accounts(&self, filter: GlAccountFilter) -> Result<Vec<GlAccount>>

List accounts (Chart of Accounts)
Source§

fn get_account_hierarchy(&self) -> Result<Vec<GlAccount>>

Get account hierarchy (parent-child)
Source§

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

Delete account (only if no transactions)
Source§

fn initialize_chart_of_accounts(&self) -> Result<Vec<GlAccount>>

Initialize default Chart of Accounts
Source§

fn create_period(&self, input: CreateGlPeriod) -> Result<GlPeriod>

Create a GL period
Source§

fn get_period(&self, id: Uuid) -> Result<Option<GlPeriod>>

Get period by ID
Source§

fn get_current_period(&self) -> Result<Option<GlPeriod>>

Get current open period
Source§

fn get_period_for_date(&self, date: NaiveDate) -> Result<Option<GlPeriod>>

Get period for a date
Source§

fn list_periods(&self, filter: GlPeriodFilter) -> Result<Vec<GlPeriod>>

List periods
Source§

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

Open a period
Source§

fn close_period(&self, id: Uuid, closed_by: &str) -> Result<GlPeriod>

Close a period
Source§

fn lock_period(&self, id: Uuid, locked_by: &str) -> Result<GlPeriod>

Lock a period (prevents any changes)
Source§

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

Reopen a closed period (not locked)
Source§

fn create_journal_entry( &self, input: CreateJournalEntry, ) -> Result<JournalEntry>

Create a journal entry
Source§

fn get_journal_entry(&self, id: Uuid) -> Result<Option<JournalEntry>>

Get journal entry by ID
Source§

fn get_journal_entry_by_number( &self, number: &str, ) -> Result<Option<JournalEntry>>

Get journal entry by number
Source§

fn list_journal_entries( &self, filter: JournalEntryFilter, ) -> Result<Vec<JournalEntry>>

List journal entries
Source§

fn post_journal_entry(&self, id: Uuid, posted_by: &str) -> Result<JournalEntry>

Post a journal entry (update account balances)
Source§

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

Void a journal entry
Source§

fn reverse_journal_entry( &self, id: Uuid, reversal_date: NaiveDate, ) -> Result<JournalEntry>

Reverse a journal entry (creates reversing entry)
Source§

fn get_journal_entry_lines( &self, journal_entry_id: Uuid, ) -> Result<Vec<JournalEntryLine>>

Get journal entry lines
Source§

fn get_auto_posting_config(&self) -> Result<Option<AutoPostingConfig>>

Get active auto-posting config
Source§

fn set_auto_posting_config( &self, input: CreateAutoPostingConfig, ) -> Result<AutoPostingConfig>

Create/update auto-posting config
Source§

fn auto_post_invoice(&self, invoice_id: InvoiceId) -> Result<JournalEntry>

Auto-post invoice creation (DR AR / CR Revenue)
Source§

fn auto_post_payment_received(&self, payment_id: Uuid) -> Result<JournalEntry>

Auto-post payment received (DR Cash / CR AR)
Source§

fn auto_post_bill(&self, bill_id: Uuid) -> Result<JournalEntry>

Auto-post bill creation (DR Expense / CR AP)
Source§

fn auto_post_bill_payment(&self, payment_id: Uuid) -> Result<JournalEntry>

Auto-post bill payment (DR AP / CR Cash)
Source§

fn auto_post_inventory_cost( &self, cost_transaction_id: Uuid, ) -> Result<JournalEntry>

Auto-post inventory cost transaction (DR/CR Inventory/COGS)
Source§

fn auto_post_write_off(&self, write_off_id: Uuid) -> Result<JournalEntry>

Auto-post write-off (DR Bad Debt / CR AR)
Source§

fn get_trial_balance(&self, as_of_date: NaiveDate) -> Result<TrialBalance>

Generate trial balance
Source§

fn get_balance_sheet(&self, as_of_date: NaiveDate) -> Result<BalanceSheet>

Generate balance sheet
Source§

fn get_income_statement( &self, start_date: NaiveDate, end_date: NaiveDate, ) -> Result<IncomeStatement>

Generate income statement
Source§

fn get_account_balance( &self, account_id: Uuid, _as_of_date: Option<NaiveDate>, ) -> Result<Option<Decimal>>

Get account balance (None if account is not found)
Source§

fn get_account_transactions( &self, account_id: Uuid, filter: JournalEntryFilter, ) -> Result<Vec<JournalEntryLine>>

Get account transaction history
Source§

fn run_period_close( &self, period_id: Uuid, closed_by: &str, ) -> Result<JournalEntry>

Run period close (creates closing entries)
Source§

fn revalue( &self, as_of_date: NaiveDate, base_currency: Option<Currency>, ) -> Result<RevaluationResult>

Revalue foreign-currency account balances at the as-of exchange rate, posting the net unrealized gain/loss as a balanced adjusting entry. Read more
Source§

fn create_accounts_batch( &self, inputs: Vec<CreateGlAccount>, ) -> Result<BatchResult<GlAccount>>

Source§

fn get_accounts_batch(&self, ids: Vec<Uuid>) -> Result<Vec<GlAccount>>

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