Skip to main content

AccountingModule

Struct AccountingModule 

Source
pub struct AccountingModule { /* private fields */ }
Expand description

Accounting module configuration

Use the builder pattern to configure and register this module:

let accounting = AccountingModule::builder()
    .with_database(pool.clone())
    .build()?;

// Unguarded full CRUD (trusted/admin); compose a guarded router for production.
let router = accounting.all_crud_routes();

Implementations§

Source§

impl AccountingModule

Source

pub fn budget_control(&self) -> Option<Arc<dyn BudgetControlPort>>

The registered budget-control port, if any — the single registration a host threads into every PostingService it builds from this module (.with_budget_control_if_set(m.budget_control())), so the HTTP posting verb, the journal workflow, and the period close all consult the same control.

Source

pub fn reporting_service(&self) -> Arc<ReportingService> ⓘ

The on-the-fly financial reports (Trial Balance tree, Balance Sheet, Income Statement, General Ledger, Partner Ledger, Aged AR/AP). Read-only; scoped reads.

Source

pub fn reconcile_write_service(&self) -> Arc<ReconcileWriteService> ⓘ

The reconciliation write service — the ONLY sanctioned writer of the reconciliation graph (guards + CLAMP + side-effecting unlink). The graph tables carry no CRUD surface anywhere; guarded_routes mounts its verb routes.

Source

pub fn reconcile_write_service_with_exchange_account( &self, exchange_account_id: Uuid, ) -> Arc<ReconcileWriteService> ⓘ

Build a reconcile write service with the FX (exchange-difference) account configured. Without one, any rate divergence that demands an exchange move fails closed (exchange_account_unconfigured) — normal single-currency posts never generate one, so the default service is complete for them.

Source

pub fn chart_install_service(&self) -> Arc<ChartInstallService> ⓘ

The chart install engine — validates, gates, and writes a registered chart dataset into the accounts, idempotently. The install VERB itself is host-mounted (it orchestrates beyond this module); this handle is the engine the host verb drives.

Source

pub fn check_printing_service(&self) -> Arc<CheckPrintingService> ⓘ

The check printing surface — sequence registration, atomic number allocation, the printed-check registry, and voids. guarded_routes mounts its verb routes; there is no CRUD path to these tables.

Source

pub fn emv_qr_service(&self) -> Arc<EmvQrService> ⓘ

The EMV(QRCPS)/QRIS display surface — merchant QR configuration and the invoice payload render (payloads are built on demand, never stored).

Source

pub fn tax_tag_repair_service(&self) -> Arc<TaxTagRepairService> ⓘ

The tax-tag legal-change repair verb (reason mandatory, locked periods refused, closed periods overridden explicitly, every run audit-stamped) plus its audit-ledger read.

Source§

impl AccountingModule

Source

pub fn builder() -> AccountingModuleBuilder

Create a new module builder

Source

pub fn all_crud_routes(&self) -> Router

Mount ALL generated CRUD endpoints (12 per entity) with NO domain validation — the fully unguarded surface. A well-formed request can create invalid rows or soft-delete a referenced master out from under its dependents. Prefer a guarded composition (read + validated writes) for any real deployment; use this only in trusted/admin/seeding contexts.

Source

pub fn routes(&self) -> Router

👎Deprecated:

mounts unvalidated generic CRUD; prefer readonly_routes() + validated writes, or all_crud_routes() for the full/unguarded surface

Deprecated alias for Self::all_crud_routes. routes() reads like “the routes” but mounts UNVALIDATED generic CRUD on every entity — a naive mount exposes unguarded writes. Compose a guarded router (read + validated writes) for production, or call all_crud_routes() to opt into the full unguarded surface explicitly.

Source

pub fn readonly_routes(&self) -> Router

Read-only routes for every entity (GET endpoints only) — the safe base.

Generic mutation can’t reach here, so this surface cannot bypass a validated write service’s invariants. Use this as the production base and merge validated write routes (or a write service’s HTTP layer) onto it.

Trait Implementations§

Source§

impl Deref for AccountingModule

Source§

type Target = ModuleExt

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for AccountingModule

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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