- Counter POS gets an "Online" mode (module on + connect_orders.manage): New / In
progress / Finished, a chime on arrival (and every 30 s while one waits), badge,
toast in any mode; the order panel offers only the next step: accept / reject with
a reason, preparing, ready or out for delivery, then take the payment (shared
PaymentDialog, drawer, shift) and mark delivered/served.
- connect_orders router on v2 conventions: require(connect_orders.manage), error
codes online.not_found / online.status_changed, the cloud's step order enforced,
audit rows, GET /api/connect/orders/board. POS device scope gains connect_orders.*;
barista and barman get the key by default.
- Fixes: the KDS showed online orders before acceptance; accepting printed no
kitchen tickets; a pull whose synced mark failed stored the order twice
(store_online_orders skips known cloud ids); pulled orders lacked the business day
and delivery type; rejected orders kept active items; delivered sets closed_at/by.
- Online orders belong to holders of connect_orders.manage (_can_access_order), so
the counter pays them with POST /api/pos/orders/{id}/pay.
- Tests: test_pos_online.py (5), terminal unit +1, terminal.mjs +17 with a fake
cloud (pull, synced, status mirror); fixed a timing race in a 3.3c check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.6 KiB
Python
36 lines
1.6 KiB
Python
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
|
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm
|
|
|
|
# Back to the sign-in screen after this many idle minutes (shared screens; 0 = never). Used by
|
|
# the terminal from step 3.1c.
|
|
AUTO_SIGN_OUT = ConfigField('auto_sign_out_minutes', 'int', default=0, choices=(0, 2, 5, 10, 30, 60))
|
|
|
|
# A counter screen's settings (plan step 3.3a): the order type a sale starts as, the receipt
|
|
# printer whose drawer opens on cash payments (used from 3.3b), and the category the product
|
|
# grid opens on (none = all products).
|
|
POS_CONFIG = (
|
|
ConfigField('default_order_type', 'enum', default='takeaway', choices=('takeaway', 'here')),
|
|
ConfigField('start_category_id', 'ref', default=None, choices_from='categories'),
|
|
ConfigField('receipt_printer_id', 'ref', default=None, choices_from='printers'),
|
|
AUTO_SIGN_OUT,
|
|
)
|
|
|
|
MODULE = Module(
|
|
key='pos_counter',
|
|
kind='app',
|
|
name='Counter POS',
|
|
description='A counter terminal for quick sales, tables, price checks and online orders.',
|
|
depends=('ordering',),
|
|
permissions=(
|
|
Perm('pos_counter.access', 'Use the counter POS', roles=('owner', 'store_manager', 'barista', 'barman', 'waiter')),
|
|
),
|
|
limits=(
|
|
Limit('devices', 'Number of counter terminals', free=0, licensed_default=1),
|
|
),
|
|
device_app=DeviceApp(login_modes=('pin', 'tap', 'password'), scope=('pos_counter.*', 'ordering.*', 'connect_orders.*'),
|
|
config=POS_CONFIG),
|
|
routers=(
|
|
Mount('routers.pos', '/api/pos'),
|
|
),
|
|
)
|