API — Calendars & shifts
Purpose
Read access to the resolved working calendar (working days, hours, holidays, modifiers) and to shift reference data (shift patterns, templates, types). These are largely read-only surfaces; the editable shift-template CRUD lives on Lookups & reference data.
Auth & roles
- Calendar — base
/api/calendar· class-level[Authorize("calendar.view")]. - Shifts — base
/api· reads gate onshift_template.view/shift_pattern.view.
Endpoints
Calendar — /api/calendar · calendar.view
| Method | Path | Purpose |
|---|---|---|
| GET | /api/calendar/configuration |
Resolved calendar configuration |
| GET | /api/calendar/working-days |
Working days |
| GET | /api/calendar/working-hours |
Working hours (after modifiers) |
| GET | /api/calendar/holidays |
Holidays in range |
Shifts — /api
| Method | Path | Purpose | Gate |
|---|---|---|---|
| GET | /api/shift-templates |
Shift templates (read) | shift_template.view |
| GET | /api/shift-types |
Shift types | shift_template.view |
| GET | /api/shift-patterns |
Shift patterns | shift_pattern.view |
| GET | /api/shift-patterns/{id}/preview |
Preview a pattern's days | shift_pattern.view |
Shapes & errors
The calendar resolver composes weekends, holidays, and Ramadan/working-hour modifiers. Modifiers change hours-per-day only — never dates (sheet 05). Standard ProblemDetails.
Gotchas
- Shift types, templates and patterns are read-only here — the writable shift-template CRUD is under
/api/admin/shift-templates(see Lookups & reference data). - Modifiers adjust hours, not the calendar dates — a Ramadan modifier shortens the working hours of a day; it doesn't move the day.
- The two
GET /api/shift-templatesroutes (here and the admin list) reflect read vs admin-CRUD surfaces of the same data.
Related
- Shifts & calendars (concept)
- Lookups & reference data — shift-template CRUD.
- Swagger:
/swagger· Fact sheet 05 (calendars & shifts).