Receipt Lifecycle¶
Models the lifecycle of a Receipt — the customer-facing proof of a completed commercial transaction. A receipt is created at the point of payment capture, delivered to the customer, and may subsequently be amended (VAT correction, exchange, return) or voided.
Object: receipt ·
States: 5 ·
Transitions: 7
State Diagram¶
flowchart LR
%% ── classDef palette ─────────────────────────────────────
classDef stInit fill:#0d9488,stroke:#0f766e,color:#fff,font-weight:bold
classDef stNorm fill:#3b82f6,stroke:#2563eb,color:#fff
classDef stOk fill:#16a34a,stroke:#15803d,color:#fff,font-weight:bold
classDef stFail fill:#dc2626,stroke:#b91c1c,color:#fff,font-weight:bold
classDef stHold fill:#d97706,stroke:#b45309,color:#fff
%% ── nodes ───────────────────────────────────────────────
pending(["Pending"])
issued["Issued"]
amended["Amended"]
voided[["Voided"]]
archived[["Archived"]]
%% ── transitions ─────────────────────────────────
pending -->|"receipt-issued"| issued
pending -->|"receipt-voided"| voided
issued -->|"receipt-amended"| amended
issued -->|"receipt-voided"| voided
amended -->|"receipt-voided"| voided
issued -->|"receipt-archived"| archived
amended -->|"receipt-archived"| archived
%% ── class assignments ───────────────────────────
class pending stInit
class issued,amended stNorm
class voided stFail
class archived stOk
States¶
| State | Label | Description | Initial | Terminal |
|---|---|---|---|---|
pending |
Pending | Receipt in generation — awaiting payment confirmation before issuance. | ✓ | |
issued |
Issued | Receipt generated and delivered to customer (paper, email, or app). | ||
amended |
Amended | Receipt updated to reflect a correction (VAT number, address, item description). | ||
voided |
Voided | Receipt cancelled due to transaction reversal, payment failure, or exchange. | ✓ | |
archived |
Archived | Receipt moved to long-term storage after fiscal retention period. | ✓ |
Transitions¶
| From | To | Trigger | Guards |
|---|---|---|---|
pending |
issued |
receipt-issued |
Payment confirmed (captured or settled); At least one line item on transaction |
pending |
voided |
receipt-voided |
Payment failed or reversed before receipt delivery |
issued |
amended |
receipt-amended |
Amendment request from customer or operator; Original receipt on record; Amendment within legal window |
issued |
voided |
receipt-voided |
Transaction fully reversed (return of all items); Replacement receipt issued |
amended |
voided |
receipt-voided |
Transaction fully reversed after amendment |
issued |
archived |
receipt-archived |
Fiscal retention period met (jurisdiction-dependent, typically 7–10 years) |
amended |
archived |
receipt-archived |
Fiscal retention period met |