@param \Generated\Shared\Transfer\CompanyBusinessUnitStoreAddressTransfer $companyBusinessUnitStoreAddressTransfer

@return void
495383
public function deleteCompanyBusinessUnitStoreAddress(CompanyBusinessUnitStoreAddressTransfer $companyBusinessUnitStoreAddressTransfer): void
    {
        $this->getTransactionHandler()->handleTransaction(function () use ($companyBusinessUnitStoreAddressTransfer) {
            $this->executeCompanyBusinessUnitStoreAddressTransaction($companyBusinessUnitStoreAddressTransfer);
        });
    }
1121209
public function findCompanyBusinessUnitStoreById(int $companyBusinessUnitStoreId): ?CompanyBusinessUnitStoreTransfer
    {
        $companyBusinessUnitStoreEntity = $this->getFactory()
            ->createFosCompanyBusinessUnitStoreQuery()
            ->findOneByIdCompanyBusinessUnitStore($companyBusinessUnitStoreId);

        if ($companyBusinessUnitStoreEntity === null) {
            return null;
        }

        return (new CompanyBusinessUnitStoreTransfer())->fromArray($companyBusinessUnitStoreEntity->toArray());
    }
1090076
protected function createCompanyBusinessUnitResponseTransfer(
        CompanyBusinessUnitTransfer $companyBusinessUnitTransfer
    ): RestCompanyBusinessUnitsResponseTransfer {
        $restCompanyBusinessUnitsResponseAttributesTransfer = new RestCompanyBusinessUnitsResponseAttributesTransfer();

        $restCompanyBusinessUnitsResponseAttributesTransfer->fromArray(
            $companyBusinessUnitTransfer->toArray(),
            true
        );

        $restCompanyBusinessUnitsResponseTransfer = new RestCompanyBusinessUnitsResponseTransfer();

        $restCompanyBusinessUnitsResponseTransfer->setIsSuccess(true)
            ->setRestCompanyBusinessUnitsResponseAttributes($restCompanyBusinessUnitsResponseAttributesTransfer);

        return $restCompanyBusinessUnitsResponseTransfer;
    }
607132
protected function validateRequestTransfer(AdyenApiRequestTransfer $adyenApiRequestTransfer): void
    {
        $adyenApiRequestTransfer->requireAdjustAuthorizationRequest();

        $adyenApiRequestTransfer
            ->getAdjustAuthorizationRequest()
            ->requireModificationAmount()
            ->requireMerchantAccount()
            ->requireOriginalReference();

        $adyenApiRequestTransfer
            ->getAdjustAuthorizationRequest()
            ->getModificationAmount()
            ->requireCurrency()
            ->requireValue();
    }
577122
public function create(
        RestCompaniesRequestAttributesTransfer $restCompaniesRequestAttributesTransfer
    ): RestCompaniesResponseTransfer {
        $companyTransfer = new CompanyTransfer();

        foreach ($this->companyMapperPlugins as $companyMapperPlugin) {
            $companyTransfer = $companyMapperPlugin->map(
                $restCompaniesRequestAttributesTransfer,
                $companyTransfer
            );
        }

        try {
            $companyResponseTransfer = $this->companyFacade->create($companyTransfer);
        } catch (PropelException $e) {
            return $this->createCompanyDataInvalidErrorResponse();
        }

        if (!$companyResponseTransfer->getIsSuccessful()) {
            return $this->createCompanyDataInvalidErrorResponse();
        }

        return $this->createCompanyResponseTransfer(
            $companyResponseTransfer->getCompanyTransfer()
        );
    }
276469
protected function createSaveCompanyBusinessUnitFailedErrorResponse(
        RestCompanyBusinessUnitsResponseTransfer $restCompanyBusinessUnitsResponseTransfer
    ): RestResponseInterface {
        $restResponse = $this->restResourceBuilder->createRestResponse();

        foreach ($restCompanyBusinessUnitsResponseTransfer->getErrors() as $restCompanyBusinessUnitsErrorTransfer) {
            $restResponse->addError((new RestErrorMessageTransfer())
                ->setCode($restCompanyBusinessUnitsErrorTransfer->getCode())
                ->setStatus($restCompanyBusinessUnitsErrorTransfer->getStatus())
                ->setDetail($restCompanyBusinessUnitsErrorTransfer->getDetail()));
        }

        return $restResponse;
    }
343455
public function addResourceRelationships(array $resources, RestRequestInterface $restRequest): array
    {
        foreach ($resources as $resource) {
            /**
             * @var \Generated\Shared\Transfer\CompanyUserTransfer|null $payload
             */
            $payload = $resource->getPayload();

            if ($payload === null || !($payload instanceof CompanyUserTransfer)) {
                continue;
            }

            $companyTransfer = $payload->getCompany();

            if ($companyTransfer === null) {
                continue;
            }

            $restCompanyAttributesTransfer = $this->companiesMapper
                ->mapCompanyTransferToRestCompaniesResponseAttributesTransfer(
                    $companyTransfer,
                    new RestCompaniesResponseAttributesTransfer()
                );

            $companyResource = $this->restResourceBuilder->createRestResource(
                CompaniesRestApiConfig::RESOURCE_COMPANIES,
                $companyTransfer->getUuid(),
                $restCompanyAttributesTransfer
            );

            $resource->addRelationship($companyResource);
        }
        return $resources;
    }
