Skip to main content

Crate mako_invoic

Crate mako_invoic 

Source
Expand description

The INVOIC settle/dispute state machine, shared by every billing family.

Every billing process in German market communication is the same conversation. An invoice is issued; the recipient validates it against the AHB and either settles or disputes it; where this deployment is the issuer, a REMADV comes back confirming or refusing payment, and a COMDIS may refuse that REMADV in turn.

Nothing in it is commodity-specific: the process is keyed on the invoice reference, and the Sparte only decides which price sheet invoic-checker fetches — invoicd’s decision, not the workflow’s. GPKE, WiM, GaBi Gas and GeLi Gas therefore register an InvoicFamily here rather than implementing the process.

§What a family chooses

InvoicFamily is the whole of the variation — the PID sets, the two role capabilities, the deadline label and the workflow name. Everything else is shared.

── Recipient (payer) ────────────────────────────────────────────────
New ──ReceiveInvoic──► InvoicReceived ──[valid]──► ValidationPassed
                                       ╰─[invalid]──► Rejected
ValidationPassed ──SettleInvoice──► Settled
                 ╰─DisputeInvoice──► Disputed

── Issuer ───────────────────────────────────────────────────────────
New ──SendInvoic──► InvoicSent ──ReceiveRemadv 33001──► PaymentConfirmed
                               ╰─ReceiveRemadv 33002/3/4──► PaymentDisputed

── Payer, after its REMADV was refused ──────────────────────────────
any settled/sent state ──ReceiveComdis 29001──► ComdisRejected

Any non-terminal state ──TimeoutExpired──► Rejected

§Regulatory basis

  • INVOIC AHB 1.0 (FV2025-10-01 onwards; AHB 2.8e before) — the invoice message and its Prüfidentifikatoren.
  • REMADV AHB 1.0a § 3 — the payment advice. Settlement is „ganz oder gar nicht“: there are no Teilzahlungen, so 33002/33003/33004 are all Abweisungen and only 33001 confirms.
  • COMDIS AHB 1.0 — the invoicer’s refusal of a payer’s REMADV (29001).
  • APERAK AHB 1.0 § 2.4.1 — the technical acknowledgement, 45 Minuten on a weekday. A different clock from the business answer this workflow runs.

Structs§

InvoicData
The invoice facts a billing stream carries from receipt to settlement.
InvoicProjection
In-process read model tracking billing process streams.
InvoicRecord
Read-model record for a single billing process stream.
InvoicWorkflow
The INVOIC settle/dispute workflow for one InvoicFamily.
RemadvAntwort
The market answer a Nicht-Zahlungsavis carries.
RemadvBefund
One AJT of a Nicht-Zahlungsavis — a published Antwortcode, the Ebene it came from and, on the Positionsebene, the Positionsnummer it belongs to.

Enums§

InvoicCommand
Commands accepted by the billing workflow.
InvoicEvent
Events emitted by the billing workflow.
InvoicState
Current state of one billing process stream.

Constants§

ABWEISUNG_PID
The REMADV a payer sends to refuse an invoice whose tree answers with one code — the plain „Abweisung“ of REMADV AHB 1.0a § 3.1.1.
COMDIS_ABLEHNUNG_PID
COMDIS Prüfidentifikator for an inbound Ablehnung of a REMADV (payer side).
REMADV_CONFIRMATION_PID
The single REMADV PID that confirms payment. Everything else disputes it.
REMADV_PIDS
The REMADV Prüfidentifikatoren a payer can answer an invoice with.
ZAHLUNGSAVIS_PID
The REMADV a payer sends to confirm — the Zahlungsavis. It carries no AJT at all (REMADV AHB 1.0a § 3.1.1): agreement needs no Antwortcode.

Traits§

InvoicFamily
What one billing family chooses. Everything else about the process is shared.

Functions§

remadv_confirms
true when pid is a REMADV that confirms payment rather than disputing it.