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:
@@ -70,6 +70,16 @@ def product_dict(product) -> dict:
|
||||
return admin_product_dict(product)
|
||||
|
||||
|
||||
def hotel_group_dict(group) -> dict:
|
||||
data = model_dict(group)
|
||||
if not data.get("coverImage"):
|
||||
data["coverImage"] = data.get("image")
|
||||
if not data.get("image"):
|
||||
data["image"] = data.get("coverImage")
|
||||
data["tags"] = list(group.tags or [])
|
||||
return data
|
||||
|
||||
|
||||
def destination_dict(destination, include_count: bool = False, product_count: int | None = None) -> dict:
|
||||
data = model_dict(destination, {"aliases": [model_dict(alias) for alias in _sorted_aliases(destination)]})
|
||||
if include_count:
|
||||
|
||||
Reference in New Issue
Block a user