telco

Design principles

Why the crate is pure, exact and deterministic, and what it deliberately leaves to other layers.

  • Pure. No clock, file, environment, network or randomness in the library; the CLI reads files and hands bytes in. Enforced by a grep lane and clippy's disallowed-types and disallowed-methods.
  • Exact. Decimal money, integer quantities, no floats anywhere — enforced by the same guard. Rounding happens once per bill line.
  • Deterministic. Ordered collections only; usage is sorted by data, not by arrival. Property tests rate twice and compare bytes.
  • Conserving. Every usage record ends up in exactly one charge's trace or causes a refusal; nothing is dropped silently.
  • Explained. Every charge carries a trace and a sentence.
  • Refusing. Unknown keys, unknown kinds, out-of-period usage, a missing VAT rate — each is a refusal with a stable code, never a default.

Service boundaries

The core models German tariffs in EUR and calendar months. contractd owns contract state. usaged classifies switch calls and serves itemised statements. billd persists classified usage and sealed invoices, sends booking commands to accountingd and serves documents produced by telco-render. Service architecture

Download Markdown