Skip to content

Financial movements with dates and amounts

A ledger of financial movements with references, dates, signed amounts, currencies and statuses.

simple volume small TransactionsFinance
Languages
eng
Formats
csv

Recipe

recipe.gbddl
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 — reference is a unique pattern mask (TXN-########).
  • Dates — posted_on is a date and posted_at a timestamp, both bounded to the declared range.
  • Amounts — amount is a signed decimal, so it covers debits and credits.
  • Currency — currency and country share a same(geo) group, so the currency matches the country.
  • Status — status and direction pick from enum lists.

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 enum values 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