feat: improved mutability checks for personal data in edit or create mode

This commit is contained in:
Björn Fromme
2025-10-28 15:34:09 +01:00
parent 51dbf20118
commit 5021f414d1
27 changed files with 435 additions and 233 deletions
+22
View File
@@ -16,6 +16,15 @@ use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
*/
class Insurance
{
/**
* Special ID for the synthetic "no insurance" option.
*
* This option is injected into the insurance selection list to force explicit user choice
* for legal compliance. When selected, it satisfies validation requirements but transmits
* no insurance data to the BPN API.
*/
public const NO_INSURANCE_ID = '0';
#[Groups(['api:single', 'api:list'])]
public ?string $id = null;
@@ -180,4 +189,17 @@ class Insurance
return array_values(array_unique($urls));
}
/**
* Checks if this is the synthetic "no insurance" option.
*
* The "no insurance" option is a UI construct used to force explicit user choice.
* It should be excluded from BPN API transmission.
*
* @return bool True if this is the "no insurance" option
*/
public function isNoInsurance(): bool
{
return self::NO_INSURANCE_ID === $this->id;
}
}