Shift Assignment Storage
Audience
Developers, database engineers, QA engineers, support engineers, security engineers, solution architects, and implementation partners.
Reference Content
This page records source-verified Workforce Scheduling persistence behavior and boundaries.
Summary
EmployeeShiftAssignment is canonical Attendance-owned storage linking a tenant employee record to a canonical shift over an inclusive date range.
Fields and lifecycle
It stores tenant identity, employee reference, optional related user reference, shift reference, start, optional end, active state, and timestamps. Open-ended assignments have no end. Domain methods can end or deactivate a row, although the current API only creates and lists assignments.
Mapping and indexes
Two non-unique indexes support employee/effective-start lookup and shift-reference lookup. A tenant global filter applies. Domain events are ignored by mapping. No navigation or database foreign key to Shift is configured.
Integrity
The application verifies that a shift exists and is active and checks overlap before insert. The database has no exclusion constraint, unique interval constraint, or concurrency token. Orphaned shift references are therefore structurally possible if data is written outside application rules.
Audit
Creation saves the assignment first, then writes audit and timeline evidence in a later save.
Source References
microservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.csmicroservices/src/attendance-service/Infrastructure/AttendanceDbContext.csmicroservices/src/attendance-service/Infrastructure/Persistence.cs
Related Articles
See Also
Keywords
- Workforce Scheduling database
- Shift persistence
- Attendance policy storage
Revision Information
- Status: Draft
- Last reviewed: 2026-07-20
- Next review: 2026-10-20