feat: additional status

This commit is contained in:
Björn Fromme
2026-08-04 18:09:40 +02:00
parent dc86e715cb
commit 2c381ee741
20 changed files with 588 additions and 64 deletions
+17
View File
@@ -44,6 +44,10 @@ class OfferController extends AbstractController
return $this->render('groups/booking/offer_unavailable.html.twig');
}
if (!$this->isCustomerVisible($booking)) {
return $this->render('groups/booking/offer_unavailable.html.twig');
}
$this->linkSigner->authorizeSession($request, $booking);
return new RedirectResponse($this->generateUrl('app_groups_booking_offer_view', ['uuid' => $uuid]));
@@ -58,6 +62,10 @@ class OfferController extends AbstractController
return $this->render('groups/booking/offer_unavailable.html.twig');
}
if (!$this->isCustomerVisible($booking)) {
return $this->render('groups/booking/offer_unavailable.html.twig');
}
$accommodation = $booking->getAccommodation() ?? throw $this->createNotFoundException('Booking has no accommodation.');
$priceBreakdown = $this->breakdownCalculator->compute($booking);
@@ -105,6 +113,15 @@ class OfferController extends AbstractController
]);
}
/**
* A draft is not ready to be shown, and a discarded booking must not be viewable
* any more — in both cases the link behaves as if it had expired.
*/
private function isCustomerVisible(AccommodationBooking $booking): bool
{
return !$booking->isDraft() && !$booking->isDiscarded();
}
/**
* Sends the browser to a full reload of the (non-modal) offer page — this is
* triggered from an htmx-loaded modal, so a plain render/redirect here would