mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 22:03:11 +00:00
1.3 KiB
1.3 KiB
Add-On indicator (SH-184)
Product rule superseding the SH-126 “frozen at create” FE assumption.
Authority
| Concern | Owner |
|---|---|
| Cutoff math & week-boundary recalc | Backend |
Clear isAddOn when schedule cleared |
Backend |
| Audit of every recalculation | Backend |
| Display / board overlay | Frontend |
The frontend must not treat isAddOn as frozen after create. Create may
send a hint (resolveIsAddOnForCreate / cutoff preview or unscheduled
manual override). After any schedule patch or clear, FE consumes the
authoritative isAddOn returned by the board PATCH (and subsequent board
fetch).
FE contract
Board row / PATCH response: isAddOn: boolean
Create (hint): isAddOn = cutoff preview | manual override
Schedule day/week patch: FE applies returned row.isAddOn (ON↔OFF)
Schedule cleared: FE expects isAddOn === false from BE;
optimistic clear sets isAddOn: false locally
Legacy: workOrderType=AddOn(7) without isAddOn ⇒ isAddOn=true
Dependency
Full backend recalculation + audit may land in a separate BE PR. Until then,
FE still maps and overlays whatever isAddOn the API returns so the contract
is correct once BE ships.