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 group | Stored | Confirmed enforcement | Source |
|---|---|---|---|
| Calendar exclusions | Yes | Leave-day calculation | microservices/src/leave-service/Domain/Leave/LeaveDayCalculator.cs |
| Active/type | Yes | Active repository lookup | microservices/src/leave-service/Infrastructure/Persistence.cs |
| Accrual/carry-forward | Yes | End-to-end processing not implemented | microservices/src/leave-service/Domain/Leave/LeaveConfig.cs |
| Notice/duration/negative balance | Yes | Request enforcement not confirmed | microservices/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
Related Articles
See Also
Keywords
- LeavePolicy
- Calendar exclusion
- Stored metadata
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly