application tier

application-ledger-reports

Generic double-entry ledger read-only report routers (register, GL, trial balance, income statement, balance sheet, search) over the domain-ledger schema.

Generic double-entry ledger read-only report routers (register, GL, trial balance, income statement, balance sheet, search) over the domain-ledger schema.

Tierapplication
Roleunclassified (baselined)
Pathcrates/application/ledger-reports
Edition2021
Targetsapplication_ledger_reports
Public items2 across 0 modules
Tests13

What it is for

Generic double-entry ledger reports: read-only API routers computed over the domain-ledger schema (accounts / journal_entries / line_items).

Lifted from the books app (server/src/ledger_reports.rs). All endpoints are gated by application_rbac::authz::UserPermissions::has(PERM_READ) and operate over posted entries only, signing balances by account_type (debit-normal = asset/expense; credit-normal = liability/equity/ income) — no normal_side column required. Mount router under whatever admin/auth prefix injects the UserPermissions extension.

Endpoints (relative paths)

with a DB-side running balance and an optional opening balance-forward.

grouped by account with per-account running balances + subtotals.

their natural debit/credit columns, with a balanced check.

totals + net income.

a synthetic "Net income (unclosed)" equity line so the sheet ties mid-year.

search over posted lines (ILIKE on description and journal_entries.payee).

Schema note: journal_entries.payee

search filters and returns journal_entries.payee (a standard generic ledger concept). The base ledger migration (crates/domain/ledger/migrations/001_ledger_tables.sql) declares it as a plain nullable text column; consumers get it for free.

Capabilities

crate root

Generic double-entry ledger reports: read-only API routers computed over the

Item
pub const PERM_READ: & str
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,

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`

ItemWhat it is
pub const PERM_READ: & strPermission code required by every endpoint in this crate.
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Build the ledger-reports sub-router

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

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)
Locationcrates/application/ledger-reports
Vocabulary in force (lexicon)current

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-rbac`applicationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
axum^0.7multipartnoalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
uuid^1v4, v7, serde, jsnoalways

Development. None.

Build. None.

Depended on by. Nothing in this workspace.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  SELF["application-ledger-reports"]
  SELF -->|runtime| n_application_rbac["application-rbac"]
  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

KindNameSource
libapplication_ledger_reports`src/lib.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

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessyes
network I/Oyes
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

No workspace crate depends on this one.

Verification

KindCount
Unit tests13
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root200

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc22
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 2
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files1
Source lines1212
Code lines963
Public API items2
Public modules0
Tests13
Examples0
Cargo features0
Direct runtime dependencies7
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 1
    "function" : 1
pie showData
    title Rust source composition
    "Code" : 963
    "Blank or comment" : 249

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.

All application · Manual