67 行
2.3 KiB
Python
67 行
2.3 KiB
Python
"""
|
|
Seasonal products: autumn (游牧的森林) and winter (嗨冰雪).
|
|
Both share the same table structure, distinguished by `season` field.
|
|
"""
|
|
from __future__ import annotations
|
|
from sqlalchemy import Column, Integer, String, Text, DateTime, JSON
|
|
from sqlalchemy.sql import func
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class SeasonalProductConfig(Base):
|
|
__tablename__ = "seasonal_product_config"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
season = Column(String(20), unique=True, nullable=False) # 'autumn' or 'winter'
|
|
narrative = Column(Text)
|
|
style = Column(Text)
|
|
brand_name = Column(String(100))
|
|
version_label = Column(String(100))
|
|
season_label = Column(String(100))
|
|
selection_guide = Column(JSON) # {byVacationLength: [...]}
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
|
|
|
|
|
class SeasonalProductVersion(Base):
|
|
__tablename__ = "seasonal_product_versions"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
season = Column(String(20), nullable=False) # 'autumn' or 'winter'
|
|
version_id = Column(String(50), unique=True, nullable=False)
|
|
name = Column(String(200), nullable=False)
|
|
days = Column(Integer, nullable=False)
|
|
nights = Column(Integer, nullable=False)
|
|
tag = Column(String(50))
|
|
line = Column(String(50))
|
|
route = Column(String(200))
|
|
audience = Column(String(255))
|
|
description = Column(Text)
|
|
highlights = Column(JSON) # list of strings
|
|
itinerary = Column(JSON) # list of strings
|
|
sort_order = Column(Integer, default=0)
|
|
|
|
|
|
class SeasonalProductHighlight(Base):
|
|
__tablename__ = "seasonal_product_highlights"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
season = Column(String(20), nullable=False)
|
|
category = Column(String(20), nullable=False) # 'shared', 'south', 'north'
|
|
title = Column(String(200), nullable=False)
|
|
description = Column(Text)
|
|
sort_order = Column(Integer, default=0)
|
|
|
|
|
|
class SeasonalProductTimeline(Base):
|
|
__tablename__ = "seasonal_product_timeline"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
season = Column(String(20), nullable=False)
|
|
version = Column(String(50))
|
|
date = Column(String(50))
|
|
title = Column(String(200))
|
|
changes = Column(JSON) # list of {type, text}
|
|
reason = Column(Text)
|
|
sort_order = Column(Integer, default=0)
|