feat: re-generate access links for bookings when sent via email

This commit is contained in:
Björn Fromme
2026-08-20 14:21:02 +02:00
parent 98a303e941
commit ef439f6faf
9 changed files with 58 additions and 252 deletions
@@ -23,7 +23,7 @@ class SendAccessLinkControllerTest extends TestCase
public function testGetRendersTheConfirmationModal(): void
{
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendCustomerConfirmationEmail');
$bookingService->expects(self::never())->method('sendAccessLink');
$controller = new TestableSendAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));
@@ -38,7 +38,7 @@ class SendAccessLinkControllerTest extends TestCase
$booking = $this->openBooking();
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::once())->method('sendCustomerConfirmationEmail')->with($booking);
$bookingService->expects(self::once())->method('sendAccessLink')->with($booking);
$controller = new TestableSendAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));
@@ -53,7 +53,7 @@ class SendAccessLinkControllerTest extends TestCase
$booking->setAccessLinkIssuedAt(null);
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendCustomerConfirmationEmail');
$bookingService->expects(self::never())->method('sendAccessLink');
$controller = new TestableSendAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));
@@ -74,7 +74,7 @@ class SendAccessLinkControllerTest extends TestCase
$booking->setStatus(AccommodationBookingStatus::Draft);
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendCustomerConfirmationEmail');
$bookingService->expects(self::never())->method('sendAccessLink');
$controller = new TestableSendAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));
@@ -96,7 +96,7 @@ class SendAccessLinkControllerTest extends TestCase
public function testPostWithAnInvalidTokenIsDenied(): void
{
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendCustomerConfirmationEmail');
$bookingService->expects(self::never())->method('sendAccessLink');
$controller = new TestableSendAccessLinkController($bookingService, $this->createMock(LoggerInterface::class), tokenValid: false);
@@ -111,7 +111,7 @@ class SendAccessLinkControllerTest extends TestCase
$booking->setEmail(null);
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendCustomerConfirmationEmail');
$bookingService->expects(self::never())->method('sendAccessLink');
$controller = new TestableSendAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));