feat(backend,manager): the business day opens and closes by itself (opening hours, a time, or only an alert)
- services/day_auto.py: a minute loop (venue time, offline) opens the day when the opening
hours start (or at business_day.auto_open_time) and closes it when they end (or at
auto_close_time); 'alert' only tells the managers. Offsets before / after, one day across
the break or one per span, spans past midnight belong to the day they start, a day closed
by hand isn't reopened in the same span, a restart catches up the open (until the business
date changes for 'time') and alerts a missed close instead of doing it late.
- The close runs only when no order of the day is unclosed (Q-10): otherwise a sticky alert
and a new try every 15 minutes. A locked / expired license turns the open into an alert.
- Sticky notifications: notifications.resolved_at + core.notifications.resolve(); the
alerts resolve when the day opens / closes (by hand or by itself).
- services/business_days.py: the one open / close path (the routes and the loop); days opened
or closed by the system have no opener / closer and opened_auto / closed_auto (Alembic 0052).
- Manager: Settings -> Operation "Opening and closing the day"; the bell's action buttons
("Open now", "Go to the overview"); Reports -> Days marks days opened / closed by itself.
Plan platform-v2 6F.8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1187,6 +1187,7 @@ def business_days_list(
|
||||
"closed_at": _dt(d.closed_at),
|
||||
"opened_by": (opener.full_name or opener.username) if opener else None,
|
||||
"closed_by": (closer.full_name or closer.username) if closer else None,
|
||||
"opened_auto": bool(d.opened_auto), "closed_auto": bool(d.closed_auto), # 6F.8: by the system
|
||||
"notes": d.notes,
|
||||
"order_count": len(orders),
|
||||
"closed_order_count": len(closed_orders),
|
||||
|
||||
Reference in New Issue
Block a user