Leave Types API
Summary
Two Direct operations list Leave types and save by name. There is no get-by-id, delete, or dedicated activation operation.
Audience
Frontend/backend developers, QA, Leave administrators, and implementation partners.
Reference Content
Maturity: Direct / Foundation/Transitional. Authentication: expected. Authorization: administration scope Requires confirmation. Tenant: required for save; list is tenant-filtered.
| Operation | Method/route | Request | Response/status | Behavior |
|---|---|---|---|---|
| List Leave types | GET /leave/types | None | 200 LeaveTypeDto[] | Ordered by name; no search/pagination/side effects. |
| Save Leave type | POST /leave/types | LeaveTypeRequest | 200 LeaveTypeDto; 400 missing name | Creates or updates the same tenant/name; audits; no domain/outbox event confirmed. |
Request/response fields: name, optional code, isPaid, allowHalfDay, allowCarryForward, optional maxDaysPerYear, and isActive; response additionally includes id.
{"name":"Configured Leave","code":"CFG","isPaid":true,"allowHalfDay":true,"allowCarryForward":false,"maxDaysPerYear":null,"isActive":true}
Success returns the saved DTO. Missing name returns 400. POST serves both create and update-by-name; identifiers are not accepted for selecting an update. Encashment eligibility is not a LeaveType field. Several metadata fields are stored but not enforced during request creation.
Source References
microservices/src/leave-service/Api/LeaveEndpoints.csmicroservices/src/leave-service/Application/Dtos.csmicroservices/src/leave-service/Application/LeaveWorkflows.csmicroservices/src/leave-service/Domain/Leave/LeaveConfig.cs
Related Articles
See Also
Keywords
- Leave API
- Leave Types API
- Endpoint reference
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly