fix: never validate insurance selection in edit mode
This commit is contained in:
@@ -32,12 +32,21 @@ class ParticipantEditDto
|
||||
* the insurance field is hidden and will be automatically assigned by the bulk
|
||||
* insurance handler.
|
||||
*
|
||||
* In edit mode, this validation is skipped entirely because insurance data is
|
||||
* readonly and preserved as-is from the BPN API (the insurance field handler
|
||||
* does not process insurance in edit mode).
|
||||
*
|
||||
* This validation only runs when strict_required group is active.
|
||||
*/
|
||||
#[Assert\Callback(groups: ['strict_required'])]
|
||||
public function validateInsuranceRequired(ExecutionContextInterface $context): void
|
||||
{
|
||||
// Insurance is always required for applicant
|
||||
// Skip validation in edit mode - insurance is readonly and preserved as-is
|
||||
if (BookingDto::MODE_EDIT === $this->bookingContext->getMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Insurance is always required for applicant in create mode
|
||||
if (true === $this->participant->isApplicant()) {
|
||||
if (null === $this->participant->insurance) {
|
||||
$context->buildViolation('Bitte auswählen')
|
||||
|
||||
Reference in New Issue
Block a user