feat: improved mutability checks for personal data in edit or create mode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user