refactor: plan timeframes use a per-day-of-week picker (like the V2 tariff)
The timeframes model was a coarse weekday/weekend split, which couldn't express
"open Saturdays" or different rules on a specific day — and it didn't match the
V2 tariff, which already has a proper per-day-of-week picker (Hën–Die).
Replace PlanTimeframes { weekday, weekend } with { days[], fromMin, toMin }: the
allowed window applies only on the selected days (0=Sun..6=Sat; empty = every
day); on unselected days the subscriber parks free. A "night plan, free
weekends" is just days [Mon..Fri] with a 20:00→08:00 window — the exact case
from before, now expressible alongside any other day combination.
outOfWindowGap reworked to the days model (per-day membership test instead of
the weekend helper); the plans editor reuses the tariff composer's Mon-first
checkbox row and the shared tariff.dow0..6 labels. No production plans carry
timeframes yet (feature shipped today), so the shape changed directly with no
migration. Unit tests updated + extended (Saturday-only, every-day, weekday
night); 81 shared tests pass. Build+lint 12/12.
Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
This commit is contained in:
@@ -469,12 +469,12 @@ export const en: Catalog = {
|
||||
saved: "Plan saved.",
|
||||
confirmRetire: "Retire the plan “{{name}}”? It will no longer be sellable (history is kept).",
|
||||
needWindow: "Enter valid window times (HH:MM).",
|
||||
needDays: "Select at least one day for the window.",
|
||||
restrictTimes: "Restrict parking times (charge transient tariff outside the window)",
|
||||
weekdayWindow: "Weekday",
|
||||
days: "Days",
|
||||
window: "Window",
|
||||
enterAfter: "enter after",
|
||||
exitBefore: "· exit before",
|
||||
weekend: "Weekend",
|
||||
weekendAllDay: "all day (no restriction)",
|
||||
grace: "Grace",
|
||||
graceHint: "minutes tolerance around the window edges",
|
||||
timeframesHint: "A scan outside the allowed window is charged the normal transient tariff for the out-of-window minutes (early entry is deferred to exit; late exit is gated until paid).",
|
||||
|
||||
@@ -480,12 +480,12 @@ export const sq = {
|
||||
saved: "Plani u ruajt.",
|
||||
confirmRetire: "Të tërhiqet plani “{{name}}”? Nuk do të jetë më i shitshëm (historiku ruhet).",
|
||||
needWindow: "Shkruaj orare të vlefshme (HH:MM).",
|
||||
needDays: "Zgjidh të paktën një ditë për intervalin.",
|
||||
restrictTimes: "Kufizo oraret e parkimit (tarifë kalimtare jashtë intervalit)",
|
||||
weekdayWindow: "Ditë pune",
|
||||
days: "Ditët",
|
||||
window: "Intervali",
|
||||
enterAfter: "hyrje pas",
|
||||
exitBefore: "· dalje para",
|
||||
weekend: "Fundjavë",
|
||||
weekendAllDay: "gjithë ditën (pa kufizim)",
|
||||
grace: "Tolerancë",
|
||||
graceHint: "minuta tolerancë rreth kufijve të intervalit",
|
||||
timeframesHint: "Një skanim jashtë intervalit të lejuar tarifohet me tarifën normale kalimtare për minutat jashtë intervalit (hyrja e hershme shtyhet në dalje; dalja e vonuar bllokohet derisa paguhet).",
|
||||
|
||||
Reference in New Issue
Block a user