Repository navigation
Backlog
Labels
area:backendBackend (Express/SQLite)area:frontendFrontend (React/Next.js)enhancementNew feature or requestpriority:normalNormal priority against the backlogstate:needs-designNeeds a design/scope decision before work startstype:designArchitecture/design decision needed before implementation
Description
Problem
Late-night cafes, restaurants, and bars whose operating day runs from afternoon past midnight (e.g., 15:00 to 01:00 next calendar day) asked to set business_day_start_time to 15:00 so Cash Close and daily reports group each overnight operating cycle together (acknowledged as "noted" by code owner on Nov 17). Today main/routes/settings.ts:449-456 rejects any value >= 12:00 (400 Invalid business_day_start_time format (must be HH:mm between 00:00 and 11:59)), and GeneralSettingsTab.tsx caps the selector at 11:30.
Codebase Anchor
main/routes/settings.ts:277,449-456(!/^(?:0\d|1[01]):[0-5]\d$/validation cap).shared/business-date.ts&main/db.ts(dayBoundsInTimezone, business-date derivation for Z-reports, refund approval tiers, and order/invoice daily sequences).frontend/src/components/settings/GeneralSettingsTab.tsx(business-day start time dropdown).docs/architecture/business-time.md.
Core Invariants & Constraints
- Business-timestamp & fiscal integrity (Core Invariant fix(windows): add AppX tile assets to resolve Microsoft Store cert 10.1.1.11 #4): Every order, Z-report (
cash_closures), refund manager-window boundary (docs/reference/product-invariants.md:237-248), and daily sequence bucket must map deterministically to exactly one business date across DST transitions with zero overlap or gap. - Historical immutability (Core Invariant fix(windows): add Express path-rewriting middleware for Next.js static exports #2): Changing
business_day_start_timemust never retroactively reassign already-closedcash_closuresrows.
Scope / Acceptance Criteria (Design Exit)
- Decide between Option A (relax
business_day_start_timeto00:00-23:30with explicit business-date ownership rules inshared/business-date.tsand full DST/sequence/refund tests) vs Option B (keep00:00-11:59cutoff and add clear inline helper copy inGeneralSettingsTab.tsxexplaining that setting03:00-05:00already groups a15:00 -> 01:00overnight venue into one business day, pairing with per-shift X/Z reporting for split morning/evening teams). - Document the chosen rule in
docs/architecture/business-time.mdbefore implementation.
Concrete Design Decisions to Lock Before Coding
- Option A vs Option B: Confirm whether any real merchant operates both a morning shift and an overnight shift requiring two different business-date labels split at
15:00, or whether03:00-05:00cutoff + clearer UI explanation solves the overnight venue need with zero date-label ambiguity. - Date-label rule (if Option A): For a
15:00 -> 15:00+1window, confirm the business date label is the opening calendar date (16 Novfor16 Nov 15:00 -> 17 Nov 14:59).
Out of Scope
- Ad-hoc arbitrary date-time window overrides on historical Z-report numbering.
Metadata
Metadata
Assignees
Labels
area:backendBackend (Express/SQLite)area:frontendFrontend (React/Next.js)enhancementNew feature or requestpriority:normalNormal priority against the backlogstate:needs-designNeeds a design/scope decision before work startstype:designArchitecture/design decision needed before implementation
Activity