Shift Assignment Schema
Campos
Shift Assignment Schema
A concrete staffing entry: one employee occupies one role-slot of one coverage-demand using one shift-block on one date. Together with the coverage-demand.coverageWindow, the set of assignments determines whether the demand is fully covered.
employeeId
UUID of the employee profile — canonical key (ADR 0122). Shifts can be planned for employees without a linked user account (Aushilfen, Subunternehmer, Azubis ohne IT-Konto).
userId
Linked user UUID (denormalised from `employee_profile.userId` for fast personal-calendar lookups). `null` when the employee has no login. Writers must keep it in sync.
shiftBlockId
UUID of the shift-block (time bucket). Required — the time + ArbZG semantics of the assignment come from this block.
coverageDemandId
UUID of the coverage-demand this assignment fills. Null for ad-hoc shifts that do not belong to any demand (e.g. Springer, training time blocked off as a shift).
roleSlotId
When coverageDemandId is set, this is the slotId of the role within coverage-demand.roles[] that the employee occupies. Null when coverageDemandId is null.
date
Date of the shift (YYYY-MM-DD)
startTimeOverride
Override start time for this specific assignment
endTimeOverride
Override end time for this specific assignment
status
Assignment status
PLANNEDCONFIRMEDSWAPPEDCANCELLEDOPENswappedWithUserId
User UUID if this shift was swapped
notes
schedulePeriodId
UUID of the schedule period this assignment belongs to
solverGenerated
True if generated by the scheduling solver (CP-SAT / greedy fallback). Manually-created or manually-edited assignments stay false.
aiExplanation
LLM-rendered German-language explanation of why the solver made this assignment (generated post-solve by schedule-evaluation.service via Claude).
preferenceScore
Normalised employee preference for this employee × shift-block combination, in [-1, 1]. Mapping: LOVE=1.0, PREFER=0.7, NEUTRAL=0.5, AVOID=0.1, NEVER=-1.0. NEVER is a soft penalty, not a veto — the solver may still assign a NEVER block when no feasible alternative exists (such cases are reported in qualityReport.neverViolations).
confirmedByEmployee
confirmedAt
Ningún campo coincide con el filtro.
Endpoints estándar
Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:
GET /api/v1/shift_assignments— Lista, paginada y filtrableGET /api/v1/shift_assignments/<id>— Una entidadPOST /api/v1/shift_assignments— CrearPATCH /api/v1/shift_assignments/<id>— Actualización parcialDELETE /api/v1/shift_assignments/<id>— Eliminación lógicaGET /api/v1/shift_assignments/<id>/timeline— Auditoría y actividades