The overall architecture
How can “The shipment runs behind the approval commit” be proven in the specific case?
Delivery services can be slow while local releases continue to run.
Starting point Version the amounts due; preserve additional payments with stable references in one continuous ledger.
Assumptions for the example case
Fictitious design for a house, a completed annual period and a contractually specified area key. The application documents released billings and correction versions; the legal examination of individual costs remains with property management. All quantities, thresholds and operational targets are illustrative assumptions. The signed amount due equals the allocated cost share minus advance payments already accounted for. A separate immutable payment ledger records only additional positive payments received later. Outstanding balance = current amount due minus the sum of these additional payments. A positive balance is the remaining amount due, zero means settled, and a negative balance is a credit equal to its absolute value. Corrections replace the amount due, retain all payments and post only the difference from the previous amount due. They remain permitted after settlement and for credit balances. Actual positive payments are accepted and deduplicated even when they exceed the remaining amount due or arrive after settlement. Advance payments are not counted again in the additional ledger. Refunds are outside this case; a credit documents a balance and does not receivable a payout.
Guide document and receivable together
Runtime architecture · manage the document and receivable together
Billing system
Approval writes the manifest and receivable atomically. Delivery and payment import follow separate, documented paths.
Responsibilities within the application
Billing API open · Professional cooperation
Process framework · Billing API
Only the billing release writes document manifest and claim together; the remaining modules work on local contracts.
Runtime components and authoritative data
- Runtime boundary
- Tenant portal and property management interface → Billing API → relational data store. API → document store for immutable documents. A delivery worker reads committed delivery requests and sends them → external delivery service; its evidence → inbox → data store. Payment import → payment reconciliation → data store. Documents and monetary balance remain separate outputs.
- Module responsibilities
- Tenancies: Tracks dwelling areas and validity periods.; Cost allocation: Assigns receipts and allocation keys to a period.; Statement approval: Freezes calculation status and receivable atomically.; Access to receipts: Provides approved document versions.; Payment reconciliation: Connects payment and receivable with differences.
Delivery follows the approval commit.
A delivery worker processes durably stored commands outside the approval transaction.
Delivery services can be slow while local releases continue to run.
The API is responsible for the shared local decision; the worker handles transport and reconciliation. The document store holds immutable files, while the relational data store connects permissions, the manifest, and the receivable.
- Alternative considered
- External shipping within a database lock blocks further processing.
- Trade-off
- Delivery status and approval status may be temporarily separated.
- Reassess
- A separate document inventory is scaled independently only when load measurements justify it.
Try it yourself
Sketch the path of a release up to the delivery service. Mark the common commit and assign document storage, relational data store and worker to their responsibilities.
A hint for your attempt
Track the released billing up to the documented result; observe the boundary to the external system.
Compare with a possible solution
- Local Commit
- The API writes document manifest, amount due and delivery request together in the relational data store. The document store holds the immutable document bytes; their hash connects them to the manifest.
- External service
- The worker only reads committed delivery requests and transmits them to the external delivery service. Its proof is permanently assigned to the correct document status; a shipping error does not change the amount due.
Apply to your project
What decision do you need in your project for leading and derived data?