Audience: backend engineers. How leave entitlement, accrual, balances, perks, holidays and absences are modelled and computed.

Companion: business.md, surface-map.md, requests/technical.md (the request engine).

Derived from the tenant entities in src/Core.Backend.Domain/Entities/Tenant/ + HolidayService, Paid_HolidaysService, and the leave paths in RequestService.cs. ⚠️ VERIFY marks items to confirm.


1. Architectural shape

Leave has no dedicated service — the request lifecycle lives in RequestService (leave = request type 1), while this subsystem is primarily a rich entity model + HolidayService. The C# layer manages balances/accrual; holidays and working-day maths feed payroll's SQL engine.

flowchart TB
  REQ[RequestService<br/>leave request lifecycle] --> BAL[EmployeeLeaveBalance<br/>+ Log]
  POL[LeavePolicy + LeavePolicyItem<br/>entitlement rules] --> BAL
  ACC[AccrualType + LeaveRequestTrigger<br/>accrual] --> BAL
  POL --> PERK[LeavePerk / LeavePolicyPerk<br/>EmployeeLeavePerkBalance]
  HOL[PublicHoliday / Paid_Holidays<br/>HolidayService] --> PAY[Payroll working-day maths]
  BAL --> PAY
  ABS[EmployeeAbsence + Review + Batch] --> PAY

2. Entity model

Policy

Balances

Accrual