Skip to content

period.closed

A pay period is closed for a person: their timecard as payroll pays it, with its totals. Sent once per close; a change recorded after the close shows as an adjustment, not a new period.closed. 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). The envelope’s endpoint is “attendance”, its package “houradvantage-attend”, and its device ”//” (the timecard). The same event sent again has the same id.

Schema id: urn:houradvantage:events:3:period.closed

Fields

FieldTypeRequiredDescription
tenantstringyesThe tenant it is about.
personstringyesThe person’s id in the attendance engine (an employee’s id, or an unlinked person’s, ”~”).
sidestringyesWhich side the timecard is: “pay” (what the person is paid), or a bill side the tenant keeps (what a customer is billed).
firststring (date)yesThe pay period’s first day, YYYY-MM-DD.
laststring (date)yesThe pay period’s last day, YYYY-MM-DD.
totalsobjectyesThe timecard’s totals.
totals.paidstringyesThe hours of its lines in paid categories, in decimal hours as the tenant keeps them (“40.25”): carried forward, never rounded line by line. Time in a category that is not paid is not in it. pattern ^-?\d+(\.\d+)?$
totals.workedstringyesThe time worked, as a duration: hours and minutes (“40h 15m”), “0s” for none.
totals.categoriesobjectyesHours by pay category (work, overtime, holiday… as the tenant names them), in decimal hours.
totals.category_useobjectyesWhat each pay category in categories is, by name: whether its time is paid and whether it counts as worked, and the code payroll knows it by where the tenant’s setup names one. Time in a category that is not paid (a meal deducted, say) is recorded but not in paid.
closed_atstring (date-time)yesWhen the period was closed, RFC 3339 UTC.

Example

{
"tenant": "acme",
"person": "4471",
"side": "pay",
"first": "2026-10-05",
"last": "2026-10-11",
"totals": {
"paid": "42.50",
"worked": "42h 30m",
"categories": {
"overtime": "2.50",
"work": "40.00"
},
"category_use": {
"overtime": {
"paid": true,
"worked": true
},
"work": {
"paid": true,
"worked": true
}
}
},
"closed_at": "2026-10-12T15:00:00Z"
}

JSON Schema

period.closed.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:period.closed",
"title": "period.closed: data",
"description": "A pay period is closed for a person: their timecard as payroll pays it, with its totals. Sent once per close; a change recorded after the close shows as an adjustment, not a new period.closed. 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). The envelope's endpoint is \"attendance\", its package \"houradvantage-attend\", and its device \"<person>/<side>/<first>\" (the timecard). 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 (an employee's id, or an unlinked person's, \"<group>~<person>\")."
},
"side": {
"type": "string",
"description": "Which side the timecard is: \"pay\" (what the person is paid), or a bill side the tenant keeps (what a customer is billed)."
},
"first": {
"type": "string",
"format": "date",
"description": "The pay period's first day, YYYY-MM-DD."
},
"last": {
"type": "string",
"format": "date",
"description": "The pay period's last day, YYYY-MM-DD."
},
"totals": {
"type": "object",
"description": "The timecard's totals.",
"properties": {
"paid": {
"type": "string",
"description": "The hours of its lines in paid categories, in decimal hours as the tenant keeps them (\"40.25\"): carried forward, never rounded line by line. Time in a category that is not paid is not in it.",
"pattern": "^-?\\d+(\\.\\d+)?$"
},
"worked": {
"type": "string",
"description": "The time worked, as a duration: hours and minutes (\"40h 15m\"), \"0s\" for none."
},
"categories": {
"type": "object",
"description": "Hours by pay category (work, overtime, holiday... as the tenant names them), in decimal hours.",
"additionalProperties": {
"type": "string",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"category_use": {
"type": "object",
"description": "What each pay category in `categories` is, by name: whether its time is paid and whether it counts as worked, and the code payroll knows it by where the tenant's setup names one. Time in a category that is not paid (a meal deducted, say) is recorded but not in `paid`.",
"additionalProperties": {
"type": "object",
"properties": {
"paid": {
"type": "boolean",
"description": "Its time is paid."
},
"worked": {
"type": "boolean",
"description": "Its time counts as worked."
},
"code": {
"type": "string",
"description": "The code payroll knows it by."
}
},
"required": [
"paid",
"worked"
]
}
}
},
"required": [
"paid",
"worked",
"categories",
"category_use"
]
},
"closed_at": {
"type": "string",
"format": "date-time",
"description": "When the period was closed, RFC 3339 UTC."
}
},
"required": [
"tenant",
"person",
"side",
"first",
"last",
"totals",
"closed_at"
],
"examples": [
{
"tenant": "acme",
"person": "4471",
"side": "pay",
"first": "2026-10-05",
"last": "2026-10-11",
"totals": {
"paid": "42.50",
"worked": "42h 30m",
"categories": {
"overtime": "2.50",
"work": "40.00"
},
"category_use": {
"overtime": {
"paid": true,
"worked": true
},
"work": {
"paid": true,
"worked": true
}
}
},
"closed_at": "2026-10-12T15:00:00Z"
}
]
}