-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #258 from BitBagCommerce/api-facets-fix
Fix api facets
- Loading branch information
Showing
4 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
tests/PHPUnit/Integration/Api/DataFixtures/ORM/test_it_updates_facets.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
Sylius\Component\Core\Model\Channel: | ||
channel_web: | ||
code: 'WEB' | ||
name: 'Web Channel' | ||
hostname: 'localhost' | ||
description: 'Lorem ipsum' | ||
baseCurrency: '@currency_usd' | ||
defaultLocale: '@locale_en' | ||
locales: ['@locale_en'] | ||
color: 'black' | ||
enabled: true | ||
taxCalculationStrategy: 'order_items_based' | ||
|
||
Sylius\Component\Currency\Model\Currency: | ||
currency_usd: | ||
code: 'USD' | ||
|
||
Sylius\Component\Locale\Model\Locale: | ||
locale_en: | ||
code: 'en_US' | ||
|
||
Sylius\Component\Core\Model\Product: | ||
product_mug: | ||
code: 'MUG' | ||
channels: ['@channel_web'] | ||
currentLocale: 'en_US' | ||
translations: | ||
en_US: '@product_translation_mug' | ||
product_mug2: | ||
code: 'MUG2' | ||
channels: ['@channel_web'] | ||
currentLocale: 'en_US' | ||
translations: | ||
en_US: '@product_translation_mug2' | ||
product_mug3: | ||
code: 'MUG3' | ||
channels: ['@channel_web'] | ||
currentLocale: 'en_US' | ||
translations: | ||
en_US: '@product_translation_mug3' | ||
|
||
Sylius\Component\Core\Model\ProductTranslation: | ||
product_translation_mug: | ||
slug: 'mug' | ||
locale: 'en_US' | ||
name: 'Mug' | ||
description: '<paragraph(2)>' | ||
translatable: '@product_mug' | ||
product_translation_mug2: | ||
slug: 'mug-2' | ||
locale: 'en_US' | ||
name: 'Mug 2' | ||
description: '<paragraph(2)>' | ||
translatable: '@product_mug2' | ||
product_translation_mug3: | ||
slug: 'mug-3' | ||
locale: 'en_US' | ||
name: 'Mug 3' | ||
description: '<paragraph(2)>' | ||
translatable: '@product_mug3' | ||
|
||
Sylius\Component\Product\Model\ProductAttributeTranslation: | ||
attributeTranslation1: | ||
locale: en_US | ||
name: "Product color" | ||
translatable: "@product_attribute_color" | ||
attributeTranslation2: | ||
locale: en_US | ||
name: "Product material" | ||
translatable: "@product_attribute_material" | ||
|
||
Sylius\Component\Product\Model\ProductAttribute: | ||
product_attribute_color: | ||
code: 'color' | ||
type: 'text' | ||
storage_type: 'text' | ||
position: 1 | ||
translatable: 1 | ||
product_attribute_material: | ||
code: 'material' | ||
type: 'text' | ||
storage_type: 'text' | ||
position: 1 | ||
translatable: 1 | ||
|
||
Sylius\Component\Product\Model\ProductAttributeValue: | ||
product_attribute_value_color_1: | ||
product: '@product_mug' | ||
attribute: '@product_attribute_color' | ||
localeCode: 'en_US' | ||
value: 'red' | ||
product_attribute_value_color_2: | ||
product: '@product_mug2' | ||
attribute: '@product_attribute_color' | ||
localeCode: 'en_US' | ||
value: 'blue' | ||
product_attribute_value_color_3: | ||
product: '@product_mug3' | ||
attribute: '@product_attribute_color' | ||
localeCode: 'en_US' | ||
value: 'white' | ||
product_attribute_value_material_1: | ||
product: '@product_mug' | ||
attribute: '@product_attribute_material' | ||
localeCode: 'en_US' | ||
value: 'ceramic' | ||
product_attribute_value_material_2: | ||
product: '@product_mug2' | ||
attribute: '@product_attribute_material' | ||
localeCode: 'en_US' | ||
value: 'ceramic' | ||
|
||
Sylius\Component\Core\Model\Taxon: | ||
mugs: | ||
code: "mugs" | ||
|
||
Sylius\Component\Core\Model\ProductTaxon: | ||
productTaxon1: | ||
product: "@product_mug" | ||
taxon: "@mugs" | ||
position: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
tests/PHPUnit/Integration/Api/Responses/Expected/test_it_updates_facets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"items": [ | ||
{ | ||
"productTaxons": [ | ||
"/api/v2/shop/product-taxons/@string@" | ||
], | ||
"mainTaxon": null, | ||
"averageRating": 0, | ||
"images": [], | ||
"id": "@integer@", | ||
"code": "MUG", | ||
"variants": [], | ||
"options": [], | ||
"associations": [], | ||
"createdAt": "@string@", | ||
"updatedAt": "@string@", | ||
"shortDescription": null, | ||
"reviews": [], | ||
"name": "Mug", | ||
"description": "@string@", | ||
"slug": "mug" | ||
} | ||
], | ||
"facets": { | ||
"material": { | ||
"doc_count_error_upper_bound": 0, | ||
"sum_other_doc_count": 0, | ||
"buckets": [ | ||
{ | ||
"key": "ceramic", | ||
"doc_count": 1 | ||
} | ||
] | ||
}, | ||
"color": { | ||
"doc_count_error_upper_bound": 0, | ||
"sum_other_doc_count": 0, | ||
"buckets": [ | ||
{ | ||
"key": "red", | ||
"doc_count": 1 | ||
} | ||
] | ||
}, | ||
"taxon": { | ||
"doc_count_error_upper_bound": 0, | ||
"sum_other_doc_count": 0, | ||
"buckets": [ | ||
{ | ||
"key": "mugs", | ||
"doc_count": 1 | ||
} | ||
] | ||
} | ||
}, | ||
"pagination": { | ||
"current_page": 1, | ||
"has_previous_page": false, | ||
"has_next_page": false, | ||
"per_page": 9, | ||
"total_items": 1, | ||
"total_pages": 1 | ||
} | ||
} |