private function getCreateAddressValidationDefinition(DataBag
$data, ?string
$accountType, DataBag
$address, SalesChannelContext
$context): DataValidationDefinition
{ $validation =
$this->addressValidationFactory->
create($context);
if ($accountType === CustomerEntity::ACCOUNT_TYPE_BUSINESS
&&
$this->systemConfigService->
get('core.loginRegistration.showAccountTypeSelection',
$context->
getSalesChannelId())) { $validation->
add('company',
new NotBlank());
} $validation->
set('zipcode',
new CustomerZipCode(['countryId' =>
$address->
get('countryId'
)]));
$validationEvent =
new BuildValidationEvent($validation,
$data,
$context->
getContext());
$this->eventDispatcher->
dispatch($validationEvent,
$validationEvent->
getName());
return $validation;
} private function getCustomerCreateValidationDefinition(bool
$isGuest, DataBag
$data, SalesChannelContext
$context): DataValidationDefinition
{ $validation =
$this->accountValidationFactory->
create($context);