From 60a99bc15737f0a5ca83fa59fa060f73c436e43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 4 Nov 2026 13:59:16 +0100 Subject: [PATCH] refactor: match the personnel selection group by its id 'Leistungen Personal' is BusPro selection group 88, so it is matched by id like the other included-services groups and a rename upstream no longer drops it from services_included. The label match and its "register its id" warning are gone. Group 88 is soft-deleted in BusPro; whether it is still needed is being clarified with the office. Co-Authored-By: Claude Opus 5.5 --- .../Classes/Service/DateImportService.php | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/packages/ep_products/Classes/Service/DateImportService.php b/packages/ep_products/Classes/Service/DateImportService.php index e3cda8e..271562e 100644 --- a/packages/ep_products/Classes/Service/DateImportService.php +++ b/packages/ep_products/Classes/Service/DateImportService.php @@ -35,6 +35,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface const SELECTION_GROUP_ACCOMMODATION = 85; const SELECTION_GROUP_PROGRAMME = 86; const SELECTION_GROUP_COURSES = 87; + const SELECTION_GROUP_PERSONNEL = 88; const SELECTION_GROUP_EVENTS = 89; const SELECTION_GROUP_TRANSPORTATION = 90; @@ -54,12 +55,6 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface */ const END_CUSTOMER_CODE_PATTERN = '/(?:MP|WE|KT|PM|MW|FA)\d{6}$/'; - /** - * 'Leistungen Personal' occurs in no export so far, so its id is unknown and - * it is still matched by label. Register its id once the warning fires. - */ - const SELECTION_GROUP_LABEL_PERSONNEL = 'Leistungen Personal'; - private int $pid; private array $hotelMappings = []; @@ -315,7 +310,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface $includedBoard = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_BOARD); $includedTransportation = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_TRANSPORTATION); $includedProgramme = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_PROGRAMME); - $includedPersonnel = $this->parsePersonnelSelectionGroup($row['selectionGroups']); + $includedPersonnel = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_PERSONNEL); $includedEvents = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_EVENTS); $includedOther = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_OTHER); $includedCourses = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_COURSES); @@ -661,28 +656,6 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface return $data; } - /** - * @param array[] $selectionGroups - */ - private function parsePersonnelSelectionGroup(array $selectionGroups): array - { - $data = []; - foreach ($selectionGroups as $group) { - if ($group['label'] !== static::SELECTION_GROUP_LABEL_PERSONNEL) { - continue; - } - $this->logger->warning( - 'selection group matched by label, register its id', - ['label' => $group['label'], 'idbuspro' => (int) $group['busProId']] - ); - $this->addSelections($group['selections'], $data); - } - - ksort($data); - - return $data; - } - /** * 'Gruppenkunde' and 'Endkunde' decide. A date carrying neither is judged by * its travel code.