fix: prevent generating offer links while booking is in draft
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user