feat(terminal): counter POS screen with server-priced cart and shift gate (platform-v2 3.3a)
- Backend /api/pos (pos_counter): session (business day, the cashier's own shift, self-start, who can open the day), menu (sellable products with every kind of choice, no costs; price now from the pricing engine), quote (lines by id → the waiter's selected_options entries with DB prices → resolve_price as orders do; pos.line_invalid). - POS device settings: default order type, start category, receipt printer (new ref sources categories / printers, also in the manager's Devices dialogs). - Terminal apps/pos: shift gate (start shift with drawer cash), categories, search, product grid, price check, options dialog, cart priced by the backend. - Tests: backend test_pos (13), terminal pos.test.mjs, manager refOptions, terminal.mjs +10 POS checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,25 @@
|
||||
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
||||
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Perm
|
||||
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 orders (coming in phase 3).',
|
||||
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')),
|
||||
@@ -18,5 +28,8 @@ MODULE = Module(
|
||||
Limit('devices', 'Number of counter terminals', free=0, licensed_default=1),
|
||||
),
|
||||
device_app=DeviceApp(login_modes=('pin', 'tap', 'password'), scope=('pos_counter.*', 'ordering.*'),
|
||||
config=(AUTO_SIGN_OUT,)),
|
||||
config=POS_CONFIG),
|
||||
routers=(
|
||||
Mount('routers.pos', '/api/pos'),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user