feat: printing problems shown and handled; printing set-up on v2 (platform-v2 step 6.10)

- a ticket that doesn't print is a problem for whoever sent it and the managers:
  GET /api/print-problems (the order, table, dishes, printer, since when, tries,
  last error, who sent it) and three ways out: print again, send to another
  printer, handled (services/print_problems.py; print_jobs.resolved_by /
  redirected_to, Alembic 0036); live event print.problems from the print paths
- phone: the red printer button opens the problems sheet, the table page warns
  (usePrintProblems replaces the 8 s poll); counter POS: a red button under the
  modes with the shared panel (@xenia/ordering PrintProblemsPanel + pure rules);
  manager: a card on the overview (top), the Tables page and the order page
- manager: Settings -> Printing (printers with reachability, test print, network
  scan; ticket layout + test ticket, beep, fonts with previews, dot leader,
  dividers) and Management -> Prep zones (cards + zone dialog with the ticket
  language, printers, copies, sorting, category order, kitchen screen) rebuilt in
  src/pages/printing; v1 PrintFontsTab, PrepZonesConfigPage, PendingPrints and
  /api/orders/pending-prints removed
- access: printer add/edit/delete/scan need core.settings.manage, prep zone
  changes catalog.menu.manage (were any dashboard user)
- tests: test_print_problems.py, @xenia/ordering printProblems, manager
  printing.test.mjs, e2e print_problems.mjs (done-when) + manager.mjs printing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 01:40:07 +02:00
co-authored by Claude Opus 5.5
parent 070c9cf625
commit f31bdf42aa
57 changed files with 2557 additions and 2221 deletions
+7 -3
View File
@@ -8,6 +8,7 @@ DELETE /api/prep-zones/{id} delete a prep zone
"""
import json
from core.i18n import normalize_language
from core.access.deps import require
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from pydantic import BaseModel
@@ -114,11 +115,14 @@ def list_prep_zones(
return [_zone_out(z) for z in zones]
_MENU = require("catalog.menu.manage") # 6.10: like the nav entry
@router.post("")
def create_prep_zone(
body: PrepZoneCreate,
db: Session = Depends(get_db),
user: User = Depends(require_manager),
user: User = Depends(_MENU),
):
zone = PrepZone(
name=body.name,
@@ -152,7 +156,7 @@ def update_prep_zone(
zone_id: int,
body: PrepZoneUpdate,
db: Session = Depends(get_db),
user: User = Depends(require_manager),
user: User = Depends(_MENU),
):
zone = db.query(PrepZone).filter(PrepZone.id == zone_id).first()
if not zone:
@@ -213,7 +217,7 @@ def update_prep_zone(
def delete_prep_zone(
zone_id: int,
db: Session = Depends(get_db),
user: User = Depends(require_manager),
user: User = Depends(_MENU),
):
zone = db.query(PrepZone).filter(PrepZone.id == zone_id).first()
if not zone: