from abc import ABC, abstractmethod class BaseProfile(ABC): name: str = "" label: str = "" # Fields required to configure this engine, shown in the add-hotel form # Each entry: {"key": "hotel_id", "label": "Hotel ID", "help": "e.g. THREEWAYS"} required_params: list[dict] = [] @classmethod @abstractmethod def detect(cls, url: str) -> dict | None: """Return extracted params dict if URL matches this engine, else None.""" @abstractmethod async def fetch_arrival_dates(self, client, params: dict) -> list[str]: """Return list of bookable arrival date strings YYYY-MM-DD.""" @abstractmethod async def fetch_night_rates(self, client, params: dict, arrival: str, nights: int = 1) -> list[dict]: """Return list of room/rate dicts for the stay. Each dict must have: roomId, rateId, availability, prices[{amountBeforeTax, amountAfterTax}], currencyCode prices list has one entry per night when nights > 1. """