Skip to main content

Leave Policy Storage

Summary

LeavePolicies stores one policy per tenant and Leave-type string, with only part of the metadata currently enforced.

Audience

Backend developers, QA engineers, architects, and policy reviewers.

Reference Content

Stored fields cover accrual per month, maximum carry forward, minimum notice, maximum consecutive days, Holiday exclusion, weekly-off exclusion, negative-balance permission, and active state. There are no effective dates, half-day policy field, employee assignment, organization assignment, or policy-version relationship.

The database enforces unique tenant/type and numeric precision for accrual and carry-forward values. It does not enforce a foreign key to LeaveTypes, value ranges, active-policy cardinality beyond tenant/type uniqueness, or date/duration rules. The repository resolves an active policy by type. LeaveDayCalculator enforces the two calendar-exclusion flags. Other stored policy fields are Foundation / Requires confirmation for runtime enforcement.

Field groupStoredConfirmed enforcementSource
Calendar exclusionsYesLeave-day calculationmicroservices/src/leave-service/Domain/Leave/LeaveDayCalculator.cs
Active/typeYesActive repository lookupmicroservices/src/leave-service/Infrastructure/Persistence.cs
Accrual/carry-forwardYesEnd-to-end processing not implementedmicroservices/src/leave-service/Domain/Leave/LeaveConfig.cs
Notice/duration/negative balanceYesRequest enforcement not confirmedmicroservices/src/leave-service/Domain/Leave/LeaveConfig.cs

Source References

  • microservices/src/leave-service/Domain/Leave/LeaveConfig.cs
  • microservices/src/leave-service/Domain/Leave/LeaveDayCalculator.cs
  • microservices/src/leave-service/Infrastructure/LeaveDbContext.cs
  • microservices/src/leave-service/Infrastructure/Persistence.cs

See Also

Keywords

  • LeavePolicy
  • Calendar exclusion
  • Stored metadata

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly