Forge ledger module — double-entry accounting: accounts, journal entries, transactions. Wraps domain-ledger. Foundation for application-billing, application-fulfillment, and any ERP-shape consumer.
| Tier | application |
| Role | unclassified (baselined) |
| Path | crates/application/ledger |
| Edition | 2024 |
| Targets | application_ledger, pg_forge_ledger |
| Public items | 7 across 0 modules |
| Tests | 2 |
What it is for
application-ledger — double-entry accounting for the Forge framework.
Wraps domain-ledger. Consumers compose this when they need bookkeeping library crates: chart of accounts, journal entries, debit/credit transactions with referential integrity. Migrations are owned by domain-ledger; this module reports them via migrations() so application-engine's ledger picks them up.
Capabilities
LedgerModule
application-ledger — double-entry accounting for the Forge framework.
| Item |
|---|
pub struct LedgerModule |
LedgerModule :: fn new() -> Self |
LedgerModule :: fn name(& self) -> & 'static str |
LedgerModule :: fn version(& self) -> & 'static str |
LedgerModule :: fn migrations(& self) -> Vec <MigrationSet> |
LedgerModule :: async fn migrate_pending(& self, pool : & PgPool) -> std::result::Result <u32, MigrationError> |
LedgerModule :: fn permission_codes(& self) -> Vec <String> |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub struct LedgerModule | — |
LedgerModule :: fn new() -> Self | — |
LedgerModule :: fn name(& self) -> & 'static str | — |
LedgerModule :: fn version(& self) -> & 'static str | — |
LedgerModule :: fn migrations(& self) -> Vec <MigrationSet> | — |
LedgerModule :: async fn migrate_pending(& self, pool : & PgPool) -> std::result::Result <u32, MigrationError> | — |
LedgerModule :: fn permission_codes(& self) -> Vec <String> | Kept in sync by hand with application-ledger-accounts/-entries/-reports' own PERM_* constants (sprint 3.65, Gate 1.5 Q1) -- this list is declarative only (LedgerModule mounts no router of its own and nothing calls this for seeding), but a stale entry here is exactly the kind of policy fiction that misleads the next reader. |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into domain.
Shares tier application with 120 other crates: application-agreements, application-ai, application-analytics, application-approvals, application-assessments, application-audit-log, application-auth, application-billing, … (120 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | application |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/application/ledger |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_application["application"] --> n_domain["domain"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `application-core` | application | no | always |
| `application-money` | application | no | always |
| `domain-ledger` | domain | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full | no | always |
Build. None.
Depended on by. 2 workspace crates.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_billing["application-billing"] -->|uses| SELF n_tools_corpus["tools-corpus"] -->|uses| SELF SELF["application-ledger"] SELF -->|runtime| n_application_core["application-core"] SELF -->|runtime| n_application_money["application-money"] SELF -->|runtime| n_domain_ledger["domain-ledger"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | application_ledger | `src/lib.rs` |
| test | pg_forge_ledger | `tests/pg_forge_ledger.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | none detected |
| database access | yes |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | yes |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
| Variable | Read in |
|---|---|
CARGO_PKG_VERSION | src/lib.rs |
Related capabilities
2 workspace crates depend on this one: application-billing, tools-corpus.
Verification
| Kind | Count |
|---|---|
| Unit tests | 1 |
| Integration tests | 1 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 1 | 0 | 1 |
What the tests establish, by name:
migrate_pending_creates_accounts_table—tests/pg_forge_ledger.rstest_module_migrations_non_empty—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 1 | 7 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 1
"No rustdoc detected" : 6
Metrics
| Metric | Value |
|---|---|
| Rust source files | 1 |
| Source lines | 100 |
| Code lines | 69 |
| Public API items | 7 |
| Public modules | 0 |
| Tests | 2 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 5 |
| Workspace reverse dependencies | 2 |
pie showData
title Public API by kind
"method" : 6
"struct" : 1
pie showData
title Rust source composition
"Code" : 69
"Blank or comment" : 31
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.