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
impl AccountingModule
Sourcepub fn builder() -> AccountingModuleBuilder
pub fn builder() -> AccountingModuleBuilder
Create a new module builder
Sourcepub fn all_crud_routes(&self) -> Router
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.
Sourcepub fn routes(&self) -> Router
👎Deprecated: mounts unvalidated generic CRUD; prefer readonly_routes() + validated writes, or all_crud_routes() for the full/unguarded surface
pub fn routes(&self) -> Router
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.
Sourcepub fn readonly_routes(&self) -> Router
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.
Sourcepub fn budget_control(&self) -> Option<Arc<dyn BudgetControlPort>>
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.
Sourcepub fn reporting_service(&self) -> Arc<ReportingService> ⓘ
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.
Sourcepub fn reconcile_write_service(&self) -> Arc<ReconcileWriteService> ⓘ
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.
Sourcepub fn reconcile_write_service_with_exchange_account(
&self,
exchange_account_id: Uuid,
) -> Arc<ReconcileWriteService> ⓘ
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.
Sourcepub fn chart_install_service(&self) -> Arc<ChartInstallService> ⓘ
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.
Sourcepub fn check_printing_service(&self) -> Arc<CheckPrintingService> ⓘ
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.
Sourcepub fn emv_qr_service(&self) -> Arc<EmvQrService> ⓘ
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).
Sourcepub fn tax_tag_repair_service(&self) -> Arc<TaxTagRepairService> ⓘ
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.
Auto Trait Implementations§
impl !RefUnwindSafe for AccountingModule
impl !UnwindSafe for AccountingModule
impl Freeze for AccountingModule
impl Send for AccountingModule
impl Sync for AccountingModule
impl Unpin for AccountingModule
impl UnsafeUnpin for AccountingModule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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