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:
2026-11-23 13:17:15 +02:00
co-authored by Claude Opus 5.5
parent 7706bf2470
commit 096bd53dbd
21 changed files with 856 additions and 117 deletions
+47 -2
View File
@@ -368,7 +368,12 @@
"empty": "Nothing new. Licence, printing and support alerts show up here.",
"markAll": "Mark all as read",
"times_one": "{{count}} time",
"times_other": "{{count}} times"
"times_other": "{{count}} times",
"dayOpened": "The day is open",
"actions": {
"open_day": "Open now",
"overview": "Go to the overview"
}
},
"settings": {
"saved": "Saved",
@@ -797,6 +802,43 @@
},
"max": "The most equal parts",
"maxHint": "The parts start at the table's customers when it has some."
},
"autoDay": {
"title": "Opening and closing the day",
"intro": "The business day can open and close by itself, at the opening hours (Schedule page) or at a time of its own. It works without the internet.",
"open": "The day opens",
"openHint": "A day a manager closed by hand isn't reopened before the next opening.",
"openTip": "At the opening hours: the day opens when the hours start. At a time: every day at that time, whatever the hours. Only alert: managers get a message that stays until the day is opened, with an \"Open now\" button.",
"close": "The day closes",
"closeHint": "Closes only when every table is closed; otherwise you're alerted and it tries again every 15 minutes.",
"closeTip": "Open shifts end as with a manual close. If the server was off at closing time, the day isn't closed later by itself: you're alerted instead.",
"modes": {
"open": {
"off": "By hand",
"schedule": "By itself at the opening hours",
"time": "By itself at a time",
"alert": "Only alert at the opening hours"
},
"close": {
"off": "By hand",
"schedule": "By itself at the end of the opening hours",
"time": "By itself at a time",
"alert": "Only alert at the end of the opening hours"
}
},
"openTime": "Opens at",
"closeTime": "Closes at",
"openOffset": "Open earlier",
"closeOffset": "Close later",
"offsetNone": "Exactly at the hours",
"before_one": "{{count}} minute before",
"before_other": "{{count}} minutes before",
"after_one": "{{count}} minute after",
"after_other": "{{count}} minutes after",
"ignoreBreak": "One day across the break",
"ignoreBreakHint": "Off: the break between two opening spans closes the day and the next span opens a new one.",
"ignoreBreakTip": "With hours 12:00–16:00 and 19:00–23:00: on = one day from 12:00 to 23:00; off = two days.",
"noHours": "No opening hours yet: set them on the Schedule page, or nothing happens."
}
},
"logs": {
@@ -4082,7 +4124,10 @@
"anyTable": "Any table",
"cancelledLines": "Cancelled lines",
"ordersCount_one": "{{count}} order · {{total}}",
"ordersCount_other": "{{count}} orders · {{total}}"
"ordersCount_other": "{{count}} orders · {{total}}",
"autoBoth": "Opened and closed by itself",
"autoOpened": "Opened by itself",
"autoClosed": "Closed by itself"
},
"traffic": {
"orders": "Orders",