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": "Τίποτα καινούργιο. Εδώ εμφανίζονται ειδοποιήσεις για την άδεια, την εκτύπωση και την υποστήριξη.",
"markAll": "Όλες διαβασμένες",
"times_one": "{{count}} φορά",
"times_other": "{{count}} φορές"
"times_other": "{{count}} φορές",
"dayOpened": "Η ημέρα άνοιξε",
"actions": {
"open_day": "Άνοιγμα τώρα",
"overview": "Στην επισκόπηση"
}
},
"settings": {
"saved": "Αποθηκεύτηκε",
@@ -797,6 +802,43 @@
},
"max": "Μέγιστα ίσα μέρη",
"maxHint": "Τα μέρη ξεκινούν από τους πελάτες του τραπεζιού, όταν υπάρχουν."
},
"autoDay": {
"title": "Άνοιγμα και κλείσιμο της ημέρας",
"intro": "Η εργάσιμη ημέρα μπορεί να ανοίγει και να κλείνει μόνη της, στο ωράριο (σελίδα Πρόγραμμα) ή σε δική της ώρα. Δουλεύει και χωρίς ίντερνετ.",
"open": "Η ημέρα ανοίγει",
"openHint": "Μια ημέρα που έκλεισε υπεύθυνος με το χέρι δεν ξανανοίγει πριν το επόμενο άνοιγμα.",
"openTip": "Στο ωράριο: η ημέρα ανοίγει όταν αρχίζει το ωράριο. Σε ώρα: κάθε μέρα εκείνη την ώρα, όποιο κι αν είναι το ωράριο. Μόνο ειδοποίηση: οι υπεύθυνοι παίρνουν μήνυμα που μένει μέχρι να ανοίξει η ημέρα, με κουμπί «Άνοιγμα τώρα».",
"close": "Η ημέρα κλείνει",
"closeHint": "Κλείνει μόνο όταν έχουν κλείσει όλα τα τραπέζια· αλλιώς ειδοποιείστε και ξαναδοκιμάζει κάθε 15 λεπτά.",
"closeTip": "Οι ανοιχτές βάρδιες τελειώνουν όπως σε χειροκίνητο κλείσιμο. Αν ο server ήταν κλειστός την ώρα του κλεισίματος, η ημέρα δεν κλείνει αργότερα μόνη της: ειδοποιείστε.",
"modes": {
"open": {
"off": "Με το χέρι",
"schedule": "Μόνη της στο ωράριο",
"time": "Μόνη της σε ώρα",
"alert": "Μόνο ειδοποίηση στο ωράριο"
},
"close": {
"off": "Με το χέρι",
"schedule": "Μόνη της στο τέλος του ωραρίου",
"time": "Μόνη της σε ώρα",
"alert": "Μόνο ειδοποίηση στο τέλος του ωραρίου"
}
},
"openTime": "Ανοίγει στις",
"closeTime": "Κλείνει στις",
"openOffset": "Άνοιγμα νωρίτερα",
"closeOffset": "Κλείσιμο αργότερα",
"offsetNone": "Ακριβώς στο ωράριο",
"before_one": "{{count}} λεπτό πριν",
"before_other": "{{count}} λεπτά πριν",
"after_one": "{{count}} λεπτό μετά",
"after_other": "{{count}} λεπτά μετά",
"ignoreBreak": "Μία ημέρα και με διάλειμμα",
"ignoreBreakHint": "Κλειστό: το διάλειμμα ανάμεσα σε δύο διαστήματα κλείνει την ημέρα και το επόμενο ανοίγει νέα.",
"ignoreBreakTip": "Με ωράριο 12:00–16:00 και 19:00–23:00: ανοιχτό = μία ημέρα 12:00–23:00· κλειστό = δύο ημέρες.",
"noHours": "Δεν υπάρχει ακόμα ωράριο: ορίστε το στη σελίδα Πρόγραμμα, αλλιώς δεν γίνεται τίποτα."
}
},
"logs": {
@@ -4082,7 +4124,10 @@
"anyTable": "Κάθε τραπέζι",
"cancelledLines": "Ακυρωμένες γραμμές",
"ordersCount_one": "{{count}} παραγγελία · {{total}}",
"ordersCount_other": "{{count}} παραγγελίες · {{total}}"
"ordersCount_other": "{{count}} παραγγελίες · {{total}}",
"autoBoth": "Άνοιξε και έκλεισε μόνη της",
"autoOpened": "Άνοιξε μόνη της",
"autoClosed": "Έκλεισε μόνη της"
},
"traffic": {
"orders": "Παραγγελίες",