Skip to main content

Apply for Leave

Summary

Employees can submit Leave from ESS or the broader Leave page; administrators can also add a request for a selected employee in the broader UI.

Audience

Employees, HR administrators, QA, support, and developers.

Overview

  • Purpose/navigation: select Apply Leave or use the inline ESS form at /leave.
  • Fields: Leave type, from date, to date, and reason; the broader form also has employee selection/read-only employee context.
  • Not present: half-day input, supporting-document upload, calculated-day preview, and a per-type balance in the form.
  • Client validation: ESS requires an ordered date range and a trimmed reason of at least three characters. The broader form requires employee and dates, checks joining date, and blocks while a conflict exists.
  • Conflict checks: the broader form queries Attendance and approved-Leave compatibility data after relevant fields change.
  • Submission: ESS posts to its gateway contract and shows success toast then reloads. The broader form posts to its compatibility contract, closes on success, and reloads.
  • Error state: broader API errors are shown safely. ESS has no local submit try/catch; global handling behavior requires confirmation.
  • Permission behavior: route checks are client-side; API enforcement is authoritative.
  • Screenshot placeholder: sanitized request form, conflict state, and saving state.

Server-side day calculation and validation remain authoritative; see Leave day calculation.

Screen reference

RequirementConfirmed behavior
PurposeCreate a tenant-scoped employee Leave request.
Navigation path/leave inline ESS form or Apply Leave/Add Approved Leave action.
Intended usersEmployees; the broader form also supports its confirmed admin rendering.
PreconditionsAuthenticated route, employee context, and available request form.
Main componentsEssLeavePage form or LeaveManagementPage modal.
Fields, columns, or sectionsLeave type, from date, to date, reason, and employee in the broader form. No half-day or document field.
FiltersNone.
ActionsSubmit/request Leave; close/cancel the broader modal.
ValidationRequired context/dates, date order, ESS reason length, joining date, and broader conflict checks.
Loading stateBroader checking/saving indicators; ESS page skeleton before data loads.
Empty stateNot applicable to the form; history may be empty.
Success stateESS toast/reset/reload; broader close and reload.
Error stateBroader validation/API error; ESS submit-error presentation requires confirmation.
Permission behaviorRoute and local employee/admin rendering; server authorization remains authoritative.
API dependenciesESS gateway submission or compatibility creation plus Attendance/approved-overlap checks.
Related business rulesServer-side working-day calculation, overlap, joining-date, state, and employee rules.
Screenshot placeholderSanitized blank form, checking state, conflict state, and saving state.

Source References

  • UI/salary-ui/apps/client-hrms-portal/src/pages/hr/PayrollFeaturePages.tsx
  • UI/salary-ui/apps/client-hrms-portal/src/ess/EssPages.tsx
  • microservices/src/leave-service/Application/LeaveWorkflows.cs

See Also

Keywords

  • Leave UI
  • Apply for Leave
  • Workforce management

Revision Information

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