Create → Submit → Approve
PassHappy path: balance debit, promote, pending cleared.
Tracopus · HRMS · Leave · CFA-LEAVE-WA0
Coverage map for the native leave lifecycle behind leaveManagementEnabled:
create → submit → approve / reject / withdraw / cancel, plus overlap, half-day,
delegation, on-behalf, and ZingHR SYNCED coexistence. Side effects include balance
ledger, Approvals inbox, attendance sync, and TaskActivity LEAVE promotion.
CREATED. Holiday-aware day count; optional half-day on single calendar day. No pending hold.
SUBMITTED; reserve pending balance; notify manager / delegates. Appears on Leave pending + Approvals inbox.
APPROVED; debit (releases hold); promote TaskActivity LEAVE; attendance LEAVE / HALF_DAY when sync on.
REJECTED; release hold; no TaskActivity / attendance write. Comment required.
CREATED or SUBMITTED → WITHDRAWN; release hold if submitted. Blocked on APPROVED / SYNCED.
SUBMITTED / APPROVED / SYNCED → CANCELLED; release hold or creditOnCancelAfterApprove; demote TaskActivity; reverse attendance.
Happy path: balance debit, promote, pending cleared.
Reject releases pending; no promote / debit.
Owner withdraws draft; never pending.
Owner withdraws submitted; hold released.
Owner cancels submitted; hold released; no approve-debit reverse.
Owner cancel after approve credits debit and re-runs promote (demote path).
Overlap ignores REJECTED / WITHDRAWN / CANCELLED; second leave can approve.
Second active overlap blocked; first untouched.
Create/submit resolve day count via holiday validation; non-working-only range blocked.
Half-day flag persisted on single-day create; multi-day request clears half-day.
Submit blocked; no orphan reserve.
4xx; status unchanged — withdraw on APPROVED, cancel on CREATED, approve without authority.
Concurrent safe conflict on approve.
Same reverse as approved (credit + promote demote).
Withdraw blocked on APPROVED/SYNCED; cancel blocked on CREATED/REJECTED/WITHDRAWN/CANCELLED.
Manager/delegate forbidden; manager uses reject.
LEAVE delegation → delegate approves; DELEGATE + actedOnBehalfOf audit.
Delegate blocked; owner manager can still approve.
ATTENDANCE-only delegation / persona cannot leave-approve; no debit/promote.
Manager create/submit for member (member balance); approve A leaves B SUBMITTED.
Native leave with zinghrTransactionId + SYNCED; cancel credits balance + promote demote.
| Effect | Approve | Reject / Withdraw (pre-approve) | Cancel (post-approve / SYNCED) |
|---|---|---|---|
| Status | APPROVED | REJECTED / WITHDRAWN | CANCELLED |
| Balance | Debit | Release hold / no debit | Credit back |
| Pending + Approvals inbox | Cleared | Cleared | N/A |
| Attendance (sync on) | LEAVE / HALF_DAY | Unchanged | Reversed |
| TaskActivity | Upsert LEAVE | None | Demoted (deleted) |
| Audit | Actor + authority | Actor | CANCEL |
| Siblings | Untouched | Untouched | Untouched |
LeavePromotionService.promote upserts TaskActivity
TaskType.LEAVE, then LeaveAttendanceSyncService.syncAfterPromotion.
Cancel sets CANCELLED then calls promote; cancelled path soft-deletes
existing LEAVE activities and syncs attendance reverse.
| From | Blocked ops | Allowed owner ops |
|---|---|---|
| CREATED | Approve, Reject, Cancel | Submit, Withdraw |
| SUBMITTED | Withdraw by non-owner; Approve without authority | Withdraw, Cancel (owner); Approve/Reject (authority) |
| APPROVED / SYNCED | Withdraw, Approve, Reject | Cancel (owner) |
| REJECTED / WITHDRAWN / CANCELLED | Approve, Reject, Cancel, Withdraw | — |
| ID | Wave | Baseline |
|---|---|---|
| LS-LOC-* | W1 | Pass — CfaIndiaLeaveEntitlementMatrixTest |
| LS-FY-1 | W1 | Pass — fiscal Apr 1 CF/lapse + PL45 |
| LS-MAT / PAT / MSL / WWL | W2 | Pass — SpecialLeavePolicySupportTest + workflow/doc privacy |
| LS-CO-1..4 | W3 | Pass — CompOffCreditSupportTest + GlobalLeavePolicy / workflow |
| LS-PH-1..2 | W4 | Pass — FloatingHolidayPolicySupportTest + legal calendar budget/cycle |
| Document |
|---|
fui/docs/enhancement-evidence/CFA-LEAVE-WA0.md |
fui/docs/enhancement-evidence/CFA-LEAVE-WA1.md |
fui/docs/enhancement-evidence/CFA-LEAVE-WA2.md |
fui/docs/enhancement-evidence/CFA-LEAVE-W0.md |
fui/docs/enhancement-evidence/CFA-LEAVE-W1.md |
fui/docs/enhancement-evidence/CFA-LEAVE-W2.md |
fui/docs/enhancement-evidence/CFA-LEAVE-W3.md |
fui/docs/enhancement-evidence/CFA-LEAVE-W4.md |
fui/docs/leave/pending/CFA_LEAVE_GAP_PLAN.md |
fui/docs/leave/pending/CFA_LEAVE_TRACKER.md |
LeaveWorkflowServiceTest (LS-named methods) |
fui/tests/e2e/05-attendance-leave-timesheet/leave-approval-scenarios.spec.js |