feat: multiple hotelcodes assignable to users

This commit is contained in:
Björn Fromme
2025-01-08 10:07:19 +01:00
parent 5a07d95837
commit c15188c43c
16 changed files with 256 additions and 67 deletions
+4 -4
View File
@@ -142,7 +142,7 @@ class ResponseParser
{
$groups = [];
$isAdmin = $isManager = $isHouseManager = $isTeamer = false;
$hotelCode = null;
$hotelCodes = [];
foreach ($xml->selektionsmerkmale->selektionsgruppe as $item) {
$group = new CrmAttributeGroup();
@@ -164,7 +164,7 @@ class ResponseParser
if (1 === preg_match('/^Hausleitung ([A-Z0-9]+)$/', $attributeLabel, $matches) && true === $attribute->isSelected()) {
$isHouseManager = true;
$hotelCode = $matches[1];
$hotelCodes[] = $matches[1];
}
if ($this->config['bpn_crm_id_admin'] === $attribute->getId() && true === $attribute->isSelected()) {
$isAdmin = true;
@@ -183,7 +183,7 @@ class ResponseParser
// Apply additional role and hotel code for testing purposes when provided
if ($isAdmin && null !== $this->config['bpn_default_hotel_code']) {
$isHouseManager = true;
$hotelCode = $this->config['bpn_default_hotel_code'];
$hotelCodes[] = $this->config['bpn_default_hotel_code'];
}
$response = new CrmAttributesResponse();
@@ -193,7 +193,7 @@ class ResponseParser
->setManager($isManager)
->setTeamer($isTeamer)
->setHouseManager($isHouseManager)
->setHotelCode($hotelCode)
->setHotelCodes($hotelCodes)
;
return $response;