Leave Approval and Rejection API
Summary
One Direct status operation handles approval, rejection, and technically cancellation; this inventory assigns it to the decision family to avoid duplicate endpoint counts.
Audience
Frontend/backend developers, QA, support, architects, and implementation partners.
Reference Content
Maturity: Direct / Transitional. Authentication: expected. Authorization: approver enforcement Requires confirmation in extracted service; compatibility scope is documented separately. Tenant: required by command behavior.
| Operation | Method and public route | Parameters/body | Response and statuses | Behavior/side effects |
|---|---|---|---|---|
| Update Leave decision/status | PUT /leave/requests/{id}/status | Route id:int; UpdateLeaveStatusRequest with status, optional rejectionReason, optional fallback reason | 200 LeaveRequestDto; 404 missing; 400 validation/dependency/state; 409 workflow-managed restriction | Approve rechecks employee/joining date and approved Attendance; reject requires reason; approved transition increases used balance; leaving Approved reverses usage; audits/timeline; high-level decision/balance events. |
Approval example: {"status":"Approved"}. Rejection example: {"status":"Rejected","rejectionReason":"Scheduling conflict"}. Success returns the updated DTO. Missing rejection reason returns 400; a workflow-managed direct decision returns 409 with a message object. Workflow completion uses the Internal callback family, not this operation.
The same status operation accepts Cancelled; the dedicated cancellation page references this fact but counts only the DELETE cancellation operation.
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/LeaveRequest.cs
Related Articles
See Also
Keywords
- Leave API
- Leave Approval and Rejection API
- Endpoint reference
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly