# vehicle-rental

> Intermediate: 4 tables, 5 relationships, 8 scenarios — a complete recipe you can run as shipped.

Section: Examples · Type: example · Last updated: 2026-09-13

vehicle-rental. A worked, COMMENTED example of the recipe language at medium complexity. Every _-prefixed key in this file is a comment: the engine does not execute them, validate_recipe records them in declared_not_executed, and they are the only supported way to annotate a recipe. There is no note key. 4 tables (Branch, Vehicle, Customer, Hire), 662 rows as declared, 5 relationships, 8 scenarios. Seed 20260901, so running it reproduces exactly the data described here.

## The picture

examples/vehicle-rental.wl.json (4 tables) → worklens bundle (seed 20260901) → Run folder (data + proof)

## Tables

- Branch — 8 fields, 12 rows, tree
- Vehicle — 7 fields, 90 rows
- Customer — 10 fields, 300 rows
- Hire — 20 fields, 260 rows, 2 constraints, flow

## Relationships

- Vehicle.home_branch_id → Branch.branch_id (fk)
- Hire.customer_id → Customer.customer_id (fk)
- Hire.vehicle_id → Vehicle.vehicle_id (fk)
- Hire.pickup_branch_id → Branch.branch_id (fk)
- Hire.vehicle_id → Hire.starts_on (unique) — one vehicle, one start date

## Scenarios

- clean — as declared, no rates changed
- import_rejects — sets invalid_format_rate, null_rate, typo_rate
- orphans — sets broken_fk_rate
- outliers — sets outlier_rate, outlier_magnitude
- duplicates — sets duplicate_rate
- date_anomalies — sets date_anomaly_rate
- known_bad — sets defects
- volume — sets rows

## Recipe keys used

- after, aggregate, column, constraints, derive, fanout, flow, from, max, min, month_weights, no_overlap, nullable, params_when, pattern, present_when, ref, relationships, role, rollup, rows, scenarios, scope, seed, sensitivity, shape, table, tree, type, type_def, unique, values, weights, weights_when

## Run it

```bash
validate_recipe -> sample_world (cheap, 120 rows, catches vacuous declarations) -> generate_from_graph -> prove_recipe.
```

Seed 20260901 is in the file, so the bytes are the same on every machine.

## Related

- [Examples](https://theworklens.com/docs/examples): See how real requirements become WorkLens recipes: four complete recipes shipped with the engine, each on its own page.
- [Prove & bundle](https://theworklens.com/docs/cli/prove): worklens prove and worklens bundle — a verifiable proof as JSON, or a whole run folder with data, recipe, proof and manifest.
- [Homepage demo](https://theworklens.com/docs/examples/homepage-demo): Starter: 2 tables, 1 relationship, 0 scenarios — a complete recipe you can run as shipped.
- [Suncorp-shaped general insurance group](https://theworklens.com/docs/examples/insurance-group): Advanced: 20 tables, 23 relationships, 8 scenarios — a complete recipe you can run as shipped.

_← Previous: [Suncorp-shaped general insurance group](https://theworklens.com/docs/examples/insurance-group) · Next: [Northwind Supply Co](https://theworklens.com/docs/examples/whole-company) →_

_Tables, relationships, scenarios and the keys used are read from the recipe file at generation time. Source: examples/vehicle-rental.wl.json._

_Canonical: https://theworklens.com/docs/examples/vehicle-rental · This copy: https://theworklens.com/docs/examples/vehicle-rental.md_
