Skip to main content

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.

ContextProviderPurpose and relevant setsTenant filteringSave behavior and audit
AttendanceDbContextPostgreSQL EF providerCanonical shifts, assignments, weekly-off rules, policies/rules, audit, timelineGlobal filters; privileged bypassConverts mapped attendance events to outbox during save; scheduling commands add audit/timeline
ShiftPolicyBackfillDbContextPostgreSQL EF providerSpecialized canonical target for shifts, weekly offs, assignmentsUses null ambient context; backfill queries deliberately bypass filtersSame save override; compatibility identity is supplied rather than generated
LeaveDbContextPostgreSQL EF providerLeave-owned holidays and weekly offsGlobal filters; privileged bypassConverts mapped Leave events to outbox; calendar rows themselves have no mapped events
AppDbContextPostgreSQL EF providerLegacy shifts, holidays, weekly offs, and employee shift referenceGlobal filters; privileged bypassStamps 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.cs
  • microservices/src/attendance-service/Backfill/ShiftPolicyBackfillTypes.cs
  • microservices/src/leave-service/Infrastructure/LeaveDbContext.cs
  • Data/AppDbContext.cs

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