feat: add cms product code for future use

This commit is contained in:
2026-09-03 17:40:29 +02:00
parent 198fbfe6a2
commit 976b30ccc0
4 changed files with 54 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260903153641 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE accommodation ADD product_code VARCHAR(16) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE accommodation DROP product_code');
}
}
+15
View File
@@ -35,6 +35,9 @@ class Accommodation implements BlameableEntityInterface, TimestampableEntityInte
#[ORM\Column(length: 16, nullable: true)]
private ?string $cmsCode = null;
#[ORM\Column(length: 16, nullable: true)]
private ?string $productCode = null;
/**
* @var Collection<int, AccommodationPrice>
*/
@@ -122,6 +125,18 @@ class Accommodation implements BlameableEntityInterface, TimestampableEntityInte
return $this->cmsCode ?? $this->calendarCode;
}
public function getProductCode(): ?string
{
return $this->productCode;
}
public function setProductCode(?string $productCode): self
{
$this->productCode = $productCode;
return $this;
}
/**
* @return Collection<int, AccommodationPrice>
*/
+6 -2
View File
@@ -24,10 +24,14 @@ class AccommodationType extends AbstractType
'label' => 'Name',
])
->add('calendarCode', TextType::class, [
'label' => 'Code für Kalender',
'label' => 'Kalender-Code in BusPro',
])
->add('cmsCode', TextType::class, [
'label' => 'Code für CMS-Daten',
'label' => 'Hotel-Code in TYPO3',
'required' => false,
])
->add('productCode', TextType::class, [
'label' => 'Produkt-Code in TYPO3',
'required' => false,
])
->add('maxAdolescentAge', IntegerType::class, [
@@ -8,6 +8,7 @@
</div>
{{ form_row(form.calendarCode) }}
{{ form_row(form.cmsCode) }}
{{ form_row(form.productCode) }}
{{ form_row(form.maxAdolescentAge) }}
{{ form_row(form.currency) }}
{{ form_row(form.country) }}
@@ -32,7 +33,7 @@
<svg class="w-full h-auto" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 5V19H20V7H11.5858L9.58579 5H4ZM12.4142 5H21C21.5523 5 22 5.44772 22 6V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H10.4142L12.4142 5ZM10 10.5C10 11.3284 9.32843 12 8.5 12C7.67157 12 7 11.3284 7 10.5C7 9.67157 7.67157 9 8.5 9C9.32843 9 10 9.67157 10 10.5ZM18 17L14 11L7 17H18Z"></path></svg>
</div>
<div>
<strong>CMS-Code falsch oder Haus in TYPO3 nicht angelegt</strong>
<strong>Hotel-Code falsch oder nicht in TYPO3 angelegt</strong>
</div>
</div>
{% endif %}