From 3e36136bfadd1225ab5be181a156d3e110f80903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 5 Nov 2026 14:09:19 +0100 Subject: [PATCH] fix: groups.swiss follows the contingent status again instead of blocking unpriced days The export read MyE&P's contingents/calendar, which marks every day without a MyE&P price as BLOCKED. Group houses without winter prices (e.g. SVS) were published to groups.swiss as fully booked for the whole winter, and their on-request runs were lost. It now reads contingents/availability, the plain bpn-connect snapshot the iCal feed already uses, as TYPO3 10 did. getContingentCalendar() had no other caller and is removed. Co-Authored-By: Claude Opus 5.5 --- .../ep_products/Classes/MyEP/ApiClient.php | 19 ------------------- .../Classes/Service/GroupsSwissService.php | 13 +++++++------ 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/packages/ep_products/Classes/MyEP/ApiClient.php b/packages/ep_products/Classes/MyEP/ApiClient.php index 4736e06..62e2a5f 100644 --- a/packages/ep_products/Classes/MyEP/ApiClient.php +++ b/packages/ep_products/Classes/MyEP/ApiClient.php @@ -188,25 +188,6 @@ class ApiClient implements LoggerAwareInterface ]); } - /** - * One entry per day ('date', 'status': OK, BLOCKED or ON_REQUEST) for the given range - * - * @throws ApiException - */ - public function getContingentCalendar( - string $hotelCode, - \DateTimeInterface $dateFrom, - \DateTimeInterface $dateTo, - ): array { - return $this->requestJson('GET', 'contingents/calendar', [ - 'query' => [ - 'hotelCode' => $hotelCode, - 'dateFrom' => $dateFrom->format('Y-m-d'), - 'dateTo' => $dateTo->format('Y-m-d'), - ], - ]); - } - /** * One entry per day the snapshot has ('date', 'status': OK, BLOCKED or ON_REQUEST), today until the * end of the snapshot; unlike contingents/calendar, days without a price keep their status diff --git a/packages/ep_products/Classes/Service/GroupsSwissService.php b/packages/ep_products/Classes/Service/GroupsSwissService.php index 802543c..8ad583d 100644 --- a/packages/ep_products/Classes/Service/GroupsSwissService.php +++ b/packages/ep_products/Classes/Service/GroupsSwissService.php @@ -14,9 +14,10 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; /** * Publishes the availability of a group house to its groups.swiss availability chart * - * The calendar comes from MyE&P (contingents/calendar, synced from bpn-connect); TYPO3 10 read it - * from bpn-connect directly. The chart is reset to "free" for the next year, then every run of - * BLOCKED / ON_REQUEST days is sent as one range. + * The availability comes from MyE&P (contingents/availability, the bpn-connect snapshot without the + * price rule of contingents/calendar, which would block every unpriced day); TYPO3 10 read it from + * bpn-connect directly. The chart is reset to "free" for the next year, then every run of + * BLOCKED / ON_REQUEST days within it is sent as one range. */ class GroupsSwissService implements LoggerAwareInterface { @@ -58,10 +59,10 @@ class GroupsSwissService implements LoggerAwareInterface $to = $from->modify('+1 year'); try { - // The last day of the range is reset below but not asked for, as in TYPO3 10 - $calendarRows = $this->apiClient->getContingentCalendar($hotelCode, $from, $to->modify('-1 day')); + // Runs to the end of the snapshot; buildRanges() keeps the days before $to + $calendarRows = $this->apiClient->getContingentAvailability($hotelCode); } catch (ApiException $e) { - $this->logger?->error(sprintf('groups.swiss: no calendar for hotel %s', $hotelCode), ['exception' => $e]); + $this->logger?->error(sprintf('groups.swiss: no availability for hotel %s', $hotelCode), ['exception' => $e]); return null; }