DbContext Inventory
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
Four relevant context types were verified.
| Context | Provider | Purpose and relevant sets | Tenant filtering | Save behavior and audit |
|---|---|---|---|---|
AttendanceDbContext | PostgreSQL EF provider | Canonical shifts, assignments, weekly-off rules, policies/rules, audit, timeline | Global filters; privileged bypass | Converts mapped attendance events to outbox during save; scheduling commands add audit/timeline |
ShiftPolicyBackfillDbContext | PostgreSQL EF provider | Specialized canonical target for shifts, weekly offs, assignments | Uses null ambient context; backfill queries deliberately bypass filters | Same save override; compatibility identity is supplied rather than generated |
LeaveDbContext | PostgreSQL EF provider | Leave-owned holidays and weekly offs | Global filters; privileged bypass | Converts mapped Leave events to outbox; calendar rows themselves have no mapped events |
AppDbContext | PostgreSQL EF provider | Legacy shifts, holidays, weekly offs, and employee shift reference | Global filters; privileged bypass | Stamps current tenant on added/modified tenant entities |
Factories
Attendance and Leave have design-time factories for migration tooling. The backfill context is constructed by its dedicated runner. No dedicated design-time factory for the monolith context was found.
Boundary
Only Attendance is the canonical shift-policy context. Leave and monolith contexts are documented for calendar and compatibility traceability.
Source References
microservices/src/attendance-service/Infrastructure/AttendanceDbContext.csmicroservices/src/attendance-service/Backfill/ShiftPolicyBackfillTypes.csmicroservices/src/leave-service/Infrastructure/LeaveDbContext.csData/AppDbContext.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