Leave Type Storage
Summary
LeaveTypes is a tenant-owned first-class configuration object with database uniqueness by tenant and name.
Audience
Backend developers, QA engineers, architects, and Leave configuration reviewers.
Reference Content
The object stores name, optional code, paid flag, half-day eligibility, carry-forward eligibility, optional annual cap, and active state. It has an integer primary key, required bounded name, optional bounded code, fixed-precision annual-cap metadata, a tenant query filter, and a unique tenant/name index.
The current save path creates or updates by exact name. No foreign key connects a Leave request, policy, balance, carry-forward, or encashment row to LeaveTypes; those objects use string values. Delete behavior is Not implemented in the extracted API/application surface. Encashment eligibility is not a persisted LeaveType field. Stored paid, half-day, carry-forward, annual-cap, and active metadata is not fully enforced during request creation and is therefore partly Foundation.
| Rule | Enforcement | Source |
|---|---|---|
| Tenant/name uniqueness | Unique database index | microservices/src/leave-service/Infrastructure/LeaveDbContext.cs |
| Required name and lengths | EF mapping | microservices/src/leave-service/Infrastructure/LeaveDbContext.cs |
| Update selection | Application lookup by name | microservices/src/leave-service/Application/LeaveWorkflows.cs |
| Type relationships | String convention only; no FK | microservices/src/leave-service/Infrastructure/Migrations/LeaveDbContextModelSnapshot.cs |
Source References
- microservices/src/leave-service/Domain/Leave/LeaveConfig.cs
- microservices/src/leave-service/Infrastructure/LeaveDbContext.cs
- microservices/src/leave-service/Application/LeaveWorkflows.cs
- microservices/src/leave-service/Infrastructure/Migrations/LeaveDbContextModelSnapshot.cs
Related Articles
See Also
Keywords
- LeaveType
- Type configuration
- Annual cap
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly