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 <[email protected]>
This commit is contained in:
1 parent
3333eed980
commit
60a99bc157
1 file changed
+2
-29
@@ -35,6 +35,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
|||||||
const SELECTION_GROUP_ACCOMMODATION = 85;
|
const SELECTION_GROUP_ACCOMMODATION = 85;
|
||||||
const SELECTION_GROUP_PROGRAMME = 86;
|
const SELECTION_GROUP_PROGRAMME = 86;
|
||||||
const SELECTION_GROUP_COURSES = 87;
|
const SELECTION_GROUP_COURSES = 87;
|
||||||
|
const SELECTION_GROUP_PERSONNEL = 88;
|
||||||
const SELECTION_GROUP_EVENTS = 89;
|
const SELECTION_GROUP_EVENTS = 89;
|
||||||
const SELECTION_GROUP_TRANSPORTATION = 90;
|
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}$/';
|
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 int $pid;
|
||||||
|
|
||||||
private array $hotelMappings = [];
|
private array $hotelMappings = [];
|
||||||
@@ -315,7 +310,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
|||||||
$includedBoard = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_BOARD);
|
$includedBoard = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_BOARD);
|
||||||
$includedTransportation = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_TRANSPORTATION);
|
$includedTransportation = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_TRANSPORTATION);
|
||||||
$includedProgramme = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_PROGRAMME);
|
$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);
|
$includedEvents = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_EVENTS);
|
||||||
$includedOther = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_OTHER);
|
$includedOther = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_OTHER);
|
||||||
$includedCourses = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_COURSES);
|
$includedCourses = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_COURSES);
|
||||||
@@ -661,28 +656,6 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
|||||||
return $data;
|
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
|
* 'Gruppenkunde' and 'Endkunde' decide. A date carrying neither is judged by
|
||||||
* its travel code.
|
* its travel code.
|
||||||
|
|||||||
Reference in new issue
Block a user