leave.cancelled
A leave request is taken back (cancelled), and no other replaces it: its time is no longer in the person’s ledger. A request replaced by another is not cancelled: the other is requested in its turn, naming it in replaces. The fields are those of the request as it last stood. Kept in Time and Attendance’s own event log (apart from Connect’s) and delivered to its sinks: the tenant’s (/api/attendance/tenants/{tenant}/sinks) and the install’s (/api/attendance/sinks). It is told from the ledger of the pay period the request’s first day is in. The envelope’s endpoint is “attendance”, its package “houradvantage-attend”, and its device “
Schema id: urn:houradvantage:events:3:leave.cancelled
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 | "pending" \ | "approved" \ | "rejected" |
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.cancelled.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:houradvantage:events:3:leave.cancelled", "title": "leave.cancelled: data", "description": "A leave request is taken back (cancelled), and no other replaces it: its time is no longer in the person's ledger. A request replaced by another is not cancelled: the other is requested in its turn, naming it in replaces. The fields are those of the request as it last stood. Kept in Time and Attendance's own event log (apart from Connect's) and delivered to its sinks: the tenant's (/api/attendance/tenants/{tenant}/sinks) and the install's (/api/attendance/sinks). It is told from the ledger of the pay period the request's first day is in. The envelope's endpoint is \"attendance\", its package \"houradvantage-attend\", and its device \"<person>/leave/<id>\". 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": [ "pending", "approved", "rejected" ], "description": "Where its approval stands: pending (waiting for a stage), approved at every stage, or rejected." }, "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" } ]}