feat(hotelGroups): add offer display fields and related logic

- Add new database columns (coverImage, priceAmount, priceUnit, tags, status) to HotelGroup model
- Create hotel_group_dict serializer to handle image/coverImage synchronization and tag formatting
- Update site config endpoints to use the new serializer and filter published hotel groups
- Add Alembic migration for the new database schema changes
- Update test fixtures and API contract tests for the new fields
- Revise public and admin API documentation to document the new hotel group fields and usage rules
This commit is contained in:
duanshuwen
2026-07-03 22:44:57 +08:00
parent 201e835eab
commit 1aac3c64b2
9 changed files with 188 additions and 28 deletions

View File

@@ -133,6 +133,11 @@ class HotelGroup(Base):
title: Mapped[str] = mapped_column(String, nullable=False)
description: Mapped[str | None] = mapped_column(Text)
image: Mapped[str | None] = mapped_column(String)
coverImage: Mapped[str | None] = mapped_column(String)
priceAmount: Mapped[int | None] = mapped_column(Integer)
priceUnit: Mapped[str | None] = mapped_column(String, default="起/晚")
tags: Mapped[list[str]] = mapped_column(ARRAY(String), default=list, nullable=False)
status: Mapped[str] = mapped_column(String, default="published", nullable=False)
sortOrder: Mapped[int] = mapped_column(Integer, default=0, nullable=False)
isActive: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
createdAt: Mapped[datetime] = mapped_column(DateTime, default=utc_now, nullable=False)