Source of truth: web-app develope @ 8ff381cc4 and core-backend-service develop @ 78e0e76bd (the dev pair), read on 6 Oct 2026. Stored procedures and balance logs were read from the live dev database (read-only). Important: this is Leave after the V2 build. Lifecycle actions, annual planning, overlap limits, per-policy approval chains, a typed balance ledger and new statuses are all in code now. The July/August leave docs under core-backend-service/doc/system/leaves/ predate this and are not on develop.

What this module is

Employees book time off against a leave policy, and their balance goes down. An approval chain decides the request. After approval, leave can be withdrawn, cut short or extended. Each year HR can open a planning cycle so teams can coordinate dates before anyone books.

A leave request is an EmployeeRequest of type 1 on the shared Requests engine. Leave V2 added dedicated services around it: LeaveBalanceService, LeaveRequestLifecycleService, LeaveOverlapService, LeavePlanningService, LeaveCalendarService, LeaveReportService and LeaveNotificationService.

1. Who uses it and where

Actor Screen (route) Gate
HR /dashboard/requests/list/leaves, with tabs Requests · Changes · Policies · Perks · Holidays · Calendar · Planning · Reports can_view_leave_requests / can_view_leave_policies
HR /dashboard/requests/leave/create: record leave for an employee can_create_leave_requests
HR /dashboard/requests/leave/calendar, /planning-roster, /my-plan —
HR /dashboard/requests/leave/pending-report, /reports can_view_leave_requests
HR /dashboard/requests/leave/policy/:key: view a policy, bulk-upload balances can_view_leave_policies
HR /dashboard/report/leave-balances: Leave Balance report (Documents → Reports) report access
Approver /approval/requests/leaves: reuses the HR view, edit, delete and batch modals Being the current step's reviewer, or admin
Employee /employee/dashboard/requests/leave: my leave, and calendar (My leave / My team) —
Employee /employee/dashboard/requests/all/create-leave —
Employee /employee/dashboard/requests/leave-balances, /requests/leave-plan —
Any approver/HR Settings → Approval workflow → Time Tracking and Leave, including one node per leave policy Settings access

2. Flow map

flowchart LR
  UF1["UF1 Configure leave"] --> UF2["UF2 Balances"]
  UF2 --> UF3["UF3 Employee requests leave"]
  UF2 --> UF4["UF4 HR records leave"]
  UF9["UF9 Annual leave planning"] -->|Convert a period| UF3
  UF3 --> UF5["UF5 Approver decides"]
  UF4 --> UF5
  UF5 -->|Approved| UF6["UF6 Withdraw before it starts"]
  UF5 -->|Approved| UF7["UF7 Cancel or extend"]
  UF7 --> UF8["UF8 Approve the change"]
  UF5 --> UF10["UF10 Calendar and reports"]

3. Status model

3.1 Leave request status

stateDiagram-v2
  [*] --> New: Submitted, days taken from balance now
  New --> Approved: Last step approves
  New --> Declined: Any step declines, days returned
  New --> Withdrawn: Requester withdraws, days returned
  New --> New: Edited, approvals reset
  Approved --> Withdrawn: Withdrawn before the first day
  Approved --> Cancelled: Cancellation approved, unused days returned
  Approved --> Approved: Extension or modification approved
  New --> Returned: Returned for correction (not reachable, see section 11)
  Returned --> New: Resubmitted
Id Status Holds days? Editable?
3 New (awaiting review) Yes Yes
1 Approved Yes No: use withdraw, cancel or extend
2 Declined No API says yes, screen says no (see section 11)
4 Cancelled No No
5 Returned for correction Yes Yes
6 Withdrawn No No

Days commit at submission (rule BR-01). A pending request has already reduced the balance; decline, withdrawal and cancellation give the days back.

3.2 Changes are child requests

Changes to an approved leave are separate requests linked to the original (ParentEmployeeRequestId + EmployeeRequestKindId). Each change goes through the same approval chain as the original. Nothing moves until the change is approved.

Kind Raised from On approval
1 Original — —
2 Cancellation Cancel on leave under way Returns the unused days, and the original becomes Cancelled
3 Modification API only, no screen Moves the balance by the difference, and can change the policy
4 Extension Extend Takes only the extra working days

3.3 Planned period status (annual planning)

stateDiagram-v2
  [*] --> Draft: Employee adds a period
  Draft --> Submitted: Submit to roster
  Submitted --> RevisionRequested: Supervisor asks to move it
  RevisionRequested --> Submitted: Employee edits and resubmits
  Submitted --> Coordinated: Supervisor marks agreed
  Submitted --> Converted: Book as leave
  Coordinated --> Converted: Book as leave
  Converted --> Submitted: Booking declined, withdrawn or cancelled (back to its previous status)
  Draft --> Withdrawn
  Submitted --> Withdrawn

UF1. Configure leave

Entry: HR Leave page → Policies, Perks and Holidays tabs; Settings → Approval workflow.