leave.booked
What a leave request books changed while where it stands did not: a day of leave on a holiday added after the leave was approved books no time (the hours are back in the balance and the holiday is paid), or the time a day books was changed by a step. The request’s days are what it books now, was what it booked before, because what changed it. A change of where the request stands (approved, refused, waiting) is told by the event of that (leave.requested, leave.decided), with the same fields. Kept in Time and Attendance’s own event log and delivered to its sinks, as the other leave events are. The same event sent again has the same id.
Schema id: urn:houradvantage:events:3:leave.booked
Fields
| Field | Type | Required | Description |
|---|---|---|---|
tenant | string | yes | The tenant it is about. |
person | string | yes | The person’s id in the attendance engine. |
id | string | yes | The leave request’s id. A changed request is another request, with its own id, naming the one it replaces. |
category | string | yes | The pay category its time is in (vacation, sick…), as the tenant names it. |
days | array of object | yes | The days asked for, each with its time. |
days[].date | string (date) | yes | The workday, YYYY-MM-DD. |
days[].time | string | yes | The time asked for that day, as a duration (“8h”, “4h 30m”). |
by | string | yes | Who asked for it. |
comment | string | yes | What they wrote with it ("" for nothing). |
values | object | What the tenant’s policy reads of the request beyond its days, by name (the relationship of a bereavement: {“relationship”: “spouse”}). Absent: none. | |
replaces | string or null | yes | The request this one replaces; null when it replaces none. |
state | "approved" \ | "rejected" \ | "refused" |
was | object | Where the request stood before, when this is told because that changed: its state and the days it booked (as days). Absent the first time it is told. A request refused that stands now says it was refused; a day booked down to nothing by a holiday shows the time it was booked at. | |
was.state | string | yes | |
was.days | array of object | yes | |
was.days[].date | string (date) | yes | |
was.days[].time | string | yes | |
because | array of object | What marked the person for this recalculation, as the store knew it, in the order made: a setup item put (kind “setup”, its item kind and id, when it was stored, by whom and reason) a correction made (kind “correction”, its id), punches that arrived (kind “punches”: one, however many, with no id), or an operator asking for the person to be worked out again keeping nothing (kind “redo”, by whom and reason). Absent where nothing is known of what it was (a load, a policy, a punch). | |
because[].kind | "setup" \ | "correction" \ | "punches" \ |
because[].id | string | ||
because[].item | string | For setup, the kind of the item (holiday, rate…). | |
because[].stored | string (date-time) | ||
because[].by | string | ||
because[].reason | string |
Example
{ "tenant": "acme", "person": "104552", "id": "v1", "category": "vacation", "days": [ { "date": "2026-10-12", "time": "8h" }, { "date": "2026-10-13", "time": "4h" } ], "by": "104552", "comment": "family visit", "replaces": null, "state": "approved"}JSON Schema
leave.booked.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:houradvantage:events:3:leave.booked", "title": "leave.booked: data", "description": "What a leave request books changed while where it stands did not: a day of leave on a holiday added after the leave was approved books no time (the hours are back in the balance and the holiday is paid), or the time a day books was changed by a step. The request's days are what it books now, `was` what it booked before, `because` what changed it. A change of where the request stands (approved, refused, waiting) is told by the event of that (`leave.requested`, `leave.decided`), with the same fields. Kept in Time and Attendance's own event log and delivered to its sinks, as the other leave events are. The same event sent again has the same id.", "type": "object", "properties": { "tenant": { "type": "string", "description": "The tenant it is about." }, "person": { "type": "string", "description": "The person's id in the attendance engine." }, "id": { "type": "string", "description": "The leave request's id. A changed request is another request, with its own id, naming the one it replaces." }, "category": { "type": "string", "description": "The pay category its time is in (vacation, sick...), as the tenant names it." }, "days": { "type": "array", "description": "The days asked for, each with its time.", "items": { "type": "object", "properties": { "date": { "type": "string", "format": "date", "description": "The workday, YYYY-MM-DD." }, "time": { "type": "string", "description": "The time asked for that day, as a duration (\"8h\", \"4h 30m\")." } }, "required": [ "date", "time" ] } }, "by": { "type": "string", "description": "Who asked for it." }, "comment": { "type": "string", "description": "What they wrote with it (\"\" for nothing)." }, "values": { "type": "object", "description": "What the tenant's policy reads of the request beyond its days, by name (the relationship of a bereavement: {\"relationship\": \"spouse\"}). Absent: none.", "additionalProperties": { "type": "string" } }, "replaces": { "type": [ "string", "null" ], "description": "The request this one replaces; null when it replaces none." }, "state": { "enum": [ "approved", "rejected", "refused" ], "description": "Where its approval stands: approved at every stage, rejected, or refused (the policy's leave check refused it, whatever is decided: its approval cannot pass)." }, "was": { "type": "object", "description": "Where the request stood before, when this is told because that changed: its `state` and the `days` it booked (as `days`). Absent the first time it is told. A request refused that stands now says it was refused; a day booked down to nothing by a holiday shows the time it was booked at.", "properties": { "state": { "type": "string" }, "days": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "time": { "type": "string" } }, "required": [ "date", "time" ] } } }, "required": [ "state", "days" ] }, "because": { "type": "array", "description": "What marked the person for this recalculation, as the store knew it, in the order made: a setup item put (`kind` \"setup\", its `item` kind and `id`, when it was `stored`, `by` whom and `reason`) a correction made (`kind` \"correction\", its `id`), punches that arrived (`kind` \"punches\": one, however many, with no id), or an operator asking for the person to be worked out again keeping nothing (`kind` \"redo\", `by` whom and `reason`). Absent where nothing is known of what it was (a load, a policy, a punch).", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "setup", "correction", "punches", "redo" ] }, "id": { "type": "string" }, "item": { "type": "string", "description": "For setup, the kind of the item (holiday, rate...)." }, "stored": { "type": "string", "format": "date-time" }, "by": { "type": "string" }, "reason": { "type": "string" } }, "required": [ "kind" ] } } }, "required": [ "tenant", "person", "id", "category", "days", "by", "comment", "replaces", "state" ], "examples": [ { "tenant": "acme", "person": "104552", "id": "v1", "category": "vacation", "days": [ { "date": "2026-10-12", "time": "8h" }, { "date": "2026-10-13", "time": "4h" } ], "by": "104552", "comment": "family visit", "replaces": null, "state": "approved" } ]}