fix: prevent generating offer links while booking is in draft

This commit is contained in:
Björn Fromme
2026-08-19 13:00:43 +02:00
parent 2601e46ec4
commit 8617bf6c86
11 changed files with 442 additions and 36 deletions
@@ -72,6 +72,23 @@ class AccommodationBookingTest extends TestCase
self::assertSame('Buchung', $accepted->recordLabel());
}
public function testADraftIsTheOnlyStatusTheCustomerMustNotReach(): void
{
// Entwurf is the office's own workbench — nothing has been offered yet, so there is
// nothing an access link could show. Whether a link that exists still opens anything
// is a separate question the offer page answers (a discarded booking does not).
foreach (AccommodationBookingStatus::cases() as $status) {
$booking = new AccommodationBooking();
$booking->setStatus($status);
self::assertSame(
AccommodationBookingStatus::Draft !== $status,
$booking->isCustomerAccessible(),
$status->value,
);
}
}
public function testTheLabelIsIndependentOfWhereTheBookingCameFrom(): void
{
// Origin answers "how did this come about" and is deliberately not the same