feat: additional status
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Entity\BlameableEntityInterface;
|
||||
use App\Entity\TimestampableEntity;
|
||||
use App\Entity\TimestampableEntityInterface;
|
||||
use App\Entity\User;
|
||||
use App\Enum\Groups\AccommodationBookingStatus;
|
||||
use App\Enum\Groups\AdditionalServiceType;
|
||||
use App\Repository\Groups\AccommodationBookingRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
@@ -75,8 +76,8 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
private ?int $pricingVersion = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private bool $isInquiry = false;
|
||||
#[ORM\Column(length: 20, enumType: AccommodationBookingStatus::class)]
|
||||
private AccommodationBookingStatus $status = AccommodationBookingStatus::Draft;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $accessLinkIssuedAt = null;
|
||||
@@ -335,18 +336,38 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
return $this->pricingVersion;
|
||||
}
|
||||
|
||||
public function isInquiry(): bool
|
||||
public function getStatus(): AccommodationBookingStatus
|
||||
{
|
||||
return $this->isInquiry;
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setIsInquiry(bool $isInquiry): self
|
||||
public function setStatus(AccommodationBookingStatus $status): self
|
||||
{
|
||||
$this->isInquiry = $isInquiry;
|
||||
$this->status = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isDraft(): bool
|
||||
{
|
||||
return AccommodationBookingStatus::Draft === $this->status;
|
||||
}
|
||||
|
||||
public function isInquiry(): bool
|
||||
{
|
||||
return AccommodationBookingStatus::Inquiry === $this->status;
|
||||
}
|
||||
|
||||
public function isBooking(): bool
|
||||
{
|
||||
return AccommodationBookingStatus::Booking === $this->status;
|
||||
}
|
||||
|
||||
public function isDiscarded(): bool
|
||||
{
|
||||
return AccommodationBookingStatus::Discarded === $this->status;
|
||||
}
|
||||
|
||||
public function getAccessLinkIssuedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->accessLinkIssuedAt;
|
||||
|
||||
Reference in New Issue
Block a user