- menu_display_name is now separate from the site's internal name (was
incorrectly showing the sysadmin-only site name on the public menu).
- Header image now resolves against the cloud API origin instead of
the menu-app's own origin, fixing the broken-image icon.
- Tagline/blurb/hours now genuinely hide when cleared: the sysadmin
save handler was converting empty fields to null, which the PUT
endpoint's exclude_none silently drops instead of clearing.
- Added a settable blurb (EN/GR) below the tagline, previously
hardcoded ("Fresh seasonal plates, served with care.").
- Collapsed hours from two fields (EN/GR) to one — opening hours don't
vary by language.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
1.6 KiB
Python
36 lines
1.6 KiB
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from database import Base
|
|
|
|
|
|
class Site(Base):
|
|
__tablename__ = "sites"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
site_id = Column(String, unique=True, nullable=False, index=True)
|
|
name = Column(String, nullable=False)
|
|
owner_name = Column(String, nullable=False)
|
|
contact_email = Column(String, nullable=False)
|
|
secret_key_hash = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
is_locked = Column(Boolean, default=False)
|
|
lock_reason = Column(String, nullable=True)
|
|
license_expires_at = Column(DateTime(timezone=True), nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
last_seen_at = Column(DateTime(timezone=True), nullable=True)
|
|
last_seen_ip = Column(String, nullable=True)
|
|
last_seen_local_ip = Column(String, nullable=True)
|
|
waiter_domain = Column(String, nullable=True)
|
|
# Monotonically incrementing counter used to generate public_ref for online orders
|
|
order_counter = Column(Integer, default=0, nullable=False)
|
|
|
|
# QR menu branding/config
|
|
menu_mode = Column(String, nullable=False, default="order") # "order" | "view_only"
|
|
menu_display_name = Column(String, nullable=True)
|
|
menu_tagline_en = Column(String, nullable=True)
|
|
menu_tagline_gr = Column(String, nullable=True)
|
|
menu_blurb_en = Column(String, nullable=True)
|
|
menu_blurb_gr = Column(String, nullable=True)
|
|
menu_hours = Column(String, nullable=True)
|
|
menu_header_image_url = Column(String, nullable=True)
|