private readonly EventDispatcherInterface
$eventDispatcher,
private readonly DataValidationFactoryInterface
$addressValidationFactory,
private readonly SystemConfigService
$systemConfigService,
private readonly StoreApiCustomFieldMapper
$storeApiCustomFieldMapper,
private readonly EntityRepository
$salutationRepository,
) { $this->addressRepository =
$addressRepository;
} public function getDecorated(): AbstractUpsertAddressRoute
{ throw new DecorationPatternException(self::
class);
} #[Route(path: '/store-api/account/address', name: 'store-api.account.address.create', methods: ['POST'], defaults: ['addressId' => null, '_loginRequired' => true, '_loginRequiredAllowGuest' => true])]
#[Route(path: '/store-api/account/address/{addressId}', name: 'store-api.account.address.update', methods: ['PATCH'], defaults: ['_loginRequired' => true, '_loginRequiredAllowGuest' => true])]
public function upsert(?string
$addressId, RequestDataBag
$data, SalesChannelContext
$context, CustomerEntity
$customer): UpsertAddressRouteResponse
{ if (!
$addressId) { $isCreate = true;
$addressId = Uuid::
randomHex();
} else { $this->
validateAddress($addressId,
$context,
$customer);