feat: additional role 'customer expert'

This commit is contained in:
2026-09-15 15:00:59 +02:00
parent 042037867b
commit 1d14f00bb7
5 changed files with 58 additions and 19 deletions
@@ -26,11 +26,21 @@ class CrmAttributesResponseParser
{
use TypeConversionTrait;
private const BPN_CRM_ID_ADMIN = 1292;
private const BPN_CRM_ID_MANAGER = 1293;
private const BPN_CRM_ID_TEAMER = 1070;
private const BPN_CRM_ID_GROUPS_MANAGER = 1477;
private const BPN_CRM_ID_GROUPS_ADMIN = 1478;
/**
* The CRM selections that stand for a role, by selection id. "Hausleitung" is deliberately not
* in here: its ids are deployment configuration (see $houseManagerIds) and carry a hotel code
* on top of the role.
*
* @var array<int, string> selection id => role
*/
private const ROLE_BY_CRM_ID = [
1070 => Role::TEAMER,
1292 => Role::ADMIN,
1293 => Role::MANAGER,
1477 => Role::GROUPS_MANAGER,
1478 => Role::GROUPS_ADMIN,
1483 => Role::CUSTOMER_EXPERT,
];
/**
* @param array<int|string, string> $houseManagerIds "Hausleitung" selection id => hotel code
@@ -71,20 +81,11 @@ class CrmAttributesResponseParser
$roles[] = Role::HOUSE_MANAGER;
$hotelCodes[] = $hotelCode;
}
if (self::BPN_CRM_ID_ADMIN === $attribute->id) {
$roles[] = Role::ADMIN;
}
if (self::BPN_CRM_ID_MANAGER === $attribute->id) {
$roles[] = Role::MANAGER;
}
if (self::BPN_CRM_ID_TEAMER === $attribute->id) {
$roles[] = Role::TEAMER;
}
if (self::BPN_CRM_ID_GROUPS_MANAGER === $attribute->id) {
$roles[] = Role::GROUPS_MANAGER;
}
if (self::BPN_CRM_ID_GROUPS_ADMIN === $attribute->id) {
$roles[] = Role::GROUPS_ADMIN;
$role = self::ROLE_BY_CRM_ID[$attribute->id] ?? null;
if (null !== $role) {
$roles[] = $role;
}
}