Expand description
§backbone-gl-posting
The GL-posting wire contract shared across Backbone producers — the serialized envelope a
producer (payment, payment-gateway, selling, inventory, billing, …) emits, and the sink port the
composition layer implements over accounting’s PostingService. This crate owns the contract so
each producer stops carrying its own structurally-identical copy (ADR-001 §6’s deferred cleanup).
- A producer builds an
AccountingPostEnvelope(balancedDr … · Cr …lines) and reaches accounting ONLY through aGlPostSink— zero normal Cargo edge into backbone-accounting. - A composition ACL implements
GlPostSinkand maps the envelope into accounting’sPostingRequest(injecting the accounting-ownedcost_center/project/departmentthe envelope deliberately omits). - Idempotency: accounting dedups on
source_id(the producer document id, opaque to accounting).
This crate is framework plumbing: it depends on serde + primitives only, never on a domain module
or accounting itself.
The companion seam is the reconciliation contract (ReconcileSink): producers settle and
clear through reconciliation edges on accounting’s journal lines via the same zero-edge posture —
a locator-based, connection-taking port implemented by the composition layer.
Structs§
- Accounting
Post Envelope - The serialized GL-post envelope a producer emits.
source_typediscriminates the producer (“payment”, “gateway_fee”, “sales”, …);source_idis the producer document id accounting dedups on. - GlPost
Ack - Accounting’s ack: the resulting post + journal, and whether the idempotency key short-circuited.
- GlPost
Line - One debit/credit line of a GL post.
- GlPost
Rejected - Why accounting rejected a post (e.g. a closed period). The producer leaves the document retryable.
- Reconcile
Edge Ack - The resulting edge.
appliedis the post-clamp amount actually reconciled. - Reconcile
Line - Locates one side of a reconciliation edge by producer identity. Resolves to exactly one posted
journal line on
account_id— the reconcilable control account BOTH sides must share. - Reconcile
Pair Request - Create (or grow) the debit↔credit edge between two located lines.
- Reconcile
Rejected - Why the sink refused (guard violation, unresolvable locator, unconfigured FX account …).
- Unreconcile
Pair Request - Unlink every partial between the located pair (side-effecting — see the module docs).
Enums§
- Reconcile
Origin - What created the edge — stamped on the partial for traceability.
Traits§
- GlPost
Sink - The GL-posting seam. A composing service implements this over accounting’s
PostingService; tests record. Producers never depend on backbone-accounting — they reach it only through this port. - Reconcile
Sink - The reconciliation seam. A composing service implements this over accounting’s reconciliation
write service; producers never depend on backbone-accounting — they reach the graph only
through this port, exactly as they reach posting through
crate::GlPostSink.