Resolvers are the context-reading layer of Shiftly’s domain. While calculators apply fixed arithmetic rules and builders assemble data structures, resolvers answer questions that require external or historical context: Is this calendar date a Jewish holiday? What per-diem rate was in effect in March 2023? Does this shift span an evening-to-night boundary? Resolvers encapsulate all of these lookups behind a uniform interface, keeping builders and calculators free of date-handling, API data, and rate table logic.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 Resolver Interface
Resolvers Overview
ShiftSegmentResolver
Maps a time-window
Point against the correct rate map for the day’s WorkDayType, returning labeled segment ranges.HolidayResolverService
Classifies each calendar day as Regular, SpecialPartialStart, or SpecialFull from its weekday and Hebcal event titles.
WorkDayInfoResolver
Inspects a
WorkDayInfo record for special-day status, partial-holiday start, and cross-day continuation flags.DefaultMonthResolver
Provides available months for a year, resolves the default month to display, and returns Hebrew month names.
TimelinePerDiemRateResolver
Looks up the applicable per-diem rate (ILS per point) for a given year and month from a historical timeline.
TimelineMealAllowanceRateResolver
Looks up large and small meal allowance rates for a given year and month from a historical timeline.
MealAllowanceResolver
Determines meal allowance eligibility and computes the monetary entitlement for a single day.
ShiftSegmentResolver
ShiftSegmentResolver is the innermost rate-mapping component. It takes a time-window (Point) and the current day’s WorkDayMeta, selects the correct rate map based on typeDay, and returns only the segments that overlap the requested window.
Key Types
Rate Maps by Day Type
- Regular
- SpecialPartialStart (Friday / Eve)
- SpecialFull (Shabbat / Holiday)
| Window | Key | Rate |
|---|---|---|
| 00:00 – 06:00 | hours50 | 50% night bonus |
| 06:00 – 17:00 | hours100 | Standard |
| 14:00 – 22:00 | hours20 | 20% evening bonus |
| 22:00 – 30:00 | hours50 | 50% night bonus |
Segment Intersection
The resolver’sfindSegments method trims each rate-map segment to the intersection with the requested Point:
target.start or after target.end are excluded entirely.
HolidayResolverService
HolidayResolverService is the bridge between raw Hebcal API event titles and Shiftly’s WorkDayType classification. It maintains internal lists of paid holidays and partial-start events (eves and half-days).
Classification Rules
| Condition | Result |
|---|---|
weekday === Saturday | SpecialFull |
eventTitles contains a paid holiday | SpecialFull |
eventTitles contains a partial-start event | SpecialPartialStart |
weekday === Friday | SpecialPartialStart |
| Otherwise | Regular |
Paid Holidays (Full Special Day)
Partial Start Events (Eve / Half-Day)
HolidayResolverService is used by DefaultWorkDaysForMonthBuilder during calendar assembly. It does not fetch from Hebcal directly — the eventMap (ISO date → event titles) is fetched upstream and passed in as a builder parameter.WorkDayInfoResolver
WorkDayInfoResolver is a thin utility resolver that exposes named predicates for inspecting a WorkDayInfo record. It is used by DefaultWorkDaysForMonthBuilder to set crossDayContinuation on each day.
Methods
| Method | Returns |
|---|---|
isSpecialFullDay(day) | day.meta.typeDay === WorkDayType.SpecialFull |
isPartialHolidayStart(day) | day.meta.typeDay === WorkDayType.SpecialPartialStart |
hasCrossDayContinuation(day) | day.meta.crossDayContinuation === true |
formatHebrewWorkDay(day) | Hebrew day letter + zero-padded day number, e.g. "ו-13" |
DefaultMonthResolver
DefaultMonthResolver provides the application with the set of months available for a given year, the default month to display on load, and Hebrew month names. It respects the system’s effective start date (November 2015) and does not expose future months.
Availability Rules
| Year | Available months |
|---|---|
| Before 2015 | None |
| 2015 (system start) | November – December (indices 10–11) |
| Past year | All 12 months (indices 0–11) |
| Current year | January through current month |
| Future year | None |
resolveDefaultMonth returns the current month for the current year, November for 2015, and January for all other past years.
Timeline Per-Diem and Meal Allowance Rate Resolvers
BothTimelinePerDiemRateResolver and TimelineMealAllowanceRateResolver maintain an internal sorted timeline of rate changes. When resolved for a (year, month) pair, they return the most recent entry that is ≤ the requested period.
TimelinePerDiemRateResolver
| Effective from | Rate A (ILS) |
|---|---|
| 2000-01 | 33.90 |
| 2024-09 | 36.30 |
TimelineMealAllowanceRateResolver
| Effective from | Small (ILS) | Large (ILS) |
|---|---|---|
| 2000-01 | 13.50 | 19.70 |
| 2024-09 | 14.50 | 21.10 |
Resolution Algorithm
Both resolvers filter timeline entries to those withyear < requested or (year === requested && month <= requested), sort descending by date, and return the first match’s value. If no entry matches, the default is 0 (per-diem) or { small: 0, large: 0 } (meal allowance).
MealAllowanceResolver
MealAllowanceResolver is the decision gate for daily meal allowance entitlement. It coordinates LargeMealAllowanceCalculator and SmallMealAllowanceCalculator and ensures that large and small allowances are mutually exclusive: only one can be awarded per day.
Logic
MealAllowanceResolver also provides createEmpty(): MealAllowance which returns { large: { points: 0, amount: 0 }, small: { points: 0, amount: 0 } }, used by DefaultDayPayMapBuilder when initializing the day state.