Skip to content

Feature: Scheduled orders with release semantics #360

Description

@khaira777

Feature: Scheduled orders with release semantics

Summary

Support orders scheduled for a future time (e.g. tomorrow 5pm). Today creating an order immediately marks it pending, deducts inventory (main/routes/orders.ts ~556/767) and notifies KDS — so adding a bare scheduled_for column would let the kitchen see tomorrow's pizza today.

Proposed approach

Keep scheduling separate from kitchen state:

orders: scheduled_for, release_status (scheduled|released), released_at

Flow: Customer places order → sits in scheduled queue → at release time it becomes a normal pending order → KDS.

  • A background timer releases due orders; on startup, release any overdue orders in case the app was closed when the timer should have fired.
  • One explicit product decision required (do not invent): does inventory get reserved at scheduling time or at release time?

Acceptance criteria

  • Future orders appear in a scheduled view, not KDS.
  • At release time the order becomes pending and KDS/inventory behavior matches today's flow exactly.
  • Restarting the app while scheduled orders are due releases them.
  • Fresh + upgrade-path DB tests (PRAGMA user_version migration; see AGENTS.md data-safety rules).

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions