Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dmaman86/shiftly/llms.txt

Use this file to discover all available pages before exploring further.

The Calculation Rules page (reachable at /en/calculation-rules or /he/calculation-rules) is an interactive reference that documents every pay rule implemented in Shiftly’s domain layer. Rather than a static table, it uses expandable accordion sections so you can drill into exactly the rule category you need. All percentages in Shiftly are stored as decimal multipliers — 1 means 100%, 1.25 means 125%, 1.5 means 150%, and 2 means 200%.
Throughout the codebase, pay rates are normalised as plain multipliers: fieldShiftPercent.hours100 = 1, hours125 = 1.25, hours150 = 1.5, hours200 = 2, hours50 = 0.5, hours20 = 0.2. These constants live in src/constants/fields.constant.ts.

Page Components

The Calculation Rules page is composed of three presentational building blocks:
  • RuleCard — a card with a bold title, a dividing rule, and a description paragraph. Groups a related set of accordion items under one topic (e.g. “Extra Hours”, “Salary Additions”, “Meal Allowance”).
  • RuleAccordion — a zero-elevation <Accordion> inside a RuleCard. Expanding it reveals the detailed rule, timeline visualisation, or table for that specific topic. Each accordion fires an analytics event on expand.
  • TimelineNote — a highlighted callout inside an accordion, available in three variants: info (blue), warning (amber), and tip (green). Used to surface caveats, automatic behaviours, and rate-change notes.
// CalculationRulesPage.tsx — component hierarchy
<RuleCard title="Extra Hours">
  <RuleAccordion title="Daily overtime breakdown">
    <WorkDayTimeline>
      <TimeSegment label="100%" ... />
      <TimeSegment label="125%" ... />
      <TimeSegment label="150%" ... />
    </WorkDayTimeline>
    <TimelineNote variant="tip">
      Standard hours threshold is {standardHours} hrs/day
    </TimelineNote>
  </RuleAccordion>
</RuleCard>
Visit the in-app Calculation Rules page for the full interactive reference — it reflects your currently configured Standard Hours value in the worked examples, so the overtime threshold shown is always in sync with your Configuration panel setting.

Rule Categories

Regular-hour calculation resets every calendar day. The threshold used for the first tier is the Standard Hours value configured in the Configuration panel (default 6.67).
TierHoursRate
StandardFirst standardHours hours100%
Overtime tier 1Next 2 hours125%
Overtime tier 2All remaining hours150%
Example with default 6.67 standard hours:
  • Hours 0 – 6.67 → 100%
  • Hours 7.67 – 8.67 → 125%
  • Hours 8.67+ → 150%
These tiers are represented by regular.hours100, regular.hours125, and regular.hours150 in the MonthPayMap.
Night bonuses are additions on top of the regular rate and apply to any workday (including Fridays). They stack with the base pay for each hour worked in the relevant window:
WindowBonusField
14:00 – 22:00 (evening)+20%extra.hours20
22:00 – 06:00 (night)+50%extra.hours50
00:00 – 06:00 (carries from previous night)+50%extra.hours50
A shift that spans midnight generates both a 22:00–midnight segment (+50%) and a 00:00–06:00 segment (+50%) on the next calendar day, provided the next day is not itself a full special day. The cross-day note in the table hints: “Check ✅ for shifts crossing midnight.”On Friday / holiday-eve days (SpecialPartialStart), the evening bonus window (14:00–22:00, +20%) applies during the regular-rate portion of the day up until the Shabbat transition time (17:00 winter / 18:00 summer DST). After the transition, Shabbat rates replace the regular + bonus calculation.
Days classified as WorkDayType.SpecialFull (Saturday and Jewish public holidays such as Rosh Hashana, Yom Kippur, Pesach, Shavuot, Independence Day, etc.) use Shabbat rates for the entire day:
Time WindowRateField
06:00 – 22:00150%special.shabbat150
22:00 – 06:00 (+ 00:00 – 06:00)200%special.shabbat200
Sick and vacation checkboxes are hidden on full special days — these days cannot be marked as absence days. Regular overtime tiers do not apply; only the Shabbat-rate segments are used.
Days classified as WorkDayType.SpecialPartialStart (Fridays and holiday eves such as Erev Rosh Hashana, Erev Yom Kippur, etc.) apply regular rates first, then Shabbat rates after the transition time:
PhaseTimeRates
Regular phaseFrom shift start up to transitionStandard 100%/125%/150% + evening bonus (+20% from 14:00)
Shabbat phase — dayTransition time – 22:00150% Shabbat (special.shabbat150)
Shabbat phase — night22:00 – 06:00 next day200% Shabbat (special.shabbat200)
The transition time is determined automatically from the date:
  • Summer (DST active): 18:00
  • Winter (standard time): 17:00
