Skip to content

Data Model

Entity relationship diagram

Six tables. Each has a single responsibility — no table does double duty.

JOBS
1 row per batch
Top-level envelope — intent, owner, overall status, idempotency key
JOB_ITEMS
1 row per card
Per-card execution state, retry count, failure code
NOTIFICATIONS
1 row per delivery
Outbound comms log — absence means the cardholder was never notified
AUDIT_LOG
Many per item
Immutable append-only event stream; basis for dispute resolution and debugging
POLICY_REGISTRY
~10s of active rules
Versioned rules governing when auto-execution is allowed vs. human approval required
APPROVALS
0–1 per job
Approval lifecycle with expiry; links a job to the policy that required human sign-off
JOBS1 → ∞JOB_ITEMScontains
JOBS1 → ∞AUDIT_LOGlogs
JOBS0 → 1APPROVALSrequires
JOB_ITEMS0 → 1NOTIFICATIONStriggers
APPROVALSPOLICY_REGISTRYenforces