application capa

application-ledger-entries

Manual N-line balanced journal-entry write API (draft/posted, draft-only edit/delete) over the domain-ledger schema, gated by forge-rbac UserPermissions.

Manual N-line balanced journal-entry write API (draft/posted, draft-only edit/delete) over the domain-ledger schema, gated by forge-rbac UserPermissions.

Tierapplication
Roleunclassified (baselined)
Pathcrates/application/ledger-entries
Edition2021
Targetsapplication_ledger_entries
Public items7 across 0 modules
Tests6

What it is for

Manual N-line balanced journal-entry write API over the domain-ledger schema, gated by application-rbac UserPermissions.

Routes (mount under the host's admin prefix, e.g. /api/v1/admin):

and/or lines); may also post it (status:"posted"). Posted → 409.

Posted → 409 (corrections are reversals; INV-1).

Posting is enforced twice: a friendly service-level balance check (Gate 1.5 A3) and the DB journal_entries_check_balance trigger as the backstop. All entry kinds share one shape + a kind tag (Gate 1.5 A2); drafts may be unbalanced/incomplete (Gate 1.5 B4), only posting requires balance.

Capabilities

crate root

Manual N-line balanced journal-entry write API over the domain-ledger

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

ReverseOutcome

Manual N-line balanced journal-entry write API over the domain-ledger

Item
pub enum ReverseOutcome
async fn reverse_in_tx(tx : & mut sqlx::Transaction <'_, sqlx::Postgres>, tenant_id : Uuid, original_id : Uuid, reversal_date : Option <& str>, memo : Option <& str>,) -> Result <ReverseOutcome, sqlx::Error>

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 to read journal entries.
pub const PERM_WRITE: & strPermission to write (create/edit/delete/post) journal entries.
pub const PERM_REVERSE: & strDedicated permission to reverse (void) a posted entry
pub const PERM_SETTINGS_WRITE: & strPermission to change the ledger org settings (the reversal policy)
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>,Build the journal-entry write sub-router.
pub enum ReverseOutcomeOutcome of reverse_in_tx.
async fn reverse_in_tx(tx : & mut sqlx::Transaction <'_, sqlx::Postgres>, tenant_id : Uuid, original_id : Uuid, reversal_date : Option <& str>, memo : Option <& str>,) -> Result <ReverseOutcome, sqlx::Error>Reverse a posted entry inside an existing transaction: lock it (FOR UPDATE), require posted + not-already-reversed, insert a balanced reversing entry (lines swapped), post it, and set reversed_by_id

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)
Locationcrates/application/ledger-entries
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.

CrateTierOptionalOnly on
`application-rbac`applicationnoalways
`domain-ledger`domainnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
axum^0.7multipartnoalways
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-entries"]
  SELF -->|runtime| n_application_rbac["application-rbac"]
  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

KindNameSource
libapplication_ledger_entries`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 surfaceyes
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 tests6
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root700

What the tests establish, by name:

Documentation coverage

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

Metrics

MetricValue
Rust source files1
Source lines1143
Code lines982
Public API items7
Public modules0
Tests6
Examples0
Cargo features0
Direct runtime dependencies7
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 4
    "enum" : 1
    "function" : 2
pie showData
    title Rust source composition
    "Code" : 982
    "Blank or comment" : 161

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.

Todas las application · Manual