The overall architecture
Which invoice data remain unchangeable despite subsequent tariff changes?
The data contract defines the runtime topology: usage source → ingestion API → usage and contract store. The finalisation worker fixes the period watermark and writes invoices. The payment worker reads payment orders and sends them to the payment service; results enter a durable inbox. The entitlement service reads evidenced contract and payment decisions. The customer portal reads invoices and entitlements through separately authorised views. Internal modules define domain boundaries in code; a separate process has its own operational lifecycle.
Starting point Fix an unambiguous ingestion watermark.
Assumptions for the example case
Original fictional example design: one monthly contract in EUR, positive integer usage units, a fixed tariff version per period, one invoice and one payment order, and separate correction records. Figures and quality targets are illustrative test assumptions. Tax law, multiple currencies, prorated tariff changes and debt collection are outside the scope.
Runtime architecture
Runtime architecture · Ingestion, period finalisation and payment inbox
Billing platform
Ingestion maintains usage and tariff data; the finalisation worker fixes R-161; payment evidence reaches the entitlement service through the durable inbox.
Domain modules within the application
Inside the billing process · Five domain modules
Usage ingestion and tariff binding produce an unambiguous finalisation. Payment reconciliation and entitlement handling keep unknown outcomes and corrections visible.
Operational boundaries
- Runtime
- Usage source → ingestion API → usage and contract store. The finalisation worker fixes the period watermark and writes invoices. The payment worker reads payment orders and sends them to the payment service; results enter a durable inbox. The entitlement service reads evidenced contract and payment decisions. The customer portal reads invoices and entitlements through separately authorised views.
- Persistence
- Transactional store for contract V-161, usage event N-161 and period P-10. The authoritative business change and its retry result are saved together; external side effects require separate evidence.
Decouple billing and payment
Finalise invoices immutably and track payments separately.
Payment collection may complete minutes later.
Payment errors do not change invoice content.
- Alternative considered
- Rebuilding the invoice for every payment attempt can change the amount.
- Trade-off
- Several distinct states must be displayed.
- Reassess
- Partial payments are added to the scope.
Terms in this step
- Decouple billing and payment
- Payment errors do not change invoice content.
Try it yourself
Payment collection fails after the tariff has changed. Which data in R-161 may change?
A hint for your attempt
Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.
Compare with a possible solution
- First part of the solution
- R-161 retains tariff T-2 and its finalised usage snapshot unchanged.
- Second part of the solution
- The payment receives the evidenced failure status. A new payment attempt or follow-up process must not recalculate the invoice using the current tariff.
Apply to your project
Which corresponding assumption in your project would you check first when partial payments are added to the scope?