<aside> 🔁 Synced from GitHub #4c61cf048420. Edit in the paidhr-system-docs repository, not here: changes made in Notion are overwritten.
</aside>
Status: Live (Leave V2 features on integration branches are marked where relevant)
💡 In plain words
Leave is time off, and this module keeps count of how many days off each person has.
The company sets up types of leave, such as annual, sick or maternity. For each type it decides how many days people get a year, which can differ by seniority. Every employee has a separate count for each type.
The count goes up over time (for example, a little every month) and goes down the moment someone asks for days off, even before it's approved. If the request is turned down or cancelled, the days come back.
Picture a jar for each type of leave. The company drops days in on a schedule. Asking for leave takes days out. A "no" puts them back.
Who's involved: the employee (asks), their manager or HR (approves, sometimes several people in turn), and sometimes a colleague covering for them, who gets told.
Some companies also pay a leave allowance: a once-a-year cash sum for taking leave. You can claim it when you book leave, or, if you never do, the company pays it to you automatically before the year ends.
Leave is the most-used request type. A company creates leave policies (annual, sick, maternity…). Each policy has items that set the entitlement for a pay band, pay grade or policy group, and how it accrues. Every employee covered by a policy gets a leave balance (How many days of this leave type the person has left.) for it. Balances grow by accrual (Days being added to your balance automatically on a schedule, e.g. a little each month.) (monthly, yearly or on the work anniversary), shrink when the employee submits a request, and grow back when a request is declined, withdrawn or cancelled. Requests go through the leave approval chain. Leave on an unpaid policy reduces pay in payroll.
| Term | Meaning |
|---|---|
| Leave policy | Name, alias, whether it is paid, optional gender restriction, whether employees may apply themselves (IsEmployeeEnabled) |
| Leave policy item | Per band/grade/group: WorkingDays (entitlement per year), AccrualTypeId, WaitingPeriod, NoticePeriod, roll-over rules, and an optional leave allowance |
| Accrual type | 1 Monthly (entitlement ÷ 12 at each payroll cut-off) · 2 Annual (all on 1 January) · 3 Anniversary (on the hire-date anniversary) |
| Leave balance | EmployeeLeaveBalances: one row per person per policy with StartingBalance and CurrentBalance. Balances never pool across policies |
| Balance log / movements | Every change is logged with a movement type: accrual, roll-over, roll-over expiry, request submitted, declined, updated, cancelled, withdrawn, extended, deleted, manual adjustment, reconciliation |
| Roll-over | Unused days carried into the next year, up to RolloverDays, on RolloverDate (dd/MM), expiring on RolloverExpiryDate |
| Waiting period | Days of service before the policy can be used |
| Notice period | How far ahead a request must be made |
| Leave allowance | A once-a-year cash payment for taking leave. The new model (see Leave allowance below) pays a fixed yearly figure from the pay grade. An older model paid once a person had taken CummulativeDaysBeforeAllowanceTrigger days (LeaveRequestTriggers); those columns are still mapped but superseded by LeaveAllowanceClaims |
| Leave perks | Extra entitlements (for example a birthday day off) |
| Reliever | The colleague covering. They are emailed on approval and can review their part (LeaveRequestRelieveReview) |
Balance = starting balance + accruals − days requested + days returned
flowchart LR
ACC[Daily procedures 02:01<br/>spUpdateEmployeeLeaveBalance] -->|+ accrual| BAL[(Leave balance)]
SUB[Employee submits request] -->|− working days| BAL
DEC[Declined / withdrawn / cancelled] -->|+ days back| BAL
ADJ[HR manual adjustment<br/>or bulk balance upload] -->|±| BAL
RO[Roll-over date] -->|carry / expire| BAL
Days are deducted at submission, not approval. A pending request already shows in the balance.
A request whose start date is before today is checked by LeaveBackdateRule, in this order. The first failure is the only message shown.