Plan phase 3S, step S.6. - Pull: "reservation" / "preorder" orders become Reservations waiting for an answer (status "requested"; services/online_reservations.py), with the food ordered ahead kept on the booking (items_json at the cloud's prices, the site's price check) — no order yet. Migration 0020 (reservations: online_order_cloud_id, online_ref, items_json, total, online_price_diff, fire_at, order_id, response_note). - Confirm → the food's fire time = booking time − fire minutes (setting); the fire worker (connect_orders, every 20 s) turns the food into an order at that time (needs an open business day; waits otherwise): kitchen tickets, KDS (reference and time). Early arrival fires at once. Seating moves the order to the table (refused if the table has an open order). Decline / cancel / no-show with a reason. Every step mirrored to the cloud. - Found: the KDS filter dropped every online order without an online status (SQL NULL in NOT(a AND b)) — made NULL-safe. - Counter: Online → Bookings (requests first, then upcoming), BookingPanel (confirm, decline with reasons, food and when it goes to the kitchen, seat at a free table, cancel, no-show); the Online badge and chime count booking requests. - Manager: Online ordering → Table bookings settings (on, food ahead, hours, slot, notice, days ahead, party size, fire minutes); the dashboard's reservations card confirms / declines online requests; the reservations router delegates online bookings' status steps. - Tests: tests/test_online_bookings.py (8), unit tests (terminal, manager), e2e: order app (book with food → the venue confirms), terminal (request → confirm → the two dishes reach the KDS at the fire time, not before → seated), manager (booking settings). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.1 KiB
Python
24 lines
1.1 KiB
Python
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
|
from core.modules.model import Module, Mount, Perm, SettingDef
|
|
|
|
MODULE = Module(
|
|
key='connect_orders',
|
|
kind='feature',
|
|
name='Online orders',
|
|
description='Orders placed from the QR menu, pulled from the cloud.',
|
|
depends=('ordering', 'connect_menu'),
|
|
permissions=(
|
|
Perm('connect_orders.manage', 'Accept and manage online orders', roles=('owner', 'store_manager', 'staff_manager', 'barista', 'barman')),
|
|
Perm('connect_orders.fees', 'Set delivery areas and fees', roles=('owner', 'store_manager')),
|
|
),
|
|
settings=(
|
|
SettingDef('connect_orders.ordering', '{}', 'Online ordering (phase 3S): services offered, ordering hours, preparation and slot minutes, days ahead, as soon as possible. Edited on the Online ordering page.', type='json'),
|
|
),
|
|
routers=(
|
|
Mount('routers.fees', '/api/connect/fees'),
|
|
Mount('routers.connect_orders', '/api/connect'),
|
|
),
|
|
# S.6: bookings' food goes to the kitchen at its fire time
|
|
workers=('services.cloud_sync:order_pull_worker', 'services.online_reservations:fire_worker'),
|
|
)
|