Fix: Adjust end dates of unavailabilities for Groups.swiss

This commit is contained in:
Björn Fromme
2023-09-14 11:03:08 +02:00
parent eb458aaddb
commit b7fc3350bc
@@ -144,8 +144,10 @@ class GroupsSwissService implements SingletonInterface, LoggerAwareInterface
'status' => $contingentStatus,
];
} elseif (null !== $item && $itemStatus !== $contingentStatus) {
// Set end date of current chart item to previous contingent's date
$item['to'] = $contingent->getEnd();
// Set end date of current chart item to previous day when following
// status is OK
$item['to'] = Contingent::STATUS_OK !== $contingentStatus ?
$contingent->getEnd() : $contingent->getEnd()->modify('-1 day');
// Translate status code for Groups.swiss
$statusCode = Contingent::STATUS_ONREQUEST === $item['status'] ? 1 : 2;
// Post chart item to API