diff --git a/src/DataProvider/Provider/Data/ProductCanonicalAssociationProvider.php b/src/DataProvider/Provider/Data/ProductCanonicalAssociationProvider.php new file mode 100644 index 000000000..7baefc873 --- /dev/null +++ b/src/DataProvider/Provider/Data/ProductCanonicalAssociationProvider.php @@ -0,0 +1,87 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\DataProvider\Provider\Data; + +use Shopware\Core\Content\Product\ProductCollection; +use Shopware\Core\Framework\Context; +use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\NotFilter; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Sorting\FieldSorting; +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +#[Package('fundamentals@after-sales')] +class ProductCanonicalAssociationProvider extends AbstractProvider +{ + private const BUNDLE_PRODUCT_TYPE = 'grouped_bundle'; + + /** + * @param EntityRepository $productRepo + */ + public function __construct(private readonly EntityRepository $productRepo) + { + } + + public function getIdentifier(): string + { + return DefaultEntities::PRODUCT_CANONICAL_ASSOCIATION; + } + + public function getProvidedData(int $limit, int $offset, Context $context): array + { + $criteria = new Criteria(); + $criteria->setLimit($limit); + $criteria->setOffset($offset); + $this->addBundleExclusionFilter($criteria); + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('canonicalProductId', null), + ])); + $criteria->addSorting(new FieldSorting('id')); + $result = $this->productRepo->search($criteria, $context)->getEntities(); + + $neededResult = []; + + foreach ($result as $item) { + $neededResult[] = [ + 'id' => $item->getId(), + 'canonicalProductId' => $item->getCanonicalProductId(), + ]; + } + + return $this->cleanupSearchResult($neededResult); + } + + public function getProvidedTotal(Context $context): int + { + $criteria = new Criteria(); + $this->addBundleExclusionFilter($criteria); + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('canonicalProductId', null), + ])); + + return $this->readTotalFromRepo($this->productRepo, $context, $criteria); + } + + private function addBundleExclusionFilter(Criteria $criteria): void + { + if (!$this->hasTypeColumn()) { + return; + } + + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('type', self::BUNDLE_PRODUCT_TYPE), + ])); + } + + private function hasTypeColumn(): bool + { + return $this->productRepo->getDefinition()->getField('type') !== null; + } +} diff --git a/src/DataProvider/Provider/Data/ProductCmsPageAssociationProvider.php b/src/DataProvider/Provider/Data/ProductCmsPageAssociationProvider.php new file mode 100644 index 000000000..929c5429e --- /dev/null +++ b/src/DataProvider/Provider/Data/ProductCmsPageAssociationProvider.php @@ -0,0 +1,87 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\DataProvider\Provider\Data; + +use Shopware\Core\Content\Product\ProductCollection; +use Shopware\Core\Framework\Context; +use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\NotFilter; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Sorting\FieldSorting; +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +#[Package('fundamentals@after-sales')] +class ProductCmsPageAssociationProvider extends AbstractProvider +{ + private const BUNDLE_PRODUCT_TYPE = 'grouped_bundle'; + + /** + * @param EntityRepository $productRepo + */ + public function __construct(private readonly EntityRepository $productRepo) + { + } + + public function getIdentifier(): string + { + return DefaultEntities::PRODUCT_CMS_PAGE_ASSOCIATION; + } + + public function getProvidedData(int $limit, int $offset, Context $context): array + { + $criteria = new Criteria(); + $criteria->setLimit($limit); + $criteria->setOffset($offset); + $this->addBundleExclusionFilter($criteria); + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('cmsPageId', null), + ])); + $criteria->addSorting(new FieldSorting('id')); + $result = $this->productRepo->search($criteria, $context)->getEntities(); + + $neededResult = []; + + foreach ($result as $item) { + $neededResult[] = [ + 'id' => $item->getId(), + 'cmsPageId' => $item->getCmsPageId(), + ]; + } + + return $this->cleanupSearchResult($neededResult); + } + + public function getProvidedTotal(Context $context): int + { + $criteria = new Criteria(); + $this->addBundleExclusionFilter($criteria); + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('cmsPageId', null), + ])); + + return $this->readTotalFromRepo($this->productRepo, $context, $criteria); + } + + private function addBundleExclusionFilter(Criteria $criteria): void + { + if (!$this->hasTypeColumn()) { + return; + } + + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('type', self::BUNDLE_PRODUCT_TYPE), + ])); + } + + private function hasTypeColumn(): bool + { + return $this->productRepo->getDefinition()->getField('type') !== null; + } +} diff --git a/src/DataProvider/Provider/Data/SalesChannelHomeCmsPageAssociationProvider.php b/src/DataProvider/Provider/Data/SalesChannelHomeCmsPageAssociationProvider.php new file mode 100644 index 000000000..f34237803 --- /dev/null +++ b/src/DataProvider/Provider/Data/SalesChannelHomeCmsPageAssociationProvider.php @@ -0,0 +1,67 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\DataProvider\Provider\Data; + +use Shopware\Core\Framework\Context; +use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\NotFilter; +use Shopware\Core\Framework\DataAbstractionLayer\Search\Sorting\FieldSorting; +use Shopware\Core\Framework\Log\Package; +use Shopware\Core\System\SalesChannel\SalesChannelCollection; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +#[Package('fundamentals@after-sales')] +class SalesChannelHomeCmsPageAssociationProvider extends AbstractProvider +{ + /** + * @param EntityRepository $salesChannelRepo + */ + public function __construct(private readonly EntityRepository $salesChannelRepo) + { + } + + public function getIdentifier(): string + { + return DefaultEntities::SALES_CHANNEL_HOME_CMS_PAGE_ASSOCIATION; + } + + public function getProvidedData(int $limit, int $offset, Context $context): array + { + $criteria = new Criteria(); + $criteria->setLimit($limit); + $criteria->setOffset($offset); + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('homeCmsPageId', null), + ])); + $criteria->addSorting(new FieldSorting('id')); + $result = $this->salesChannelRepo->search($criteria, $context)->getEntities(); + + $neededResult = []; + + foreach ($result as $item) { + $neededResult[] = [ + 'id' => $item->getId(), + 'homeCmsPageId' => $item->getHomeCmsPageId(), + ]; + } + + return $this->cleanupSearchResult($neededResult); + } + + public function getProvidedTotal(Context $context): int + { + $criteria = new Criteria(); + $criteria->addFilter(new NotFilter(NotFilter::CONNECTION_AND, [ + new EqualsFilter('homeCmsPageId', null), + ])); + + return $this->readTotalFromRepo($this->salesChannelRepo, $context, $criteria); + } +} diff --git a/src/DataProvider/Provider/Data/SalesChannelProvider.php b/src/DataProvider/Provider/Data/SalesChannelProvider.php index 6806d13e7..a011a520a 100644 --- a/src/DataProvider/Provider/Data/SalesChannelProvider.php +++ b/src/DataProvider/Provider/Data/SalesChannelProvider.php @@ -43,7 +43,7 @@ public function getProvidedData(int $limit, int $offset, Context $context): arra $criteria->addSorting(new FieldSorting('id')); $result = $this->salesChannelRepo->search($criteria, $context); - return $this->cleanupSearchResult($result, ['analyticsId', 'hreflangDefaultDomainId', 'deliveryTime', 'paymentMethodIds']); + return $this->cleanupSearchResult($result, ['analyticsId', 'hreflangDefaultDomainId', 'deliveryTime', 'paymentMethodIds', 'homeCmsPageId']); } public function getProvidedTotal(Context $context): int diff --git a/src/DependencyInjection/dataProvider.php b/src/DependencyInjection/dataProvider.php index 56369fbed..5f2a81953 100644 --- a/src/DependencyInjection/dataProvider.php +++ b/src/DependencyInjection/dataProvider.php @@ -41,6 +41,8 @@ use SwagMigrationAssistant\DataProvider\Provider\Data\OrderProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\PageSystemConfigProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\PaymentMethodProvider; +use SwagMigrationAssistant\DataProvider\Provider\Data\ProductCanonicalAssociationProvider; +use SwagMigrationAssistant\DataProvider\Provider\Data\ProductCmsPageAssociationProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\ProductFeatureSetProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\ProductManufacturerProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\ProductProvider; @@ -52,6 +54,7 @@ use SwagMigrationAssistant\DataProvider\Provider\Data\PropertyGroupProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\RuleProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\SalesChannelDomainProvider; +use SwagMigrationAssistant\DataProvider\Provider\Data\SalesChannelHomeCmsPageAssociationProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\SalesChannelProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\SalutationProvider; use SwagMigrationAssistant\DataProvider\Provider\Data\SeoUrlProvider; @@ -132,6 +135,14 @@ ]) ->tag('shopware.dataProvider.provider'); + $services->set(ProductCanonicalAssociationProvider::class) + ->args([service('product.repository')]) + ->tag('shopware.dataProvider.provider'); + + $services->set(ProductCmsPageAssociationProvider::class) + ->args([service('product.repository')]) + ->tag('shopware.dataProvider.provider'); + $services->set(TaxProvider::class) ->args([service('tax.repository')]) ->tag('shopware.dataProvider.provider'); @@ -164,6 +175,10 @@ ->args([service('sales_channel.repository')]) ->tag('shopware.dataProvider.provider'); + $services->set(SalesChannelHomeCmsPageAssociationProvider::class) + ->args([service('sales_channel.repository')]) + ->tag('shopware.dataProvider.provider'); + $services->set(SalesChannelDomainProvider::class) ->args([service('sales_channel_domain.repository')]) ->tag('shopware.dataProvider.provider'); diff --git a/src/DependencyInjection/shopware6.php b/src/DependencyInjection/shopware6.php index 6e25a792b..4a7222e4e 100644 --- a/src/DependencyInjection/shopware6.php +++ b/src/DependencyInjection/shopware6.php @@ -19,6 +19,7 @@ use Shopware\Core\Content\Media\MediaService; use Shopware\Core\Content\Product\Aggregate\ProductFeatureSet\ProductFeatureSetDefinition; use Shopware\Core\Content\Product\Aggregate\ProductManufacturer\ProductManufacturerDefinition; +use Shopware\Core\Content\Product\ProductDefinition; use Shopware\Core\Content\Product\SalesChannel\Sorting\ProductSortingDefinition; use Shopware\Core\Content\ProductStream\Aggregate\ProductStreamFilter\ProductStreamFilterDefinition; use Shopware\Core\Content\ProductStream\ProductStreamDefinition; @@ -30,6 +31,7 @@ use Shopware\Core\System\CustomField\Aggregate\CustomFieldSet\CustomFieldSetDefinition; use Shopware\Core\System\DeliveryTime\DeliveryTimeDefinition; use Shopware\Core\System\SalesChannel\Aggregate\SalesChannelDomain\SalesChannelDomainDefinition; +use Shopware\Core\System\SalesChannel\SalesChannelDefinition; use Shopware\Core\System\Salutation\SalutationDefinition; use Shopware\Core\System\Snippet\Aggregate\SnippetSet\SnippetSetDefinition; use Shopware\Core\System\Snippet\SnippetDefinition; @@ -98,6 +100,8 @@ use SwagMigrationAssistant\Profile\Shopware6\Converter\NumberRangeConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\OrderConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\PageSystemConfigConverter; +use SwagMigrationAssistant\Profile\Shopware6\Converter\ProductCanonicalAssociationConverter; +use SwagMigrationAssistant\Profile\Shopware6\Converter\ProductCmsPageAssociationConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\ProductConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\ProductFeatureSetConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\ProductManufacturerConverter; @@ -110,6 +114,7 @@ use SwagMigrationAssistant\Profile\Shopware6\Converter\RuleConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\SalesChannelConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\SalesChannelDomainConverter; +use SwagMigrationAssistant\Profile\Shopware6\Converter\SalesChannelHomeCmsPageAssociationConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\SalutationConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\SeoUrlConverter; use SwagMigrationAssistant\Profile\Shopware6\Converter\SeoUrlTemplateConverter; @@ -153,6 +158,8 @@ use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\OrderDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\OrderDocumentGeneratedDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\PageSystemConfigDataSet; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCanonicalAssociationDataSet; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCmsPageAssociationDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductDownloadDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductFeatureSetDataSet; @@ -166,6 +173,7 @@ use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\RuleDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SalesChannelDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SalesChannelDomainDataSet; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SalesChannelHomeCmsPageAssociationDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SalutationDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SeoUrlDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SeoUrlTemplateDataSet; @@ -212,6 +220,8 @@ use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\NumberRangeReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\OrderReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\PageSystemConfigReader; +use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\ProductCanonicalAssociationReader; +use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\ProductCmsPageAssociationReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\ProductFeatureSetReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\ProductManufacturerReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\ProductReader; @@ -223,6 +233,7 @@ use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\PropertyGroupReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\RuleReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\SalesChannelDomainReader; +use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\SalesChannelHomeCmsPageAssociationReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\SalesChannelReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\SalutationReader; use SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader\SeoUrlReader; @@ -258,6 +269,8 @@ use SwagMigrationAssistant\Profile\Shopware6\Writer\MailTemplateWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\MediaFolderInheritanceWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\PageSystemConfigWriter; +use SwagMigrationAssistant\Profile\Shopware6\Writer\ProductCanonicalAssociationWriter; +use SwagMigrationAssistant\Profile\Shopware6\Writer\ProductCmsPageAssociationWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\ProductFeatureSetWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\ProductManufacturerWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\ProductSortingWriter; @@ -267,6 +280,7 @@ use SwagMigrationAssistant\Profile\Shopware6\Writer\PropertyGroupWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\RuleWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\SalesChannelDomainWriter; +use SwagMigrationAssistant\Profile\Shopware6\Writer\SalesChannelHomeCmsPageAssociationWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\SalutationWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\SeoUrlTemplateWriter; use SwagMigrationAssistant\Profile\Shopware6\Writer\SnippetSetWriter; @@ -384,6 +398,14 @@ ->parent(ShopwareMediaConverter::class) ->tag('shopware.migration.converter'); + $services->set(ProductCanonicalAssociationConverter::class) + ->parent(ShopwareConverter::class) + ->tag('shopware.migration.converter'); + + $services->set(ProductCmsPageAssociationConverter::class) + ->parent(ShopwareConverter::class) + ->tag('shopware.migration.converter'); + $services->set(OrderConverter::class) ->parent(ShopwareConverter::class) ->args([service(StateMachineStateLookup::class)]) @@ -419,6 +441,10 @@ ->parent(ShopwareConverter::class) ->tag('shopware.migration.converter'); + $services->set(SalesChannelHomeCmsPageAssociationConverter::class) + ->parent(ShopwareConverter::class) + ->tag('shopware.migration.converter'); + $services->set(SalutationConverter::class) ->parent(ShopwareConverter::class) ->args([service(SalutationLookup::class)]) @@ -622,6 +648,12 @@ $services->set(ProductDataSet::class) ->tag('shopware.migration.data_set'); + $services->set(ProductCanonicalAssociationDataSet::class) + ->tag('shopware.migration.data_set'); + + $services->set(ProductCmsPageAssociationDataSet::class) + ->tag('shopware.migration.data_set'); + $services->set(OrderDataSet::class) ->tag('shopware.migration.data_set'); @@ -670,6 +702,9 @@ $services->set(SalesChannelDomainDataSet::class) ->tag('shopware.migration.data_set'); + $services->set(SalesChannelHomeCmsPageAssociationDataSet::class) + ->tag('shopware.migration.data_set'); + $services->set(ShippingMethodDataSet::class) ->tag('shopware.migration.data_set'); @@ -794,6 +829,14 @@ ->parent(ApiReader::class) ->tag('shopware.migration.reader'); + $services->set(ProductCanonicalAssociationReader::class) + ->parent(ApiReader::class) + ->tag('shopware.migration.reader'); + + $services->set(ProductCmsPageAssociationReader::class) + ->parent(ApiReader::class) + ->tag('shopware.migration.reader'); + $services->set(ProductReviewReader::class) ->parent(ApiReader::class) ->tag('shopware.migration.reader'); @@ -862,6 +905,10 @@ ->parent(ApiReader::class) ->tag('shopware.migration.reader'); + $services->set(SalesChannelHomeCmsPageAssociationReader::class) + ->parent(ApiReader::class) + ->tag('shopware.migration.reader'); + $services->set(SalutationReader::class) ->parent(ApiReader::class) ->tag('shopware.migration.reader'); @@ -990,6 +1037,22 @@ ]) ->tag('shopware.migration.writer'); + $services->set(ProductCanonicalAssociationWriter::class) + ->parent(AbstractWriter::class) + ->args([ + service(EntityWriter::class), + service(ProductDefinition::class), + ]) + ->tag('shopware.migration.writer'); + + $services->set(ProductCmsPageAssociationWriter::class) + ->parent(AbstractWriter::class) + ->args([ + service(EntityWriter::class), + service(ProductDefinition::class), + ]) + ->tag('shopware.migration.writer'); + $services->set(PropertyGroupWriter::class) ->parent(AbstractWriter::class) ->args([ @@ -1110,6 +1173,14 @@ ]) ->tag('shopware.migration.writer'); + $services->set(SalesChannelHomeCmsPageAssociationWriter::class) + ->parent(AbstractWriter::class) + ->args([ + service(EntityWriter::class), + service(SalesChannelDefinition::class), + ]) + ->tag('shopware.migration.writer'); + $services->set(SeoUrlTemplateWriter::class) ->parent(AbstractWriter::class) ->args([ diff --git a/src/Migration/DataSelection/DefaultEntities.php b/src/Migration/DataSelection/DefaultEntities.php index a391c992a..d0fbbb5b5 100644 --- a/src/Migration/DataSelection/DefaultEntities.php +++ b/src/Migration/DataSelection/DefaultEntities.php @@ -143,6 +143,10 @@ final class DefaultEntities final public const PRODUCT = 'product'; + final public const PRODUCT_CANONICAL_ASSOCIATION = 'product_canonical_association'; + + final public const PRODUCT_CMS_PAGE_ASSOCIATION = 'product_cms_page_association'; + final public const PRODUCT_CONTAINER = 'product_container'; final public const PRODUCT_CUSTOM_FIELD = 'product_custom_field'; @@ -217,6 +221,8 @@ final class DefaultEntities final public const SALES_CHANNEL = 'sales_channel'; + final public const SALES_CHANNEL_HOME_CMS_PAGE_ASSOCIATION = 'sales_channel_home_cms_page_association'; + final public const SALES_CHANNEL_DOMAIN = 'sales_channel_domain'; final public const SALES_CHANNEL_TRANSLATION = 'sales_channel_translation'; diff --git a/src/Profile/Shopware6/Converter/OrderConverter.php b/src/Profile/Shopware6/Converter/OrderConverter.php index 1549bb761..0508b5715 100644 --- a/src/Profile/Shopware6/Converter/OrderConverter.php +++ b/src/Profile/Shopware6/Converter/OrderConverter.php @@ -192,6 +192,8 @@ protected function convertData(array $data): ConvertStruct private function updateLineItems(array &$lineItems): void { foreach ($lineItems as &$converted) { + unset($converted['promotionId']); + if (!isset($converted['productId'])) { unset($converted['referencedId'], $converted['payload']['productNumber']); } diff --git a/src/Profile/Shopware6/Converter/ProductCanonicalAssociationConverter.php b/src/Profile/Shopware6/Converter/ProductCanonicalAssociationConverter.php new file mode 100644 index 000000000..03834f1a8 --- /dev/null +++ b/src/Profile/Shopware6/Converter/ProductCanonicalAssociationConverter.php @@ -0,0 +1,60 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Converter; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\Converter\ConvertStruct; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\Logging\Log\Builder\MigrationLogBuilder; +use SwagMigrationAssistant\Migration\Logging\Log\ConvertAssociationMissingLog; +use SwagMigrationAssistant\Migration\MigrationContextInterface; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCanonicalAssociationDataSet; +use SwagMigrationAssistant\Profile\Shopware6\Shopware6MajorProfile; + +#[Package('fundamentals@after-sales')] +class ProductCanonicalAssociationConverter extends ShopwareConverter +{ + public function supports(MigrationContextInterface $migrationContext): bool + { + return $migrationContext->getProfile()->getName() === Shopware6MajorProfile::PROFILE_NAME + && $this->getDataSetEntity($migrationContext) === ProductCanonicalAssociationDataSet::getEntity(); + } + + protected function convertData(array $data): ConvertStruct + { + $converted = $data; + + $this->mainMapping = $this->getOrCreateMappingMainCompleteFacade( + DefaultEntities::PRODUCT, + $data['id'], + $converted['id'] + ); + + if (isset($converted['canonicalProductId'])) { + $canonicalProductId = $this->getMappingIdFacade( + DefaultEntities::PRODUCT, + $converted['canonicalProductId'] + ); + + if ($canonicalProductId === null) { + $this->loggingService->log( + MigrationLogBuilder::fromMigrationContext($this->migrationContext) + ->withEntityName(DefaultEntities::PRODUCT) + ->withConvertedData($converted) + ->build(ConvertAssociationMissingLog::class) + ); + + unset($converted['canonicalProductId']); + } else { + $converted['canonicalProductId'] = $canonicalProductId; + } + } + + return new ConvertStruct($converted, null, $this->mainMapping['id']); + } +} diff --git a/src/Profile/Shopware6/Converter/ProductCmsPageAssociationConverter.php b/src/Profile/Shopware6/Converter/ProductCmsPageAssociationConverter.php new file mode 100644 index 000000000..99042db93 --- /dev/null +++ b/src/Profile/Shopware6/Converter/ProductCmsPageAssociationConverter.php @@ -0,0 +1,60 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Converter; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\Converter\ConvertStruct; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\Logging\Log\Builder\MigrationLogBuilder; +use SwagMigrationAssistant\Migration\Logging\Log\ConvertAssociationMissingLog; +use SwagMigrationAssistant\Migration\MigrationContextInterface; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCmsPageAssociationDataSet; +use SwagMigrationAssistant\Profile\Shopware6\Shopware6MajorProfile; + +#[Package('fundamentals@after-sales')] +class ProductCmsPageAssociationConverter extends ShopwareConverter +{ + public function supports(MigrationContextInterface $migrationContext): bool + { + return $migrationContext->getProfile()->getName() === Shopware6MajorProfile::PROFILE_NAME + && $this->getDataSetEntity($migrationContext) === ProductCmsPageAssociationDataSet::getEntity(); + } + + protected function convertData(array $data): ConvertStruct + { + $converted = $data; + + $this->mainMapping = $this->getOrCreateMappingMainCompleteFacade( + DefaultEntities::PRODUCT, + $data['id'], + $converted['id'] + ); + + if (isset($converted['cmsPageId'])) { + $cmsPageId = $this->getMappingIdFacade( + DefaultEntities::CMS_PAGE, + $converted['cmsPageId'] + ); + + if ($cmsPageId === null) { + $this->loggingService->log( + MigrationLogBuilder::fromMigrationContext($this->migrationContext) + ->withEntityName(DefaultEntities::PRODUCT) + ->withConvertedData($converted) + ->build(ConvertAssociationMissingLog::class) + ); + + unset($converted['cmsPageId']); + } else { + $converted['cmsPageId'] = $cmsPageId; + } + } + + return new ConvertStruct($converted, null, $this->mainMapping['id']); + } +} diff --git a/src/Profile/Shopware6/Converter/ProductConverter.php b/src/Profile/Shopware6/Converter/ProductConverter.php index e74781876..08bd6e126 100644 --- a/src/Profile/Shopware6/Converter/ProductConverter.php +++ b/src/Profile/Shopware6/Converter/ProductConverter.php @@ -70,6 +70,8 @@ protected function convertData(array $data): ConvertStruct Defaults::CURRENCY ); + unset($converted['canonicalProductId'], $converted['cmsPageId']); + if (isset($converted['price'])) { $this->updateAssociationIds( $converted['price'], diff --git a/src/Profile/Shopware6/Converter/PromotionConverter.php b/src/Profile/Shopware6/Converter/PromotionConverter.php index 7c7b432e4..e0e79a883 100644 --- a/src/Profile/Shopware6/Converter/PromotionConverter.php +++ b/src/Profile/Shopware6/Converter/PromotionConverter.php @@ -32,6 +32,8 @@ protected function convertData(array $data): ConvertStruct { $converted = $data; + unset($converted['promotionId']); + $this->mainMapping = $this->getOrCreateMappingMainCompleteFacade( DefaultEntities::PROMOTION, $data['id'], diff --git a/src/Profile/Shopware6/Converter/SalesChannelConverter.php b/src/Profile/Shopware6/Converter/SalesChannelConverter.php index 635f858ae..5198de6b1 100644 --- a/src/Profile/Shopware6/Converter/SalesChannelConverter.php +++ b/src/Profile/Shopware6/Converter/SalesChannelConverter.php @@ -44,6 +44,7 @@ public function supports(MigrationContextInterface $migrationContext): bool protected function convertData(array $data): ConvertStruct { $converted = $data; + unset($converted['hreflangDefaultDomainId'], $converted['homeCmsPageId']); if (!$this->salesChannelTypeLookup->hasSalesChannelType($converted['typeId'], $this->context)) { $this->loggingService->log( diff --git a/src/Profile/Shopware6/Converter/SalesChannelHomeCmsPageAssociationConverter.php b/src/Profile/Shopware6/Converter/SalesChannelHomeCmsPageAssociationConverter.php new file mode 100644 index 000000000..102559017 --- /dev/null +++ b/src/Profile/Shopware6/Converter/SalesChannelHomeCmsPageAssociationConverter.php @@ -0,0 +1,60 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Converter; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\Converter\ConvertStruct; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\Logging\Log\Builder\MigrationLogBuilder; +use SwagMigrationAssistant\Migration\Logging\Log\ConvertAssociationMissingLog; +use SwagMigrationAssistant\Migration\MigrationContextInterface; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SalesChannelHomeCmsPageAssociationDataSet; +use SwagMigrationAssistant\Profile\Shopware6\Shopware6MajorProfile; + +#[Package('fundamentals@after-sales')] +class SalesChannelHomeCmsPageAssociationConverter extends ShopwareConverter +{ + public function supports(MigrationContextInterface $migrationContext): bool + { + return $migrationContext->getProfile()->getName() === Shopware6MajorProfile::PROFILE_NAME + && $this->getDataSetEntity($migrationContext) === SalesChannelHomeCmsPageAssociationDataSet::getEntity(); + } + + protected function convertData(array $data): ConvertStruct + { + $converted = $data; + + $this->mainMapping = $this->getOrCreateMappingMainCompleteFacade( + DefaultEntities::SALES_CHANNEL, + $data['id'], + $converted['id'] + ); + + if (isset($converted['homeCmsPageId'])) { + $homeCmsPageId = $this->getMappingIdFacade( + DefaultEntities::CMS_PAGE, + $converted['homeCmsPageId'] + ); + + if ($homeCmsPageId === null) { + $this->loggingService->log( + MigrationLogBuilder::fromMigrationContext($this->migrationContext) + ->withEntityName(DefaultEntities::SALES_CHANNEL) + ->withConvertedData($converted) + ->build(ConvertAssociationMissingLog::class) + ); + + unset($converted['homeCmsPageId']); + } else { + $converted['homeCmsPageId'] = $homeCmsPageId; + } + } + + return new ConvertStruct($converted, null, $this->mainMapping['id']); + } +} diff --git a/src/Profile/Shopware6/DataSelection/CmsDataSelection.php b/src/Profile/Shopware6/DataSelection/CmsDataSelection.php index b7990b784..3cbd59844 100644 --- a/src/Profile/Shopware6/DataSelection/CmsDataSelection.php +++ b/src/Profile/Shopware6/DataSelection/CmsDataSelection.php @@ -14,6 +14,8 @@ use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\CategoryCmsPageAssociationDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\CmsPageDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\PageSystemConfigDataSet; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCmsPageAssociationDataSet; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SalesChannelHomeCmsPageAssociationDataSet; use SwagMigrationAssistant\Profile\Shopware6\Shopware6ProfileInterface; #[Package('fundamentals@after-sales')] @@ -45,6 +47,8 @@ public function getDataSets(): array (new MediaDataSelection())->getDataSets(), [ new CmsPageDataSet(), + new SalesChannelHomeCmsPageAssociationDataSet(), + new ProductCmsPageAssociationDataSet(), new CategoryCmsPageAssociationDataSet(), new PageSystemConfigDataSet(), ] diff --git a/src/Profile/Shopware6/DataSelection/DataSet/ProductCanonicalAssociationDataSet.php b/src/Profile/Shopware6/DataSelection/DataSet/ProductCanonicalAssociationDataSet.php new file mode 100644 index 000000000..5290534f8 --- /dev/null +++ b/src/Profile/Shopware6/DataSelection/DataSet/ProductCanonicalAssociationDataSet.php @@ -0,0 +1,28 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DataSet\DataSet; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\MigrationContextInterface; +use SwagMigrationAssistant\Profile\Shopware6\Shopware6ProfileInterface; + +#[Package('fundamentals@after-sales')] +class ProductCanonicalAssociationDataSet extends DataSet +{ + public static function getEntity(): string + { + return DefaultEntities::PRODUCT_CANONICAL_ASSOCIATION; + } + + public function supports(MigrationContextInterface $migrationContext): bool + { + return $migrationContext->getProfile() instanceof Shopware6ProfileInterface; + } +} diff --git a/src/Profile/Shopware6/DataSelection/DataSet/ProductCmsPageAssociationDataSet.php b/src/Profile/Shopware6/DataSelection/DataSet/ProductCmsPageAssociationDataSet.php new file mode 100644 index 000000000..bb2c13568 --- /dev/null +++ b/src/Profile/Shopware6/DataSelection/DataSet/ProductCmsPageAssociationDataSet.php @@ -0,0 +1,28 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DataSet\DataSet; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\MigrationContextInterface; +use SwagMigrationAssistant\Profile\Shopware6\Shopware6ProfileInterface; + +#[Package('fundamentals@after-sales')] +class ProductCmsPageAssociationDataSet extends DataSet +{ + public static function getEntity(): string + { + return DefaultEntities::PRODUCT_CMS_PAGE_ASSOCIATION; + } + + public function supports(MigrationContextInterface $migrationContext): bool + { + return $migrationContext->getProfile() instanceof Shopware6ProfileInterface; + } +} diff --git a/src/Profile/Shopware6/DataSelection/DataSet/SalesChannelHomeCmsPageAssociationDataSet.php b/src/Profile/Shopware6/DataSelection/DataSet/SalesChannelHomeCmsPageAssociationDataSet.php new file mode 100644 index 000000000..7f1773058 --- /dev/null +++ b/src/Profile/Shopware6/DataSelection/DataSet/SalesChannelHomeCmsPageAssociationDataSet.php @@ -0,0 +1,28 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DataSet\DataSet; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\MigrationContextInterface; +use SwagMigrationAssistant\Profile\Shopware6\Shopware6ProfileInterface; + +#[Package('fundamentals@after-sales')] +class SalesChannelHomeCmsPageAssociationDataSet extends DataSet +{ + public static function getEntity(): string + { + return DefaultEntities::SALES_CHANNEL_HOME_CMS_PAGE_ASSOCIATION; + } + + public function supports(MigrationContextInterface $migrationContext): bool + { + return $migrationContext->getProfile() instanceof Shopware6ProfileInterface; + } +} diff --git a/src/Profile/Shopware6/DataSelection/ProductDataSelection.php b/src/Profile/Shopware6/DataSelection/ProductDataSelection.php index 082cc6f17..9643dab28 100644 --- a/src/Profile/Shopware6/DataSelection/ProductDataSelection.php +++ b/src/Profile/Shopware6/DataSelection/ProductDataSelection.php @@ -13,6 +13,7 @@ use SwagMigrationAssistant\Migration\MigrationContextInterface; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\CategoryProductStreamAssociationDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\CrossSellingDataSet; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCanonicalAssociationDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductFeatureSetDataSet; use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductManufacturerDataSet; @@ -54,6 +55,7 @@ public function getDataSets(): array new ProductFeatureSetDataSet(), new ProductManufacturerDataSet(), new ProductDataSet(), + new ProductCanonicalAssociationDataSet(), new ProductStreamDataSet(), new ProductStreamFilterInheritanceDataSet(), new CategoryProductStreamAssociationDataSet(), diff --git a/src/Profile/Shopware6/Gateway/Api/Reader/ProductCanonicalAssociationReader.php b/src/Profile/Shopware6/Gateway/Api/Reader/ProductCanonicalAssociationReader.php new file mode 100644 index 000000000..b3759754e --- /dev/null +++ b/src/Profile/Shopware6/Gateway/Api/Reader/ProductCanonicalAssociationReader.php @@ -0,0 +1,20 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +#[Package('fundamentals@after-sales')] +class ProductCanonicalAssociationReader extends ApiReader +{ + protected function getIdentifier(): string + { + return DefaultEntities::PRODUCT_CANONICAL_ASSOCIATION; + } +} diff --git a/src/Profile/Shopware6/Gateway/Api/Reader/ProductCmsPageAssociationReader.php b/src/Profile/Shopware6/Gateway/Api/Reader/ProductCmsPageAssociationReader.php new file mode 100644 index 000000000..e0dd86773 --- /dev/null +++ b/src/Profile/Shopware6/Gateway/Api/Reader/ProductCmsPageAssociationReader.php @@ -0,0 +1,20 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +#[Package('fundamentals@after-sales')] +class ProductCmsPageAssociationReader extends ApiReader +{ + protected function getIdentifier(): string + { + return DefaultEntities::PRODUCT_CMS_PAGE_ASSOCIATION; + } +} diff --git a/src/Profile/Shopware6/Gateway/Api/Reader/SalesChannelHomeCmsPageAssociationReader.php b/src/Profile/Shopware6/Gateway/Api/Reader/SalesChannelHomeCmsPageAssociationReader.php new file mode 100644 index 000000000..d668e0fb8 --- /dev/null +++ b/src/Profile/Shopware6/Gateway/Api/Reader/SalesChannelHomeCmsPageAssociationReader.php @@ -0,0 +1,20 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Gateway\Api\Reader; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +#[Package('fundamentals@after-sales')] +class SalesChannelHomeCmsPageAssociationReader extends ApiReader +{ + protected function getIdentifier(): string + { + return DefaultEntities::SALES_CHANNEL_HOME_CMS_PAGE_ASSOCIATION; + } +} diff --git a/src/Profile/Shopware6/Writer/ProductCanonicalAssociationWriter.php b/src/Profile/Shopware6/Writer/ProductCanonicalAssociationWriter.php new file mode 100644 index 000000000..5da1395e7 --- /dev/null +++ b/src/Profile/Shopware6/Writer/ProductCanonicalAssociationWriter.php @@ -0,0 +1,21 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Writer; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\Writer\AbstractWriter; + +#[Package('fundamentals@after-sales')] +class ProductCanonicalAssociationWriter extends AbstractWriter +{ + public function supports(): string + { + return DefaultEntities::PRODUCT_CANONICAL_ASSOCIATION; + } +} diff --git a/src/Profile/Shopware6/Writer/ProductCmsPageAssociationWriter.php b/src/Profile/Shopware6/Writer/ProductCmsPageAssociationWriter.php new file mode 100644 index 000000000..72f2681f3 --- /dev/null +++ b/src/Profile/Shopware6/Writer/ProductCmsPageAssociationWriter.php @@ -0,0 +1,21 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Writer; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\Writer\AbstractWriter; + +#[Package('fundamentals@after-sales')] +class ProductCmsPageAssociationWriter extends AbstractWriter +{ + public function supports(): string + { + return DefaultEntities::PRODUCT_CMS_PAGE_ASSOCIATION; + } +} diff --git a/src/Profile/Shopware6/Writer/SalesChannelHomeCmsPageAssociationWriter.php b/src/Profile/Shopware6/Writer/SalesChannelHomeCmsPageAssociationWriter.php new file mode 100644 index 000000000..8efd7adcb --- /dev/null +++ b/src/Profile/Shopware6/Writer/SalesChannelHomeCmsPageAssociationWriter.php @@ -0,0 +1,21 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Profile\Shopware6\Writer; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; +use SwagMigrationAssistant\Migration\Writer\AbstractWriter; + +#[Package('fundamentals@after-sales')] +class SalesChannelHomeCmsPageAssociationWriter extends AbstractWriter +{ + public function supports(): string + { + return DefaultEntities::SALES_CHANNEL_HOME_CMS_PAGE_ASSOCIATION; + } +} diff --git a/src/Resources/app/administration/src/module/swag-migration/snippet/de.json b/src/Resources/app/administration/src/module/swag-migration/snippet/de.json index 68df9d980..0cd913aff 100644 --- a/src/Resources/app/administration/src/module/swag-migration/snippet/de.json +++ b/src/Resources/app/administration/src/module/swag-migration/snippet/de.json @@ -305,6 +305,7 @@ "currency": "Währungen", "sales_channel": "Verkaufskanäle", "sales_channel_domain": "Domänen", + "sales_channel_home_cms_page_association": "Verkaufskanal-Startseiten-Layout-Verbindungen", "product_review": "Bewertungen", "seo_url": "SEO-URLs", "seo_url_template": "SEO-URL-Vorlagen", @@ -314,6 +315,8 @@ "category_association": "Kategorie-Verbindungen", "category_cms_page_association": "Kategorie-Layout-Verbindungen", "category_product_stream_association": "Kategorie-Dynamische-Produktgruppe-Verbindungen", + "product_canonical_association": "Kanonische-Produkt-Verbindungen", + "product_cms_page_association": "Produkt-Layout-Verbindungen", "tax": "Steuersätze", "tax_rule": "Steuerregeln", "property_group": "Produkteigenschaften-Gruppen", diff --git a/src/Resources/app/administration/src/module/swag-migration/snippet/en.json b/src/Resources/app/administration/src/module/swag-migration/snippet/en.json index f9afc9ea2..fc5908631 100644 --- a/src/Resources/app/administration/src/module/swag-migration/snippet/en.json +++ b/src/Resources/app/administration/src/module/swag-migration/snippet/en.json @@ -305,6 +305,7 @@ "currency": "Currencies", "sales_channel": "Sales Channels", "sales_channel_domain": "Domains", + "sales_channel_home_cms_page_association": "Sales channel home layout associations", "product_review": "Reviews", "seo_url": "SEO URLs", "seo_url_template": "SEO URL templates", @@ -314,6 +315,8 @@ "category_association": "Category associations", "category_cms_page_association": "Category layout associations", "category_product_stream_association": "Category dynamic product group associations", + "product_canonical_association": "Canonical product associations", + "product_cms_page_association": "Product layout associations", "tax": "Tax rates", "tax_rule": "Tax rules", "property_group": "Property groups", diff --git a/tests/Profile/Shopware6/Converter/ProductCanonicalAssociationConverterTest.php b/tests/Profile/Shopware6/Converter/ProductCanonicalAssociationConverterTest.php new file mode 100644 index 000000000..901897077 --- /dev/null +++ b/tests/Profile/Shopware6/Converter/ProductCanonicalAssociationConverterTest.php @@ -0,0 +1,40 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Test\Profile\Shopware6\Converter; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\Converter\ConverterInterface; +use SwagMigrationAssistant\Migration\DataSelection\DataSet\DataSet; +use SwagMigrationAssistant\Migration\Logging\LoggingServiceInterface; +use SwagMigrationAssistant\Migration\Mapping\MappingServiceInterface; +use SwagMigrationAssistant\Migration\Media\MediaFileServiceInterface; +use SwagMigrationAssistant\Profile\Shopware6\Converter\ProductCanonicalAssociationConverter; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCanonicalAssociationDataSet; + +#[Package('fundamentals@after-sales')] +class ProductCanonicalAssociationConverterTest extends ShopwareConverterTest +{ + protected function createConverter( + MappingServiceInterface $mappingService, + LoggingServiceInterface $loggingService, + MediaFileServiceInterface $mediaFileService, + ?array $mappingArray = [], + ): ConverterInterface { + return new ProductCanonicalAssociationConverter($mappingService, $loggingService); + } + + protected function createDataSet(): DataSet + { + return new ProductCanonicalAssociationDataSet(); + } + + protected static function getFixtureBasePath(): string + { + return __DIR__ . '/../../../_fixtures/Shopware6/ProductCanonicalAssociation/'; + } +} diff --git a/tests/Profile/Shopware6/Converter/ProductCmsPageAssociationConverterTest.php b/tests/Profile/Shopware6/Converter/ProductCmsPageAssociationConverterTest.php new file mode 100644 index 000000000..0e406dc40 --- /dev/null +++ b/tests/Profile/Shopware6/Converter/ProductCmsPageAssociationConverterTest.php @@ -0,0 +1,40 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Test\Profile\Shopware6\Converter; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\Converter\ConverterInterface; +use SwagMigrationAssistant\Migration\DataSelection\DataSet\DataSet; +use SwagMigrationAssistant\Migration\Logging\LoggingServiceInterface; +use SwagMigrationAssistant\Migration\Mapping\MappingServiceInterface; +use SwagMigrationAssistant\Migration\Media\MediaFileServiceInterface; +use SwagMigrationAssistant\Profile\Shopware6\Converter\ProductCmsPageAssociationConverter; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\ProductCmsPageAssociationDataSet; + +#[Package('fundamentals@after-sales')] +class ProductCmsPageAssociationConverterTest extends ShopwareConverterTest +{ + protected function createConverter( + MappingServiceInterface $mappingService, + LoggingServiceInterface $loggingService, + MediaFileServiceInterface $mediaFileService, + ?array $mappingArray = [], + ): ConverterInterface { + return new ProductCmsPageAssociationConverter($mappingService, $loggingService); + } + + protected function createDataSet(): DataSet + { + return new ProductCmsPageAssociationDataSet(); + } + + protected static function getFixtureBasePath(): string + { + return __DIR__ . '/../../../_fixtures/Shopware6/ProductCmsPageAssociation/'; + } +} diff --git a/tests/Profile/Shopware6/Converter/SalesChannelHomeCmsPageAssociationConverterTest.php b/tests/Profile/Shopware6/Converter/SalesChannelHomeCmsPageAssociationConverterTest.php new file mode 100644 index 000000000..d379966cf --- /dev/null +++ b/tests/Profile/Shopware6/Converter/SalesChannelHomeCmsPageAssociationConverterTest.php @@ -0,0 +1,40 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SwagMigrationAssistant\Test\Profile\Shopware6\Converter; + +use Shopware\Core\Framework\Log\Package; +use SwagMigrationAssistant\Migration\Converter\ConverterInterface; +use SwagMigrationAssistant\Migration\DataSelection\DataSet\DataSet; +use SwagMigrationAssistant\Migration\Logging\LoggingServiceInterface; +use SwagMigrationAssistant\Migration\Mapping\MappingServiceInterface; +use SwagMigrationAssistant\Migration\Media\MediaFileServiceInterface; +use SwagMigrationAssistant\Profile\Shopware6\Converter\SalesChannelHomeCmsPageAssociationConverter; +use SwagMigrationAssistant\Profile\Shopware6\DataSelection\DataSet\SalesChannelHomeCmsPageAssociationDataSet; + +#[Package('fundamentals@after-sales')] +class SalesChannelHomeCmsPageAssociationConverterTest extends ShopwareConverterTest +{ + protected function createConverter( + MappingServiceInterface $mappingService, + LoggingServiceInterface $loggingService, + MediaFileServiceInterface $mediaFileService, + ?array $mappingArray = [], + ): ConverterInterface { + return new SalesChannelHomeCmsPageAssociationConverter($mappingService, $loggingService); + } + + protected function createDataSet(): DataSet + { + return new SalesChannelHomeCmsPageAssociationDataSet(); + } + + protected static function getFixtureBasePath(): string + { + return __DIR__ . '/../../../_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/'; + } +} diff --git a/tests/_fixtures/Shopware6/Order/05-StripPromotionId/input.php b/tests/_fixtures/Shopware6/Order/05-StripPromotionId/input.php new file mode 100644 index 000000000..74a94b920 --- /dev/null +++ b/tests/_fixtures/Shopware6/Order/05-StripPromotionId/input.php @@ -0,0 +1,474 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'orderNumber' => '10012', + 'currencyId' => 'b7d2554b0ce847cd82f3ac9bd1c0dfca', + 'currencyFactor' => 1, + 'salesChannelId' => '98432def39fc4624b33213a56b8c944d', + 'billingAddressId' => 'f29e62f4b0a94e1cb279a2b9a1c0ab5e', + 'orderDateTime' => '2020-10-14T15:07:42.651+00:00', + 'price' => [ + 'netPrice' => 4133.3, + 'totalPrice' => 4376.45, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 243.14999999999998, + 'taxRate' => 7, + 'price' => 3473.6728971962616, + ], + 1 => [ + 'tax' => 0, + 'taxRate' => 0, + 'price' => 659.62, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + 'positionPrice' => 4133.3, + 'taxStatus' => 'net', + ], + 'shippingCosts' => [ + 'unitPrice' => 0, + 'quantity' => 1, + 'totalPrice' => 0, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 0, + 'taxRate' => 7, + 'price' => 0, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 84.0411510704827, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 15.958677086105533, + ], + ], + ], + 'orderCustomer' => [ + 'email' => 'b018844eae3d4d7d97901a8d3955516etpouros@example.net', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'salutationId' => '7c2800508bce4ee0a1f6aee7c9698831', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'title' => 'Prof. Dr.', + 'customerNumber' => '10005', + 'customerId' => 'b018844eae3d4d7d97901a8d3955516e', + 'id' => '73c9c6d9fd5d4f0b8b7a5d124a7c1264', + ], + 'languageId' => '2fbb5fe2e29a4d70aa5854ce7ce3e20b', + 'addresses' => [ + 0 => [ + 'countryId' => '793d37407690486fa3dc0f72cde3e5fc', + 'salutationId' => '7c2800508bce4ee0a1f6aee7c9698831', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'street' => 'Eve Extension', + 'zipcode' => '18586-5037', + 'city' => 'Hegmannfurt', + 'title' => 'Prof. Dr.', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'id' => 'f29e62f4b0a94e1cb279a2b9a1c0ab5e', + 'countryStateId' => '019243e2514c71e491389bd966855419', + ], + 1 => [ + 'countryId' => 'b5900f53fdf44cc49e668222f435b77b', + 'salutationId' => '7c2800508bce4ee0a1f6aee7c9698831', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'street' => 'Williamson Square', + 'zipcode' => '99658', + 'city' => 'Kihnborough', + 'title' => 'Prof. Dr.', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'id' => 'f96e79ec949d4b90931a89216887b438', + ], + ], + 'deliveries' => [ + 0 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'shippingOrderAddressId' => 'f96e79ec949d4b90931a89216887b438', + 'shippingMethodId' => '256e38edb1274bc3a5e3a9c65371c550', + 'shippingDateEarliest' => '2020-11-16T00:00:00.000+00:00', + 'shippingDateLatest' => '2020-11-18T00:00:00.000+00:00', + 'shippingCosts' => [ + 'unitPrice' => 0, + 'quantity' => 1, + 'totalPrice' => 0, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 0, + 'taxRate' => 7, + 'price' => 0, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 84.0411510704827, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 15.958677086105533, + ], + ], + ], + 'shippingOrderAddress' => [ + 'countryId' => 'b5900f53fdf44cc49e668222f435b77b', + 'salutationId' => '7c2800508bce4ee0a1f6aee7c9698831', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'street' => 'Williamson Square', + 'zipcode' => '99658', + 'city' => 'Kihnborough', + 'title' => 'Prof. Dr.', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'id' => 'f96e79ec949d4b90931a89216887b438', + ], + 'stateId' => '5195a80dc2f0447187cd6cb9a3e77079', + 'stateMachineState' => [ + 'name' => 'Open', + 'technicalName' => 'open', + 'stateMachineId' => '33e6da5ed70345feaeb3a65c5dfc8a0e', + 'stateMachine' => [ + 'technicalName' => 'order_delivery.state', + 'name' => 'Order state', + 'initialStateId' => '5195a80dc2f0447187cd6cb9a3e77079', + 'id' => '33e6da5ed70345feaeb3a65c5dfc8a0e', + ], + 'id' => '5195a80dc2f0447187cd6cb9a3e77079', + ], + 'id' => '8c6259d6e4ef44ed93ed244b349305a2', + ], + ], + 'lineItems' => [ + 0 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'identifier' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'referencedId' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'productId' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'quantity' => 2, + 'unitPrice' => 329.81, + 'totalPrice' => 659.62, + 'label' => 'Heavy Duty Granite Dandy Brand', + 'good' => true, + 'removable' => true, + 'coverId' => 'fb1edaf2e5464a869d8aab3d5a20fdc9', + 'stackable' => true, + 'position' => 3, + 'price' => [ + 'unitPrice' => 329.81, + 'quantity' => 2, + 'totalPrice' => 659.62, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 0, + 'taxRate' => 0, + 'price' => 659.62, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + ], + 'priceDefinition' => [ + 'price' => 329.81, + 'taxRules' => [ + 0 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + 'quantity' => 2, + 'isCalculated' => true, + 'precision' => 2, + 'listPrice' => 0, + 'type' => 'quantity', + ], + 'payload' => [ + 'isCloseout' => false, + 'isNew' => false, + 'purchasePrice' => 90.85, + 'purchasePrices' => '{"currencyId":"b7d2554b0ce847cd82f3ac9bd1c0dfca","net":90.85,"gross":90.85,"linked":true,"listPrice":null,"extensions":[]}', + 'productNumber' => '63c0720dd1d748efa94220256e2bb5c7', + 'manufacturerId' => '3634c8f559524c85b59acadfd419a93a', + 'taxId' => 'ddeda88505ca4ce39799b51ccfab5cac', + 'categoryIds' => [ + 0 => '6ef1902522cc4adda31b8eaec53c870d', + ], + 'propertyIds' => [ + 0 => '1b5528beede34979aa7833b162a8c2f6', + 1 => '1fa100fbfb4a40569e7dd789da5d400b', + 2 => '219b93998d7d430f970fbdc109dba10e', + 3 => '6421ab21d3cf431db8118f04d2fad161', + 4 => '9204e42cea97415592ae632ceb1a3885', + 5 => '98638385e36444729e83055116fc7c3a', + 6 => '9a1752a9d6c741069a0edbc9b47e12df', + 7 => 'a066b075b4b747ae88b14ea45edd5e74', + 8 => 'aebc48fb76a94c848419530c990dc739', + 9 => 'b32a5d9d7f1541e89ad8554cbfe3e12c', + 10 => 'bdee6d99422a4b41953de116ddac520f', + 11 => 'd0fa6f4a2c084209b48812056627f215', + 12 => 'ec056bfebdb941dbb6f4f7796c11df98', + 13 => 'ed686195690d4791b27f66a00615c0be', + 14 => 'f268376e71564abfa1dc857ea8e08508', + 15 => 'f8eb11e818a24356a817549f615d5ec7', + 16 => 'fc4dc89dc001407ab5dc7ffb2c72e7c7', + 17 => 'fd957ea8663048ae8af092bd404151fa', + ], + ], + 'type' => 'product', + 'id' => '1e71d98f547e47739ed6db604e270e2f', + 'promotionId' => '3b3121e6772e48c1bb171f4ff4ff4ff4', + ], + 1 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'identifier' => '553274a0ccb641488c5ba5801414d2bc', + 'referencedId' => '553274a0ccb641488c5ba5801414d2bc', + 'productId' => '553274a0ccb641488c5ba5801414d2bc', + 'quantity' => 1, + 'unitPrice' => 590.4953271028038, + 'totalPrice' => 590.5, + 'label' => 'Mediocre Steel Quick Licks', + 'good' => true, + 'removable' => true, + 'coverId' => '5469f7b0dfb64621b6cd2926b4721612', + 'stackable' => true, + 'position' => 1, + 'price' => [ + 'unitPrice' => 590.4953271028038, + 'quantity' => 1, + 'totalPrice' => 590.5, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 41.33, + 'taxRate' => 7, + 'price' => 590.4953271028038, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + ], + 'priceDefinition' => [ + 'price' => 590.4953271028038, + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + 'quantity' => 1, + 'isCalculated' => true, + 'precision' => 2, + 'listPrice' => 0, + 'type' => 'quantity', + ], + 'payload' => [ + 'isCloseout' => false, + 'isNew' => false, + 'purchasePrice' => 76.94, + 'purchasePrices' => '{"currencyId":"b7d2554b0ce847cd82f3ac9bd1c0dfca","net":71.90654205607476,"gross":76.94,"linked":true,"listPrice":null,"extensions":[]}', + 'productNumber' => 'f5cfda12b99e401aaa6de8ec4f78d9b7', + 'manufacturerId' => 'f5ef1ab8d7ef42d8aa349fb09d1949be', + 'taxId' => 'dfdd3af489d14e3f9fe45966c43c5182', + 'categoryIds' => [ + 0 => '5487b40cb041415e8098b2f8ea62319f', + 1 => '15fcfa722b454f65a8fe4e58c0041391', + ], + 'propertyIds' => [ + 0 => '06571c5b760842e2a3b347b4aba724aa', + 1 => '1b31a24c257c43a98d552ad9341a6a57', + 2 => '219b93998d7d430f970fbdc109dba10e', + 3 => '29fe930068214bdeaea1b3a70eec5894', + 4 => '328f9b7b70c8437a908d751d606afbb2', + 5 => '3e0ba09e7ae449d983e170ba122e6317', + 6 => '591e9562d2cc4a30a53fec23b5bcf7e1', + 7 => '6421ab21d3cf431db8118f04d2fad161', + 8 => '66f0ad0abc6a4b02b3f1d2ca5e5d4721', + 9 => '8765ac67373d439f82439654a88598e9', + 10 => '9204e42cea97415592ae632ceb1a3885', + 11 => 'abcddad818214153a93697d891630509', + 12 => 'b32a5d9d7f1541e89ad8554cbfe3e12c', + 13 => 'b8168455cc194d288da89d1d77f5460e', + 14 => 'c80449c94bba4ac8b7dc9e5284a50c81', + 15 => 'e9fb04cc14b542439808b9dad59fc861', + 16 => 'f0c446af250d4a5b9e6dd5ff251e739a', + 17 => 'f76efab75d2d424a80b769aa53038835', + ], + ], + 'type' => 'product', + 'id' => '7213d230c0834de7961371ce160637ce', + ], + 2 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'identifier' => '575eb6fe95364285b26a5eb57d5ab24e', + 'referencedId' => '575eb6fe95364285b26a5eb57d5ab24e', + 'productId' => '575eb6fe95364285b26a5eb57d5ab24e', + 'quantity' => 5, + 'unitPrice' => 576.6355140186915, + 'totalPrice' => 2883.18, + 'label' => 'Durable Linen Prawn Ton Soup', + 'good' => true, + 'removable' => true, + 'coverId' => 'c09e7037583c4ecbadb4936d4ac02913', + 'stackable' => true, + 'position' => 2, + 'price' => [ + 'unitPrice' => 576.6355140186915, + 'quantity' => 5, + 'totalPrice' => 2883.18, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 201.82, + 'taxRate' => 7, + 'price' => 2883.1775700934577, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + ], + 'priceDefinition' => [ + 'price' => 576.6355140186915, + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + 'quantity' => 5, + 'isCalculated' => true, + 'precision' => 2, + 'type' => 'quantity', + ], + 'payload' => [ + 'isCloseout' => false, + 'isNew' => false, + 'purchasePrice' => 88.41, + 'purchasePrices' => '{"currencyId":"b7d2554b0ce847cd82f3ac9bd1c0dfca","net":82.62616822429906,"gross":88.41,"linked":true,"listPrice":null,"extensions":[]}', + 'productNumber' => 'e4a50fc7df7e44b191daa3258712e415', + 'manufacturerId' => '3634c8f559524c85b59acadfd419a93a', + 'taxId' => 'dfdd3af489d14e3f9fe45966c43c5182', + 'categoryIds' => [ + 0 => '03a16f032437412898c420cbc0e9c46c', + ], + 'propertyIds' => [ + 0 => '06d4c2777d704043aebb2305205665af', + 1 => '2fd0628fafdc41f390607ba807281a58', + 2 => '519a4e5e3aaa4de3926ad42d20fac8d8', + 3 => '7077be1cad214b3dbbf44413313209c8', + 4 => '73e20dac4478458b9448cb0994ff8803', + 5 => '7d3dab90cf854164bc27191fd64f43b4', + 6 => '912028b6b97742158512a5199969311c', + 7 => '99ac9e2003ca46599d3574f35f54303b', + 8 => 'aebc48fb76a94c848419530c990dc739', + 9 => 'b32a5d9d7f1541e89ad8554cbfe3e12c', + 10 => 'c49a012159e349ecb74218e0590b7ded', + 11 => 'c80449c94bba4ac8b7dc9e5284a50c81', + 12 => 'ccd62a7c9d754633b4b13c8a429eae74', + 13 => 'd01873317bce4f838eda107f9efbfcaa', + 14 => 'eaf8c0a32320419586210f8e4374f446', + 15 => 'ec056bfebdb941dbb6f4f7796c11df98', + 16 => 'f8133e24e41b41a8919fcfffdf132cd0', + 17 => 'f8eb11e818a24356a817549f615d5ec7', + ], + ], + 'type' => 'product', + 'id' => '78b191d01e904d2c89efc5838729688e', + ], + ], + 'transactions' => [ + 0 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'paymentMethodId' => '92fa111b3a81433fb22fd17d3d6804fc', + 'amount' => [ + 'unitPrice' => 4376.45, + 'quantity' => 1, + 'totalPrice' => 4376.45, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 243.14999999999998, + 'taxRate' => 7, + 'price' => 3473.6728971962616, + ], + 1 => [ + 'tax' => 0, + 'taxRate' => 0, + 'price' => 659.62, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + ], + 'stateMachineState' => [ + 'name' => 'Open', + 'technicalName' => 'open', + 'stateMachineId' => '67a4cd56205346909a145bebf41c31fe', + 'stateMachine' => [ + 'technicalName' => 'order_transaction . state', + 'name' => 'Payment state', + 'initialStateId' => '3b55f624e3b040f98b3420e79db05729', + 'id' => '67a4cd56205346909a145bebf41c31fe', + ], + 'id' => '3b55f624e3b040f98b3420e79db05729', + ], + 'stateId' => '3b55f624e3b040f98b3420e79db05729', + 'id' => 'e6e10333864f49248ecab59e481fe32e', + ], + ], + 'deepLinkCode' => 'iBUe5S7w3a8sYxAKYboK1zk9oGnc9_bL', + 'stateMachineState' => [ + 'name' => 'Open', + 'technicalName' => 'open', + 'stateMachineId' => '44c7774d8a4b4bb985a86b8162a2b4b8', + 'stateMachine' => [ + 'technicalName' => 'order . state', + 'name' => 'Order state', + 'initialStateId' => '225a07ac700649848be1da88eb5cfbb2', + 'id' => '44c7774d8a4b4bb985a86b8162a2b4b8', + ], + 'id' => '225a07ac700649848be1da88eb5cfbb2', + ], + 'stateId' => '225a07ac700649848be1da88eb5cfbb2', + 'ruleIds' => [ + 0 => 'a6cc47655efc4fa893e91d1cdea88f8b', + 1 => 'addbf17d94374bfaa2f2d2b57baa5161', + 2 => 'e3563b3f63c14b52a9b1dedfbc12c2fa', + ], + 'id' => 'efaf7e8752b242baa67ed795d18f785d', +]; diff --git a/tests/_fixtures/Shopware6/Order/05-StripPromotionId/mapping.php b/tests/_fixtures/Shopware6/Order/05-StripPromotionId/mapping.php new file mode 100644 index 000000000..3acbaf49e --- /dev/null +++ b/tests/_fixtures/Shopware6/Order/05-StripPromotionId/mapping.php @@ -0,0 +1,111 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +return [ + [ + 'entityName' => DefaultEntities::CURRENCY, + 'oldIdentifier' => 'b7d2554b0ce847cd82f3ac9bd1c0dfca', + 'newIdentifier' => '5dd637353d044752ae6a8c6e7f53430b', + ], + [ + 'entityName' => DefaultEntities::SALES_CHANNEL, + 'oldIdentifier' => '98432def39fc4624b33213a56b8c944d', + 'newIdentifier' => '665b8a01d83841369cf3c58d22481a3d', + ], + [ + 'entityName' => DefaultEntities::SALUTATION, + 'oldIdentifier' => '7c2800508bce4ee0a1f6aee7c9698831', + 'newIdentifier' => '665b8a01d83841369cf3c58d22481a3d', + ], + [ + 'entityName' => DefaultEntities::LANGUAGE, + 'oldIdentifier' => '2fbb5fe2e29a4d70aa5854ce7ce3e20b', + 'newIdentifier' => '5dd637353d044752ae6a8c6e7f53430b', + ], + [ + 'entityName' => DefaultEntities::COUNTRY, + 'oldIdentifier' => 'b5900f53fdf44cc49e668222f435b77b', + 'newIdentifier' => '885b8a01d83841369cf3c58d22481a3d', + ], + [ + 'entityName' => DefaultEntities::COUNTRY, + 'oldIdentifier' => '793d37407690486fa3dc0f72cde3e5fc', + 'newIdentifier' => '793d37407690486fa3dc0f72cde3e5fc', + ], + [ + 'entityName' => DefaultEntities::COUNTRY_STATE, + 'oldIdentifier' => '019243e2514c71e491389bd966855419', + 'newIdentifier' => '019243e2514672debd864b2b979544f4', + ], + [ + 'entityName' => DefaultEntities::STATE_MACHINE_STATE, + 'oldIdentifier' => '5195a80dc2f0447187cd6cb9a3e77079', + 'newIdentifier' => '775b8a01d83841369cf3c58d22481a3d', + ], + [ + 'entityName' => DefaultEntities::STATE_MACHINE_STATE, + 'oldIdentifier' => '225a07ac700649848be1da88eb5cfbb2', + 'newIdentifier' => '665b8a01d83841369cf3c58d22481a3d', + ], + [ + 'entityName' => DefaultEntities::STATE_MACHINE_STATE, + 'oldIdentifier' => '3b55f624e3b040f98b3420e79db05729', + 'newIdentifier' => '555b8a01d83841369cf3c58d22481a3d', + ], + [ + 'entityName' => DefaultEntities::PRODUCT, + 'oldIdentifier' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'newIdentifier' => '59708e360b82402bbf3ceb2b7bff4ebb', + ], + [ + 'entityName' => DefaultEntities::PRODUCT, + 'oldIdentifier' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'newIdentifier' => '59708e360b82402bbf3ceb2b7bff4ebb', + ], + [ + 'entityName' => DefaultEntities::PRODUCT, + 'oldIdentifier' => '553274a0ccb641488c5ba5801414d2bc', + 'newIdentifier' => '553274a0ccb641488c5ba5801414d2bc', + ], + [ + 'entityName' => DefaultEntities::PRODUCT, + 'oldIdentifier' => '575eb6fe95364285b26a5eb57d5ab24e', + 'newIdentifier' => '575eb6fe95364285b26a5eb57d5ab24e', + ], + [ + 'entityName' => DefaultEntities::MEDIA, + 'oldIdentifier' => 'fb1edaf2e5464a869d8aab3d5a20fdc9', + 'newIdentifier' => 'fb1edaf2e5464a869d8aab3d5a20fdc9', + ], + [ + 'entityName' => DefaultEntities::MEDIA, + 'oldIdentifier' => '5469f7b0dfb64621b6cd2926b4721612', + 'newIdentifier' => '5469f7b0dfb64621b6cd2926b4721612', + ], + [ + 'entityName' => DefaultEntities::MEDIA, + 'oldIdentifier' => 'c09e7037583c4ecbadb4936d4ac02913', + 'newIdentifier' => 'c09e7037583c4ecbadb4936d4ac02913', + ], + [ + 'entityName' => DefaultEntities::PAYMENT_METHOD, + 'oldIdentifier' => '92fa111b3a81433fb22fd17d3d6804fc', + 'newIdentifier' => '92fa111b3a81433fb22fd17d3d6804fc', + ], + [ + 'entityName' => DefaultEntities::TAX, + 'oldIdentifier' => 'ddeda88505ca4ce39799b51ccfab5cac', + 'newIdentifier' => 'ddeda88505ca4ce39799b51ccfab5cac', + ], + [ + 'entityName' => DefaultEntities::TAX, + 'oldIdentifier' => 'dfdd3af489d14e3f9fe45966c43c5182', + 'newIdentifier' => 'dfdd3af489d14e3f9fe45966c43c5182', + ], +]; diff --git a/tests/_fixtures/Shopware6/Order/05-StripPromotionId/output.php b/tests/_fixtures/Shopware6/Order/05-StripPromotionId/output.php new file mode 100644 index 000000000..4fb74d8e8 --- /dev/null +++ b/tests/_fixtures/Shopware6/Order/05-StripPromotionId/output.php @@ -0,0 +1,440 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'orderNumber' => '10012', + 'currencyId' => '5dd637353d044752ae6a8c6e7f53430b', + 'currencyFactor' => 1, + 'salesChannelId' => '665b8a01d83841369cf3c58d22481a3d', + 'billingAddressId' => 'f29e62f4b0a94e1cb279a2b9a1c0ab5e', + 'orderDateTime' => '2020-10-14T15:07:42.651+00:00', + 'price' => [ + 'netPrice' => 4133.3, + 'totalPrice' => 4376.45, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 243.14999999999998, + 'taxRate' => 7, + 'price' => 3473.6728971962616, + ], + 1 => [ + 'tax' => 0, + 'taxRate' => 0, + 'price' => 659.62, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + 'positionPrice' => 4133.3, + 'taxStatus' => 'net', + 'rawTotal' => 4376.45, + ], + 'shippingCosts' => [ + 'unitPrice' => 0, + 'quantity' => 1, + 'totalPrice' => 0, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 0, + 'taxRate' => 7, + 'price' => 0, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 84.0411510704827, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 15.958677086105533, + ], + ], + ], + 'orderCustomer' => [ + 'email' => 'b018844eae3d4d7d97901a8d3955516etpouros@example.net', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'salutationId' => '665b8a01d83841369cf3c58d22481a3d', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'title' => 'Prof. Dr.', + 'customerNumber' => '10005', + 'customerId' => 'b018844eae3d4d7d97901a8d3955516e', + 'id' => '73c9c6d9fd5d4f0b8b7a5d124a7c1264', + ], + 'languageId' => '5dd637353d044752ae6a8c6e7f53430b', + 'addresses' => [ + 0 => [ + 'countryId' => '793d37407690486fa3dc0f72cde3e5fc', + 'salutationId' => '665b8a01d83841369cf3c58d22481a3d', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'street' => 'Eve Extension', + 'zipcode' => '18586-5037', + 'city' => 'Hegmannfurt', + 'title' => 'Prof. Dr.', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'id' => 'f29e62f4b0a94e1cb279a2b9a1c0ab5e', + 'countryStateId' => '019243e2514672debd864b2b979544f4', + ], + 1 => [ + 'countryId' => '885b8a01d83841369cf3c58d22481a3d', + 'salutationId' => '665b8a01d83841369cf3c58d22481a3d', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'street' => 'Williamson Square', + 'zipcode' => '99658', + 'city' => 'Kihnborough', + 'title' => 'Prof. Dr.', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'id' => 'f96e79ec949d4b90931a89216887b438', + ], + ], + 'deliveries' => [ + 0 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'shippingOrderAddressId' => 'f96e79ec949d4b90931a89216887b438', + 'shippingMethodId' => '256e38edb1274bc3a5e3a9c65371c550', + 'shippingDateEarliest' => '2020-11-16T00:00:00.000+00:00', + 'shippingDateLatest' => '2020-11-18T00:00:00.000+00:00', + 'shippingCosts' => [ + 'unitPrice' => 0, + 'quantity' => 1, + 'totalPrice' => 0, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 0, + 'taxRate' => 7, + 'price' => 0, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 84.0411510704827, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 15.958677086105533, + ], + ], + ], + 'shippingOrderAddress' => [ + 'countryId' => '885b8a01d83841369cf3c58d22481a3d', + 'salutationId' => '665b8a01d83841369cf3c58d22481a3d', + 'firstName' => 'Hoyt', + 'lastName' => 'Murphy', + 'street' => 'Williamson Square', + 'zipcode' => '99658', + 'city' => 'Kihnborough', + 'title' => 'Prof. Dr.', + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'id' => 'f96e79ec949d4b90931a89216887b438', + ], + 'stateId' => '775b8a01d83841369cf3c58d22481a3d', + 'id' => '8c6259d6e4ef44ed93ed244b349305a2', + ], + ], + 'lineItems' => [ + 0 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'identifier' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'referencedId' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'productId' => '59708e360b82402bbf3ceb2b7bff4ebb', + 'quantity' => 2, + 'unitPrice' => 329.81, + 'totalPrice' => 659.62, + 'label' => 'Heavy Duty Granite Dandy Brand', + 'good' => true, + 'removable' => true, + 'coverId' => 'fb1edaf2e5464a869d8aab3d5a20fdc9', + 'stackable' => true, + 'position' => 3, + 'price' => [ + 'unitPrice' => 329.81, + 'quantity' => 2, + 'totalPrice' => 659.62, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 0, + 'taxRate' => 0, + 'price' => 659.62, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + ], + 'priceDefinition' => [ + 'price' => 329.81, + 'taxRules' => [ + 0 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + 'quantity' => 2, + 'isCalculated' => true, + 'precision' => 2, + 'listPrice' => 0, + 'type' => 'quantity', + ], + 'payload' => [ + 'isCloseout' => false, + 'isNew' => false, + 'purchasePrice' => 90.85, + 'purchasePrices' => '{"currencyId":"b7d2554b0ce847cd82f3ac9bd1c0dfca","net":90.85,"gross":90.85,"linked":true,"listPrice":null,"extensions":[]}', + 'productNumber' => '63c0720dd1d748efa94220256e2bb5c7', + 'manufacturerId' => '3634c8f559524c85b59acadfd419a93a', + 'taxId' => 'ddeda88505ca4ce39799b51ccfab5cac', + 'categoryIds' => [ + 0 => '6ef1902522cc4adda31b8eaec53c870d', + ], + 'propertyIds' => [ + 0 => '1b5528beede34979aa7833b162a8c2f6', + 1 => '1fa100fbfb4a40569e7dd789da5d400b', + 2 => '219b93998d7d430f970fbdc109dba10e', + 3 => '6421ab21d3cf431db8118f04d2fad161', + 4 => '9204e42cea97415592ae632ceb1a3885', + 5 => '98638385e36444729e83055116fc7c3a', + 6 => '9a1752a9d6c741069a0edbc9b47e12df', + 7 => 'a066b075b4b747ae88b14ea45edd5e74', + 8 => 'aebc48fb76a94c848419530c990dc739', + 9 => 'b32a5d9d7f1541e89ad8554cbfe3e12c', + 10 => 'bdee6d99422a4b41953de116ddac520f', + 11 => 'd0fa6f4a2c084209b48812056627f215', + 12 => 'ec056bfebdb941dbb6f4f7796c11df98', + 13 => 'ed686195690d4791b27f66a00615c0be', + 14 => 'f268376e71564abfa1dc857ea8e08508', + 15 => 'f8eb11e818a24356a817549f615d5ec7', + 16 => 'fc4dc89dc001407ab5dc7ffb2c72e7c7', + 17 => 'fd957ea8663048ae8af092bd404151fa', + ], + ], + 'type' => 'product', + 'id' => '1e71d98f547e47739ed6db604e270e2f', + ], + 1 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'identifier' => '553274a0ccb641488c5ba5801414d2bc', + 'referencedId' => '553274a0ccb641488c5ba5801414d2bc', + 'productId' => '553274a0ccb641488c5ba5801414d2bc', + 'quantity' => 1, + 'unitPrice' => 590.4953271028038, + 'totalPrice' => 590.5, + 'label' => 'Mediocre Steel Quick Licks', + 'good' => true, + 'removable' => true, + 'coverId' => '5469f7b0dfb64621b6cd2926b4721612', + 'stackable' => true, + 'position' => 1, + 'price' => [ + 'unitPrice' => 590.4953271028038, + 'quantity' => 1, + 'totalPrice' => 590.5, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 41.33, + 'taxRate' => 7, + 'price' => 590.4953271028038, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + ], + 'priceDefinition' => [ + 'price' => 590.4953271028038, + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + 'quantity' => 1, + 'isCalculated' => true, + 'precision' => 2, + 'listPrice' => 0, + 'type' => 'quantity', + ], + 'payload' => [ + 'isCloseout' => false, + 'isNew' => false, + 'purchasePrice' => 76.94, + 'purchasePrices' => '{"currencyId":"b7d2554b0ce847cd82f3ac9bd1c0dfca","net":71.90654205607476,"gross":76.94,"linked":true,"listPrice":null,"extensions":[]}', + 'productNumber' => 'f5cfda12b99e401aaa6de8ec4f78d9b7', + 'manufacturerId' => 'f5ef1ab8d7ef42d8aa349fb09d1949be', + 'taxId' => 'dfdd3af489d14e3f9fe45966c43c5182', + 'categoryIds' => [ + 0 => '5487b40cb041415e8098b2f8ea62319f', + 1 => '15fcfa722b454f65a8fe4e58c0041391', + ], + 'propertyIds' => [ + 0 => '06571c5b760842e2a3b347b4aba724aa', + 1 => '1b31a24c257c43a98d552ad9341a6a57', + 2 => '219b93998d7d430f970fbdc109dba10e', + 3 => '29fe930068214bdeaea1b3a70eec5894', + 4 => '328f9b7b70c8437a908d751d606afbb2', + 5 => '3e0ba09e7ae449d983e170ba122e6317', + 6 => '591e9562d2cc4a30a53fec23b5bcf7e1', + 7 => '6421ab21d3cf431db8118f04d2fad161', + 8 => '66f0ad0abc6a4b02b3f1d2ca5e5d4721', + 9 => '8765ac67373d439f82439654a88598e9', + 10 => '9204e42cea97415592ae632ceb1a3885', + 11 => 'abcddad818214153a93697d891630509', + 12 => 'b32a5d9d7f1541e89ad8554cbfe3e12c', + 13 => 'b8168455cc194d288da89d1d77f5460e', + 14 => 'c80449c94bba4ac8b7dc9e5284a50c81', + 15 => 'e9fb04cc14b542439808b9dad59fc861', + 16 => 'f0c446af250d4a5b9e6dd5ff251e739a', + 17 => 'f76efab75d2d424a80b769aa53038835', + ], + ], + 'type' => 'product', + 'id' => '7213d230c0834de7961371ce160637ce', + ], + 2 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'identifier' => '575eb6fe95364285b26a5eb57d5ab24e', + 'referencedId' => '575eb6fe95364285b26a5eb57d5ab24e', + 'productId' => '575eb6fe95364285b26a5eb57d5ab24e', + 'quantity' => 5, + 'unitPrice' => 576.6355140186915, + 'totalPrice' => 2883.18, + 'label' => 'Durable Linen Prawn Ton Soup', + 'good' => true, + 'removable' => true, + 'coverId' => 'c09e7037583c4ecbadb4936d4ac02913', + 'stackable' => true, + 'position' => 2, + 'price' => [ + 'unitPrice' => 576.6355140186915, + 'quantity' => 5, + 'totalPrice' => 2883.18, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 201.82, + 'taxRate' => 7, + 'price' => 2883.1775700934577, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + ], + 'priceDefinition' => [ + 'price' => 576.6355140186915, + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + ], + 'quantity' => 5, + 'isCalculated' => true, + 'precision' => 2, + 'type' => 'quantity', + ], + 'payload' => [ + 'isCloseout' => false, + 'isNew' => false, + 'purchasePrice' => 88.41, + 'purchasePrices' => '{"currencyId":"b7d2554b0ce847cd82f3ac9bd1c0dfca","net":82.62616822429906,"gross":88.41,"linked":true,"listPrice":null,"extensions":[]}', + 'productNumber' => 'e4a50fc7df7e44b191daa3258712e415', + 'manufacturerId' => '3634c8f559524c85b59acadfd419a93a', + 'taxId' => 'dfdd3af489d14e3f9fe45966c43c5182', + 'categoryIds' => [ + 0 => '03a16f032437412898c420cbc0e9c46c', + ], + 'propertyIds' => [ + 0 => '06d4c2777d704043aebb2305205665af', + 1 => '2fd0628fafdc41f390607ba807281a58', + 2 => '519a4e5e3aaa4de3926ad42d20fac8d8', + 3 => '7077be1cad214b3dbbf44413313209c8', + 4 => '73e20dac4478458b9448cb0994ff8803', + 5 => '7d3dab90cf854164bc27191fd64f43b4', + 6 => '912028b6b97742158512a5199969311c', + 7 => '99ac9e2003ca46599d3574f35f54303b', + 8 => 'aebc48fb76a94c848419530c990dc739', + 9 => 'b32a5d9d7f1541e89ad8554cbfe3e12c', + 10 => 'c49a012159e349ecb74218e0590b7ded', + 11 => 'c80449c94bba4ac8b7dc9e5284a50c81', + 12 => 'ccd62a7c9d754633b4b13c8a429eae74', + 13 => 'd01873317bce4f838eda107f9efbfcaa', + 14 => 'eaf8c0a32320419586210f8e4374f446', + 15 => 'ec056bfebdb941dbb6f4f7796c11df98', + 16 => 'f8133e24e41b41a8919fcfffdf132cd0', + 17 => 'f8eb11e818a24356a817549f615d5ec7', + ], + ], + 'type' => 'product', + 'id' => '78b191d01e904d2c89efc5838729688e', + ], + ], + 'transactions' => [ + 0 => [ + 'orderId' => 'efaf7e8752b242baa67ed795d18f785d', + 'paymentMethodId' => '92fa111b3a81433fb22fd17d3d6804fc', + 'amount' => [ + 'unitPrice' => 4376.45, + 'quantity' => 1, + 'totalPrice' => 4376.45, + 'calculatedTaxes' => [ + 0 => [ + 'tax' => 243.14999999999998, + 'taxRate' => 7, + 'price' => 3473.6728971962616, + ], + 1 => [ + 'tax' => 0, + 'taxRate' => 0, + 'price' => 659.62, + ], + ], + 'taxRules' => [ + 0 => [ + 'taxRate' => 7, + 'percentage' => 100, + ], + 1 => [ + 'taxRate' => 0, + 'percentage' => 100, + ], + ], + ], + 'stateId' => '555b8a01d83841369cf3c58d22481a3d', + 'id' => 'e6e10333864f49248ecab59e481fe32e', + ], + ], + 'deepLinkCode' => 'iBUe5S7w3a8sYxAKYboK1zk9oGnc9_bL', + 'stateId' => '665b8a01d83841369cf3c58d22481a3d', + 'ruleIds' => [ + 0 => 'a6cc47655efc4fa893e91d1cdea88f8b', + 1 => 'addbf17d94374bfaa2f2d2b57baa5161', + 2 => 'e3563b3f63c14b52a9b1dedfbc12c2fa', + ], + 'id' => 'efaf7e8752b242baa67ed795d18f785d', + 'primaryOrderDeliveryId' => '8c6259d6e4ef44ed93ed244b349305a2', + 'primaryOrderTransactionId' => 'e6e10333864f49248ecab59e481fe32e', +]; diff --git a/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/input.php b/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/input.php new file mode 100644 index 000000000..c0ebc9108 --- /dev/null +++ b/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/input.php @@ -0,0 +1,12 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'productNumber' => 'SW10000', + 'canonicalProductId' => 'ab4dd5b6656b4b44bc2fe9f36a18d17d', +]; diff --git a/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/mapping.php b/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/mapping.php new file mode 100644 index 000000000..2c3ce3366 --- /dev/null +++ b/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/mapping.php @@ -0,0 +1,8 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return []; diff --git a/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/output.php b/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/output.php new file mode 100644 index 000000000..b01a55c70 --- /dev/null +++ b/tests/_fixtures/Shopware6/Product/11-StripCanonicalProductAssociation/output.php @@ -0,0 +1,12 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'productNumber' => 'SW10000', + 'type' => 'physical', +]; diff --git a/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/input.php b/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/input.php new file mode 100644 index 000000000..e44e93d74 --- /dev/null +++ b/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/input.php @@ -0,0 +1,12 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'productNumber' => 'SW10000', + 'cmsPageId' => 'f7db027466ac4808a7b855754bd0cfa9', +]; diff --git a/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/mapping.php b/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/mapping.php new file mode 100644 index 000000000..2c3ce3366 --- /dev/null +++ b/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/mapping.php @@ -0,0 +1,8 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return []; diff --git a/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/output.php b/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/output.php new file mode 100644 index 000000000..b01a55c70 --- /dev/null +++ b/tests/_fixtures/Shopware6/Product/12-StripCmsPageAssociation/output.php @@ -0,0 +1,12 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'productNumber' => 'SW10000', + 'type' => 'physical', +]; diff --git a/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/input.php b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/input.php new file mode 100644 index 000000000..b61bb0875 --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/input.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'canonicalProductId' => 'ab4dd5b6656b4b44bc2fe9f36a18d17d', +]; diff --git a/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/mapping.php b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/mapping.php new file mode 100644 index 000000000..33abeb173 --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/mapping.php @@ -0,0 +1,16 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +return [ + [ + 'entityName' => DefaultEntities::PRODUCT, + 'oldIdentifier' => 'ab4dd5b6656b4b44bc2fe9f36a18d17d', + 'newIdentifier' => '0f5be78db20b4068b5d9d776fcf6740a', + ], +]; diff --git a/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/output.php b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/output.php new file mode 100644 index 000000000..d99792bd5 --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/01-HappyCase/output.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'canonicalProductId' => '0f5be78db20b4068b5d9d776fcf6740a', +]; diff --git a/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/input.php b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/input.php new file mode 100644 index 000000000..b61bb0875 --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/input.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'canonicalProductId' => 'ab4dd5b6656b4b44bc2fe9f36a18d17d', +]; diff --git a/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/log.php b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/log.php new file mode 100644 index 000000000..cc0466b52 --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/log.php @@ -0,0 +1,14 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\Logging\Log\ConvertAssociationMissingLog; + +return [ + [ + 'code' => ConvertAssociationMissingLog::getCode(), + ], +]; diff --git a/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/output.php b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/output.php new file mode 100644 index 000000000..e2f03a09d --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCanonicalAssociation/02-MissingCanonicalProductMapping/output.php @@ -0,0 +1,10 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', +]; diff --git a/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/input.php b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/input.php new file mode 100644 index 000000000..d5e73931e --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/input.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'cmsPageId' => 'f7db027466ac4808a7b855754bd0cfa9', +]; diff --git a/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/mapping.php b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/mapping.php new file mode 100644 index 000000000..94dfeaeb8 --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/mapping.php @@ -0,0 +1,16 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +return [ + [ + 'entityName' => DefaultEntities::CMS_PAGE, + 'oldIdentifier' => 'f7db027466ac4808a7b855754bd0cfa9', + 'newIdentifier' => '41248655c60c4dd58cde43f14cd4f149', + ], +]; diff --git a/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/output.php b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/output.php new file mode 100644 index 000000000..729c1544a --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/01-HappyCase/output.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'cmsPageId' => '41248655c60c4dd58cde43f14cd4f149', +]; diff --git a/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/input.php b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/input.php new file mode 100644 index 000000000..d5e73931e --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/input.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', + 'cmsPageId' => 'f7db027466ac4808a7b855754bd0cfa9', +]; diff --git a/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/log.php b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/log.php new file mode 100644 index 000000000..cc0466b52 --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/log.php @@ -0,0 +1,14 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\Logging\Log\ConvertAssociationMissingLog; + +return [ + [ + 'code' => ConvertAssociationMissingLog::getCode(), + ], +]; diff --git a/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/output.php b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/output.php new file mode 100644 index 000000000..e2f03a09d --- /dev/null +++ b/tests/_fixtures/Shopware6/ProductCmsPageAssociation/02-MissingCmsPageMapping/output.php @@ -0,0 +1,10 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '6313d15a735a4fd08508dd349ad010f9', +]; diff --git a/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/input.php b/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/input.php new file mode 100644 index 000000000..47bc22aa0 --- /dev/null +++ b/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/input.php @@ -0,0 +1,141 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'name' => 'BlackFriday', + 'active' => true, + 'validFrom' => '2020-11-01T12:00:00.000+00:00', + 'validUntil' => '2020-12-31T12:00:00.000+00:00', + 'maxRedemptionsGlobal' => 1500, + 'maxRedemptionsPerCustomer' => 5, + 'exclusive' => false, + 'useCodes' => true, + 'useSetGroups' => false, + 'customerRestriction' => false, + 'useIndividualCodes' => true, + 'individualCodePattern' => 'BLACK-FRIDAY-%d%d', + 'salesChannels' => [ + [ + 'salesChannelId' => '98432def39fc4624b33213a56b8c944d', + 'priority' => 1, + 'id' => '0eb744c71b88478f81ece1be37b7b846', + ], + [ + 'salesChannelId' => 'cd2fc096384c4e048791f6aef41af84c', + 'priority' => 1, + 'id' => '304b7c825c96498e847a6318badb8340', + ], + [ + 'salesChannelId' => '11d1d4e0218e4eb48e1a1eceac9c76d3', + 'priority' => 1, + 'id' => '6fdf440b227148b7824234ed9da33658', + ], + ], + 'discounts' => [ + [ + 'scope' => 'cart', + 'type' => 'percentage', + 'value' => 10, + 'considerAdvancedRules' => false, + 'maxValue' => 1000, + 'sorterKey' => 'PRICE_ASC', + 'applierKey' => 'ALL', + 'usageKey' => 'ALL', + 'id' => 'eb25d17b770645e3baa7dac2a6dc60ab', + ], + ], + 'individualCodes' => [ + [ + 'code' => 'BLACK-FRIDAY-33', + 'id' => '0078ec1575554ddb8f80fb8128bc5a6f', + ], + [ + 'code' => 'BLACK-FRIDAY-71', + 'payload' => [ + 'orderId' => '96d7123158bb4fb28cb5e2342d1fa38b', + 'customerId' => '828e0550c1b3402e89f7757b0090d4b4', + 'customerName' => 'Krispin Luetjann', + ], + 'id' => '2e57d9d01e2848ea9475f644fd76647c', + ], + [ + 'code' => 'BLACK-FRIDAY-42', + 'id' => '331fb687cf42470bbf0223b8dc7df16c', + ], + [ + 'code' => 'BLACK-FRIDAY-0', + 'payload' => [ + 'orderId' => 'e2afd5d90f1848b5b720ab23245d4712', + 'customerId' => '828e0550c1b3402e89f7757b0090d4b4', + 'customerName' => 'Krispin Luetjann', + ], + 'id' => '3e2a612b96d94c88af5be2a4bda66759', + ], + [ + 'code' => 'BLACK-FRIDAY-78', + 'id' => '6246f2dbaaed492f9fb742fcba514a73', + ], + [ + 'code' => 'BLACK-FRIDAY-95', + 'id' => '686872885bc0430cb25c4b503042bbbd', + ], + [ + 'code' => 'BLACK-FRIDAY-20', + 'id' => '88520e2c71e54edfa35c4e5ee11f35b2', + ], + [ + 'code' => 'BLACK-FRIDAY-23', + 'id' => 'a5afda08b58648b9a44bb99f1368ba77', + ], + [ + 'code' => 'BLACK-FRIDAY-93', + 'id' => 'b3b28b67f79f43a98d87aa669ebd3c3a', + ], + [ + 'code' => 'BLACK-FRIDAY-14', + 'id' => 'b7b80913f3654595a381ed20e3a68b54', + ], + [ + 'code' => 'BLACK-FRIDAY-50', + 'id' => 'be4189635e2c403f8798686253373f4a', + ], + [ + 'code' => 'BLACK-FRIDAY-39', + 'id' => 'eccb8ea3707c43b2b1d3d04b90c9f765', + ], + ], + 'personaRules' => [ + [ + 'id' => '8b773a602272453eb4df291c7c83c5e5', + ], + ], + 'personaCustomers' => [ + [ + 'id' => '828e0550c1b3402e89f7757b0090d4b4', + ], + ], + 'cartRules' => [ + [ + 'id' => '8b773a602272453eb4df291c7c83c5e5', + ], + ], + 'translations' => [ + [ + 'name' => 'BlackFriday', + 'languageId' => '2fbb5fe2e29a4d70aa5854ce7ce3e20b', + ], + ], + 'orderCount' => 2, + 'ordersPerCustomerCount' => [ + '828e0550c1b3402e89f7757b0090d4b4' => 2, + ], + 'exclusionIds' => [ + 0 => 'cb88e0d0bde9419baaa09ed0508c50b9', + ], + 'id' => '7e8b76efced84b6ab4d9737a580ef8c8', + 'promotionId' => '2d0ed2f8378d4f3e980d29f306d4e20e', +]; diff --git a/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/mapping.php b/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/mapping.php new file mode 100644 index 000000000..a46e04c0e --- /dev/null +++ b/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/mapping.php @@ -0,0 +1,16 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +return [ + [ + 'entityName' => DefaultEntities::LANGUAGE, + 'oldIdentifier' => '2fbb5fe2e29a4d70aa5854ce7ce3e20b', + 'newIdentifier' => '2fbb5fe2e29a4d70aa5854ce7ce3e20b', + ], +]; diff --git a/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/output.php b/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/output.php new file mode 100644 index 000000000..ac84637e7 --- /dev/null +++ b/tests/_fixtures/Shopware6/Promotion/02-StripPromotionAssociation/output.php @@ -0,0 +1,140 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'name' => 'BlackFriday', + 'active' => true, + 'validFrom' => '2020-11-01T12:00:00.000+00:00', + 'validUntil' => '2020-12-31T12:00:00.000+00:00', + 'maxRedemptionsGlobal' => 1500, + 'maxRedemptionsPerCustomer' => 5, + 'exclusive' => false, + 'useCodes' => true, + 'useSetGroups' => false, + 'customerRestriction' => false, + 'useIndividualCodes' => true, + 'individualCodePattern' => 'BLACK-FRIDAY-%d%d', + 'salesChannels' => [ + [ + 'salesChannelId' => '98432def39fc4624b33213a56b8c944d', + 'priority' => 1, + 'id' => '0eb744c71b88478f81ece1be37b7b846', + ], + [ + 'salesChannelId' => 'cd2fc096384c4e048791f6aef41af84c', + 'priority' => 1, + 'id' => '304b7c825c96498e847a6318badb8340', + ], + [ + 'salesChannelId' => '11d1d4e0218e4eb48e1a1eceac9c76d3', + 'priority' => 1, + 'id' => '6fdf440b227148b7824234ed9da33658', + ], + ], + 'discounts' => [ + [ + 'scope' => 'cart', + 'type' => 'percentage', + 'value' => 10, + 'considerAdvancedRules' => false, + 'maxValue' => 1000, + 'sorterKey' => 'PRICE_ASC', + 'applierKey' => 'ALL', + 'usageKey' => 'ALL', + 'id' => 'eb25d17b770645e3baa7dac2a6dc60ab', + ], + ], + 'individualCodes' => [ + [ + 'code' => 'BLACK-FRIDAY-33', + 'id' => '0078ec1575554ddb8f80fb8128bc5a6f', + ], + [ + 'code' => 'BLACK-FRIDAY-71', + 'payload' => [ + 'orderId' => '96d7123158bb4fb28cb5e2342d1fa38b', + 'customerId' => '828e0550c1b3402e89f7757b0090d4b4', + 'customerName' => 'Krispin Luetjann', + ], + 'id' => '2e57d9d01e2848ea9475f644fd76647c', + ], + [ + 'code' => 'BLACK-FRIDAY-42', + 'id' => '331fb687cf42470bbf0223b8dc7df16c', + ], + [ + 'code' => 'BLACK-FRIDAY-0', + 'payload' => [ + 'orderId' => 'e2afd5d90f1848b5b720ab23245d4712', + 'customerId' => '828e0550c1b3402e89f7757b0090d4b4', + 'customerName' => 'Krispin Luetjann', + ], + 'id' => '3e2a612b96d94c88af5be2a4bda66759', + ], + [ + 'code' => 'BLACK-FRIDAY-78', + 'id' => '6246f2dbaaed492f9fb742fcba514a73', + ], + [ + 'code' => 'BLACK-FRIDAY-95', + 'id' => '686872885bc0430cb25c4b503042bbbd', + ], + [ + 'code' => 'BLACK-FRIDAY-20', + 'id' => '88520e2c71e54edfa35c4e5ee11f35b2', + ], + [ + 'code' => 'BLACK-FRIDAY-23', + 'id' => 'a5afda08b58648b9a44bb99f1368ba77', + ], + [ + 'code' => 'BLACK-FRIDAY-93', + 'id' => 'b3b28b67f79f43a98d87aa669ebd3c3a', + ], + [ + 'code' => 'BLACK-FRIDAY-14', + 'id' => 'b7b80913f3654595a381ed20e3a68b54', + ], + [ + 'code' => 'BLACK-FRIDAY-50', + 'id' => 'be4189635e2c403f8798686253373f4a', + ], + [ + 'code' => 'BLACK-FRIDAY-39', + 'id' => 'eccb8ea3707c43b2b1d3d04b90c9f765', + ], + ], + 'personaRules' => [ + [ + 'id' => '8b773a602272453eb4df291c7c83c5e5', + ], + ], + 'personaCustomers' => [ + [ + 'id' => '828e0550c1b3402e89f7757b0090d4b4', + ], + ], + 'cartRules' => [ + [ + 'id' => '8b773a602272453eb4df291c7c83c5e5', + ], + ], + 'translations' => [ + [ + 'name' => 'BlackFriday', + 'languageId' => '2fbb5fe2e29a4d70aa5854ce7ce3e20b', + ], + ], + 'orderCount' => 2, + 'ordersPerCustomerCount' => [ + '828e0550c1b3402e89f7757b0090d4b4' => 2, + ], + 'exclusionIds' => [ + 0 => 'cb88e0d0bde9419baaa09ed0508c50b9', + ], + 'id' => '7e8b76efced84b6ab4d9737a580ef8c8', +]; diff --git a/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/input.php b/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/input.php new file mode 100644 index 000000000..8cd125278 --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/input.php @@ -0,0 +1,54 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'typeId' => '8a243080f92e4c719546314b577cf82b', + 'languageId' => '24f78d24f14849f6922ab2f76dcd76e8', + 'currencyId' => 'b7d2554b0ce847cd82f3ac9bd1c0dfca', + 'paymentMethodId' => 'c5917da8076b495ba80b14a61afd90fb', + 'shippingMethodId' => '6e028d0f24114544ad25235d56bb8846', + 'countryId' => '580a3bdd1739487f99ddd56ec365828f', + 'navigationCategoryId' => '7515fecfbfe14fbb87892873dbd1134d', + 'navigationCategoryDepth' => 2, + 'footerCategoryId' => '77b959cf66de4c1590c7f9b7da3982f3', + 'serviceCategoryId' => '19ca405790ff4f07aac8c599d4317868', + 'homeCmsPageId' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'hreflangDefaultDomainId' => 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', + 'name' => 'Late associations', + 'accessKey' => 'SWSCA83PBVT8UA_X_P5UF6IJKG', + 'currencies' => [ + [ + 'id' => 'b7d2554b0ce847cd82f3ac9bd1c0dfca', + ], + ], + 'languages' => [ + [ + 'id' => '24f78d24f14849f6922ab2f76dcd76e8', + ], + ], + 'active' => true, + 'maintenance' => false, + 'countries' => [ + [ + 'id' => '580a3bdd1739487f99ddd56ec365828f', + ], + ], + 'shippingMethods' => [ + [ + 'id' => '6e028d0f24114544ad25235d56bb8846', + ], + ], + 'translations' => [ + [ + 'salesChannelId' => '5f05f1f6514d43f7ae11a669c7557d1c', + 'name' => 'Late associations', + 'languageId' => '24f78d24f14849f6922ab2f76dcd76e8', + ], + ], + 'customerGroupId' => 'cfbd5018d38d41d8adca10d94fc8bdd6', + 'id' => '5f05f1f6514d43f7ae11a669c7557d1c', +]; diff --git a/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/mapping.php b/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/mapping.php new file mode 100644 index 000000000..b10cd9fa5 --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/mapping.php @@ -0,0 +1,56 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +return [ + [ + 'entityName' => DefaultEntities::LANGUAGE, + 'oldIdentifier' => '24f78d24f14849f6922ab2f76dcd76e8', + 'newIdentifier' => '41248655c60c4dd58cde43f14cd4f149', + ], + [ + 'entityName' => DefaultEntities::CURRENCY, + 'oldIdentifier' => 'b7d2554b0ce847cd82f3ac9bd1c0dfca', + 'newIdentifier' => 'b7d2554b0ce847cd82f3ac9bd1c0dfcb', + ], + [ + 'entityName' => DefaultEntities::COUNTRY, + 'oldIdentifier' => '580a3bdd1739487f99ddd56ec365828f', + 'newIdentifier' => '580a3bdd1739487f99ddd56ec3658290', + ], + [ + 'entityName' => DefaultEntities::PAYMENT_METHOD, + 'oldIdentifier' => 'c5917da8076b495ba80b14a61afd90fb', + 'newIdentifier' => 'c5917da8076b495ba80b14a61afd90fc', + ], + [ + 'entityName' => DefaultEntities::SHIPPING_METHOD, + 'oldIdentifier' => '6e028d0f24114544ad25235d56bb8846', + 'newIdentifier' => '6e028d0f24114544ad25235d56bb8847', + ], + [ + 'entityName' => DefaultEntities::CATEGORY, + 'oldIdentifier' => '7515fecfbfe14fbb87892873dbd1134d', + 'newIdentifier' => '7515fecfbfe14fbb87892873dbd1134e', + ], + [ + 'entityName' => DefaultEntities::CATEGORY, + 'oldIdentifier' => '77b959cf66de4c1590c7f9b7da3982f3', + 'newIdentifier' => '77b959cf66de4c1590c7f9b7da3982f4', + ], + [ + 'entityName' => DefaultEntities::CATEGORY, + 'oldIdentifier' => '19ca405790ff4f07aac8c599d4317868', + 'newIdentifier' => '19ca405790ff4f07aac8c599d4317869', + ], + [ + 'entityName' => DefaultEntities::CUSTOMER_GROUP, + 'oldIdentifier' => 'cfbd5018d38d41d8adca10d94fc8bdd6', + 'newIdentifier' => 'cfbd5018d38d41d8adca10d94fc8bdd7', + ], +]; diff --git a/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/output.php b/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/output.php new file mode 100644 index 000000000..b8c2e5491 --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannel/05-StripLateAssociations/output.php @@ -0,0 +1,52 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'typeId' => '8a243080f92e4c719546314b577cf82b', + 'languageId' => '41248655c60c4dd58cde43f14cd4f149', + 'currencyId' => 'b7d2554b0ce847cd82f3ac9bd1c0dfcb', + 'paymentMethodId' => 'c5917da8076b495ba80b14a61afd90fc', + 'shippingMethodId' => '6e028d0f24114544ad25235d56bb8847', + 'countryId' => '580a3bdd1739487f99ddd56ec3658290', + 'navigationCategoryId' => '7515fecfbfe14fbb87892873dbd1134e', + 'navigationCategoryDepth' => 2, + 'footerCategoryId' => '77b959cf66de4c1590c7f9b7da3982f4', + 'serviceCategoryId' => '19ca405790ff4f07aac8c599d4317869', + 'name' => 'Late associations', + 'accessKey' => 'SWSCA83PBVT8UA_X_P5UF6IJKG', + 'currencies' => [ + [ + 'id' => 'b7d2554b0ce847cd82f3ac9bd1c0dfcb', + ], + ], + 'languages' => [ + [ + 'id' => '41248655c60c4dd58cde43f14cd4f149', + ], + ], + 'active' => true, + 'maintenance' => false, + 'countries' => [ + [ + 'id' => '580a3bdd1739487f99ddd56ec3658290', + ], + ], + 'shippingMethods' => [ + [ + 'id' => '6e028d0f24114544ad25235d56bb8847', + ], + ], + 'translations' => [ + [ + 'salesChannelId' => '5f05f1f6514d43f7ae11a669c7557d1c', + 'name' => 'Late associations', + 'languageId' => '41248655c60c4dd58cde43f14cd4f149', + ], + ], + 'customerGroupId' => 'cfbd5018d38d41d8adca10d94fc8bdd7', + 'id' => '5f05f1f6514d43f7ae11a669c7557d1c', +]; diff --git a/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/input.php b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/input.php new file mode 100644 index 000000000..c6a67eade --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/input.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '5f05f1f6514d43f7ae11a669c7557d1c', + 'homeCmsPageId' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', +]; diff --git a/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/mapping.php b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/mapping.php new file mode 100644 index 000000000..6235b2633 --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/mapping.php @@ -0,0 +1,21 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +return [ + [ + 'entityName' => DefaultEntities::SALES_CHANNEL, + 'oldIdentifier' => '5f05f1f6514d43f7ae11a669c7557d1c', + 'newIdentifier' => '5f05f1f6514d43f7ae11a669c7557d1d', + ], + [ + 'entityName' => DefaultEntities::CMS_PAGE, + 'oldIdentifier' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'newIdentifier' => 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', + ], +]; diff --git a/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/output.php b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/output.php new file mode 100644 index 000000000..85dccf8e4 --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/01-HappyCase/output.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '5f05f1f6514d43f7ae11a669c7557d1c', + 'homeCmsPageId' => 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', +]; diff --git a/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/input.php b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/input.php new file mode 100644 index 000000000..c6a67eade --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/input.php @@ -0,0 +1,11 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '5f05f1f6514d43f7ae11a669c7557d1c', + 'homeCmsPageId' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', +]; diff --git a/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/log.php b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/log.php new file mode 100644 index 000000000..cc0466b52 --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/log.php @@ -0,0 +1,14 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\Logging\Log\ConvertAssociationMissingLog; + +return [ + [ + 'code' => ConvertAssociationMissingLog::getCode(), + ], +]; diff --git a/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/mapping.php b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/mapping.php new file mode 100644 index 000000000..8caf9710a --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/mapping.php @@ -0,0 +1,16 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SwagMigrationAssistant\Migration\DataSelection\DefaultEntities; + +return [ + [ + 'entityName' => DefaultEntities::SALES_CHANNEL, + 'oldIdentifier' => '5f05f1f6514d43f7ae11a669c7557d1c', + 'newIdentifier' => '5f05f1f6514d43f7ae11a669c7557d1d', + ], +]; diff --git a/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/output.php b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/output.php new file mode 100644 index 000000000..89ce5a217 --- /dev/null +++ b/tests/_fixtures/Shopware6/SalesChannelHomeCmsPageAssociation/02-MissingCmsPageMapping/output.php @@ -0,0 +1,10 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'id' => '5f05f1f6514d43f7ae11a669c7557d1c', +];