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
@@ -402,6 +402,17 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
return AccommodationBookingStatus::Discarded === $this->status;
}
/**
* Whether the record may be put in front of the customer at all. A draft is the office's
* own workbench — nothing has been offered yet, so an access link would point the customer
* at a half-prepared record. Every access link action (issuing, regenerating, sending)
* hangs off this, so the rule lives in one place rather than in each caller.
*/
public function isCustomerAccessible(): bool
{
return !$this->isDraft();
}
public function getOrigin(): AccommodationBookingOrigin
{
return $this->origin;