Skip to content

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 “/leave/”. The same event sent again has the same id.

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

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" \"approved" \"rejected"
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": "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"
}
]
}