1.2. Definition files
A definition file lists entities under entities, each with its key field, events and rules. It is a YAML file in the app's repo; the format is on Files and requests. This one defines a hotel folio: three event types and one rule.
entities:
folio:
key: folio_id
events:
FolioOpened: { reservation_id: text, currency: text }
ChargePosted: { charge_id: text, gross_minor: number, note: text? }
FolioClosed: {}
rules:
- on: any
requires: never FolioClosed # a closed folio takes no more events
folioText · checked against the spec · Folio file loads without errors. Folio has three event types. Folio note is optional. Folio has one rule.
Rules may be split across files of the same entity: