Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7bfb19ac9 | ||
|
|
18a890e50e | ||
|
|
3c9caeaad0 | ||
|
|
eba1a901d6 | ||
|
|
f8e4fe4d1e | ||
|
|
d9f29a5a5a | ||
|
|
a6ba4fac0d | ||
|
|
a9bd46be4a | ||
|
|
d0511ba2cd | ||
|
|
487597c828 | ||
|
|
b3210a7a27 | ||
|
|
a8c0801c32 | ||
|
|
690391da98 | ||
|
|
b075e3ecfc | ||
|
|
13491f346d | ||
|
|
fafc60eba9 |
No files matched your search
Generated
+7
-7
@@ -11622,16 +11622,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "friendsofphp/php-cs-fixer",
|
"name": "friendsofphp/php-cs-fixer",
|
||||||
"version": "v3.95.13",
|
"version": "v3.95.15",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||||
"reference": "ea941114a002eb5e5876f190223deec1066c482c"
|
"reference": "3e47e5d50046f87e3244acde2fe655d1a3b72555"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ea941114a002eb5e5876f190223deec1066c482c",
|
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3e47e5d50046f87e3244acde2fe655d1a3b72555",
|
||||||
"reference": "ea941114a002eb5e5876f190223deec1066c482c",
|
"reference": "3e47e5d50046f87e3244acde2fe655d1a3b72555",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -11671,7 +11671,7 @@
|
|||||||
"php-coveralls/php-coveralls": "^2.9.1",
|
"php-coveralls/php-coveralls": "^2.9.1",
|
||||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.8",
|
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.8",
|
||||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.8",
|
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.8",
|
||||||
"phpunit/phpunit": "^9.6.35 || ^10.5.64 || ^11.5.56",
|
"phpunit/phpunit": "^9.6.35 || ^10.5.64 || ^11.5.56 || ^12.5.31",
|
||||||
"symfony/polyfill-php85": "^1.38",
|
"symfony/polyfill-php85": "^1.38",
|
||||||
"symfony/var-dumper": "^5.4.48 || ^6.4.36 || ^7.4.8 || ^8.1.0",
|
"symfony/var-dumper": "^5.4.48 || ^6.4.36 || ^7.4.8 || ^8.1.0",
|
||||||
"symfony/yaml": "^5.4.53 || ^6.4.41 || ^7.4.13 || ^8.1.0"
|
"symfony/yaml": "^5.4.53 || ^6.4.41 || ^7.4.13 || ^8.1.0"
|
||||||
@@ -11715,7 +11715,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.13"
|
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.15"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -11723,7 +11723,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-07-10T09:23:21+00:00"
|
"time": "2026-07-15T09:51:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "myclabs/deep-copy",
|
"name": "myclabs/deep-copy",
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ security:
|
|||||||
users:
|
users:
|
||||||
mailjet:
|
mailjet:
|
||||||
password: '%env(MAILJET_WEBHOOK_BASIC_PASSWORD)%'
|
password: '%env(MAILJET_WEBHOOK_BASIC_PASSWORD)%'
|
||||||
roles: ['ROLE_MAILJET_WEBHOOK']
|
roles: [ ROLE_MAILJET_WEBHOOK ]
|
||||||
|
role_hierarchy:
|
||||||
|
ROLE_ADMIN: [ ROLE_GROUPS_ADMIN ]
|
||||||
|
ROLE_GROUPS_ADMIN: [ ROLE_GROUPS_MANAGER ]
|
||||||
|
|
||||||
firewalls:
|
firewalls:
|
||||||
dev:
|
dev:
|
||||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20260716101949 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Split the single accommodation booking discount into per-component discounts';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE accommodation_booking CHANGE discount accommodation_discount INT DEFAULT NULL, ADD board_service_discount INT DEFAULT NULL, ADD additional_services_discount INT DEFAULT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE accommodation_booking CHANGE accommodation_discount discount INT DEFAULT NULL, DROP board_service_discount, DROP additional_services_discount');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -114,8 +114,16 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
|||||||
private ?string $remarks = null;
|
private ?string $remarks = null;
|
||||||
|
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
#[Assert\Positive(message: 'invalid')]
|
#[Assert\Range(min: 1, max: 100)]
|
||||||
private ?int $discount = null;
|
private ?int $accommodationDiscount = null;
|
||||||
|
|
||||||
|
#[ORM\Column(nullable: true)]
|
||||||
|
#[Assert\Range(min: 1, max: 100)]
|
||||||
|
private ?int $boardServiceDiscount = null;
|
||||||
|
|
||||||
|
#[ORM\Column(nullable: true)]
|
||||||
|
#[Assert\Range(min: 1, max: 100)]
|
||||||
|
private ?int $additionalServicesDiscount = null;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -473,14 +481,38 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDiscount(): ?int
|
public function getAccommodationDiscount(): ?int
|
||||||
{
|
{
|
||||||
return $this->discount;
|
return $this->accommodationDiscount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDiscount(?int $discount): self
|
public function setAccommodationDiscount(?int $accommodationDiscount): self
|
||||||
{
|
{
|
||||||
$this->discount = $discount;
|
$this->accommodationDiscount = $accommodationDiscount;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBoardServiceDiscount(): ?int
|
||||||
|
{
|
||||||
|
return $this->boardServiceDiscount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setBoardServiceDiscount(?int $boardServiceDiscount): self
|
||||||
|
{
|
||||||
|
$this->boardServiceDiscount = $boardServiceDiscount;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAdditionalServicesDiscount(): ?int
|
||||||
|
{
|
||||||
|
return $this->additionalServicesDiscount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAdditionalServicesDiscount(?int $additionalServicesDiscount): self
|
||||||
|
{
|
||||||
|
$this->additionalServicesDiscount = $additionalServicesDiscount;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,8 +125,22 @@ class AccommodationBookingType extends AbstractType
|
|||||||
'label' => 'Anfrage (nicht bindend)',
|
'label' => 'Anfrage (nicht bindend)',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('discount', IntegerType::class, [
|
->add('accommodationDiscount', IntegerType::class, [
|
||||||
'label' => 'Rabatt (%)',
|
'label' => 'Rabatt Unterkunft (%)',
|
||||||
|
'required' => false,
|
||||||
|
'constraints' => [
|
||||||
|
new Range(min: 1, max: 100),
|
||||||
|
],
|
||||||
|
])
|
||||||
|
->add('boardServiceDiscount', IntegerType::class, [
|
||||||
|
'label' => 'Rabatt Verpflegung (%)',
|
||||||
|
'required' => false,
|
||||||
|
'constraints' => [
|
||||||
|
new Range(min: 1, max: 100),
|
||||||
|
],
|
||||||
|
])
|
||||||
|
->add('additionalServicesDiscount', IntegerType::class, [
|
||||||
|
'label' => 'Rabatt Zusatzleistungen (%)',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new Range(min: 1, max: 100),
|
new Range(min: 1, max: 100),
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class AdminMenuBuilder extends AbstractMenuBuilder
|
|||||||
'routes' => [['pattern' => '/^app_admin_bookingeditdraft/']],
|
'routes' => [['pattern' => '/^app_admin_bookingeditdraft/']],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$menu->addChild('Guppenbuchungen', [
|
$menu->addChild('Gruppenbuchungen', [
|
||||||
'route' => 'app_admin_accommodationbooking',
|
'route' => 'app_admin_accommodationbooking',
|
||||||
'linkAttributes' => [
|
'linkAttributes' => [
|
||||||
'title' => 'Buchungen',
|
'title' => 'Buchungen',
|
||||||
|
|||||||
@@ -59,7 +59,13 @@ final readonly class AccommodationBookingApiResponse
|
|||||||
public array $additionalServices;
|
public array $additionalServices;
|
||||||
|
|
||||||
#[Groups(['api:single'])]
|
#[Groups(['api:single'])]
|
||||||
public ?int $discount;
|
public ?int $accommodationDiscount;
|
||||||
|
|
||||||
|
#[Groups(['api:single'])]
|
||||||
|
public ?int $boardServiceDiscount;
|
||||||
|
|
||||||
|
#[Groups(['api:single'])]
|
||||||
|
public ?int $additionalServicesDiscount;
|
||||||
|
|
||||||
#[Groups(['api:single'])]
|
#[Groups(['api:single'])]
|
||||||
public ?int $totalPrice;
|
public ?int $totalPrice;
|
||||||
@@ -98,7 +104,9 @@ final readonly class AccommodationBookingApiResponse
|
|||||||
static fn (array $service) => new AccommodationBookingAdditionalServiceItem($service),
|
static fn (array $service) => new AccommodationBookingAdditionalServiceItem($service),
|
||||||
$booking->getAdditionalServices(),
|
$booking->getAdditionalServices(),
|
||||||
);
|
);
|
||||||
$this->discount = $booking->getDiscount();
|
$this->accommodationDiscount = $booking->getAccommodationDiscount();
|
||||||
|
$this->boardServiceDiscount = $booking->getBoardServiceDiscount();
|
||||||
|
$this->additionalServicesDiscount = $booking->getAdditionalServicesDiscount();
|
||||||
$this->totalPrice = $booking->getTotalPrice();
|
$this->totalPrice = $booking->getTotalPrice();
|
||||||
$this->pricingCurrency = $booking->getPricingCurrency();
|
$this->pricingCurrency = $booking->getPricingCurrency();
|
||||||
$this->pricingVersion = $booking->getPricingVersion();
|
$this->pricingVersion = $booking->getPricingVersion();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ final readonly class AccommodationBookingContext
|
|||||||
* @param array<string, AdditionalService[]> $groupedAdditionalServices
|
* @param array<string, AdditionalService[]> $groupedAdditionalServices
|
||||||
* @param AdditionalService[] $ungroupedAdditionalServices
|
* @param AdditionalService[] $ungroupedAdditionalServices
|
||||||
* @param array<string, mixed>|null $priceBreakdown
|
* @param array<string, mixed>|null $priceBreakdown
|
||||||
* @param array<string, mixed>|null $hotelCmsData
|
* @param array<string, mixed>|null $hotelCmsData see {@see \App\Service\CmsDataProvider::getHotelDetails()} for the shape
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public Accommodation $accommodation,
|
public Accommodation $accommodation,
|
||||||
|
|||||||
@@ -101,9 +101,12 @@ class AccommodationBookingService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches hotel name, image, and address from the CMS for display in the sidebar.
|
* Fetches hotel details from the CMS for display in the booking flow — name, images,
|
||||||
|
* address, descriptive text blocks, amenity icons, and the surrounding region's info
|
||||||
|
* (name, coordinates, webcam, ski area text, stats, images).
|
||||||
*
|
*
|
||||||
* @return array<string, mixed>|null null on CMS error or missing code
|
* @return array<string, mixed>|null null on CMS error or missing code, see
|
||||||
|
* {@see CmsDataProvider::getHotelDetails()} for the shape
|
||||||
*/
|
*/
|
||||||
public function loadHotelCmsData(Accommodation $accommodation): ?array
|
public function loadHotelCmsData(Accommodation $accommodation): ?array
|
||||||
{
|
{
|
||||||
@@ -320,10 +323,14 @@ class AccommodationBookingService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$total = (int) ($breakdown['total'] ?? 0);
|
$accommodationBase = (int) ($breakdown['basePrice'] ?? 0) + (int) ($breakdown['additionalPersonsPrice'] ?? 0);
|
||||||
if (null !== $booking->getDiscount()) {
|
$boardBase = (int) ($breakdown['boardPrice'] ?? 0);
|
||||||
$total -= (int) round($total * $booking->getDiscount() / 100);
|
$servicesBase = (int) ($breakdown['servicesPrice'] ?? 0);
|
||||||
}
|
|
||||||
|
$total = (int) ($breakdown['total'] ?? 0)
|
||||||
|
- $this->discountAmount($accommodationBase, $booking->getAccommodationDiscount())
|
||||||
|
- $this->discountAmount($boardBase, $booking->getBoardServiceDiscount())
|
||||||
|
- $this->discountAmount($servicesBase, $booking->getAdditionalServicesDiscount());
|
||||||
|
|
||||||
$booking->setPriceSnapshot(
|
$booking->setPriceSnapshot(
|
||||||
$breakdown,
|
$breakdown,
|
||||||
@@ -333,6 +340,11 @@ class AccommodationBookingService
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function discountAmount(int $base, ?int $percent): int
|
||||||
|
{
|
||||||
|
return null !== $percent ? (int) round($base * $percent / 100) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
public function sendNotificationEmail(AccommodationBooking $booking): void
|
public function sendNotificationEmail(AccommodationBooking $booking): void
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -202,8 +202,6 @@ class BpnXmlAnonymizer
|
|||||||
$title = '';
|
$title = '';
|
||||||
$gender = 'D';
|
$gender = 'D';
|
||||||
$nationality = 'XX';
|
$nationality = 'XX';
|
||||||
$birthDate = '01.01.1980';
|
|
||||||
|
|
||||||
$street = sprintf('%s %s', $this->faker->streetName(), $this->faker->buildingNumber());
|
$street = sprintf('%s %s', $this->faker->streetName(), $this->faker->buildingNumber());
|
||||||
$postalCode = $this->faker->postcode();
|
$postalCode = $this->faker->postcode();
|
||||||
$city = $this->faker->city();
|
$city = $this->faker->city();
|
||||||
@@ -232,7 +230,6 @@ class BpnXmlAnonymizer
|
|||||||
'title' => $title,
|
'title' => $title,
|
||||||
'gender' => $gender,
|
'gender' => $gender,
|
||||||
'nationality' => $nationality,
|
'nationality' => $nationality,
|
||||||
'birthDate' => $birthDate,
|
|
||||||
'street' => $street,
|
'street' => $street,
|
||||||
'postalCode' => $postalCode,
|
'postalCode' => $postalCode,
|
||||||
'city' => $city,
|
'city' => $city,
|
||||||
@@ -389,11 +386,6 @@ class BpnXmlAnonymizer
|
|||||||
$this->replaceNodeValue($nationalityNode, $identity['nationality']);
|
$this->replaceNodeValue($nationalityNode, $identity['nationality']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$birthDateNode = $this->getDirectChild($personNode, 'geburtsdatum');
|
|
||||||
if (null !== $birthDateNode) {
|
|
||||||
$this->replaceNodeValue($birthDateNode, $identity['birthDate']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$heightNode = $this->getDirectChild($personNode, 'sonstiges1');
|
$heightNode = $this->getDirectChild($personNode, 'sonstiges1');
|
||||||
if (null !== $heightNode) {
|
if (null !== $heightNode) {
|
||||||
$this->replaceNodeValue($heightNode, $identity['height']);
|
$this->replaceNodeValue($heightNode, $identity['height']);
|
||||||
|
|||||||
@@ -46,7 +46,35 @@ class CmsDataProvider
|
|||||||
return $result['images'] ?? null;
|
return $result['images'] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return array<string, mixed> */
|
/**
|
||||||
|
* @return array{
|
||||||
|
* success?: bool,
|
||||||
|
* message?: string,
|
||||||
|
* name?: string,
|
||||||
|
* address?: string,
|
||||||
|
* description?: string,
|
||||||
|
* features?: string,
|
||||||
|
* roomTypes?: string,
|
||||||
|
* additionalInformation?: string,
|
||||||
|
* images?: array<string, mixed>,
|
||||||
|
* icons?: array<string, bool|string>,
|
||||||
|
* region?: array{
|
||||||
|
* name: string,
|
||||||
|
* latitude: float,
|
||||||
|
* longitude: float,
|
||||||
|
* webcam: string,
|
||||||
|
* ski_area: string,
|
||||||
|
* ski_area_extended: string,
|
||||||
|
* description: string,
|
||||||
|
* news: string,
|
||||||
|
* length: int,
|
||||||
|
* altitude: int,
|
||||||
|
* lifts: int,
|
||||||
|
* images: array<string, mixed>,
|
||||||
|
* region_maps: list<string>,
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public function getHotelDetails(string $hotelCode): array
|
public function getHotelDetails(string $hotelCode): array
|
||||||
{
|
{
|
||||||
return $this->cache->get(
|
return $this->cache->get(
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class AppExtension extends AbstractExtension
|
|||||||
new TwigFilter('map_status', [AppRuntime::class, 'mapStatus']),
|
new TwigFilter('map_status', [AppRuntime::class, 'mapStatus']),
|
||||||
new TwigFilter('map_country', [AppRuntime::class, 'mapCountry']),
|
new TwigFilter('map_country', [AppRuntime::class, 'mapCountry']),
|
||||||
new TwigFilter('map_nationality', [AppRuntime::class, 'mapNationality']),
|
new TwigFilter('map_nationality', [AppRuntime::class, 'mapNationality']),
|
||||||
|
new TwigFilter('visible_cms_icons', [AppRuntime::class, 'visibleCmsIcons']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,44 @@ class AppRuntime implements RuntimeExtensionInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Normalizes a CMS "icons" map (identifier => bool|string|int) into the visible entries only.
|
||||||
|
*
|
||||||
|
* A value either toggles visibility (bool), makes the icon visible and overrides its
|
||||||
|
* default (humanized) label (non-empty string), or makes the icon visible with the
|
||||||
|
* number itself as the label to display next to the icon (non-zero int, e.g. bed_count).
|
||||||
|
*
|
||||||
|
* @param array<string, mixed>|null $icons
|
||||||
|
*
|
||||||
|
* @return list<array{key: string, label: string}>
|
||||||
|
*/
|
||||||
|
public function visibleCmsIcons(?array $icons): array
|
||||||
|
{
|
||||||
|
if (null === $icons) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = [];
|
||||||
|
foreach ($icons as $key => $value) {
|
||||||
|
if (false === $value || null === $value || '' === $value || 0 === $value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$label = match (true) {
|
||||||
|
is_int($value) => (string) $value,
|
||||||
|
is_string($value) => $value,
|
||||||
|
default => ucfirst(str_replace(['_', '-'], ' ', $key)),
|
||||||
|
};
|
||||||
|
|
||||||
|
$result[] = [
|
||||||
|
'key' => $key,
|
||||||
|
'label' => $label,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a form field should be rendered as static text.
|
* Checks if a form field should be rendered as static text.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -33,7 +33,9 @@
|
|||||||
<div class="lg:col-span-2">
|
<div class="lg:col-span-2">
|
||||||
{{ form_row(form.isInquiry) }}
|
{{ form_row(form.isInquiry) }}
|
||||||
</div>
|
</div>
|
||||||
{{ form_row(form.discount) }}
|
{{ form_row(form.accommodationDiscount) }}
|
||||||
|
{{ form_row(form.boardServiceDiscount) }}
|
||||||
|
{{ form_row(form.additionalServicesDiscount) }}
|
||||||
<div class="lg:col-span-2">
|
<div class="lg:col-span-2">
|
||||||
{{ form_row(form.remarks) }}
|
{{ form_row(form.remarks) }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -47,7 +47,9 @@
|
|||||||
Angenommen am {{ booking.acceptedAt | date('d.m.Y, H:i') }}
|
Angenommen am {{ booking.acceptedAt | date('d.m.Y, H:i') }}
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_row(form.discount) }}
|
{{ form_row(form.accommodationDiscount) }}
|
||||||
|
{{ form_row(form.boardServiceDiscount) }}
|
||||||
|
{{ form_row(form.additionalServicesDiscount) }}
|
||||||
<div class="lg:col-span-2">
|
<div class="lg:col-span-2">
|
||||||
{{ form_row(form.remarks) }}
|
{{ form_row(form.remarks) }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -57,11 +57,17 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if booking.discount is not null %}
|
{% set discounts = [] %}
|
||||||
{{ booking.discount }} %
|
{% if booking.accommodationDiscount is not null %}
|
||||||
{% else %}
|
{% set discounts = discounts | merge(['Unterkunft ' ~ booking.accommodationDiscount ~ '%']) %}
|
||||||
–
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if booking.boardServiceDiscount is not null %}
|
||||||
|
{% set discounts = discounts | merge(['Verpflegung ' ~ booking.boardServiceDiscount ~ '%']) %}
|
||||||
|
{% endif %}
|
||||||
|
{% if booking.additionalServicesDiscount is not null %}
|
||||||
|
{% set discounts = discounts | merge(['Zusatzleistungen ' ~ booking.additionalServicesDiscount ~ '%']) %}
|
||||||
|
{% endif %}
|
||||||
|
{{ discounts | length > 0 ? (discounts | join(', ')) : '–' }}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<twig:dropdown>
|
<twig:dropdown>
|
||||||
|
|||||||
@@ -140,16 +140,31 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="pt-2 text-right whitespace-nowrap">{{ (priceBreakdown.total / 100) | format_currency(currency) }}</td>
|
<td class="pt-2 text-right whitespace-nowrap">{{ (priceBreakdown.total / 100) | format_currency(currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if booking.discount is not null %}
|
{% if booking.accommodationDiscount is not null or booking.boardServiceDiscount is not null or booking.additionalServicesDiscount is not null %}
|
||||||
{% set discountAmount = (priceBreakdown.total * booking.discount / 100) | round | number_format(0, '.', '') %}
|
{% if booking.accommodationDiscount is not null %}
|
||||||
{% set discountedTotal = booking.totalPrice ?? (priceBreakdown.total - discountAmount) %}
|
{% set accommodationDiscountAmount = ((priceBreakdown.basePrice + priceBreakdown.additionalPersonsPrice) * booking.accommodationDiscount / 100) | round %}
|
||||||
<tr class="text-green-700">
|
<tr class="text-green-700">
|
||||||
<td class="pt-1">Rabatt {{ booking.discount }} %</td>
|
<td class="pt-1">Rabatt Unterkunft {{ booking.accommodationDiscount }} %</td>
|
||||||
<td class="pt-1 text-right whitespace-nowrap">– {{ (discountAmount / 100) | format_currency(currency) }}</td>
|
<td class="pt-1 text-right whitespace-nowrap">– {{ (accommodationDiscountAmount / 100) | format_currency(currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% if booking.boardServiceDiscount is not null %}
|
||||||
|
{% set boardDiscountAmount = (priceBreakdown.boardPrice * booking.boardServiceDiscount / 100) | round %}
|
||||||
|
<tr class="text-green-700">
|
||||||
|
<td class="pt-1">Rabatt Verpflegung {{ booking.boardServiceDiscount }} %</td>
|
||||||
|
<td class="pt-1 text-right whitespace-nowrap">– {{ (boardDiscountAmount / 100) | format_currency(currency) }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% if booking.additionalServicesDiscount is not null %}
|
||||||
|
{% set servicesDiscountAmount = (priceBreakdown.servicesPrice * booking.additionalServicesDiscount / 100) | round %}
|
||||||
|
<tr class="text-green-700">
|
||||||
|
<td class="pt-1">Rabatt Zusatzleistungen {{ booking.additionalServicesDiscount }} %</td>
|
||||||
|
<td class="pt-1 text-right whitespace-nowrap">– {{ (servicesDiscountAmount / 100) | format_currency(currency) }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr class="border-t border-gray-200 font-bold text-green-700">
|
<tr class="border-t border-gray-200 font-bold text-green-700">
|
||||||
<td class="pt-2">Gesamtpreis nach Rabatt</td>
|
<td class="pt-2">Gesamtpreis nach Rabatt</td>
|
||||||
<td class="pt-2 text-right whitespace-nowrap">{{ (discountedTotal / 100) | format_currency(currency) }}</td>
|
<td class="pt-2 text-right whitespace-nowrap">{{ ((booking.totalPrice ?? priceBreakdown.total) / 100) | format_currency(currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -150,19 +150,55 @@
|
|||||||
{{ (ctx.priceBreakdown.total / 100)|format_currency(currency) }}
|
{{ (ctx.priceBreakdown.total / 100)|format_currency(currency) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if booking.discount is not null %}
|
{% if booking.accommodationDiscount is not null or booking.boardServiceDiscount is not null or booking.additionalServicesDiscount is not null %}
|
||||||
<tr class="text-green-700">
|
{% if booking.accommodationDiscount is not null %}
|
||||||
<td class="p-2">Rabatt {{ booking.discount }} %</td>
|
{% set accommodationDiscountAmount = ((ctx.priceBreakdown.basePrice + ctx.priceBreakdown.additionalPersonsPrice) * booking.accommodationDiscount / 100) | round %}
|
||||||
<td class="p-2 text-right whitespace-nowrap">– {{ (discountAmount / 100)|format_currency(currency) }}</td>
|
<tr class="text-green-700">
|
||||||
</tr>
|
<td class="p-2">Rabatt Unterkunft {{ booking.accommodationDiscount }} %</td>
|
||||||
|
<td class="p-2 text-right whitespace-nowrap">– {{ (accommodationDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% if booking.boardServiceDiscount is not null %}
|
||||||
|
{% set boardDiscountAmount = (ctx.priceBreakdown.boardPrice * booking.boardServiceDiscount / 100) | round %}
|
||||||
|
<tr class="text-green-700">
|
||||||
|
<td class="p-2">Rabatt Verpflegung {{ booking.boardServiceDiscount }} %</td>
|
||||||
|
<td class="p-2 text-right whitespace-nowrap">– {{ (boardDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% if booking.additionalServicesDiscount is not null %}
|
||||||
|
{% set servicesDiscountAmount = (ctx.priceBreakdown.servicesPrice * booking.additionalServicesDiscount / 100) | round %}
|
||||||
|
<tr class="text-green-700">
|
||||||
|
<td class="p-2">Rabatt Zusatzleistungen {{ booking.additionalServicesDiscount }} %</td>
|
||||||
|
<td class="p-2 text-right whitespace-nowrap">– {{ (servicesDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr class="border-t border-primary-bg font-bold text-base text-green-700">
|
<tr class="border-t border-primary-bg font-bold text-base text-green-700">
|
||||||
<td class="p-2">Gesamtpreis nach Rabatt</td>
|
<td class="p-2">Gesamtpreis nach Rabatt</td>
|
||||||
<td class="p-2 text-right whitespace-nowrap">{{ (discountedTotal / 100)|format_currency(currency) }}</td>
|
<td class="p-2 text-right whitespace-nowrap">{{ ((booking.totalPrice ?? ctx.priceBreakdown.total) / 100)|format_currency(currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{# Footer: booking action / accepted-at status #}
|
||||||
|
{% if booking.inquiry %}
|
||||||
|
<div class="shrink-0 px-4 lg:px-8 py-4 border-t border-primary-bg">
|
||||||
|
<button type="button"
|
||||||
|
class="button button--primary w-full"
|
||||||
|
hx-get="{{ path('app_groups_booking_offer_confirm', { uuid: booking.uuid }) }}"
|
||||||
|
hx-target="body"
|
||||||
|
hx-swap="beforeend">
|
||||||
|
Angebot verbindlich buchen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{% elseif booking.acceptedAt is not null %}
|
||||||
|
<div class="shrink-0 px-4 lg:px-8 py-4 border-t border-primary-bg">
|
||||||
|
<p class="text-gray-500">
|
||||||
|
Angenommen am {{ booking.acceptedAt | date('d.m.Y') }} um {{ booking.acceptedAt | date('H:i') }} Uhr
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -6,11 +6,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% set currency = booking.pricingCurrency ?? priceBreakdown.currency %}
|
{% set currency = booking.pricingCurrency ?? priceBreakdown.currency %}
|
||||||
{% if booking.discount is not null and priceBreakdown is not null %}
|
{% set displayTotal = booking.totalPrice ?? (priceBreakdown.total ?? null) %}
|
||||||
{% set discountAmount = (priceBreakdown.total * booking.discount / 100) | round | number_format(0, '.', '') %}
|
|
||||||
{% set discountedTotal = booking.totalPrice ?? (priceBreakdown.total - discountAmount) %}
|
|
||||||
{% endif %}
|
|
||||||
{% set displayTotal = discountedTotal ?? (priceBreakdown.total ?? null) %}
|
|
||||||
|
|
||||||
<div class="flex-1 flex flex-col lg:grid lg:grid-cols-5 min-h-0 relative">
|
<div class="flex-1 flex flex-col lg:grid lg:grid-cols-5 min-h-0 relative">
|
||||||
|
|
||||||
@@ -23,8 +19,6 @@
|
|||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
currency: currency,
|
currency: currency,
|
||||||
displayTotal: displayTotal,
|
displayTotal: displayTotal,
|
||||||
discountAmount: discountAmount ?? null,
|
|
||||||
discountedTotal: discountedTotal ?? null,
|
|
||||||
} %}
|
} %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -94,9 +88,89 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% set visibleIcons = (ctx.hotelCmsData.icons ?? null) | visible_cms_icons %}
|
||||||
|
{% if visibleIcons is not empty %}
|
||||||
|
<ul class="grid grid-cols-2 md:grid-cols-3 gap-2 mt-6 text-sm text-gray-600">
|
||||||
|
{% for item in visibleIcons %}
|
||||||
|
<li class="flex items-center gap-2">
|
||||||
|
{{ icon(item.key, 'w-5 h-5 shrink-0') }}
|
||||||
|
{{ item.label }}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# TODO: additional hotel and location information fetched from the CMS #}
|
{% if ctx.hotelCmsData is not null and ctx.hotelCmsData.region is defined %}
|
||||||
|
{% set region = ctx.hotelCmsData.region %}
|
||||||
|
<div class="rte-content mt-8">
|
||||||
|
<h2>Die Region {{ region.name }}</h2>
|
||||||
|
{% if region.altitude or region.length or region.lifts %}
|
||||||
|
<ul class="flex flex-wrap gap-x-6 text-sm not-prose">
|
||||||
|
{% if region.altitude %}
|
||||||
|
<li>{{ region.altitude }} m Höhe</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if region.length %}
|
||||||
|
<li>{{ region.length }} km Pisten</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if region.lifts %}
|
||||||
|
<li>{{ region.lifts }} Lifte</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
{% if region.webcam %}
|
||||||
|
<p>
|
||||||
|
<a href="{{ region.webcam }}" target="_blank" rel="noopener">Webcam der Region</a>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
{{ region.description | default('') | raw }}
|
||||||
|
<h2>Skigebiet</h2>
|
||||||
|
{{ region.ski_area | default('') | raw }}
|
||||||
|
{{ region.ski_area_extended | default('') | raw }}
|
||||||
|
{% if region.news %}
|
||||||
|
<h2>Aktuelles aus der Region</h2>
|
||||||
|
{{ region.news | raw }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% if region.region_maps is defined and region.region_maps | length > 0 %}
|
||||||
|
<div class="grid md:grid-cols-2 gap-8 mt-6" {{ stimulus_controller('gallery') }}>
|
||||||
|
{% for mapUrl in region.region_maps %}
|
||||||
|
<div class="relative block w-full h-auto cursor-pointer{{ loop.index0 >= 2 ? ' hidden' : '' }}"
|
||||||
|
data-gallery-target="item"
|
||||||
|
data-gallery-href="{{ mapUrl }}"
|
||||||
|
data-gallery-alt="{{ region.name }}">
|
||||||
|
<img src="{{ mapUrl }}" alt="{{ region.name }}" class="block w-full h-auto">
|
||||||
|
{% if loop.index0 == 1 and region.region_maps | length > 2 %}
|
||||||
|
<div class="absolute inset-0 bg-black/50 flex items-center justify-center text-white font-bold text-lg">
|
||||||
|
+{{ region.region_maps | length - 2 }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% set regionLargeImages = region.images.resized.l ?? [] %}
|
||||||
|
{% set regionMediumImages = region.images.resized.m ?? [] %}
|
||||||
|
{% if regionLargeImages | length > 0 %}
|
||||||
|
<div class="grid md:grid-cols-2 gap-8 mt-6" {{ stimulus_controller('gallery') }}>
|
||||||
|
{% for image in regionLargeImages %}
|
||||||
|
<div class="relative block w-full h-auto cursor-pointer{{ loop.index0 >= 2 ? ' hidden' : '' }}"
|
||||||
|
data-gallery-target="item"
|
||||||
|
data-gallery-href="{{ image.url }}"
|
||||||
|
data-gallery-alt="{{ image.alt ?? region.name }}">
|
||||||
|
<img src="{{ regionMediumImages[loop.index0].url ?? image.url }}"
|
||||||
|
alt="{{ image.alt ?? region.name }}"
|
||||||
|
class="block w-full h-auto">
|
||||||
|
{% if loop.index0 == 1 and regionLargeImages | length > 2 %}
|
||||||
|
<div class="absolute inset-0 bg-black/50 flex items-center justify-center text-white font-bold text-lg">
|
||||||
|
+{{ regionLargeImages | length - 2 }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if booking.remarks %}
|
{% if booking.remarks %}
|
||||||
<div class="mb-8">
|
<div class="mb-8">
|
||||||
@@ -104,24 +178,6 @@
|
|||||||
<p class="text-sm">{{ booking.remarks | nl2br }}</p>
|
<p class="text-sm">{{ booking.remarks | nl2br }}</p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if booking.inquiry %}
|
|
||||||
<div>
|
|
||||||
<button type="button"
|
|
||||||
class="button button--primary"
|
|
||||||
hx-get="{{ path('app_groups_booking_offer_confirm', { uuid: booking.uuid }) }}"
|
|
||||||
hx-target="body"
|
|
||||||
hx-swap="beforeend">
|
|
||||||
Angebot verbindlich buchen
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{% if booking.acceptedAt is not null %}
|
|
||||||
<p class="text-sm text-gray-500">
|
|
||||||
Angenommen am {{ booking.acceptedAt | date('d.m.Y') }} um {{ booking.acceptedAt | date('H:i') }} Uhr
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ class AccommodationBookingControllerTest extends TestCase
|
|||||||
$booking->setBoardServiceLabel('Halbpension');
|
$booking->setBoardServiceLabel('Halbpension');
|
||||||
$booking->setBoardServicePrice(1500);
|
$booking->setBoardServicePrice(1500);
|
||||||
$booking->addAdditionalServiceSnapshot('Bettwäsche', 500, 'flat', 3);
|
$booking->addAdditionalServiceSnapshot('Bettwäsche', 500, 'flat', 3);
|
||||||
$booking->setDiscount(10);
|
$booking->setAccommodationDiscount(10);
|
||||||
|
$booking->setBoardServiceDiscount(20);
|
||||||
|
$booking->setAdditionalServicesDiscount(30);
|
||||||
$booking->setIsInquiry(false);
|
$booking->setIsInquiry(false);
|
||||||
$booking->setAcceptedAt(new \DateTimeImmutable('2026-07-15T10:00:00+00:00'));
|
$booking->setAcceptedAt(new \DateTimeImmutable('2026-07-15T10:00:00+00:00'));
|
||||||
|
|
||||||
@@ -117,7 +119,9 @@ class AccommodationBookingControllerTest extends TestCase
|
|||||||
'type' => 'flat',
|
'type' => 'flat',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'discount' => 10,
|
'accommodationDiscount' => 10,
|
||||||
|
'boardServiceDiscount' => 20,
|
||||||
|
'additionalServicesDiscount' => 30,
|
||||||
'totalPrice' => 11111,
|
'totalPrice' => 11111,
|
||||||
'pricingCurrency' => 'EUR',
|
'pricingCurrency' => 'EUR',
|
||||||
'pricingVersion' => 1,
|
'pricingVersion' => 1,
|
||||||
|
|||||||
@@ -237,20 +237,32 @@ class AccommodationBookingServiceTest extends TestCase
|
|||||||
public function testRefreshPriceSnapshotStoresDiscountedFinalTotal(): void
|
public function testRefreshPriceSnapshotStoresDiscountedFinalTotal(): void
|
||||||
{
|
{
|
||||||
$booking = new AccommodationBooking();
|
$booking = new AccommodationBooking();
|
||||||
$booking->setDiscount(10);
|
$booking->setAccommodationDiscount(10);
|
||||||
|
$booking->setBoardServiceDiscount(20);
|
||||||
|
$booking->setAdditionalServicesDiscount(50);
|
||||||
|
|
||||||
|
$breakdown = [
|
||||||
|
'total' => 12345,
|
||||||
|
'currency' => 'CHF',
|
||||||
|
'basePrice' => 8000,
|
||||||
|
'additionalPersonsPrice' => 2000,
|
||||||
|
'boardPrice' => 1000,
|
||||||
|
'servicesPrice' => 500,
|
||||||
|
];
|
||||||
|
|
||||||
$breakdownCalculator = $this->createMock(AccommodationBookingBreakdownCalculator::class);
|
$breakdownCalculator = $this->createMock(AccommodationBookingBreakdownCalculator::class);
|
||||||
$breakdownCalculator
|
$breakdownCalculator
|
||||||
->expects(self::once())
|
->expects(self::once())
|
||||||
->method('computeCurrent')
|
->method('computeCurrent')
|
||||||
->with($booking)
|
->with($booking)
|
||||||
->willReturn(['total' => 12345, 'currency' => 'CHF']);
|
->willReturn($breakdown);
|
||||||
|
|
||||||
$service = $this->createServiceWithAccommodation(breakdownCalculator: $breakdownCalculator);
|
$service = $this->createServiceWithAccommodation(breakdownCalculator: $breakdownCalculator);
|
||||||
$service->refreshPriceSnapshot($booking);
|
$service->refreshPriceSnapshot($booking);
|
||||||
|
|
||||||
self::assertSame(['total' => 12345, 'currency' => 'CHF'], $booking->getPriceBreakdown());
|
// accommodation: (8000+2000)*10% = 1000, board: 1000*20% = 200, services: 500*50% = 250
|
||||||
self::assertSame(11110, $booking->getTotalPrice());
|
self::assertSame($breakdown, $booking->getPriceBreakdown());
|
||||||
|
self::assertSame(12345 - 1000 - 200 - 250, $booking->getTotalPrice());
|
||||||
self::assertSame('CHF', $booking->getPricingCurrency());
|
self::assertSame('CHF', $booking->getPricingCurrency());
|
||||||
self::assertSame(1, $booking->getPricingVersion());
|
self::assertSame(1, $booking->getPricingVersion());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class BpnXmlAnonymizerTest extends TestCase
|
|||||||
<anmelder>
|
<anmelder>
|
||||||
<name>Example</name>
|
<name>Example</name>
|
||||||
<vorname>Ava</vorname>
|
<vorname>Ava</vorname>
|
||||||
|
<geburtsdatum>03.04.1991</geburtsdatum>
|
||||||
<anschrift>
|
<anschrift>
|
||||||
<strasse>Testallee 7</strasse>
|
<strasse>Testallee 7</strasse>
|
||||||
<plz>10115</plz>
|
<plz>10115</plz>
|
||||||
@@ -32,6 +33,7 @@ class BpnXmlAnonymizerTest extends TestCase
|
|||||||
<teilnehmer id="1">
|
<teilnehmer id="1">
|
||||||
<name>Example</name>
|
<name>Example</name>
|
||||||
<vorname>Ava</vorname>
|
<vorname>Ava</vorname>
|
||||||
|
<geburtsdatum>03.04.1991</geburtsdatum>
|
||||||
<anschrift>
|
<anschrift>
|
||||||
<strasse>Testallee 7</strasse>
|
<strasse>Testallee 7</strasse>
|
||||||
<plz>10115</plz>
|
<plz>10115</plz>
|
||||||
@@ -46,6 +48,7 @@ class BpnXmlAnonymizerTest extends TestCase
|
|||||||
<teilnehmer id="2">
|
<teilnehmer id="2">
|
||||||
<name>Second</name>
|
<name>Second</name>
|
||||||
<vorname>Ben</vorname>
|
<vorname>Ben</vorname>
|
||||||
|
<geburtsdatum>12.11.1987</geburtsdatum>
|
||||||
<kommunikation>
|
<kommunikation>
|
||||||
<email>[email protected]</email>
|
<email>[email protected]</email>
|
||||||
</kommunikation>
|
</kommunikation>
|
||||||
@@ -69,6 +72,9 @@ XML;
|
|||||||
$applicantMobilePhone = trim((string) $xpath->evaluate('string(//anmelder/kommunikation/telefonmobil)'));
|
$applicantMobilePhone = trim((string) $xpath->evaluate('string(//anmelder/kommunikation/telefonmobil)'));
|
||||||
$participantOneMobilePhone = trim((string) $xpath->evaluate('string(//teilnehmer[1]/kommunikation/telefonmobil)'));
|
$participantOneMobilePhone = trim((string) $xpath->evaluate('string(//teilnehmer[1]/kommunikation/telefonmobil)'));
|
||||||
$participantTwoName = trim((string) $xpath->evaluate('string(//teilnehmer[2]/name)'));
|
$participantTwoName = trim((string) $xpath->evaluate('string(//teilnehmer[2]/name)'));
|
||||||
|
$applicantBirthDate = trim((string) $xpath->evaluate('string(//anmelder/geburtsdatum)'));
|
||||||
|
$participantOneBirthDate = trim((string) $xpath->evaluate('string(//teilnehmer[1]/geburtsdatum)'));
|
||||||
|
$participantTwoBirthDate = trim((string) $xpath->evaluate('string(//teilnehmer[2]/geburtsdatum)'));
|
||||||
|
|
||||||
$this->assertNotSame('Example', $applicantName);
|
$this->assertNotSame('Example', $applicantName);
|
||||||
$this->assertSame($applicantName, $participantOneName);
|
$this->assertSame($applicantName, $participantOneName);
|
||||||
@@ -76,6 +82,9 @@ XML;
|
|||||||
$this->assertSame('01000000002', $participantOneMobilePhone);
|
$this->assertSame('01000000002', $participantOneMobilePhone);
|
||||||
$this->assertSame($applicantMobilePhone, $participantOneMobilePhone);
|
$this->assertSame($applicantMobilePhone, $participantOneMobilePhone);
|
||||||
$this->assertNotSame($participantOneName, $participantTwoName);
|
$this->assertNotSame($participantOneName, $participantTwoName);
|
||||||
|
$this->assertSame('03.04.1991', $applicantBirthDate);
|
||||||
|
$this->assertSame('03.04.1991', $participantOneBirthDate);
|
||||||
|
$this->assertSame('12.11.1987', $participantTwoBirthDate);
|
||||||
$this->assertSame(3, $anonymizer->getLastIdentityCount());
|
$this->assertSame(3, $anonymizer->getLastIdentityCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +190,7 @@ XML;
|
|||||||
$this->assertSame('Divers', $responseSalutation);
|
$this->assertSame('Divers', $responseSalutation);
|
||||||
$this->assertSame('', $responseTitle);
|
$this->assertSame('', $responseTitle);
|
||||||
$this->assertSame('D', $responseGender);
|
$this->assertSame('D', $responseGender);
|
||||||
$this->assertSame('01.01.1980', $responseBirthDate);
|
$this->assertSame('16.04.1972', $responseBirthDate);
|
||||||
$this->assertSame('XX', $responseNationality);
|
$this->assertSame('XX', $responseNationality);
|
||||||
$this->assertNotSame('Beispielweg 57', $responseStreet);
|
$this->assertNotSame('Beispielweg 57', $responseStreet);
|
||||||
$this->assertNotSame('42853', $responsePostalCode);
|
$this->assertNotSame('42853', $responsePostalCode);
|
||||||
@@ -501,7 +510,7 @@ XML;
|
|||||||
$this->assertSame('Divers', $salutation);
|
$this->assertSame('Divers', $salutation);
|
||||||
$this->assertSame('', $title);
|
$this->assertSame('', $title);
|
||||||
$this->assertSame('D', $gender);
|
$this->assertSame('D', $gender);
|
||||||
$this->assertSame('01.01.1980', $birthDate);
|
$this->assertSame('01.02.1990', $birthDate);
|
||||||
$this->assertSame('XX', $nationality);
|
$this->assertSame('XX', $nationality);
|
||||||
$this->assertNotSame('Beispielweg 12', $street);
|
$this->assertNotSame('Beispielweg 12', $street);
|
||||||
$this->assertNotSame('12345', $postalCode);
|
$this->assertNotSame('12345', $postalCode);
|
||||||
|
|||||||
Reference in new issue
Block a user