leave.decided
A leave request is approved at every stage (its time is now in the person’s ledger, in its category), rejected at a stage, or refused by the policy’s leave check (not enough balance, a blackout day: its approval cannot pass). With no approval rule for leave, a request waits for one decision at the stage “approval”. 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.decided
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" |
why | string | Why the policy’s leave check refused it, in words. Present only when refused. | |
reason | object | Why it was refused, as a stable key and the values that fill it in (the refusing step’s rule, “standard/leave_balance.floor”), so an app can word it in any language. Present only when refused by a step that named its rule. | |
reason.key | string | yes | |
reason.values | object | ||
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.decided.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:houradvantage:events:3:leave.decided", "title": "leave.decided: data", "description": "A leave request is approved at every stage (its time is now in the person's ledger, in its category), rejected at a stage, or refused by the policy's leave check (not enough balance, a blackout day: its approval cannot pass). With no approval rule for leave, a request waits for one decision at the stage \"approval\". 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": [ "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)." }, "why": { "type": "string", "description": "Why the policy's leave check refused it, in words. Present only when refused." }, "reason": { "type": "object", "description": "Why it was refused, as a stable key and the values that fill it in (the refusing step's rule, \"standard/leave_balance.floor\"), so an app can word it in any language. Present only when refused by a step that named its rule.", "properties": { "key": { "type": "string" }, "values": { "type": "object", "additionalProperties": { "type": "string" } } }, "required": [ "key" ] }, "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" } ]}