- Scenes (Alembic 0043, models/scene.py, /api/scenes, core.scenes.manage): named modes on or off (optionally until a time); price rules / deals get the condition "a scene is on"; signage lines can play only during a scene; turning one on tells every screen and pushes the online menu. - Signage schedules are lines (signage_schedule_items): playlist, screens ([] = every screen), priority, days, smart days (1st / last day, first / last week, Greek public holidays or not: core/calendar_days.py, mirrored in @xenia/signage), hours, dates, scene. No line → the screen's default playlist. 0043 turns the old named schedules into lines for their screens. - Screens: default playlist, TV shape, turn; what plays now and why. - Manager: tabs Screens · Playlists · Schedules · Slides (placeholder) · Message and weather; schedule lines with playlist / screens / priority / delete on one line; the playlist editor's horizontal timeline of fixed cards, the slide's basics beside its preview (one height), then its content; Management → Scenes; the scene condition in pricing. - Tests: backend (lines, smart days, scenes, prices), player logic, e2e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.1 KiB
Python
24 lines
1.1 KiB
Python
"""Scenes (owner 2026-11-21): a named mode of the venue ("Party mode", "Match night") that is on or
|
|
off. What follows a scene: signage schedule lines that play only while it is on (and win by their
|
|
priority), and price rules / deals with the condition "a scene is on". Several can be on at once;
|
|
one may turn itself off at a time (`until`). services/scenes.py.
|
|
"""
|
|
from sqlalchemy import Boolean, Column, Integer, String
|
|
|
|
from core.timeutil import UTCDateTime, utcnow
|
|
from database import Base
|
|
|
|
|
|
class Scene(Base):
|
|
__tablename__ = "scenes"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, nullable=False)
|
|
color = Column(String, nullable=True) # "#rrggbb", the venue's choice
|
|
description = Column(String, nullable=True)
|
|
is_active = Column(Boolean, nullable=False, default=False)
|
|
activated_at = Column(UTCDateTime, nullable=True)
|
|
until = Column(UTCDateTime, nullable=True) # on until then (None: until turned off)
|
|
sort_order = Column(Integer, nullable=False, default=0)
|
|
created_at = Column(UTCDateTime, default=utcnow, nullable=False)
|