Financial movements with dates and amounts
A ledger of financial movements with references, dates, signed amounts, currencies and statuses.
- Languages
eng- Formats
csv
Recipe
gbddl 1
language eng
table transactions rows 30 (
id int64 autoincrement primarykey
reference text unique pattern(pattern: "TXN-########")
posted_on date date(min: "2023-01-01", max: "2024-12-31")
posted_at timestamp datetime(min: "2023-01-01 00:00:00", max: "2024-12-31 23:59:59")
amount decimal(12, 2) decimal(min: -100000, max: 100000)
direction text enum(values: ["debit","credit"])
currency text same(geo) currency()
country text same(geo) country()
status text enum(values: ["posted","pending","reversed"])
description text sentence(maxWords: 8)
)
output csv
This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.
About this recipe
Transactions
A single-table recipe that generates a ledger of financial movements: a reference, posting dates, a signed amount, a currency and a status.
What it demonstrates
- References —
referenceis auniquepatternmask (TXN-########). - Dates —
posted_onis a date andposted_ata timestamp, both bounded to the declared range. - Amounts —
amountis a signed decimal, so it covers debits and credits. - Currency —
currencyandcountryshare asame(geo)group, so the currency matches the country. - Status —
statusanddirectionpick fromenumlists.
Run it
Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it
into Chef, to generate the data. The repository's local runner (run by
task test) also generates it and verifies its output.
The recipe outputs one CSV table file, transactions.csv, holding thirty rows.
Adapt it
- Add a
per(...)table to attach each movement to a parent account. - Change the
enumvalues to your own status or direction vocabulary.
Guarantees
Every row has a unique id and reference; dates and amounts stay inside the
declared ranges; the currency and country are coherent per row. The movements
are synthetic and do not form a balanced ledger.
Tested features
Smart types, physical types, rules and formats this recipe exercises and verifies.
patterndatedatetimedecimalenumcurrencycountrysentenceuniqueautoincrementprimary-keysame:geography