feat: additional role 'customer expert'
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ final class Role
|
||||
public const HOUSE_MANAGER = 'ROLE_HOUSE_MANAGER';
|
||||
public const GROUPS_ADMIN = 'ROLE_GROUPS_ADMIN';
|
||||
public const GROUPS_MANAGER = 'ROLE_GROUPS_MANAGER';
|
||||
public const CUSTOMER_EXPERT = 'ROLE_CUSTOMER_EXPERT';
|
||||
public const EMPLOYEE = 'ROLE_EMPLOYEE';
|
||||
|
||||
/**
|
||||
@@ -63,6 +64,7 @@ final class Role
|
||||
self::HOUSE_MANAGER,
|
||||
self::GROUPS_ADMIN,
|
||||
self::GROUPS_MANAGER,
|
||||
self::CUSTOMER_EXPERT,
|
||||
self::EMPLOYEE,
|
||||
];
|
||||
|
||||
@@ -92,6 +94,7 @@ final class Role
|
||||
self::HOUSE_MANAGER,
|
||||
self::GROUPS_ADMIN,
|
||||
self::GROUPS_MANAGER,
|
||||
self::CUSTOMER_EXPERT,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -287,6 +290,7 @@ final class Role
|
||||
self::HOUSE_MANAGER => 'Hausleitung',
|
||||
self::GROUPS_ADMIN => 'Preisrechner Admin',
|
||||
self::GROUPS_MANAGER => 'Preisrechner',
|
||||
self::CUSTOMER_EXPERT => 'KO-Experte',
|
||||
self::EMPLOYEE => 'Mitarbeiter:in',
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user