mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
Comp/Flex days (#1074) — complete. A second leave type that does not deduct from the vacation entitlement (flextime / overtime offset). New kind column on vacay_entries, excluded from usedDays via a CASE sum; toggleEntry carries kind through service/nest/store with change-detection; desktop and mobile get a comp toolbar toggle next to the half-day one (orthogonal, so a half comp day is free); comp segments render as a diagonal hatch of the person colour, per-segment for split days (Version B). comp_used is surfaced separately in getStats. Translated into all 23 locales. Configurable vacation year (#737) — backend only. Per-user vacay_user_settings (calendar / fiscal / anniversary), resolveYearWindow, and usedDays / compUsedDays / getStats / carry-over now computed over the leave-year [start,end) window. 'calendar' resolves byte-identically to the old date-prefix behaviour, so nothing changes for existing users and the feature is inert until the settings UI lands. Frontend (settings selector + calendar window rollover), the settings endpoint, window-aware getEntries and holiday loading are still to do — see the PR description.
This commit is contained in:
+7
-1
@@ -307,6 +307,9 @@ export interface VacayEntry {
|
||||
// Portion of a vacation day this entry counts as: 1 = full day, 0.5 = half
|
||||
// day (#552). Absent on legacy entries, which are treated as full days.
|
||||
fraction?: number
|
||||
// Leave type (#1074): 'comp' = flex/comp day (does not touch the entitlement),
|
||||
// 'vacation' (or absent, for legacy entries) = a regular vacation day.
|
||||
kind?: 'vacation' | 'comp'
|
||||
}
|
||||
|
||||
// Vacay per-user stats row as returned by getStats
|
||||
@@ -321,6 +324,9 @@ export interface VacayStat {
|
||||
total_available: number
|
||||
used: number
|
||||
remaining: number
|
||||
// Comp/flex days used this year (#1074) — informational, not deducted from the
|
||||
// entitlement. Absent on older server builds.
|
||||
comp_used?: number
|
||||
}
|
||||
|
||||
export interface HolidayInfo {
|
||||
@@ -356,7 +362,7 @@ export interface SharedVacayCalendar {
|
||||
owner_name: string
|
||||
color: string
|
||||
hidden: boolean
|
||||
entries: { date: string; fraction?: number }[]
|
||||
entries: { date: string; fraction?: number; kind?: 'vacation' | 'comp' }[]
|
||||
companyHolidays: { date: string; note?: string }[]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user