From f10503b159f3a2d96641948f662ffb0b6cdaec85 Mon Sep 17 00:00:00 2001 From: mamazu Date: Wed, 3 Apr 2019 23:19:13 +0200 Subject: [PATCH 1/9] Adding new routes --- .../ShowProductCatalogByTaxonSlugAction.php | 2 +- .../config/routing/productByCode.yml | 33 +++++++++++++-- .../config/routing/productBySlug.yml | 41 +++++++++++++------ 3 files changed, 59 insertions(+), 17 deletions(-) diff --git a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php index 1dfcf4cb2..ce2eee081 100644 --- a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php +++ b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php @@ -32,7 +32,7 @@ public function __invoke(Request $request): Response { try { return $this->viewHandler->handle(View::create($this->productCatalogQuery->findByTaxonSlug( - $request->attributes->get('taxonSlug'), + $request->attributes->get('slug'), $request->attributes->get('channelCode'), new PaginatorDetails($request->attributes->get('_route'), $request->query->all()), $request->query->get('locale') diff --git a/src/Resources/config/routing/productByCode.yml b/src/Resources/config/routing/productByCode.yml index 5756aecd0..623da66f9 100644 --- a/src/Resources/config/routing/productByCode.yml +++ b/src/Resources/config/routing/productByCode.yml @@ -1,23 +1,48 @@ -sylius_shop_api_product_show_details_by_code: +sylius_shop_api_product_show_details_by_code_deprecated: path: /products/{code} methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_code_action -sylius_shop_api_product_show_catalog_by_code: +sylius_shop_api_product_show_catalog_by_code_deprecated: path: /taxon-products/{code} methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_code_action -sylius_shop_api_product_show_reviews_by_code: +sylius_shop_api_product_show_reviews_by_code_depricated: path: /products/{code}/reviews methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_code_action -sylius_shop_api_add_product_review_by_code: +sylius_shop_api_add_product_review_by_code_deprecated: path: /products/{code}/reviews methods: [POST] defaults: _controller: sylius.shop_api_plugin.controller.product.add_review_by_code_action + +# New routes +sylius_shop_api_product_show_details_by_code: + path: /products/by-code/{code} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_code_action + +sylius_shop_api_product_show_catalog_by_code: + path: /taxon-products/by-code/{code} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_code_action + +sylius_shop_api_product_show_reviews_by_code: + path: /products/by-code/{code}/reviews + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_code_action + +sylius_shop_api_add_product_review_by_code: + path: /products/by-code/{code}/reviews + methods: [POST] + defaults: + _controller: sylius.shop_api_plugin.controller.product.add_review_by_code_action diff --git a/src/Resources/config/routing/productBySlug.yml b/src/Resources/config/routing/productBySlug.yml index c33300c50..aedc3a934 100644 --- a/src/Resources/config/routing/productBySlug.yml +++ b/src/Resources/config/routing/productBySlug.yml @@ -1,31 +1,48 @@ -sylius_shop_api_product_show_details_by_slug: +sylius_shop_api_product_show_details_by_slug_deprecated: path: /products-by-slug/{slug} methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_slug_action - requirements: - slug: .+ -sylius_shop_api_add_product_review_by_slug: +sylius_shop_api_add_product_review_by_slug_deprecated: path: /product-reviews-by-slug/{slug} methods: [POST] defaults: _controller: sylius.shop_api_plugin.controller.product.add_review_by_slug_action - requirements: - slug: .+ -sylius_shop_api_product_show_catalog_by_slug: +sylius_shop_api_product_show_catalog_by_slug_deprecated: path: /taxon-products-by-slug/{taxonSlug} methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_slug_action - requirements: - taxonSlug: .+ -sylius_shop_api_product_show_reviews_by_slug: +sylius_shop_api_product_show_reviews_by_slug_deprecated: path: /product-reviews-by-slug/{slug} methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_slug_action - requirements: - slug: .+ + +# New routes +sylius_shop_api_product_show_details_by_slug: + path: /products/by-slug/{slug} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_slug_action + +sylius_shop_api_product_show_catalog_by_slug: + path: /taxon-products/by-slug/{slug} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_slug_action + +sylius_shop_api_product_show_reviews_by_slug: + path: /product/by-slug/{slug}/reviews + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_slug_action + +sylius_shop_api_add_product_review_by_slug: + path: /product/by-slug/{slug}/reviews + methods: [POST] + defaults: + _controller: sylius.shop_api_plugin.controller.product.add_review_by_slug_action From 728e41adb7a754762189b34fa8f74a90fc5589b1 Mon Sep 17 00:00:00 2001 From: mamazu Date: Fri, 5 Apr 2019 12:06:00 +0200 Subject: [PATCH 2/9] Adding the new docs --- doc/swagger.yml | 216 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 210 insertions(+), 6 deletions(-) diff --git a/doc/swagger.yml b/doc/swagger.yml index 9e369a5fc..39f1890b4 100644 --- a/doc/swagger.yml +++ b/doc/swagger.yml @@ -452,7 +452,7 @@ paths: security: - {} - bearerAuth: [] - /{channelCode}/taxon-products-by-slug/{slug}: + /{channelCode}/taxon-products/by-slug/{slug}: parameters: - $ref: "#/parameters/ChannelCode" get: @@ -487,7 +487,43 @@ paths: description: "Paginated product list." schema: $ref: "#/definitions/ProductsPage" - /{channelCode}/taxon-products/{code}: + /{channelCode}/taxon-products-by-slug/{slug}: + parameters: + - $ref: "#/parameters/ChannelCode" + get: + deprecated: true + tags: + - "products" + summary: "Show product catalog." + description: "This endpoint will return a paginated list of products for given taxon." + operationId: "productCatalogBySlug_deprecated" + parameters: + - name: "slug" + in: "path" + description: "Slug of taxonomy for which products should be listed." + required: true + type: "string" + - name: "locale" + in: "query" + description: "Locale in which products should be shown." + required: false + type: "string" + - name: "limit" + in: "query" + description: "Number of expected products per page." + required: false + type: "integer" + - name: "page" + in: "query" + description: "Page number." + required: false + type: "integer" + responses: + 200: + description: "Paginated product list." + schema: + $ref: "#/definitions/ProductsPage" + /{channelCode}/taxon-products/by-code/{code}: parameters: - $ref: "#/parameters/ChannelCode" get: @@ -522,7 +558,43 @@ paths: description: "Paginated product list." schema: $ref: "#/definitions/ProductsPage" - /{channelCode}/products-by-slug/{slug}: + /{channelCode}/taxon-products/{code}: + parameters: + - $ref: "#/parameters/ChannelCode" + get: + deprecated: true + tags: + - "products" + summary: "Show product catalog." + description: "This endpoint will return a paginated list of products for given taxon." + operationId: "productCatalog_deprecated" + parameters: + - name: "code" + in: "path" + description: "Code of taxonomy for which products should be listed." + required: true + type: "string" + - name: "locale" + in: "query" + description: "Locale in which products should be shown." + required: false + type: "string" + - name: "limit" + in: "query" + description: "Number of expected products per page." + required: false + type: "integer" + - name: "page" + in: "query" + description: "Page number." + required: false + type: "integer" + responses: + 200: + description: "Paginated product list." + schema: + $ref: "#/definitions/ProductsPage" + /{channelCode}/products/by-slug/{slug}: parameters: - $ref: "#/parameters/ChannelCode" get: @@ -547,7 +619,33 @@ paths: description: "Show a product with the given slug." schema: $ref: "#/definitions/ProductDetails" - /{channelCode}/products/{code}: + /{channelCode}/products-by-slug/{slug}: + parameters: + - $ref: "#/parameters/ChannelCode" + get: + deprecated: true + tags: + - "products" + summary: "Show a product with the given slug." + description: "This endpoint will return a product with the given slug." + operationId: "productDetailsBySlug_deprecated" + parameters: + - name: "slug" + in: "path" + description: "Slug of expected product." + required: true + type: "string" + - name: "locale" + in: "query" + description: "Locale in which products should be shown." + required: false + type: "string" + responses: + 200: + description: "Show a product with the given slug." + schema: + $ref: "#/definitions/ProductDetails" + /{channelCode}/products/by-code/{code}: parameters: - $ref: "#/parameters/ChannelCode" get: @@ -572,7 +670,33 @@ paths: description: "Show a product with the given code." schema: $ref: "#/definitions/ProductDetails" - /{channelCode}/product-reviews-by-slug/{slug}: + /{channelCode}/products/{code}: + parameters: + - $ref: "#/parameters/ChannelCode" + get: + deprecated: true + tags: + - "products" + summary: "Show a product with the given code." + description: "This endpoint will return a product with the given code." + operationId: "productDetails_deprecated" + parameters: + - name: "code" + in: "path" + description: "Code of expected product." + required: true + type: "string" + - name: "locale" + in: "query" + description: "Locale in which products should be shown." + required: false + type: "string" + responses: + 200: + description: "Show a product with the given code." + schema: + $ref: "#/definitions/ProductDetails" + /{channelCode}/product/by-slug/{slug}/reviews: parameters: - $ref: "#/parameters/ChannelCode" - name: "slug" @@ -610,7 +734,47 @@ paths: description: "A paginated list of all reviews related to the product identified by slug." schema: $ref: "#/definitions/ProductReviewsPage" - /{channelCode}/product/{code}/reviews: + /{channelCode}/product-reviews-by-slug/{slug}: + parameters: + - $ref: "#/parameters/ChannelCode" + - name: "slug" + in: "path" + description: "Slug of expected product." + required: true + type: "string" + post: + deprecated: true + tags: + - "products" + summary: "Add a review to the product." + description: "This endpoint will allow you to add a new review to the product. Remember, that it should be accepted by an administrator before it will be available in the review list." + operationId: "productAddReviewBySlug_deprecated" + parameters: + - in: "body" + name: "content" + required: true + schema: + $ref: "#/definitions/AddReviewRequest" + responses: + 201: + description: "Review has been added to the product." + 400: + description: "Invalid input, validation failed." + schema: + $ref: "#/definitions/GeneralError" + get: + deprecated: true + tags: + - "products" + summary: "Show reviews." + description: "This endpoint will return a paginated list of all reviews related to the product identified by slug." + operationId: "productReviewsBySlug_deprecated" + responses: + 200: + description: "A paginated list of all reviews related to the product identified by slug." + schema: + $ref: "#/definitions/ProductReviewsPage" + /{channelCode}/product/by-code/{code}/reviews: parameters: - $ref: "#/parameters/ChannelCode" - name: "code" @@ -648,6 +812,46 @@ paths: description: "A paginated list of all reviews related to the product identified by slug." schema: $ref: "#/definitions/ProductReviewsPage" + /{channelCode}/product/{code}/reviews: + parameters: + - $ref: "#/parameters/ChannelCode" + - name: "code" + in: "path" + description: "Code of expected product." + required: true + type: "string" + post: + deprecated: true + tags: + - "products" + summary: "Add a review to the product." + description: "This endpoint will allow you to add a new review to the product. Remember, that it should be accepted by an administrator before it will be available in the review list." + operationId: "productAddReview_deprecated" + parameters: + - in: "body" + name: "content" + required: true + schema: + $ref: "#/definitions/AddReviewRequest" + responses: + 201: + description: "Review has been added to the product." + 400: + description: "Invalid input, validation failed." + schema: + $ref: "#/definitions/GeneralError" + get: + deprecated: true + tags: + - "products" + summary: "Show reviews." + description: "This endpoint will return a paginated list of all reviews related to the product identified by slug." + operationId: "productReviews_deprecated" + responses: + 200: + description: "A paginated list of all reviews related to the product identified by slug." + schema: + $ref: "#/definitions/ProductReviewsPage" /{channelCode}/taxons: parameters: - $ref: "#/parameters/ChannelCode" From c2599c33b36c224a50a8ef147c5e0db9a42eeafc Mon Sep 17 00:00:00 2001 From: mamazu Date: Fri, 5 Apr 2019 19:28:05 +0200 Subject: [PATCH 3/9] Added redirect for deprecated route --- src/Resources/config/routing/productBySlug.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Resources/config/routing/productBySlug.yml b/src/Resources/config/routing/productBySlug.yml index aedc3a934..3d6a9f052 100644 --- a/src/Resources/config/routing/productBySlug.yml +++ b/src/Resources/config/routing/productBySlug.yml @@ -2,7 +2,9 @@ sylius_shop_api_product_show_details_by_slug_deprecated: path: /products-by-slug/{slug} methods: [GET] defaults: - _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_slug_action + _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController:urlRedirectAction' + path: /{channelCode}/products/by-slug/{slug} + permanent: true sylius_shop_api_add_product_review_by_slug_deprecated: path: /product-reviews-by-slug/{slug} From bc2037d7df9daac261ee817873c120d121e463db Mon Sep 17 00:00:00 2001 From: mamazu Date: Fri, 5 Apr 2019 19:35:55 +0200 Subject: [PATCH 4/9] Fixing the generated routes in test --- .../cart/add_multiple_products_to_cart_response.json | 6 +++--- .../add_multiple_products_to_new_cart_response.json | 6 +++--- ...d_on_options_multiple_times_to_cart_response.json | 2 +- ...ct_variant_based_on_options_to_cart_response.json | 2 +- ...duct_variant_multiple_times_to_cart_response.json | 2 +- .../cart/add_product_variant_to_cart_response.json | 2 +- ...mple_product_multiple_times_to_cart_response.json | 2 +- .../cart/add_simple_product_to_cart_response.json | 2 +- .../add_simple_product_to_new_cart_response.json | 2 +- ...with_coupon_based_promotion_applied_response.json | 2 +- ...d_cart_with_product_variant_summary_response.json | 4 ++-- ...ed_cart_with_simple_product_summary_response.json | 2 +- ...d_cart_with_product_variant_summary_response.json | 2 +- ...ed_cart_with_simple_product_summary_response.json | 2 +- .../reprocessed_cart_after_deleting_an_item.json | 2 +- .../Expected/checkout/cart_addressed_response.json | 2 +- ...ferent_shipping_and_billing_address_response.json | 2 +- .../checkout/cart_with_chosen_payment_response.json | 2 +- .../checkout/cart_with_chosen_shipment_response.json | 2 +- ..._chosen_shipment_with_per_item_rate_response.json | 2 +- ..._chosen_shipment_with_per_item_rate_response.json | 2 +- .../Expected/order/order_details_response.json | 2 +- .../Expected/order/orders_list_response.json | 2 +- .../german_product_list_page_by_code_response.json | 8 ++++---- .../german_product_list_page_by_slug_response.json | 8 ++++---- .../german_product_with_options_details_page.json | 6 +++--- .../product/german_simple_product_details_page.json | 2 +- .../limited_product_list_page_by_code_response.json | 2 +- .../limited_product_list_page_by_slug_response.json | 2 +- .../product/product_list_latest_2_response.json | 8 ++++---- .../product/product_list_latest_4_response.json | 12 ++++++------ .../product/product_list_page_by_code_response.json | 10 +++++----- .../product/product_list_page_by_slug_response.json | 10 +++++----- .../product_t_shirt_list_page_by_code_response.json | 2 +- .../product_t_shirt_list_page_by_slug_response.json | 2 +- .../product/product_with_options_details_page.json | 6 +++--- .../product/product_with_variant_details_page.json | 2 +- .../product/product_without_taxons_details_page.json | 2 +- .../product/simple_product_details_page.json | 2 +- 39 files changed, 70 insertions(+), 70 deletions(-) diff --git a/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json b/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json index dc00f0ee2..8474e0ed9 100644 --- a/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } @@ -106,7 +106,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -153,7 +153,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json b/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json index 1e565429d..0ef858fd7 100644 --- a/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json +++ b/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } @@ -106,7 +106,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -153,7 +153,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json index 484d28407..cced5f812 100644 --- a/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json @@ -47,7 +47,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json index b811f96d7..b0ca4c82b 100644 --- a/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json @@ -47,7 +47,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json index a19fa0503..78011be59 100644 --- a/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json @@ -54,7 +54,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json index d7670776c..821f3dd27 100644 --- a/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json @@ -54,7 +54,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json index f4f9327a8..933f84477 100644 --- a/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json index 1061fc454..024a0a0b0 100644 --- a/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json index 01abc584e..809238994 100644 --- a/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json b/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json index a29427251..be28fe9ab 100644 --- a/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json +++ b/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json b/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json index 0f55102df..720ca9905 100644 --- a/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json +++ b/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json @@ -54,7 +54,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -101,7 +101,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json b/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json index 35e5710a9..2b988c6d6 100644 --- a/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json +++ b/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json b/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json index 532a3da98..0ab2bb351 100644 --- a/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json +++ b/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json @@ -47,7 +47,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_DE\/products-by-slug\/logan-hut" + "href": "\/shop-api\/WEB_DE\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json b/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json index c355394ac..4012ab296 100644 --- a/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json +++ b/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json @@ -51,7 +51,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_DE\/products-by-slug\/logan-becher" + "href": "\/shop-api\/WEB_DE\/products\/by-slug\/logan-becher" } } } diff --git a/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json b/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json index add14d1f7..a58fe8e2b 100644 --- a/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json +++ b/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_addressed_response.json b/tests/Responses/Expected/checkout/cart_addressed_response.json index 3aa6331e6..bac761602 100644 --- a/tests/Responses/Expected/checkout/cart_addressed_response.json +++ b/tests/Responses/Expected/checkout/cart_addressed_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json b/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json index 7864a9c82..8ed221d70 100644 --- a/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json +++ b/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json index 2fb42e291..602c384be 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json index f224b6baf..8ae48b4ee 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json index 401bfbe22..395b6776f 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json b/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json index 4de293959..1854aeca3 100644 --- a/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json +++ b/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/order/order_details_response.json b/tests/Responses/Expected/order/order_details_response.json index 54fecd64b..71fe5c4d2 100644 --- a/tests/Responses/Expected/order/order_details_response.json +++ b/tests/Responses/Expected/order/order_details_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/order/orders_list_response.json b/tests/Responses/Expected/order/orders_list_response.json index bba29a794..db9d3ce58 100644 --- a/tests/Responses/Expected/order/orders_list_response.json +++ b/tests/Responses/Expected/order/orders_list_response.json @@ -53,7 +53,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json index 826ddab8c..44a3c30a0 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json @@ -57,7 +57,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-becher" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" } } }, @@ -195,7 +195,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-becher" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" } } }, @@ -265,7 +265,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -274,7 +274,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hut" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json index 7995ab237..56eb5f95b 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json @@ -57,7 +57,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-becher" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" } } }, @@ -195,7 +195,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-becher" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" } } }, @@ -265,7 +265,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -274,7 +274,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hut" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/product/german_product_with_options_details_page.json b/tests/Responses/Expected/product/german_product_with_options_details_page.json index fe7d3d0e4..f870764b7 100644 --- a/tests/Responses/Expected/product/german_product_with_options_details_page.json +++ b/tests/Responses/Expected/product/german_product_with_options_details_page.json @@ -133,7 +133,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-becher" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" } } }, @@ -203,7 +203,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -212,7 +212,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hut" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/product/german_simple_product_details_page.json b/tests/Responses/Expected/product/german_simple_product_details_page.json index d86c188d8..44b348319 100644 --- a/tests/Responses/Expected/product/german_simple_product_details_page.json +++ b/tests/Responses/Expected/product/german_simple_product_details_page.json @@ -46,7 +46,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-becher" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" } } } diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json index 624dcb828..f8ccaa5d5 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json index d52003c67..b4ef473e9 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_list_latest_2_response.json b/tests/Responses/Expected/product/product_list_latest_2_response.json index 7a3fd74c2..521ba1244 100644 --- a/tests/Responses/Expected/product/product_list_latest_2_response.json +++ b/tests/Responses/Expected/product/product_list_latest_2_response.json @@ -135,7 +135,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -205,7 +205,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -214,7 +214,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } }, @@ -266,7 +266,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/product/product_list_latest_4_response.json b/tests/Responses/Expected/product/product_list_latest_4_response.json index e0ce2412a..e7881285c 100644 --- a/tests/Responses/Expected/product/product_list_latest_4_response.json +++ b/tests/Responses/Expected/product/product_list_latest_4_response.json @@ -135,7 +135,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -205,7 +205,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -214,7 +214,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } }, @@ -266,7 +266,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -286,7 +286,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-shoes" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-shoes" } } }, @@ -356,7 +356,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_list_page_by_code_response.json b/tests/Responses/Expected/product/product_list_page_by_code_response.json index 2a866b057..dff00417d 100644 --- a/tests/Responses/Expected/product/product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_code_response.json @@ -58,7 +58,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -128,7 +128,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } }, @@ -267,7 +267,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -337,7 +337,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -346,7 +346,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/product/product_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_list_page_by_slug_response.json index 47cc864e8..35f2a48fc 100644 --- a/tests/Responses/Expected/product/product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_slug_response.json @@ -58,7 +58,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -128,7 +128,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } }, @@ -267,7 +267,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -337,7 +337,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -346,7 +346,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json index 41b8804d4..94b3c286e 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json index 9b1ad46ed..6cbd2b3f5 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_with_options_details_page.json b/tests/Responses/Expected/product/product_with_options_details_page.json index cb7371af0..e13df7f78 100644 --- a/tests/Responses/Expected/product/product_with_options_details_page.json +++ b/tests/Responses/Expected/product/product_with_options_details_page.json @@ -134,7 +134,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } }, @@ -204,7 +204,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } @@ -213,7 +213,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-hat" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/product/product_with_variant_details_page.json b/tests/Responses/Expected/product/product_with_variant_details_page.json index e3e1c22e3..e67975320 100644 --- a/tests/Responses/Expected/product/product_with_variant_details_page.json +++ b/tests/Responses/Expected/product/product_with_variant_details_page.json @@ -65,7 +65,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-t-shirt" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_without_taxons_details_page.json b/tests/Responses/Expected/product/product_without_taxons_details_page.json index 95ea2374c..2164d1aed 100644 --- a/tests/Responses/Expected/product/product_without_taxons_details_page.json +++ b/tests/Responses/Expected/product/product_without_taxons_details_page.json @@ -15,7 +15,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-shoes" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-shoes" } } } diff --git a/tests/Responses/Expected/product/simple_product_details_page.json b/tests/Responses/Expected/product/simple_product_details_page.json index 0838b4e7f..71567ed97 100644 --- a/tests/Responses/Expected/product/simple_product_details_page.json +++ b/tests/Responses/Expected/product/simple_product_details_page.json @@ -47,7 +47,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products-by-slug\/logan-mug" + "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" } } } From 5f557a59e704b197d2b2c1bb243f9a293c2ff56d Mon Sep 17 00:00:00 2001 From: mamazu Date: Fri, 5 Apr 2019 20:12:37 +0200 Subject: [PATCH 5/9] Fixing redirect --- src/Resources/config/routing/productBySlug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/config/routing/productBySlug.yml b/src/Resources/config/routing/productBySlug.yml index 3d6a9f052..4b495d6e2 100644 --- a/src/Resources/config/routing/productBySlug.yml +++ b/src/Resources/config/routing/productBySlug.yml @@ -3,7 +3,7 @@ sylius_shop_api_product_show_details_by_slug_deprecated: methods: [GET] defaults: _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController:urlRedirectAction' - path: /{channelCode}/products/by-slug/{slug} + path: /shop-api/{channelCode}/products/by-slug/{slug} permanent: true sylius_shop_api_add_product_review_by_slug_deprecated: From 3d06a4d8e2d95b82805f12636a54f0e9c8a11d52 Mon Sep 17 00:00:00 2001 From: mamazu Date: Fri, 5 Apr 2019 20:24:14 +0200 Subject: [PATCH 6/9] Removing the old routes and fixing the tests --- doc/swagger.yml | 8 +-- .../ShowProductCatalogByTaxonSlugAction.php | 2 +- .../config/routing/productByCode.yml | 46 +++++++-------- .../config/routing/productBySlug.yml | 58 ++++++++++--------- .../Product/ProductAddReviewByCodeApiTest.php | 10 ++-- .../Product/ProductAddReviewBySlugApiTest.php | 10 ++-- .../ProductShowCatalogByCodeApiTest.php | 10 ++-- .../ProductShowCatalogBySlugApiTest.php | 14 ++--- .../ProductShowDetailsByCodeApiTest.php | 16 ++--- .../ProductShowDetailsBySlugApiTest.php | 18 +++--- .../ProductShowReviewsByCodeApiTest.php | 4 +- .../ProductShowReviewsBySlugApiTest.php | 4 +- ...an_product_list_page_by_code_response.json | 8 +-- ...an_product_list_page_by_slug_response.json | 8 +-- ...ed_product_list_page_by_code_response.json | 8 +-- ...ed_product_list_page_by_slug_response.json | 8 +-- .../product_list_page_by_code_response.json | 8 +-- .../product_list_page_by_slug_response.json | 8 +-- ...uct_review_list_page_by_code_response.json | 8 +-- ...uct_review_list_page_by_slug_response.json | 8 +-- ...ct_t_shirt_list_page_by_code_response.json | 8 +-- ...ct_t_shirt_list_page_by_slug_response.json | 8 +-- 22 files changed, 143 insertions(+), 137 deletions(-) diff --git a/doc/swagger.yml b/doc/swagger.yml index 39f1890b4..7cc129162 100644 --- a/doc/swagger.yml +++ b/doc/swagger.yml @@ -452,7 +452,7 @@ paths: security: - {} - bearerAuth: [] - /{channelCode}/taxon-products/by-slug/{slug}: + /{channelCode}/taxon-products/by-slug/{taxonSlug}: parameters: - $ref: "#/parameters/ChannelCode" get: @@ -462,7 +462,7 @@ paths: description: "This endpoint will return a paginated list of products for given taxon." operationId: "productCatalogBySlug" parameters: - - name: "slug" + - name: "taxonSlug" in: "path" description: "Slug of taxonomy for which products should be listed." required: true @@ -487,7 +487,7 @@ paths: description: "Paginated product list." schema: $ref: "#/definitions/ProductsPage" - /{channelCode}/taxon-products-by-slug/{slug}: + /{channelCode}/taxon-products-by-slug/{taxonSlug}: parameters: - $ref: "#/parameters/ChannelCode" get: @@ -498,7 +498,7 @@ paths: description: "This endpoint will return a paginated list of products for given taxon." operationId: "productCatalogBySlug_deprecated" parameters: - - name: "slug" + - name: "taxonSlug" in: "path" description: "Slug of taxonomy for which products should be listed." required: true diff --git a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php index ce2eee081..1dfcf4cb2 100644 --- a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php +++ b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php @@ -32,7 +32,7 @@ public function __invoke(Request $request): Response { try { return $this->viewHandler->handle(View::create($this->productCatalogQuery->findByTaxonSlug( - $request->attributes->get('slug'), + $request->attributes->get('taxonSlug'), $request->attributes->get('channelCode'), new PaginatorDetails($request->attributes->get('_route'), $request->query->all()), $request->query->get('locale') diff --git a/src/Resources/config/routing/productByCode.yml b/src/Resources/config/routing/productByCode.yml index 623da66f9..6bca368b3 100644 --- a/src/Resources/config/routing/productByCode.yml +++ b/src/Resources/config/routing/productByCode.yml @@ -1,26 +1,26 @@ -sylius_shop_api_product_show_details_by_code_deprecated: - path: /products/{code} - methods: [GET] - defaults: - _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_code_action - -sylius_shop_api_product_show_catalog_by_code_deprecated: - path: /taxon-products/{code} - methods: [GET] - defaults: - _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_code_action - -sylius_shop_api_product_show_reviews_by_code_depricated: - path: /products/{code}/reviews - methods: [GET] - defaults: - _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_code_action - -sylius_shop_api_add_product_review_by_code_deprecated: - path: /products/{code}/reviews - methods: [POST] - defaults: - _controller: sylius.shop_api_plugin.controller.product.add_review_by_code_action +#sylius_shop_api_product_show_details_by_code_deprecated: +# path: /products/{code} +# methods: [GET] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_code_action +# +#sylius_shop_api_product_show_catalog_by_code_deprecated: +# path: /taxon-products/{code} +# methods: [GET] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_code_action +# +#sylius_shop_api_product_show_reviews_by_code_depricated: +# path: /products/{code}/reviews +# methods: [GET] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_code_action +# +#sylius_shop_api_add_product_review_by_code_deprecated: +# path: /products/{code}/reviews +# methods: [POST] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.add_review_by_code_action # New routes sylius_shop_api_product_show_details_by_code: diff --git a/src/Resources/config/routing/productBySlug.yml b/src/Resources/config/routing/productBySlug.yml index 4b495d6e2..6c66026d7 100644 --- a/src/Resources/config/routing/productBySlug.yml +++ b/src/Resources/config/routing/productBySlug.yml @@ -1,28 +1,26 @@ -sylius_shop_api_product_show_details_by_slug_deprecated: - path: /products-by-slug/{slug} - methods: [GET] - defaults: - _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController:urlRedirectAction' - path: /shop-api/{channelCode}/products/by-slug/{slug} - permanent: true - -sylius_shop_api_add_product_review_by_slug_deprecated: - path: /product-reviews-by-slug/{slug} - methods: [POST] - defaults: - _controller: sylius.shop_api_plugin.controller.product.add_review_by_slug_action - -sylius_shop_api_product_show_catalog_by_slug_deprecated: - path: /taxon-products-by-slug/{taxonSlug} - methods: [GET] - defaults: - _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_slug_action - -sylius_shop_api_product_show_reviews_by_slug_deprecated: - path: /product-reviews-by-slug/{slug} - methods: [GET] - defaults: - _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_slug_action +#sylius_shop_api_product_show_details_by_slug_deprecated: +# path: /products-by-slug/{slug} +# methods: [GET] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_slug_action +# +#sylius_shop_api_add_product_review_by_slug_deprecated: +# path: /product-reviews-by-slug/{slug} +# methods: [POST] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.add_review_by_slug_action +# +#sylius_shop_api_product_show_catalog_by_slug_deprecated: +# path: /taxon-products-by-slug/{taxonSlug} +# methods: [GET] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_slug_action +# +#sylius_shop_api_product_show_reviews_by_slug_deprecated: +# path: /product-reviews-by-slug/{slug} +# methods: [GET] +# defaults: +# _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_slug_action # New routes sylius_shop_api_product_show_details_by_slug: @@ -30,21 +28,29 @@ sylius_shop_api_product_show_details_by_slug: methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_slug_action + requirements: + slug: .+ sylius_shop_api_product_show_catalog_by_slug: - path: /taxon-products/by-slug/{slug} + path: /taxon-products/by-slug/{taxonSlug} methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_slug_action + requirements: + taxonSlug: .+ sylius_shop_api_product_show_reviews_by_slug: path: /product/by-slug/{slug}/reviews methods: [GET] defaults: _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_slug_action + requirements: + slug: .+ sylius_shop_api_add_product_review_by_slug: path: /product/by-slug/{slug}/reviews methods: [POST] defaults: _controller: sylius.shop_api_plugin.controller.product.add_review_by_slug_action + requirements: + slug: .+ diff --git a/tests/Controller/Product/ProductAddReviewByCodeApiTest.php b/tests/Controller/Product/ProductAddReviewByCodeApiTest.php index 6394d5c35..62268b272 100644 --- a/tests/Controller/Product/ProductAddReviewByCodeApiTest.php +++ b/tests/Controller/Product/ProductAddReviewByCodeApiTest.php @@ -25,7 +25,7 @@ public function it_adds_review_to_product(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); @@ -47,7 +47,7 @@ public function it_adds_review_to_the_product_for_registered_user(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); @@ -69,7 +69,7 @@ public function it_does_not_allow_to_add_product_review_by_code_in_non_existent_ "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/SPACE_KLINGON/products/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/SPACE_KLINGON/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); @@ -93,7 +93,7 @@ public function it_does_not_allow_to_add_review_when_rating_is_out_of_bounds(): } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_rating', Response::HTTP_BAD_REQUEST); @@ -117,7 +117,7 @@ public function it_does_not_allow_to_add_review_when_email_is_not_valid(): void } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_email', Response::HTTP_BAD_REQUEST); diff --git a/tests/Controller/Product/ProductAddReviewBySlugApiTest.php b/tests/Controller/Product/ProductAddReviewBySlugApiTest.php index fce80a6f9..5f7627902 100644 --- a/tests/Controller/Product/ProductAddReviewBySlugApiTest.php +++ b/tests/Controller/Product/ProductAddReviewBySlugApiTest.php @@ -25,7 +25,7 @@ public function it_adds_review_to_product(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/product-reviews-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/product/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); @@ -47,7 +47,7 @@ public function it_adds_review_to_the_product_for_registered_user(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/product-reviews-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/product/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); @@ -69,7 +69,7 @@ public function it_does_not_allow_to_add_product_review_by_slug_in_non_existent_ "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/SPACE_KLINGON/product-reviews-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/SPACE_KLINGON/product/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); @@ -92,7 +92,7 @@ public function it_does_not_allow_to_add_review_when_rating_is_out_of_bounds(): } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/product-reviews-by-slug/mug', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/product/by-slug/mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_rating', Response::HTTP_BAD_REQUEST); @@ -115,7 +115,7 @@ public function it_does_not_allow_to_add_review_when_rating_email_is_not_valid() } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/product-reviews-by-slug/mug', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/WEB_GB/product/by-slug/mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_email', Response::HTTP_BAD_REQUEST); diff --git a/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php b/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php index 4e4868692..991d2d797 100644 --- a/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php +++ b/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php @@ -16,7 +16,7 @@ public function it_shows_paginated_products_from_some_taxon_by_code(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/BRAND', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/BRAND', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_code_response', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_shows_products_for_sub_taxons_by_code(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/WOMEN_T_SHIRTS', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/WOMEN_T_SHIRTS', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_t_shirt_list_page_by_code_response', Response::HTTP_OK); @@ -42,7 +42,7 @@ public function it_shows_paginated_products_from_some_taxon_by_code_in_different { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/BRAND?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/BRAND?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_list_page_by_code_response', Response::HTTP_OK); @@ -55,7 +55,7 @@ public function it_shows_second_page_of_paginated_products_from_some_taxon_by_co { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/BRAND?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/BRAND?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/limited_product_list_page_by_code_response', Response::HTTP_OK); @@ -68,7 +68,7 @@ public function it_does_not_show_product_catalog_by_code_in_non_existent_channel { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/SPACE_KLINGON/taxon-products/BRAND', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/SPACE_KLINGON/taxon-products/by-code/BRAND', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); diff --git a/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php b/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php index af6435f1f..a6a2d3152 100644 --- a/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php +++ b/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php @@ -16,7 +16,7 @@ public function it_shows_paginated_products_from_some_taxon_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products-by-slug/brands', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/brands', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_slug_response', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_shows_products_for_sub_taxons_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products-by-slug/categories/t-shirts/women-t-shirts', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/categories/t-shirts/women-t-shirts', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_t_shirt_list_page_by_slug_response', Response::HTTP_OK); @@ -42,7 +42,7 @@ public function it_shows_paginated_products_from_some_taxon_by_slug_in_different { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products-by-slug/marken?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/marken?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_list_page_by_slug_response', Response::HTTP_OK); @@ -55,7 +55,7 @@ public function it_shows_second_page_of_paginated_products_from_some_taxon_by_sl { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products-by-slug/brands?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/brands?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/limited_product_list_page_by_slug_response', Response::HTTP_OK); @@ -68,7 +68,7 @@ public function it_shows_sorted_product_list(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products-by-slug/x-man?sorting[createdAt]=desc', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/x-man?sorting[createdAt]=desc', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_slug_response', Response::HTTP_OK); @@ -81,7 +81,7 @@ public function it_expose_only_some_of_products_in_the_list(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products-by-slug/x-man?criteria[search][value]=Logans+Hat', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/x-man?criteria[search][value]=Logans+Hat', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_slug_response', Response::HTTP_OK); @@ -94,7 +94,7 @@ public function it_does_not_show_product_catalog_by_slug_in_non_existent_channel { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/SPACE_KLINGON/taxon-products-by-slug/brands', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/SPACE_KLINGON/taxon-products/by-slug/brands', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); diff --git a/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php b/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php index 1c0f19caf..56c345c5c 100644 --- a/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php +++ b/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php @@ -16,7 +16,7 @@ public function it_shows_simple_product_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/simple_product_details_page', Response::HTTP_OK); @@ -27,7 +27,7 @@ public function it_shows_simple_product_details_page(): void */ public function it_throws_a_not_found_exception_if_channel_has_not_been_found(): void { - $this->client->request('GET', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); @@ -40,7 +40,7 @@ public function it_throws_a_not_found_exception_if_product_has_not_been_found(): { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/WRONG_PRODUCT_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/WRONG_PRODUCT_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_has_not_been_found_for_given_code_response', Response::HTTP_NOT_FOUND); @@ -53,7 +53,7 @@ public function it_shows_simple_product_details_page_in_different_locale(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_simple_product_details_page', Response::HTTP_OK); @@ -66,7 +66,7 @@ public function it_shows_product_with_variant_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/LOGAN_T_SHIRT_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_T_SHIRT_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_variant_details_page', Response::HTTP_OK); @@ -79,7 +79,7 @@ public function it_shows_product_with_options_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/LOGAN_HAT_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_HAT_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_options_details_page', Response::HTTP_OK); @@ -92,7 +92,7 @@ public function it_shows_product_with_options_details_page_in_different_locale() { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/LOGAN_HAT_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_HAT_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_with_options_details_page', Response::HTTP_OK); @@ -105,7 +105,7 @@ public function it_does_not_show_product_details_by_code_in_non_existent_channel { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); diff --git a/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php b/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php index 891461891..efb45d21e 100644 --- a/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php +++ b/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php @@ -16,7 +16,7 @@ public function it_shows_simple_product_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/simple_product_details_page', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_shows_product_without_taxon_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/logan-shoes', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-shoes', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_without_taxons_details_page', Response::HTTP_OK); @@ -40,7 +40,7 @@ public function it_shows_product_without_taxon_details_page(): void */ public function it_throws_a_not_found_exception_if_channel_has_not_been_found(): void { - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); @@ -53,7 +53,7 @@ public function it_throws_a_not_found_exception_if_product_has_not_been_found(): { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/some-weird-stuff', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/some-weird-stuff', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_has_not_been_found_for_given_slug_response', Response::HTTP_NOT_FOUND); @@ -66,7 +66,7 @@ public function it_shows_simple_product_details_page_in_different_locale(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/logan-becher?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-becher?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_simple_product_details_page', Response::HTTP_OK); @@ -79,7 +79,7 @@ public function it_shows_product_with_variant_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/logan-t-shirt', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-t-shirt', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_variant_details_page', Response::HTTP_OK); @@ -92,7 +92,7 @@ public function it_shows_product_with_options_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/logan-hat', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-hat', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_options_details_page', Response::HTTP_OK); @@ -105,7 +105,7 @@ public function it_shows_product_with_options_details_page_in_different_locale() { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products-by-slug/logan-hut?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-hut?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_with_options_details_page', Response::HTTP_OK); @@ -118,7 +118,7 @@ public function it_does_not_show_product_details_by_slug_in_non_existent_channel { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/SPACE_KLINGON/products-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); diff --git a/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php b/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php index 370845375..d144bdbf9 100644 --- a/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php +++ b/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php @@ -16,7 +16,7 @@ public function it_shows_reviews_for_product_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml', 'customer.yml', 'mug_review.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_review_list_page_by_code_response', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_does_not_show_product_reviews_by_code_in_non_existent_channel { $this->loadFixturesFromFiles(['channel.yml']); - $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); diff --git a/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php b/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php index 257a34077..2f4245097 100644 --- a/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php +++ b/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php @@ -16,7 +16,7 @@ public function it_shows_reviews_for_product_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml', 'customer.yml', 'mug_review.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/product-reviews-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/WEB_GB/product/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_review_list_page_by_slug_response', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_does_not_show_product_reviews_by_slug_in_non_existent_channel { $this->loadFixturesFromFiles(['channel.yml']); - $this->client->request('GET', '/shop-api/SPACE_KLINGON/product-reviews-by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/SPACE_KLINGON/product/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); diff --git a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json index 44a3c30a0..41ec2a00b 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 2, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?locale=de_DE&page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?locale=de_DE&page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?locale=de_DE&page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?locale=de_DE&page=1&limit=10" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json index 56eb5f95b..bed1c81b1 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 2, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/marken?locale=de_DE&page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/marken?locale=de_DE&page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/marken?locale=de_DE&page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/marken?locale=de_DE&page=1&limit=10" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json index f8ccaa5d5..e544c5fd6 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?limit=1&page=2", - "first": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?limit=1&page=1", - "last": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?limit=1&page=3", - "next": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?limit=1&page=3" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=2", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=1", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=3", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=3" }, "items": [ { diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json index b4ef473e9..1b2c56c49 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?limit=1&page=2", - "first": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?limit=1&page=1", - "last": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?limit=1&page=3", - "next": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?limit=1&page=3" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=2", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=1", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=3", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=3" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_list_page_by_code_response.json b/tests/Responses/Expected/product/product_list_page_by_code_response.json index dff00417d..b574fbdfc 100644 --- a/tests/Responses/Expected/product/product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/BRAND?page=1&limit=10" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_list_page_by_slug_response.json index 35f2a48fc..bcd521a1d 100644 --- a/tests/Responses/Expected/product/product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/brands?page=1&limit=10" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_review_list_page_by_code_response.json b/tests/Responses/Expected/product/product_review_list_page_by_code_response.json index 97d8e9d8b..aa4478f5c 100644 --- a/tests/Responses/Expected/product/product_review_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_review_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 25, "_links": { - "self": "\/shop-api\/WEB_GB\/products\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/products\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/products\/LOGAN_MUG_CODE\/reviews?page=3&limit=10", - "next": "\/shop-api\/WEB_GB\/products\/LOGAN_MUG_CODE\/reviews?page=2&limit=10" + "self": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=3&limit=10", + "next": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=2&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json index 5d2ebb643..146bc5ff8 100644 --- a/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 25, "_links": { - "self": "\/shop-api\/WEB_GB\/product-reviews-by-slug\/logan-mug?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/product-reviews-by-slug\/logan-mug?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/product-reviews-by-slug\/logan-mug?page=3&limit=10", - "next": "\/shop-api\/WEB_GB\/product-reviews-by-slug\/logan-mug?page=2&limit=10" + "self": "\/shop-api\/WEB_GB\/product\/by-slug\/logan-mug\/reviews?page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/product\/by-slug\/logan-mug\/reviews?page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/product\/by-slug\/logan-mug\/reviews?page=3&limit=10", + "next": "\/shop-api\/WEB_GB\/product\/by-slug\/logan-mug\/reviews?page=2&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json index 94b3c286e..4165cbb1e 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 1, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/WOMEN_T_SHIRTS?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/WOMEN_T_SHIRTS?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/WOMEN_T_SHIRTS?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/WOMEN_T_SHIRTS?page=1&limit=10" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json index 6cbd2b3f5..447c2a932 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 1, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products-by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10" + "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", + "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", + "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", + "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10" }, "items": [ { From 28cdbb2cd643b40327b3343373623dfec7cff073 Mon Sep 17 00:00:00 2001 From: mamazu Date: Sat, 6 Apr 2019 14:50:17 +0200 Subject: [PATCH 7/9] Adding the upgrade docs --- UPGRADE.md | 14 +++++ .../config/routing/productByCode.yml | 46 ++++++++-------- .../config/routing/productBySlug.yml | 54 +++++++++++-------- 3 files changed, 68 insertions(+), 46 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index c0c3021b4..59a3f1c1b 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,3 +1,17 @@ +# UPGRADE FROM 1.0.0-beta.22 to 1.0.0-beta.23 +The product routes have been moved: + +| Old Route | New route | +|:--------------------------------------|:-------------------------------------| +| `products/{code}` | `products/by-code/{code}` | +| `products-by-slug/{slug}` | `products/by-slug/{slug}` | +| `products/{code}/reviews` | `products/by-code/{code}/reviews` | +| `products-reviews-by-slug/{slug}` | `products/by-slug/{slug}/reviews` | +| `taxon-products/{code}` | `taxon-products/by-code/{taxonCode}` | +| `taxon-products-by-slug/{taxonSlug}` | `taxon-products/by-slug/{taxonSlug}` | + + + # UPGRADE FROM 1.0.0-beta.21 to 1.0.0-beta.22 * The configuration key for the shop api is now `sylius_shop_api`. diff --git a/src/Resources/config/routing/productByCode.yml b/src/Resources/config/routing/productByCode.yml index 6bca368b3..623da66f9 100644 --- a/src/Resources/config/routing/productByCode.yml +++ b/src/Resources/config/routing/productByCode.yml @@ -1,26 +1,26 @@ -#sylius_shop_api_product_show_details_by_code_deprecated: -# path: /products/{code} -# methods: [GET] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_code_action -# -#sylius_shop_api_product_show_catalog_by_code_deprecated: -# path: /taxon-products/{code} -# methods: [GET] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_code_action -# -#sylius_shop_api_product_show_reviews_by_code_depricated: -# path: /products/{code}/reviews -# methods: [GET] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_code_action -# -#sylius_shop_api_add_product_review_by_code_deprecated: -# path: /products/{code}/reviews -# methods: [POST] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.add_review_by_code_action +sylius_shop_api_product_show_details_by_code_deprecated: + path: /products/{code} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_code_action + +sylius_shop_api_product_show_catalog_by_code_deprecated: + path: /taxon-products/{code} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_code_action + +sylius_shop_api_product_show_reviews_by_code_depricated: + path: /products/{code}/reviews + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_code_action + +sylius_shop_api_add_product_review_by_code_deprecated: + path: /products/{code}/reviews + methods: [POST] + defaults: + _controller: sylius.shop_api_plugin.controller.product.add_review_by_code_action # New routes sylius_shop_api_product_show_details_by_code: diff --git a/src/Resources/config/routing/productBySlug.yml b/src/Resources/config/routing/productBySlug.yml index 6c66026d7..f5ae8d2fe 100644 --- a/src/Resources/config/routing/productBySlug.yml +++ b/src/Resources/config/routing/productBySlug.yml @@ -1,26 +1,34 @@ -#sylius_shop_api_product_show_details_by_slug_deprecated: -# path: /products-by-slug/{slug} -# methods: [GET] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_slug_action -# -#sylius_shop_api_add_product_review_by_slug_deprecated: -# path: /product-reviews-by-slug/{slug} -# methods: [POST] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.add_review_by_slug_action -# -#sylius_shop_api_product_show_catalog_by_slug_deprecated: -# path: /taxon-products-by-slug/{taxonSlug} -# methods: [GET] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_slug_action -# -#sylius_shop_api_product_show_reviews_by_slug_deprecated: -# path: /product-reviews-by-slug/{slug} -# methods: [GET] -# defaults: -# _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_slug_action +sylius_shop_api_product_show_details_by_slug_deprecated: + path: /products-by-slug/{slug} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_details_by_slug_action + requirements: + slug: .+ + +sylius_shop_api_add_product_review_by_slug_deprecated: + path: /product-reviews-by-slug/{slug} + methods: [POST] + defaults: + _controller: sylius.shop_api_plugin.controller.product.add_review_by_slug_action + requirements: + slug: .+ + +sylius_shop_api_product_show_catalog_by_slug_deprecated: + path: /taxon-products-by-slug/{taxonSlug} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_catalog_by_taxon_slug_action + requirements: + taxonSlug: .+ + +sylius_shop_api_product_show_reviews_by_slug_deprecated: + path: /product-reviews-by-slug/{slug} + methods: [GET] + defaults: + _controller: sylius.shop_api_plugin.controller.product.show_product_reviews_by_slug_action + requirements: + slug: .+ # New routes sylius_shop_api_product_show_details_by_slug: From 4badec19c0c98c838c71b094112a9cb278e5997d Mon Sep 17 00:00:00 2001 From: mamazu Date: Mon, 8 Apr 2019 21:45:19 +0200 Subject: [PATCH 8/9] Fixing formatting of the upgrade.md --- UPGRADE.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 59a3f1c1b..f924f27dc 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,4 +1,4 @@ -# UPGRADE FROM 1.0.0-beta.22 to 1.0.0-beta.23 +# UPGRADE FROM 1.0.0-beta.21 to 1.0.0-beta.22 The product routes have been moved: | Old Route | New route | @@ -10,8 +10,6 @@ The product routes have been moved: | `taxon-products/{code}` | `taxon-products/by-code/{taxonCode}` | | `taxon-products-by-slug/{taxonSlug}` | `taxon-products/by-slug/{taxonSlug}` | - - # UPGRADE FROM 1.0.0-beta.21 to 1.0.0-beta.22 * The configuration key for the shop api is now `sylius_shop_api`. From c7a5bafa0ea9000f573c782d03c7c219b8d68436 Mon Sep 17 00:00:00 2001 From: mamazu Date: Tue, 9 Apr 2019 21:05:39 +0200 Subject: [PATCH 9/9] Fixing documentation issues --- UPGRADE.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index f924f27dc..ad5002813 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,15 +1,3 @@ -# UPGRADE FROM 1.0.0-beta.21 to 1.0.0-beta.22 -The product routes have been moved: - -| Old Route | New route | -|:--------------------------------------|:-------------------------------------| -| `products/{code}` | `products/by-code/{code}` | -| `products-by-slug/{slug}` | `products/by-slug/{slug}` | -| `products/{code}/reviews` | `products/by-code/{code}/reviews` | -| `products-reviews-by-slug/{slug}` | `products/by-slug/{slug}/reviews` | -| `taxon-products/{code}` | `taxon-products/by-code/{taxonCode}` | -| `taxon-products-by-slug/{taxonSlug}` | `taxon-products/by-slug/{taxonSlug}` | - # UPGRADE FROM 1.0.0-beta.21 to 1.0.0-beta.22 * The configuration key for the shop api is now `sylius_shop_api`. @@ -23,6 +11,17 @@ The product routes have been moved: * The commands are now dispatched using `dispatch()` method instead of `handle()` * The method name in handlers has been changed from `handle()` to `__invoke()` +The product routes have been moved: + +| Old Route | New route | +|:--------------------------------------|:-------------------------------------| +| `products/{code}` | `products/by-code/{code}` | +| `products-by-slug/{slug}` | `products/by-slug/{slug}` | +| `products/{code}/reviews` | `products/by-code/{code}/reviews` | +| `products-reviews-by-slug/{slug}` | `products/by-slug/{slug}/reviews` | +| `taxon-products/{code}` | `taxon-products/by-code/{code}` | +| `taxon-products-by-slug/{taxonSlug}` | `taxon-products/by-slug/{taxonSlug}` | + # UPGRADE FROM 1.0.0-beta.17 to 1.0.0-beta.18 * Customer registration payload changed: