From 1f280161226100dcc4601e0da827af3dc9ddc554 Mon Sep 17 00:00:00 2001 From: bonamin Date: Fri, 13 Nov 2026 22:34:32 +0200 Subject: [PATCH] =?UTF-8?q?docs(backend):=20CS-13=20=E2=80=94=20a=20new=20?= =?UTF-8?q?module=20needs=20its=20staff=20texts=20in=20modules.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 0465975..623ca01 100644 --- a/docs/README.md +++ b/docs/README.md @@ -157,7 +157,7 @@ Automated tests cover the native-app/LAN work and licensing. See **[tests/e2e/RE New and touched endpoints raise `core.errors.XeniaError("", **params)`; register the code with its status and English message in `CODES`. Responses look like `{"error": {code, params, message}, "detail"}`; plain `HTTPException`s are wrapped as `http.` until converted. Text the backend renders itself (printed tickets and reports, later notifications) goes through `core.i18n.t(key, lang)` with keys in `core/i18n/en.json` + `el.json` (same keys, same placeholders; Greek print text without accents). Kitchen tickets print in the prep zone's language, everything else in `venue.language`. **CS-13. Every router belongs to a module** (branch `platform-v2`, D-19, §4). -Routers are mounted from the module manifests (`local_backend/modules//manifest.py` → `Mount(...)`), not from a list in `main.py`. A new router gets a `Mount` in its module's manifest (or a new module folder); a test fails if any router in `routers/` isn't mounted. New settings are declared as `SettingDef` in the owning manifest (the settings API reads them from there). Background loops that belong to a module are manifest `workers`, started and stopped by the supervisor, never started by hand in `main.py`. +Routers are mounted from the module manifests (`local_backend/modules//manifest.py` → `Mount(...)`), not from a list in `main.py`. A new router gets a `Mount` in its module's manifest (or a new module folder); a test fails if any router in `routers/` isn't mounted. New settings are declared as `SettingDef` in the owning manifest (the settings API reads them from there). Background loops that belong to a module are manifest `workers`, started and stopped by the supervisor, never started by hand in `main.py`. A new module (or a new limit) also needs its staff-facing name, description and limit labels in `packages/i18n/locales/{en,el}/modules.json`; `tests/test_module_texts.py` fails until they exist. **CS-14. Every route declares who may call it** (branch `platform-v2`, D-7, D-17). Use `core.access.deps.require("..")` (or `require_any`, `public()`, `require_device(app)`), or `Depends(get_current_user)` for "any signed-in user". The guard `tests/guards/test_route_access.py` fails a route with no marker or with an unknown key. New keys are declared as `Perm(...)` in the owning manifest, with their default roles. Inside code use `core.access.check.holds(user, key)` / `can(user, key)`, never role names or `perm_*` attributes (`tests/guards/test_no_perm_reads.py`). The v1 booleans exist only in `core/access/legacy.py` for the current frontends.