Attendance Shift Assignments API
Summary
Three direct operations create/list employee shift assignments and inspect effective calculation context.
Audience
Frontend/backend developers, QA engineers, architects, and implementation partners.
Reference Content
Authentication: Bearer and administrative context expected; exact enforcement requires confirmation. Tenant: required. Maturity: Direct/Shadow, Foundation.
| Operation | Method and public route | Contract | Responses and behavior | Safe example |
|---|---|---|---|---|
| Create assignment | POST /attendance/employees/{laborId:int}/shift-assignments | Positive employee route parameter; EmployeeShiftAssignmentCreateRequest | 200 ApiResponse<EmployeeShiftAssignmentDto>; 400 invalid/inactive; 404 shift missing; 409 overlap; audit/timeline, no Attendance event | POST …/4242/shift-assignments with {"shiftId":9001,"effectiveFrom":"2030-01-01","effectiveTo":null} → 200; overlap → 409. |
| List assignments | GET /attendance/employees/{laborId:int}/shift-assignments | Positive employee route parameter | 200 ApiResponse<EmployeeShiftAssignmentDto[]>; read-only | GET …/4242/shift-assignments → data:[]; handled tenant failure → 400. |
| Resolve effective policy | GET /attendance/employees/{laborId:int}/effective-policy | Employee route parameter; optional date, optional probeHours | 200 ApiResponse<EffectiveAttendancePolicyDto>; diagnostic, read-only | GET …/4242/effective-policy?date=2030-01-02&probeHours=7.5 → 200; binding error → 400. |
Assignment request fields are shiftId, optional effectiveFrom, and optional effectiveTo; null end is open-ended and omitted start defaults according to current service behavior. Validation requires a valid employee reference, existing active shift, valid date range, and no active overlap. Response includes assignment, employee, shift/name, effective range, and active state.
Effective-policy response reports employee/date, winning context category, optional shift/policy references, shift start, standard/overtime context, grace, rule availability, weekly-off flag, and optional probe result. It is a diagnostic read model, not a policy assignment mutation.
No assignment update, deactivate, delete, explicit end-date, or active-only resolution endpoint exists. Changes require creating a nonoverlapping assignment through currently supported behavior or another workflow not exposed here.
Source References
microservices/src/attendance-service/Api/AttendanceShiftPolicyEndpoints.csmicroservices/src/attendance-service/Application/TimeOffice/ShiftPolicyDtos.csmicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.csmicroservices/src/attendance-service/Application/Services/ShiftPolicyQueries.cs
Related Articles
See Also
Keywords
- Attendance API
- Attendance Shift Assignments API
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly