|
@@ -4,6 +4,7 @@ import logging
|
|
|
import random
|
|
import random
|
|
|
import time
|
|
import time
|
|
|
from dataclasses import dataclass
|
|
from dataclasses import dataclass
|
|
|
|
|
+from datetime import date, timedelta
|
|
|
from room_cal._utils import local_today as _local_today
|
|
from room_cal._utils import local_today as _local_today
|
|
|
from urllib.parse import parse_qs, urlparse
|
|
from urllib.parse import parse_qs, urlparse
|
|
|
|
|
|
|
@@ -25,6 +26,17 @@ def _is_past(d: str) -> bool:
|
|
|
return d < _local_today().isoformat()
|
|
return d < _local_today().isoformat()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def _dates_in_range(date_from: str, date_to: str) -> list[str]:
|
|
|
|
|
+ """Inclusive list of YYYY-MM-DD strings; roomInventoryQuery wants every date explicitly."""
|
|
|
|
|
+ start, end = date.fromisoformat(date_from), date.fromisoformat(date_to)
|
|
|
|
|
+ out = []
|
|
|
|
|
+ cur = start
|
|
|
|
|
+ while cur <= end:
|
|
|
|
|
+ out.append(cur.isoformat())
|
|
|
|
|
+ cur += timedelta(days=1)
|
|
|
|
|
+ return out
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
_BASE = 'https://admin.booking.com'
|
|
_BASE = 'https://admin.booking.com'
|
|
|
_SENDER_LABELS: dict[str, str] = {'GUEST': 'Guest', 'PARTNER': 'Host'}
|
|
_SENDER_LABELS: dict[str, str] = {'GUEST': 'Guest', 'PARTNER': 'Host'}
|
|
|
|
|
|
|
@@ -34,6 +46,103 @@ _GQL_CLIENT_VERSION = 'cfJLLJeC'
|
|
|
_GQL_TIMEOUT_MS = '60000'
|
|
_GQL_TIMEOUT_MS = '60000'
|
|
|
_MSG_CLIENT_VERSION = 'EQDFPbZe'
|
|
_MSG_CLIENT_VERSION = 'EQDFPbZe'
|
|
|
|
|
|
|
|
|
|
+# Verbatim from a live capture (data/admin.booking.com_Archive [26-11-03 16-25-07].har) — the
|
|
|
|
|
+# abridged first draft of this query dropped the @include directive on restrictionAdvice while
|
|
|
|
|
+# still declaring $includeRestrictionAdvice, which GraphQL rejects as an unused variable
|
|
|
|
|
+# (HTTP 400, "GRAPHQL_VALIDATION_FAILED" — wrongly auth-shaped and retried as a credential
|
|
|
|
|
+# failure by the base's default _auth_shaped). Keep this query text byte-for-byte matched to a
|
|
|
|
|
+# captured working request rather than hand-trimming fields we don't read.
|
|
|
|
|
+_ROOM_INVENTORY_QUERY = """query roomInventoryQuery($input: PartnerAvailabilityFetchInput!, $includeRestrictionAdvice: Boolean = true) {
|
|
|
|
|
+ partnerAvailability {
|
|
|
|
|
+ partnerAvailabilityFetch(input: $input) {
|
|
|
|
|
+ hotel {
|
|
|
|
|
+ rooms {
|
|
|
|
|
+ roomId
|
|
|
|
|
+ name
|
|
|
|
|
+ numGuests
|
|
|
|
|
+ lastUpdate
|
|
|
|
|
+ nrRooms
|
|
|
|
|
+ rateIds
|
|
|
|
|
+ permissions {
|
|
|
|
|
+ name
|
|
|
|
|
+ edit
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ dates {
|
|
|
|
|
+ date
|
|
|
|
|
+ status
|
|
|
|
|
+ statusReason
|
|
|
|
|
+ hidden
|
|
|
|
|
+ netBooked
|
|
|
|
|
+ roomsToSell
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ rates {
|
|
|
|
|
+ rateId
|
|
|
|
|
+ name
|
|
|
|
|
+ parentRateId
|
|
|
|
|
+ occupancies
|
|
|
|
|
+ derivedPrices
|
|
|
|
|
+ xml
|
|
|
|
|
+ permissions {
|
|
|
|
|
+ name
|
|
|
|
|
+ edit
|
|
|
|
|
+ enabled
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ pricePermissions {
|
|
|
|
|
+ occupancy
|
|
|
|
|
+ edit
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ defaults {
|
|
|
|
|
+ name
|
|
|
|
|
+ value
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ restrictionAdvice @include(if: $includeRestrictionAdvice) {
|
|
|
|
|
+ date
|
|
|
|
|
+ minStayThrough
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ dates {
|
|
|
|
|
+ date
|
|
|
|
|
+ roomsToSell
|
|
|
|
|
+ netBooked
|
|
|
|
|
+ status
|
|
|
|
|
+ statusReason
|
|
|
|
|
+ closed
|
|
|
|
|
+ closedOnArrival
|
|
|
|
|
+ closedOnDeparture
|
|
|
|
|
+ exactStayArrival
|
|
|
|
|
+ lengthOfStay
|
|
|
|
|
+ maxAdvanceRes
|
|
|
|
|
+ maxStayArrival
|
|
|
|
|
+ maxStayThrough
|
|
|
|
|
+ minAdvanceRes
|
|
|
|
|
+ minStayArrival
|
|
|
|
|
+ minStayThrough
|
|
|
|
|
+ policygroupId
|
|
|
|
|
+ priceSingleUse
|
|
|
|
|
+ price {
|
|
|
|
|
+ occupancy
|
|
|
|
|
+ value
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+ __typename
|
|
|
|
|
+ }
|
|
|
|
|
+}"""
|
|
|
|
|
+
|
|
|
_UPDATE_MUTATION = """mutation updateRoomDateMutation($input: PartnerAvailabilityUpdateInput) {
|
|
_UPDATE_MUTATION = """mutation updateRoomDateMutation($input: PartnerAvailabilityUpdateInput) {
|
|
|
partnerAvailabilityMutations {
|
|
partnerAvailabilityMutations {
|
|
|
partnerAvailabilityUpdate(input: $input) {
|
|
partnerAvailabilityUpdate(input: $input) {
|
|
@@ -182,6 +291,9 @@ class _BookingClient(ServiceClientBase):
|
|
|
self._account_id = account_id
|
|
self._account_id = account_id
|
|
|
self._room_id = room_id
|
|
self._room_id = room_id
|
|
|
self._rate_id = rate_id
|
|
self._rate_id = rate_id
|
|
|
|
|
+ # Deprecated: unused since the GraphQL calendar/price migration (2026-11-17) — no request
|
|
|
|
|
+ # reads this anymore, _gql_headers() always sends a hardcoded placeholder instead. Captured
|
|
|
|
|
+ # passively for now; drop the field, _update_csrf, and BOOKING_CSRF_TOKEN once stable.
|
|
|
self._csrf_token = csrf_token
|
|
self._csrf_token = csrf_token
|
|
|
self._lang = lang
|
|
self._lang = lang
|
|
|
self._rts: dict[str, int] = {} # date -> rooms_to_sell; internal, not exposed on DayInfo
|
|
self._rts: dict[str, int] = {} # date -> rooms_to_sell; internal, not exposed on DayInfo
|
|
@@ -222,7 +334,10 @@ class _BookingClient(ServiceClientBase):
|
|
|
self._csrf_token = env.get('BOOKING_CSRF_TOKEN', self._csrf_token)
|
|
self._csrf_token = env.get('BOOKING_CSRF_TOKEN', self._csrf_token)
|
|
|
|
|
|
|
|
def _update_csrf(self, headers: httpx.Headers) -> None:
|
|
def _update_csrf(self, headers: httpx.Headers) -> None:
|
|
|
- """Capture CSRF from a response header if present and not yet known."""
|
|
|
|
|
|
|
+ """Capture CSRF from a response header if present and not yet known.
|
|
|
|
|
+
|
|
|
|
|
+ Deprecated: see the `_csrf_token` comment in __init__. Nothing reads this value anymore.
|
|
|
|
|
+ """
|
|
|
csrf = headers.get('x-booking-csrf')
|
|
csrf = headers.get('x-booking-csrf')
|
|
|
if csrf and csrf != 'undefined' and csrf != self._csrf_token:
|
|
if csrf and csrf != 'undefined' and csrf != self._csrf_token:
|
|
|
self._csrf_token = csrf
|
|
self._csrf_token = csrf
|
|
@@ -380,30 +495,28 @@ class _BookingClient(ServiceClientBase):
|
|
|
_raise_gql_errors(raw, operation_name)
|
|
_raise_gql_errors(raw, operation_name)
|
|
|
return raw
|
|
return raw
|
|
|
|
|
|
|
|
- async def _multipart_post(self, url: str, referer: str, body: dict, extra_headers: dict | None = None) -> dict:
|
|
|
|
|
|
|
+ async def _gql(self, operation_name: str, query: str, variables: dict, referer: str,
|
|
|
|
|
+ extra_params: dict | None = None) -> dict:
|
|
|
async def _attempt() -> httpx.Response:
|
|
async def _attempt() -> httpx.Response:
|
|
|
- headers = self._rest_headers(referer, extra_headers)
|
|
|
|
|
- return await self._http.post(url, params=self._common_params(),
|
|
|
|
|
- files={'request': (None, json.dumps(body))}, headers=headers)
|
|
|
|
|
- r = await self._request(_attempt, op=url.removeprefix(_BASE))
|
|
|
|
|
- self._update_csrf(r.headers)
|
|
|
|
|
- return r.json()
|
|
|
|
|
-
|
|
|
|
|
- async def _gql_mutate(self, variables: dict) -> dict:
|
|
|
|
|
- async def _attempt() -> httpx.Response:
|
|
|
|
|
- referer = self._matrix_referer()
|
|
|
|
|
- params = {'view_mode': 'MATRIX', 'hotel_id': str(self._hotel_id),
|
|
|
|
|
- 'lang': self._lang, 'ses': self._session}
|
|
|
|
|
|
|
+ # params built per call so a retry after _ensure_refreshed uses the reloaded session
|
|
|
|
|
+ params = {'hotel_id': str(self._hotel_id), 'lang': self._lang, 'ses': self._session}
|
|
|
|
|
+ if extra_params:
|
|
|
|
|
+ params.update(extra_params)
|
|
|
return await self._http.post(
|
|
return await self._http.post(
|
|
|
f'{_BASE}/dml/graphql.json',
|
|
f'{_BASE}/dml/graphql.json',
|
|
|
params=params,
|
|
params=params,
|
|
|
- json={'operationName': 'updateRoomDateMutation', 'variables': variables,
|
|
|
|
|
- 'extensions': {}, 'query': _UPDATE_MUTATION},
|
|
|
|
|
|
|
+ json={'operationName': operation_name, 'variables': variables,
|
|
|
|
|
+ 'extensions': {}, 'query': query},
|
|
|
headers=self._gql_headers(referer),
|
|
headers=self._gql_headers(referer),
|
|
|
)
|
|
)
|
|
|
- r = await self._request(_attempt, op='updateRoomDateMutation')
|
|
|
|
|
|
|
+ r = await self._request(_attempt, op=operation_name)
|
|
|
raw = r.json()
|
|
raw = r.json()
|
|
|
- _raise_gql_errors(raw, 'updateRoomDateMutation')
|
|
|
|
|
|
|
+ _raise_gql_errors(raw, operation_name)
|
|
|
|
|
+ return raw
|
|
|
|
|
+
|
|
|
|
|
+ async def _gql_mutate(self, variables: dict) -> dict:
|
|
|
|
|
+ raw = await self._gql('updateRoomDateMutation', _UPDATE_MUTATION, variables,
|
|
|
|
|
+ self._matrix_referer(), {'view_mode': 'MATRIX'})
|
|
|
result = (raw.get('data', {}).get('partnerAvailabilityMutations', {})
|
|
result = (raw.get('data', {}).get('partnerAvailabilityMutations', {})
|
|
|
.get('partnerAvailabilityUpdate', {}))
|
|
.get('partnerAvailabilityUpdate', {}))
|
|
|
if not result.get('success'):
|
|
if not result.get('success'):
|
|
@@ -412,58 +525,56 @@ class _BookingClient(ServiceClientBase):
|
|
|
return raw
|
|
return raw
|
|
|
|
|
|
|
|
def _parse_calendar_days(self, raw: dict) -> dict[str, DayInfo]:
|
|
def _parse_calendar_days(self, raw: dict) -> dict[str, DayInfo]:
|
|
|
- hotel_data = raw.get('data', {}).get('hotel', {}).get(str(self._hotel_id), {})
|
|
|
|
|
- room_data = hotel_data.get('rooms', {}).get(str(self._room_id), {})
|
|
|
|
|
- rate_dates = room_data.get('rates', {}).get(str(self._rate_id), {}).get('dates', {})
|
|
|
|
|
|
|
+ # `hotel` is a list (one entry per requested hotelId, always length 1 for us), not an
|
|
|
|
|
+ # object — confirmed against a live capture.
|
|
|
|
|
+ hotels = ((raw.get('data') or {}).get('partnerAvailability') or {}).get('partnerAvailabilityFetch', {}).get('hotel') or []
|
|
|
|
|
+ rooms = hotels[0].get('rooms') if hotels else []
|
|
|
|
|
+ room = next((r for r in (rooms or []) if str(r.get('roomId')) == str(self._room_id)), None)
|
|
|
result: dict[str, DayInfo] = {}
|
|
result: dict[str, DayInfo] = {}
|
|
|
- room_level_dates = room_data.get('dates', {})
|
|
|
|
|
- if room_level_dates:
|
|
|
|
|
- # Legacy backend: room-level dates include hidden/net_booked/rooms_to_sell
|
|
|
|
|
- for d, info in room_level_dates.items():
|
|
|
|
|
- price_str = rate_dates.get(d, {}).get('price', {}).get('2')
|
|
|
|
|
- result[d] = DayInfo(
|
|
|
|
|
- date=d,
|
|
|
|
|
- price=round(float(price_str)) if price_str else None,
|
|
|
|
|
- available=(info.get('hidden', 0) == 0),
|
|
|
|
|
- booked=(info.get('net_booked', 0) > 0),
|
|
|
|
|
- )
|
|
|
|
|
- self._rts[d] = int(info.get('rooms_to_sell') or 0)
|
|
|
|
|
- else:
|
|
|
|
|
- # Partner availability API: only rate-level dates; status encodes availability
|
|
|
|
|
- # "restricted" = open, "closed" = unavailable, "soldout" = booked
|
|
|
|
|
- for d, rate_info in rate_dates.items():
|
|
|
|
|
- price_str = rate_info.get('price', {}).get('2')
|
|
|
|
|
- status = rate_info.get('status', '')
|
|
|
|
|
- result[d] = DayInfo(
|
|
|
|
|
- date=d,
|
|
|
|
|
- price=round(float(price_str)) if price_str else None,
|
|
|
|
|
- available=(status == 'restricted'),
|
|
|
|
|
- booked=(status == 'soldout'),
|
|
|
|
|
- )
|
|
|
|
|
- self._rts.pop(d, None)
|
|
|
|
|
|
|
+ if not room:
|
|
|
|
|
+ return result
|
|
|
|
|
+ rates = room.get('rates') or []
|
|
|
|
|
+ rate = next((r for r in rates if str(r.get('rateId')) == str(self._rate_id)), None)
|
|
|
|
|
+ rate_dates = {rd['date']: rd for rd in (rate.get('dates') or [])} if rate else {}
|
|
|
|
|
+ for day in room.get('dates') or []:
|
|
|
|
|
+ d = day['date']
|
|
|
|
|
+ prices = rate_dates.get(d, {}).get('price') or []
|
|
|
|
|
+ price_val = next((p.get('value') for p in prices if str(p.get('occupancy')) == '2'), None)
|
|
|
|
|
+ result[d] = DayInfo(
|
|
|
|
|
+ date=d,
|
|
|
|
|
+ price=round(float(price_val)) if price_val is not None else None,
|
|
|
|
|
+ available=not day.get('hidden', False),
|
|
|
|
|
+ booked=(day.get('netBooked') or 0) > 0,
|
|
|
|
|
+ )
|
|
|
|
|
+ self._rts[d] = int(day.get('roomsToSell') or 0)
|
|
|
return result
|
|
return result
|
|
|
|
|
|
|
|
async def _fetch_month_calendar(self, month: int, year: int) -> dict[str, DayInfo]:
|
|
async def _fetch_month_calendar(self, month: int, year: int) -> dict[str, DayInfo]:
|
|
|
start, end = month_bounds(month, year)
|
|
start, end = month_bounds(month, year)
|
|
|
if _is_past(end):
|
|
if _is_past(end):
|
|
|
return {}
|
|
return {}
|
|
|
- body = {
|
|
|
|
|
- 'dates': {'range': True, 'dates': [start, end]},
|
|
|
|
|
- 'hotel': {
|
|
|
|
|
- 'fields': ['rooms', 'policygroups'],
|
|
|
|
|
- 'rooms': {
|
|
|
|
|
- 'id': [self._room_id],
|
|
|
|
|
- 'fields': ['status', 'rooms_to_sell', 'permissions', 'rates', 'nr_rooms', 'net_booked', 'num_guests'],
|
|
|
|
|
- 'rates': {'fields': ['permissions', 'price', 'restrictions', 'status', 'rooms_to_sell',
|
|
|
|
|
- 'policygroup_id', 'policy_overrides', 'default_policygroup_id', 'name']},
|
|
|
|
|
|
|
+ variables = {
|
|
|
|
|
+ 'includeRestrictionAdvice': False,
|
|
|
|
|
+ 'input': {
|
|
|
|
|
+ 'roomIds': [self._room_id],
|
|
|
|
|
+ 'hotelId': self._hotel_id,
|
|
|
|
|
+ 'dates': _dates_in_range(start, end),
|
|
|
|
|
+ 'rateIds': [],
|
|
|
|
|
+ 'additional': {'includeFakePrice': True},
|
|
|
|
|
+ 'options': {
|
|
|
|
|
+ 'checkEmptyPrice': True,
|
|
|
|
|
+ 'mlosStatusReason': False,
|
|
|
|
|
+ 'checkDynamicRestrictions': True,
|
|
|
|
|
+ 'formatPrice': True,
|
|
|
|
|
+ 'icalDates': True,
|
|
|
|
|
+ 'lastUpdate': True,
|
|
|
|
|
+ 'multiUnitsCheck': True,
|
|
|
|
|
+ 'postProcessDataPlugins': [],
|
|
|
},
|
|
},
|
|
|
- 'policy': {'fields': ['info']},
|
|
|
|
|
},
|
|
},
|
|
|
- 'post_process_data_plugins': ['format_price', 'multi_units_check', 'last_update', 'check_dynamic_restrictions'],
|
|
|
|
|
}
|
|
}
|
|
|
- raw = await self._multipart_post(
|
|
|
|
|
- f'{_BASE}/fresa/extranet/inventory/fetch', self._monthly_referer(), body
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ raw = await self._gql('roomInventoryQuery', _ROOM_INVENTORY_QUERY, variables,
|
|
|
|
|
+ self._monthly_referer(), {'view_mode': 'MONTHLY'})
|
|
|
return self._parse_calendar_days(raw)
|
|
return self._parse_calendar_days(raw)
|
|
|
|
|
|
|
|
def _suspect_month(self, key: tuple[int, int], result: dict[str, DayInfo]) -> bool:
|
|
def _suspect_month(self, key: tuple[int, int], result: dict[str, DayInfo]) -> bool:
|
|
@@ -632,32 +743,22 @@ class _BookingClient(ServiceClientBase):
|
|
|
return
|
|
return
|
|
|
if (cached := self._cache.get(d)) and cached.price == price:
|
|
if (cached := self._cache.get(d)) and cached.price == price:
|
|
|
return
|
|
return
|
|
|
- if not self._csrf_token:
|
|
|
|
|
- raise ValueError('BOOKING_CSRF_TOKEN not available — call get_calendar() first, or run refresh-creds')
|
|
|
|
|
- price_str = str(price)
|
|
|
|
|
- body = {
|
|
|
|
|
- 'update': [{
|
|
|
|
|
- 'room_id': self._room_id,
|
|
|
|
|
- 'from_date': d,
|
|
|
|
|
- 'until_date': d,
|
|
|
|
|
- 'limit_to_weekdays': [0, 1, 2, 3, 4, 5, 6],
|
|
|
|
|
- 'rate_id': self._rate_id,
|
|
|
|
|
- 'field_name': 'price',
|
|
|
|
|
- 'field_value': price_str,
|
|
|
|
|
|
|
+ await self._gql_mutate({'input': {
|
|
|
|
|
+ 'checkAddingAVToClosedProperty': False,
|
|
|
|
|
+ 'hotelId': self._hotel_id,
|
|
|
|
|
+ 'postProcessDataPlugins': ['mlos_status_reason'],
|
|
|
|
|
+ 'preventAcav': True,
|
|
|
|
|
+ 'statusReason': True,
|
|
|
|
|
+ 'updateAvailability': [{
|
|
|
|
|
+ 'fromDate': d,
|
|
|
|
|
+ 'roomId': self._room_id,
|
|
|
|
|
+ 'untilDate': d,
|
|
|
|
|
+ 'limitToWeekDays': ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
|
|
|
|
|
+ 'rateId': int(self._rate_id),
|
|
|
|
|
+ 'price': str(price),
|
|
|
'occupancy': occupancy,
|
|
'occupancy': occupancy,
|
|
|
}],
|
|
}],
|
|
|
- 'modified_fields': {'price_changed': 1, 'price_changed_value': price_str,
|
|
|
|
|
- 'date_selection_mode': 'CELLS'},
|
|
|
|
|
- 'post_process_data_plugins': ['format_price', 'last_update'],
|
|
|
|
|
- 'update_source': {'product': 'calendar', 'extra_data': {'new_calendar': 1, 'location': 'input'}},
|
|
|
|
|
- 'status_reason': 1,
|
|
|
|
|
- 'prevent_acav': '1',
|
|
|
|
|
- 'check_adding_av_to_closed_property': '0',
|
|
|
|
|
- }
|
|
|
|
|
- await self._multipart_post(
|
|
|
|
|
- f'{_BASE}/fresa/extranet/inventory/update', self._monthly_referer(), body,
|
|
|
|
|
- extra_headers={'X-Booking-CSRF': self._csrf_token},
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ }})
|
|
|
self.clear_cache()
|
|
self.clear_cache()
|
|
|
_log.info('booking set_price date=%s price=$%d', d, price)
|
|
_log.info('booking set_price date=%s price=$%d', d, price)
|
|
|
|
|
|
|
@@ -745,22 +846,24 @@ class _BookingClient(ServiceClientBase):
|
|
|
DRIFT_MANIFEST = {
|
|
DRIFT_MANIFEST = {
|
|
|
'domain': 'admin.booking.com',
|
|
'domain': 'admin.booking.com',
|
|
|
'endpoints': {
|
|
'endpoints': {
|
|
|
- 'inventory/fetch': {
|
|
|
|
|
- 'url_fragment': 'fresa/extranet/inventory/fetch',
|
|
|
|
|
- 'hint': 'load the monthly calendar',
|
|
|
|
|
- },
|
|
|
|
|
- 'inventory/update': {
|
|
|
|
|
- 'url_fragment': 'fresa/extranet/inventory/update',
|
|
|
|
|
- 'hint': 'change a price on any date',
|
|
|
|
|
- },
|
|
|
|
|
'get_reservations': {
|
|
'get_reservations': {
|
|
|
'url_fragment': 'fresa/extranet/calendar/get_reservations',
|
|
'url_fragment': 'fresa/extranet/calendar/get_reservations',
|
|
|
'hint': 'load the reservations list',
|
|
'hint': 'load the reservations list',
|
|
|
},
|
|
},
|
|
|
|
|
+ 'roomInventoryQuery': {
|
|
|
|
|
+ 'url_fragment': 'dml/graphql.json',
|
|
|
|
|
+ 'operation_name': 'roomInventoryQuery',
|
|
|
|
|
+ 'hint': 'load the monthly calendar',
|
|
|
|
|
+ 'headers': {
|
|
|
|
|
+ 'apollographql-client-version': _GQL_CLIENT_VERSION,
|
|
|
|
|
+ 'x-envoy-expected-rq-timeout-ms': _GQL_TIMEOUT_MS,
|
|
|
|
|
+ },
|
|
|
|
|
+ 'source': '_gql_headers()',
|
|
|
|
|
+ },
|
|
|
'updateRoomDateMutation': {
|
|
'updateRoomDateMutation': {
|
|
|
'url_fragment': 'dml/graphql.json',
|
|
'url_fragment': 'dml/graphql.json',
|
|
|
'operation_name': 'updateRoomDateMutation',
|
|
'operation_name': 'updateRoomDateMutation',
|
|
|
- 'hint': 'block or unblock a date on the calendar',
|
|
|
|
|
|
|
+ 'hint': 'change a price on any date, or block/unblock it',
|
|
|
'headers': {
|
|
'headers': {
|
|
|
'apollographql-client-version': _GQL_CLIENT_VERSION,
|
|
'apollographql-client-version': _GQL_CLIENT_VERSION,
|
|
|
'x-envoy-expected-rq-timeout-ms': _GQL_TIMEOUT_MS,
|
|
'x-envoy-expected-rq-timeout-ms': _GQL_TIMEOUT_MS,
|