wip: group inquiries and booking
This commit is contained in:
1 parent
225ed518e3
commit
1e59d38eb4
33 files changed
+644
-95
No files matched your search
@@ -10,9 +10,9 @@ use App\Entity\TimestampableEntity;
|
||||
use App\Entity\TimestampableEntityInterface;
|
||||
use App\Enum\Groups\AdditionalServiceType;
|
||||
use App\Repository\Groups\AccommodationBookingRepository;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: AccommodationBookingRepository::class)]
|
||||
@@ -57,9 +57,23 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $boardServiceOriginalId = null;
|
||||
|
||||
/** @var list<array{label: string, price: int, type: string, originalServiceId: int|null}> */
|
||||
#[ORM\Column(type: Types::JSON)]
|
||||
private array $additionalServices = [];
|
||||
|
||||
/** @var array<string, mixed>|null */
|
||||
#[ORM\Column(type: Types::JSON, nullable: true)]
|
||||
private ?array $priceBreakdown = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $totalPrice = null;
|
||||
|
||||
#[ORM\Column(length: 3, nullable: true)]
|
||||
private ?string $pricingCurrency = null;
|
||||
|
||||
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
|
||||
private ?int $pricingVersion = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private bool $isInquiry = false;
|
||||
|
||||
@@ -235,11 +249,13 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
return $this;
|
||||
}
|
||||
|
||||
/** @return list<array{label: string, price: int, type: string, originalServiceId: int|null}> */
|
||||
public function getAdditionalServices(): array
|
||||
{
|
||||
return $this->additionalServices;
|
||||
}
|
||||
|
||||
/** @param list<array{label: string, price: int, type: string, originalServiceId: int|null}> $additionalServices */
|
||||
public function setAdditionalServices(array $additionalServices): self
|
||||
{
|
||||
$this->additionalServices = $additionalServices;
|
||||
@@ -259,6 +275,48 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
return $this;
|
||||
}
|
||||
|
||||
/** @return array<string, mixed>|null */
|
||||
public function getPriceBreakdown(): ?array
|
||||
{
|
||||
return $this->priceBreakdown;
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $priceBreakdown */
|
||||
public function setPriceSnapshot(array $priceBreakdown, int $totalPrice, string $currency, int $version): self
|
||||
{
|
||||
$this->priceBreakdown = $priceBreakdown;
|
||||
$this->totalPrice = $totalPrice;
|
||||
$this->pricingCurrency = $currency;
|
||||
$this->pricingVersion = $version;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function clearPriceSnapshot(): self
|
||||
{
|
||||
$this->priceBreakdown = null;
|
||||
$this->totalPrice = null;
|
||||
$this->pricingCurrency = null;
|
||||
$this->pricingVersion = null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTotalPrice(): ?int
|
||||
{
|
||||
return $this->totalPrice;
|
||||
}
|
||||
|
||||
public function getPricingCurrency(): ?string
|
||||
{
|
||||
return $this->pricingCurrency;
|
||||
}
|
||||
|
||||
public function getPricingVersion(): ?int
|
||||
{
|
||||
return $this->pricingVersion;
|
||||
}
|
||||
|
||||
public function isInquiry(): bool
|
||||
{
|
||||
return $this->isInquiry;
|
||||
|
||||
Reference in new issue
Block a user