Skip to main content

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.

OperationMethod/routeRequestResponse/statusBehavior
List Leave typesGET /leave/typesNone200 LeaveTypeDto[]Ordered by name; no search/pagination/side effects.
Save Leave typePOST /leave/typesLeaveTypeRequest200 LeaveTypeDto; 400 missing nameCreates 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.cs
  • microservices/src/leave-service/Application/Dtos.cs
  • microservices/src/leave-service/Application/LeaveWorkflows.cs
  • microservices/src/leave-service/Domain/Leave/LeaveConfig.cs

See Also

Keywords

  • Leave API
  • Leave Types API
  • Endpoint reference

Revision Information

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