GET /api/menu-tablet/menu for a paired menu tablet: categories in the catalogue's order (sub-categories after their parent, one category and its sub-categories when the tablet is set so), each with its products in its own order (a product in several categories shows in each), the products once with name, description, tags, photo, the price of the tablet's sales point (or none) and availability; sold-out hidden when set; the venue's name and the tablet's settings. Device config: view, photos, descriptions, group, theme, prices of, sold out, category, search, languages, idle reset (texts in both languages). Menu changes send menu_tablet.changed to every tablet (main.py, with signage). tests: test_menu_tablet.py (4); 531 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.9 KiB
Python
36 lines
1.9 KiB
Python
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
|
|
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm
|
|
|
|
POINTS = ('in_store', 'in_store_takeaway', 'qr_table', 'online_takeaway', 'online_delivery', 'online_preorder', 'none')
|
|
|
|
MODULE = Module(
|
|
key='menu_tablet',
|
|
kind='app',
|
|
name='Menu tablet',
|
|
description="The venue's menu on a tablet: a quick price check for staff and a menu for guests (plan step 5.7a).",
|
|
depends=('catalog',),
|
|
permissions=(
|
|
Perm('menu_tablet.manage', 'Set up menu tablets', roles=('owner', 'store_manager')),
|
|
),
|
|
limits=(
|
|
Limit('devices', 'Number of menu tablets', free=0, licensed_default=1),
|
|
),
|
|
routers=(
|
|
Mount('routers.menu_tablet', '/api/menu-tablet'),
|
|
),
|
|
# How the menu looks on this tablet (owner 2026-11-17: views, photos, descriptions, grouping…)
|
|
device_app=DeviceApp(login_modes=('none',), scope=(), config=(
|
|
ConfigField('view', 'enum', default='expanded', choices=('compact', 'expanded', 'full'), group='look'),
|
|
ConfigField('photos', 'bool', default=True, group='look'),
|
|
ConfigField('descriptions', 'bool', default=True, group='look'),
|
|
ConfigField('group', 'bool', default=True, group='look'),
|
|
ConfigField('theme', 'enum', default='light', choices=('light', 'dark'), group='look'),
|
|
ConfigField('sales_point', 'enum', default='in_store', choices=POINTS, group='menu'),
|
|
ConfigField('sold_out', 'enum', default='strike', choices=('strike', 'hide'), group='menu'),
|
|
ConfigField('category', 'ref', default=None, choices_from='categories', group='menu'),
|
|
ConfigField('search', 'bool', default=True, group='use'),
|
|
ConfigField('languages', 'enum', default='both', choices=('both', 'el', 'en'), group='use'),
|
|
ConfigField('idle_seconds', 'int', default=120, choices=(0, 30, 60, 120, 300, 600), group='use'),
|
|
)),
|
|
)
|