feat: refactored accommodation booking status model
This commit is contained in:
@@ -36,6 +36,19 @@ class AccommodationBookingPdfGeneratorTest extends TestCase
|
||||
self::assertStringContainsString('buchung-2026-07-06-schulklasse-7b.pdf', (string) $response->headers->get('Content-Disposition'));
|
||||
}
|
||||
|
||||
public function testADocumentForAnUnacceptedOfferIsNamedAsOne(): void
|
||||
{
|
||||
// The document describes whatever the record is at the time it is produced, so it
|
||||
// must not call an offer nobody has accepted a booking.
|
||||
$booking = $this->booking();
|
||||
$booking->setAcceptedAt(null);
|
||||
$booking->setConfirmedAt(null);
|
||||
|
||||
$response = $this->createGenerator($this->breakdown())->createDownloadResponse($booking);
|
||||
|
||||
self::assertStringContainsString('angebot-2026-07-06-schulklasse-7b.pdf', (string) $response->headers->get('Content-Disposition'));
|
||||
}
|
||||
|
||||
public function testABookingWithoutPricesCannotBeRendered(): void
|
||||
{
|
||||
$this->expectException(\RuntimeException::class);
|
||||
@@ -81,6 +94,9 @@ class AccommodationBookingPdfGeneratorTest extends TestCase
|
||||
$booking->setBoardServiceLabel('Vollpension');
|
||||
$booking->addAdditionalServiceSnapshot('Bettwäsche', 900, 'per_person', 5);
|
||||
$booking->setRemarks('Zwei Vegetarier.');
|
||||
// A confirmation is only ever released for a booking the customer committed to,
|
||||
// so acceptedAt is always set by the time confirmedAt is.
|
||||
$booking->setAcceptedAt(new \DateTimeImmutable('2026-08-17'));
|
||||
$booking->setConfirmedAt(new \DateTimeImmutable('2026-08-18'));
|
||||
|
||||
return $booking;
|
||||
|
||||
Reference in New Issue
Block a user