672034
public function importAddressLabelRelation(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createCompanyUnitAddressLabelRelationDataImport()->import($dataImporterConfigurationTransfer);
    }
596589
public function update(RestCompaniesRequestTransfer $restCompaniesRequestTransfer): RestCompaniesResponseTransfer
    {
        $companyTransfer = $this->companiesRestApiRepository
            ->findCompanyByExternalReference($restCompaniesRequestTransfer->getId());

        if ($companyTransfer === null) {
            return $this->createCompanyFailedToLoadErrorResponseTransfer();
        }

        foreach ($this->companyMapperPlugins as $companyMapperPlugin) {
            $companyTransfer = $companyMapperPlugin->map(
                $restCompaniesRequestTransfer->getRestCompaniesRequestAttributes(),
                $companyTransfer
            );
        }

        try {
            $companyResponseTransfer = $this->companyFacade->update($companyTransfer);
        } catch (PropelException $e) {
            return $this->createCompanyDataInvalidErrorResponse();
        }

        if (!$companyResponseTransfer->getIsSuccessful()) {
            return $this->createCompanyDataInvalidErrorResponse();
        }

        return $this->createCompanyResponseTransfer(
            $companyResponseTransfer->getCompanyTransfer()
        );
    }
457182
public function findCompanyBusinessUnitByExternalReference(
        RestCompanyBusinessUnitsRequestAttributesTransfer $restCompanyBusinessUnitsRequestAttributesTransfer
    ): RestCompanyBusinessUnitsResponseTransfer {
        /** @var \Generated\Shared\Transfer\RestCompanyBusinessUnitsResponseTransfer $restCompanyBusinessUnitsResponseTransfer */
        $restCompanyBusinessUnitsResponseTransfer = $this->zedRequestClient->call(
            '/company-business-units-rest-api/gateway/find-company-business-unit-by-external-reference',
            $restCompanyBusinessUnitsRequestAttributesTransfer
        );

        return $restCompanyBusinessUnitsResponseTransfer;
    }
218438
protected function createCompanyResponseTransfer(CompanyTransfer $companyTransfer): RestCompaniesResponseTransfer
    {
        $restCompaniesResponseAttributesTransfer = new RestCompaniesResponseAttributesTransfer();

        $restCompaniesResponseAttributesTransfer->fromArray(
            $companyTransfer->toArray(),
            true
        );

        $restCompaniesResponseTransfer = new RestCompaniesResponseTransfer();

        $restCompaniesResponseTransfer->setIsSuccess(true)
            ->setRestCompaniesResponseAttributes($restCompaniesResponseAttributesTransfer);

        return $restCompaniesResponseTransfer;
    }
1134088
public function saveCompanyBusinessUnitStore(CompanyBusinessUnitStoreTransfer $companyBusinessUnitStoreTransfer): CompanyBusinessUnitStoreTransfer
    {
        return $this->getTransactionHandler()->handleTransaction(function () use ($companyBusinessUnitStoreTransfer) {
            return $this->executeSaveCompanyBusinessUnitStoreTransaction($companyBusinessUnitStoreTransfer);
        });
    }
1165585
public function deleteCompanyBusinessUnitStore(CompanyBusinessUnitStoreTransfer $companyBusinessUnitStoreTransfer): void
    {
        $this->getFactory()
            ->createFosCompanyBusinessUnitStoreQuery()
            ->findOneByIdCompanyBusinessUnitStore($companyBusinessUnitStoreTransfer->getIdCompanyBusinessUnitStore())
            ->delete();
    }
1305482
public function importBusinessUnitUser(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->getCompanyBusinessUnitUserDataImport()->import($dataImporterConfigurationTransfer);
    }
1242764
public function mapBrandTransfer(FosBrandEntityTransfer $brandEntityTransfer): BrandTransfer
    {
        $brandTransfer = new BrandTransfer();

        $brandTransfer->fromArray($brandEntityTransfer->toArray(), true);

        return $brandTransfer;
    }
1172489
public function importCompanyUserRoles(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createCompanyUserRoleDataImport()->import($dataImporterConfigurationTransfer);
    }
403418
public function create(RestCompanyBusinessUnitsRequestAttributesTransfer $restCompanyBusinessUnitsRequestAttributesTransfer): RestCompanyBusinessUnitsResponseTransfer
    {
        /** @var \Generated\Shared\Transfer\RestCompanyBusinessUnitsResponseTransfer $restCompanyBusinessUnitsResponseTransfer */
        $restCompanyBusinessUnitsResponseTransfer = $this->zedRequestClient->call(
            '/company-business-units-rest-api/gateway/create',
            $restCompanyBusinessUnitsRequestAttributesTransfer
        );

        return $restCompanyBusinessUnitsResponseTransfer;
    }