These boundary values correspond to fieldMinutes.min17 = 17 * 60 and fieldMinutes.min18 = 18 * 60 in fields.constant.ts. The system detects DST automatically — no manual configuration is required.
Per-diem is a daily monetary allowance awarded based on shift duration and whether the employee performed a duty shift (marked with the 🚗 icon). Points are accumulated across the month and converted to a shekel amount using a historical rate timeline.
TierConditionPoints
Tier AOvertime ≥ 2 hours (no meal provided by employer)1 pt — higher rate
Tier BOvertime ≥ 2 hours (meal provided by employer)1 pt — standard rate
Tier CNight shift / duty1 pt — reduced rate
Historical rates (per point) as documented in the app:
ConditionUntil Sep 2024From Sep 2024
Overtime ≥ 2 h, no employer meal₪20.70₪23.80
Overtime ≥ 2 h, meal provided₪19.70₪21.10
Night shift₪13.50₪14.50
The per-diem amount stored in MonthPayMap.perDiem is a PerDiemInfo object: { tier: "A" | "B" | "C" | null, points: number, amount: number }. The amount field is resolved at render time using the rate timeline for the selected month/year.
Meal allowance is a separate daily allowance distinct from per-diem. It tracks two sub-types based on shift eligibility:
TypePointsDescription
Large meal allowance2 ptsAwarded when a shift meets the large-allowance threshold.
Small meal allowance (shift C)1 ptAwarded when a shift meets the small-allowance (shift C) threshold.
The monetary rate per point is resolved from a historical rate timeline, identical in mechanism to per-diem. The result is stored in MonthPayMap.mealAllowance:
mealAllowance: MealAllowance = {
  small: { points: number, amount: number },
  large: { points: number, amount: number },
}
The official eligibility thresholds and point values are published by Israel’s Civil Service Commission. A direct link to the official government PDF is provided on the in-app Calculation Rules page.

Rate Normalisation Reference

All internal rate constants in Shiftly follow a consistent decimal normalisation:
// src/constants/fields.constant.ts
export const fieldShiftPercent: Record<string, number> = {
  hours50:  0.5,   // +50% night bonus
  hours20:  0.2,   // +20% evening bonus
  hours100: 1,     // 100% standard rate
  hours125: 1.25,  // 125% overtime tier 1
  hours150: 1.5,   // 150% overtime tier 2 / Shabbat day rate
  hours200: 2,     // 200% Shabbat night rate
};
Time boundary constants used by calculators:
export const fieldMinutes: Record<string, number> = {
  fullDay: 1440,   // 24 h in minutes
  minutes: 60,
  min06:   360,    // 06:00
  min14:   840,    // 14:00 — evening bonus start
  min17:   1020,   // 17:00 — winter Shabbat transition
  min18:   1080,   // 18:00 — summer DST Shabbat transition
  min22:   1320,   // 22:00 — night bonus start / Shabbat day→night boundary
};

Daily View

See these rules applied in practice — enter shifts and watch the expanded breakdown columns populate with 100%/125%/150% and Shabbat hours.

Configuration

Set the Standard Hours threshold that determines where the 100% → 125% overtime boundary falls each day.

Build docs developers (and LLMs) love