Shift Assignment Storage
Summary
Employee Shift assignments bind an external employee reference to an Attendance-owned Shift over an inclusive effective-date range.
Audience
- Backend developers, Time Office implementers, QA engineers, and architects
Reference Content
Confirmed behavior
Assignments store tenant identity, employee/labor reference, optional compatibility user reference, Shift identifier, inclusive effective-from and optional effective-to dates, active state, and timestamps. Null end date means open-ended.
Indexes support tenant/employee/effective-start resolution and tenant/Shift lookup. The resolver selects active assignments covering the target date, preferring the latest effective start and identifier. Commands validate that the Shift exists and reject overlaps by reading active assignments and invoking domain range comparison.
Overlap prevention and Shift referential integrity are application-only rules: there is no exclusion constraint, unique range constraint, navigation, or database foreign key. Historical behavior is retained through effective ranges and deactivation. EndOn closes an assignment; physical delete behavior is Requires confirmation because no deletion command is confirmed.
Source References
microservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.csmicroservices/src/attendance-service/Infrastructure/AttendanceDbContext.csmicroservices/src/attendance-service/Infrastructure/Persistence.csmicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.csmicroservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs
Related Articles
See Also
Keywords
- Attendance persistence
- EF Core
- PostgreSQL
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly