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
+8 -4
View File
@@ -492,13 +492,15 @@ class AccommodationBookingService
}
/**
* Explicit admin action: (re)issues the access link, invalidating any previously issued
* link for this booking. No email side effect — sending is a separate, explicit admin
* action via sendCustomerConfirmationEmail().
* Explicit admin action: mails the access link again, refreshing its validity first so the
* customer always receives a link that is good for another full TTL — the mail is the only
* way a link reaches the customer, so sending and issuing belong together.
* The previously issued link stops working, which is the point: one booking has one valid
* link at a time.
* A no-op for a record that is not customer accessible yet, for the same reason as
* issueAccessLink().
*/
public function regenerateAccessLink(AccommodationBooking $booking): void
public function sendAccessLink(AccommodationBooking $booking): void
{
if (!$booking->isCustomerAccessible()) {
return;
@@ -506,6 +508,8 @@ class AccommodationBookingService
$booking->setAccessLinkIssuedAt(new \DateTimeImmutable());
$this->entityManager->flush();
$this->sendCustomerConfirmationEmail($booking);
}
/**