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 <[email protected]>
This commit is contained in:
1 parent
60a99bc157
commit
3e36136bfa
2 files changed
+7
-25
No files matched your search
@@ -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
|
* 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
|
* end of the snapshot; unlike contingents/calendar, days without a price keep their status
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
|
|||||||
/**
|
/**
|
||||||
* Publishes the availability of a group house to its groups.swiss availability chart
|
* 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
|
* The availability comes from MyE&P (contingents/availability, the bpn-connect snapshot without the
|
||||||
* from bpn-connect directly. The chart is reset to "free" for the next year, then every run of
|
* price rule of contingents/calendar, which would block every unpriced day); TYPO3 10 read it from
|
||||||
* BLOCKED / ON_REQUEST days is sent as one range.
|
* 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
|
class GroupsSwissService implements LoggerAwareInterface
|
||||||
{
|
{
|
||||||
@@ -58,10 +59,10 @@ class GroupsSwissService implements LoggerAwareInterface
|
|||||||
$to = $from->modify('+1 year');
|
$to = $from->modify('+1 year');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// The last day of the range is reset below but not asked for, as in TYPO3 10
|
// Runs to the end of the snapshot; buildRanges() keeps the days before $to
|
||||||
$calendarRows = $this->apiClient->getContingentCalendar($hotelCode, $from, $to->modify('-1 day'));
|
$calendarRows = $this->apiClient->getContingentAvailability($hotelCode);
|
||||||
} catch (ApiException $e) {
|
} 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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user