Skip to content

design(business-time): evaluate afternoon/overnight business_day_start_time cutoffs past 11:59 #1663

Backlog

Description

@khaira777

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

Scope / Acceptance Criteria (Design Exit)

  • Decide between Option A (relax business_day_start_time to 00:00-23:30 with explicit business-date ownership rules in shared/business-date.ts and full DST/sequence/refund tests) vs Option B (keep 00:00-11:59 cutoff and add clear inline helper copy in GeneralSettingsTab.tsx explaining that setting 03:00-05:00 already groups a 15:00 -> 01:00 overnight 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.md before implementation.

Concrete Design Decisions to Lock Before Coding

  1. 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 whether 03:00-05:00 cutoff + clearer UI explanation solves the overnight venue need with zero date-label ambiguity.
  2. Date-label rule (if Option A): For a 15:00 -> 15:00+1 window, confirm the business date label is the opening calendar date (16 Nov for 16 Nov 15:00 -> 17 Nov 14:59).

Out of Scope

  • Ad-hoc arbitrary date-time window overrides on historical Z-report numbering.

Activity

  1. added
    enhancement
    area:frontend
    area:backend
    priority:normal
    type:design
    state:needs-design
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendarea:frontendenhancementpriority:normalstate:needs-designtype:design

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions