What would a JSONL or Parquet schema for receipts and allocations look like?
A set of linked tables for receipts, obligations, policies, allocations, events and cases, with foreign keys, decimal amounts and a manifest that separates rule-derived fields from free text.
A release can be delivered as linked tables. This is one schema a buyer can ask for, to be adjusted in the pilot.
`receipts.jsonl` - `receipt_id` (`RCPT-7731`), `account_id`, `payer_id`, `amount`, `currency`, `value_date`, `channel` (bank credit, card, cheque), `payer_reference`, `reference_quality` (exact, abbreviated, wrong, missing)
`obligations.jsonl` - `obligation_id` (`INV-3301`), `account_id`, `type`, `issued_date`, `due_date`, `original_amount`, `balance`, `status` (open, disputed, closed), `terms`
`policies.json` - `rule_id` (`POL-TOL-01`), `applies_to`, `text`, `parameters` such as tolerance or approval limit, `version`
`allocations.jsonl` - `allocation_id`, `receipt_id`, `obligation_id`, `amount`, `rule_id`, `reason_code`, `decided_by_role`, `decided_at`, `reverses` (nullable `allocation_id`)
`events.jsonl` - `event_id`, `case_id`, `timestamp`, `role`, `type` (note, query, reply, escalation, approval), `text`
`cases.jsonl` - `case_id`, `receipt_ids`, `accepted_outcomes` (a list, since several can be valid), `exception_tags`, `split`
Foreign keys: allocations refer to receipts, obligations and rules; events refer to cases; cases refer to receipts. Dates use ISO 8601 and amounts are decimal strings to avoid float drift. The same tables can be supplied as Parquet with typed columns.
Add a `generated: true` marker and a `manifest.json` describing how each field was produced, so reviewers can separate rule-derived values from free text and look at grounding.
A keyed, typed schema lets a buyer join receipts to rules and reversals in a few lines and audit each field's origin.
- Audience:
- Model labs
- Content type:
- Integration
- Buyer question:
- What can be generated
Content release: r-a220eb6e099b243b
Related questions
- Can a release encode an organisation's allocation policies as well as transactions?
- What would a generated task for an insurance short-pay look like?
- What do the record schema and links look like in JSONL?
- What can a generated dataset for matching payments to obligations contain?
- Which record types should I request for a simulated payment matching environment?
- Can a release include tolerances, write-off limits and approval rules?