System Design Atlas

Subscription billing, usage and service entitlements

02 / 10Worked example

Business rules and operational targets

How do positive usage and a referenced correction record differ?

The system boundary gives rise to a business rule: each usage event takes effect at most once. R-161 contains exactly the usage included at finalisation, priced using T-2. Late events do not overwrite a finalised invoice, and an unknown payment outcome is not treated as a definite rejection. An operational target describes a measurable property and begins as a test assumption.

Starting point Model service entitlements with a reason and validity period.

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.

Rules governing the result

Event, finalisation and payment evidence

Usage validationPositive units within P-10
Finalisation validationT-2 and an unambiguous watermark
Entitlement validationDefinitive payment outcome
Zahlung unbekannt → AbrechnungsbetriebQuery Z-161; entitlement remains active

Usage takes effect once; finalisation fixes its watermark; an unknown payment outcome leaves the entitlement active.

A correction arrives as negative usage. Keep positive usage and correction records separate so N-161 remains one uniquely identified event.

Business requirements (functional)

Further reading
Invariant
Each usage event takes effect at most once. R-161 contains exactly the usage included at finalisation, priced using T-2. Late events do not overwrite a finalised invoice, and an unknown payment outcome is not treated as a definite rejection.
Boundary test
Usage at 31 October 23:59:59.999 UTC belongs to P-10; usage at 1 November 00:00:00.000 UTC belongs to the next period. Zero or negative units are rejected; corrections have their own record type.
Unresolved outcome
The payment service collects payment for R-161, but its response is lost. Billing operations queries Z-161. This unknown outcome does not restrict the entitlement as a definite rejection would; a late confirmation completes the same payment order.

Quality goals (non-functional)

Further reading
Local acceptance
Illustrative target: 95% of local administrative commands complete within 800 ms during the month-end peak profile of 100,000 invoices in 3,600 s = 27.78 invoices/s. Measure external execution and media transfer separately.
Traceability
Every rejected or open operation shows its reason, latest evidenced state and responsible role. Check this in a sample after the failure from step 7.

Keep usage units unambiguous

Keep usage units unambiguous

Separate positive usage from correction records.

A correction is submitted as negative usage.

N-161 remains one uniquely identified event.

Alternative considered
Mixing negative values into usage hides the link to the original transaction being reversed.
Trade-off
Corrections need their own identity.
Reassess
A different measurement model is agreed.

Terms in this step

Keep usage units unambiguous
N-161 remains one uniquely identified event.

Try it yourself

A source sends zero, minus one and 100 units. Determine which are accepted and how a correction is handled.

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
Only the positive 100 units are valid usage; zero and negative values are rejected.
Second part of the solution
A genuine reversal uses a separate correction record linked to the original usage and leaves that original record intact.

Apply to your project

Which corresponding assumption in your project would you check first when a different measurement model is agreed?

Step 3 examines the required finalisation rate.