feat: sync contingents for TYPO3 calendar hotels

This commit is contained in:
fromme committed 2026-10-29 15:05:04 +01:00
1 parent ec36b61275
commit 97c6330a9a
24 files changed
+1067 -180

No files matched your search

+24 -2
View File
@@ -12,11 +12,14 @@ use Doctrine\ORM\Mapping as ORM;
/**
* Local snapshot of a single day of contingent availability as reported by bpn-connect.
*
* Keyed by hotel code, not by accommodation: the snapshot also covers TYPO3's calendar hotels,
* which have no `Accommodation`.
*
* Written exclusively by the scheduled sync, never by a user, hence no Blameable/Timestampable.
*/
#[ORM\Entity(repositoryClass: ContingentDayRepository::class)]
#[ORM\Table(name: 'contingent_day')]
#[ORM\UniqueConstraint(name: 'uniq_contingent_day_accommodation_date', columns: ['accommodation_id', 'date'])]
#[ORM\UniqueConstraint(name: 'uniq_contingent_day_hotel_code_date', columns: ['hotel_code', 'date'])]
class ContingentDay
{
#[ORM\Id]
@@ -24,8 +27,15 @@ class ContingentDay
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 16)]
private ?string $hotelCode = null;
/**
* Superseded by $hotelCode and no longer written. Only rows from before the switch still
* carry it; it stays mapped until the column is dropped, so the switch can be rolled back.
*/
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
#[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
private ?Accommodation $accommodation = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
@@ -39,6 +49,18 @@ class ContingentDay
return $this->id;
}
public function getHotelCode(): ?string
{
return $this->hotelCode;
}
public function setHotelCode(string $hotelCode): self
{
$this->hotelCode = $hotelCode;
return $this;
}
public function getAccommodation(): ?Accommodation
{
return $this->accommodation;