Skip to content

leave.requested

A leave request waits for a stage’s approval: for whoever approves that stage to act on. Sent when the request is made, again at each stage after the one before approves it, and again when a stage’s approval no longer holds (the request changed). 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 “/leave/”. The same event sent again has the same id.

Schema id: urn:houradvantage:events:3:leave.requested

Fields

FieldTypeRequiredDescription
tenantstringyesThe tenant it is about.
personstringyesThe person’s id in the attendance engine.
idstringyesThe leave request’s id. A changed request is another request, with its own id, naming the one it replaces.
categorystringyesThe pay category its time is in (vacation, sick…), as the tenant names it.
daysarray of objectyesThe days asked for, each with its time.
days[].datestring (date)yesThe workday, YYYY-MM-DD.
days[].timestringyesThe time asked for that day, as a duration (“8h”, “4h 30m”).
bystringyesWho asked for it.
commentstringyesWhat they wrote with it ("" for nothing).
valuesobjectWhat the tenant’s policy reads of the request beyond its days, by name (the relationship of a bereavement: {“relationship”: “spouse”}). Absent: none.
replacesstring or nullyesThe request this one replaces; null when it replaces none.
state"pending"yesWhere its approval stands: pending (waiting for a stage), approved at every stage, rejected, or refused (the policy’s leave check refused it: its approval cannot pass).
stagestringyesThe stage whose approval it waits for, as the approval rule for leave names it (“supervisor”, “hr”), or “approval” when there is no rule for leave.
approverstringWho the stage goes to, where the policy’s leave check routed it elsewhere than the approval rule’s approver (“role:director”). Absent: the rule’s approver.
organizationstringThe organization the decision waits on, where the stage is tied to a hierarchy (the rule’s stage organization): the person’s own organization of that hierarchy on the request’s first day, or one above it. Whoever decides for it is the app’s to say. Absent: the stage is tied to none, or the person has no place there.
wasobjectWhere 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.statestringyes
was.daysarray of objectyes
was.days[].datestring (date)yes
was.days[].timestringyes
becausearray of objectWhat 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[].idstring
because[].itemstringFor setup, the kind of the item (holiday, rate…).
because[].storedstring (date-time)
because[].bystring
because[].reasonstring

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": "pending",
"stage": "supervisor",
"organization": "ops-west"
}

JSON Schema

leave.requested.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:leave.requested",
"title": "leave.requested: data",
"description": "A leave request waits for a stage's approval: for whoever approves that stage to act on. Sent when the request is made, again at each stage after the one before approves it, and again when a stage's approval no longer holds (the request changed). 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": [
"pending"
],
"description": "Where its approval stands: pending (waiting for a stage), approved at every stage, rejected, or refused (the policy's leave check refused it: its approval cannot pass)."
},
"stage": {
"type": "string",
"description": "The stage whose approval it waits for, as the approval rule for leave names it (\"supervisor\", \"hr\"), or \"approval\" when there is no rule for leave."
},
"approver": {
"type": "string",
"description": "Who the stage goes to, where the policy's leave check routed it elsewhere than the approval rule's approver (\"role:director\"). Absent: the rule's approver."
},
"organization": {
"type": "string",
"description": "The organization the decision waits on, where the stage is tied to a hierarchy (the rule's stage organization): the person's own organization of that hierarchy on the request's first day, or one above it. Whoever decides for it is the app's to say. Absent: the stage is tied to none, or the person has no place there."
},
"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",
"stage"
],
"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": "pending",
"stage": "supervisor",
"organization": "ops-west"
}
]
}