feat: the venue and products reports on v2 (platform-v2 step 6.12b)

- Reports -> Venue (src/pages/reports/store): business days (revenue/profit
  trend, each day's times, orders, revenue, fees, refunds, cost, profit; a day
  opens with its orders and shifts, a shift opens the overview's shift dialog;
  the owner corrects a closing time, deletes an empty day or a shift), orders
  (filters by status, person, table; per-order products / fees / refunds),
  busy times (by hour, by weekday of the business date), trends (days, weeks,
  months, the 7-day average), tables (time at the table, per visit, revenue)
- Reports -> Products (src/pages/reports/products): products (units, revenue,
  refunded, cost, profit, margin, waste, share; top 10 by revenue, units or
  profit) and categories (share bars, profit share)
- kit: PrintDialog (receipt printer, summary / full, or print the page),
  TrendChart and BarList on tokens (no chart animation), printBody()
- access: deleting a business day or a shift (which erases its orders) is
  owner-only (core.settings.manage; was any dashboard user)
- v1 StorePage, ProductsReportPage and their seven views removed
- tests: reports.test.mjs (+1), e2e manager.mjs (every tab, a day, products
  revenue = the backend's, Greek)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 09:06:20 +02:00
co-authored by Claude Opus 5.5
parent 4df59c33ef
commit 7767bdb728
28 changed files with 964 additions and 2266 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
from core.access.deps import require
from core.access.check import holds
from core.timeutil import utcnow
from fastapi import APIRouter, Depends, status
@@ -391,7 +392,7 @@ def get_shift(
def delete_shift(
shift_id: int,
db: Session = Depends(get_db),
user: User = Depends(require_manager),
user: User = Depends(require("core.settings.manage")),
):
"""Permanently delete a shift, its breaks, and all orders opened during that shift."""
from models.order import Order, OrderItem, OrderAuditLog, OrderWaiter