feat: extended insurance parsing, pass info urls to view

This commit is contained in:
Björn Fromme
2025-10-02 16:32:50 +02:00
parent 875b181aff
commit 25029dff5d
8 changed files with 277 additions and 23 deletions
+15 -5
View File
@@ -39,13 +39,14 @@ class InsuranceParser extends AbstractParser
// Parse all individual insurances for reference lookup
$insurance = $this->parseInsuranceNode($node, false);
if (null !== $insurance && null !== $insurance->id) {
// Set complementary flag from XML attribute
$insurance->complementary = $isComplementary;
$individualInsurances[$insurance->id] = $insurance;
// Include only if it's NOT a complementary insurance (zusatzversicherung)
// Complementary insurances are only available as part of packages, never standalone
if (!$isComplementary) {
$insurances[$insurance->id] = $insurance;
}
// Include ALL insurances in the result array
// Complementary insurances will be filtered out at the form field level
$insurances[$insurance->id] = $insurance;
}
});
@@ -56,6 +57,15 @@ class InsuranceParser extends AbstractParser
if (null !== $insurance && null !== $insurance->id) {
// Parse contained insurance IDs
$insurance->containedInsuranceIds = $this->parseContainedInsuranceIds($node);
// Populate containedInsurances with actual Insurance objects
$insurance->containedInsurances = [];
foreach ($insurance->containedInsuranceIds as $containedId) {
if (isset($individualInsurances[$containedId])) {
$insurance->containedInsurances[] = $individualInsurances[$containedId];
}
}
$insurances[$insurance->id] = $insurance;
}
});