From 0f651f4cfa889ab115ef42e3056015ca59f70c1e Mon Sep 17 00:00:00 2001 From: Kate Kolmakova Date: Mon, 9 Sep 2024 17:23:00 +0400 Subject: [PATCH 1/2] Product reviews: added new design settings --- .../dto/profile/result/FetchedStoreProfile.kt | 24 +++++++++++++++++++ .../FetchedStoreProfileRules.kt | 8 +++++++ 2 files changed, 32 insertions(+) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt index 9f5911747..bd8ebb703 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/result/FetchedStoreProfile.kt @@ -607,6 +607,9 @@ data class FetchedStoreProfile( @JsonFieldName("product_details_position_product_sku") val productDetailsPositionProductSku: Int? = null, + @JsonFieldName("product_details_position_review_section") + val productDetailsPositionReviewSection: Int? = null, + @JsonFieldName("product_details_position_save_for_later") val productDetailsPositionSaveForLater: Int? = null, @@ -679,6 +682,15 @@ data class FetchedStoreProfile( @JsonFieldName("product_details_show_qty") val productDetailsShowQty: Boolean? = null, + @JsonFieldName("product_details_show_rating_section") + val productDetailsShowRatingSection: Boolean? = null, + + @JsonFieldName("product_details_show_reviews_section") + val productDetailsShowReviewsSection: Boolean? = null, + + @JsonFieldName("product_details_show_reviews_section_in_one_card_view") + val productDetailsShowReviewsSectionInOneCardView: Boolean? = null, + @JsonFieldName("product_details_show_sale_price") val productDetailsShowSalePrice: Boolean? = null, @@ -769,6 +781,9 @@ data class FetchedStoreProfile( @JsonFieldName("product_list_price_behavior") val productListPriceBehaviour: String? = null, + @JsonFieldName("product_list_rating_section_behavior") + val productListRatingSectionBehavior: String? = null, + @JsonFieldName("product_list_sku_behavior") val productListSKUBehaviour: String? = null, @@ -793,6 +808,15 @@ data class FetchedStoreProfile( @JsonFieldName("product_list_show_product_images") val productListShowProductImages: Boolean? = null, + @JsonFieldName("product_list_show_rating_in_one_star") + val productListShowRatingInOneStar: Boolean? = null, + + @JsonFieldName("product_list_show_rating_number_in_five_stars_view") + val productListShowRatingNumberInFiveStarsView: Boolean? = null, + + @JsonFieldName("product_list_show_reviews_count_in_five_stars_view") + val productListShowReviewsCountInFiveStarsView: Boolean? = null, + @JsonFieldName("show_signin_link") val productListShowSignInLink: Boolean? = null, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedStoreProfileRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedStoreProfileRules.kt index 3f9287023..a4fe8d36f 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedStoreProfileRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedStoreProfileRules.kt @@ -93,6 +93,7 @@ val fetchedStoreProfileNullablePropertyRules: List> = AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsPositionProductPrice), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsPositionProductLoyalty), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsPositionProductSku), + AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsPositionReviewSection), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsPositionSaveForLater), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsPositionShareButtons), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsPositionSubtitle), @@ -117,6 +118,9 @@ val fetchedStoreProfileNullablePropertyRules: List> = AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowProductLoyalty), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowProductSku), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowQty), + AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowRatingSection), + AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowReviewsSection), + AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowReviewsSectionInOneCardView), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowSalePrice), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowSaveForLater), AllowNullable(FetchedStoreProfile.DesignSettings::productDetailsShowShareButtons), @@ -147,6 +151,7 @@ val fetchedStoreProfileNullablePropertyRules: List> = AllowNullable(FetchedStoreProfile.DesignSettings::productListImageSize), AllowNullable(FetchedStoreProfile.DesignSettings::productListNameBehaviour), AllowNullable(FetchedStoreProfile.DesignSettings::productListPriceBehaviour), + AllowNullable(FetchedStoreProfile.DesignSettings::productListRatingSectionBehavior), AllowNullable(FetchedStoreProfile.DesignSettings::productListSKUBehaviour), AllowNullable(FetchedStoreProfile.DesignSettings::productListShowAdditionalImage), AllowNullable(FetchedStoreProfile.DesignSettings::productListShowBreadcrumbs), @@ -155,6 +160,9 @@ val fetchedStoreProfileNullablePropertyRules: List> = AllowNullable(FetchedStoreProfile.DesignSettings::productListShowOnSaleLabel), AllowNullable(FetchedStoreProfile.DesignSettings::productListShowPayWhatYouWantLabel), AllowNullable(FetchedStoreProfile.DesignSettings::productListShowProductImages), + AllowNullable(FetchedStoreProfile.DesignSettings::productListShowRatingInOneStar), + AllowNullable(FetchedStoreProfile.DesignSettings::productListShowRatingNumberInFiveStarsView), + AllowNullable(FetchedStoreProfile.DesignSettings::productListShowReviewsCountInFiveStarsView), AllowNullable(FetchedStoreProfile.DesignSettings::productListShowSignInLink), AllowNullable(FetchedStoreProfile.DesignSettings::productListShowSoldOutLabel), AllowNullable(FetchedStoreProfile.DesignSettings::productListShowSortViewAsOptions), From 2cb1d533f607a5ba6af5512708370e456fbaa143 Mon Sep 17 00:00:00 2001 From: Kate Kolmakova Date: Tue, 10 Sep 2024 16:29:23 +0400 Subject: [PATCH 2/2] Fixed StoreProfileTest - replaced 'ru' country mention --- .../com/ecwid/apiclient/v3/entity/StoreProfileTest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt index dc4583eb6..75977c6dd 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/StoreProfileTest.kt @@ -84,10 +84,10 @@ class StoreProfileTest : BaseEntityTest() { email = "email@example.com", street = "street", city = "city", - countryCode = "RU", + countryCode = "GE", postalCode = "postalCode", phone = "phone", - stateOrProvinceCode = "73" + stateOrProvinceCode = "TB" ), formatsAndUnits = UpdatedStoreProfile.FormatsAndUnits( currency = "currency", @@ -148,8 +148,8 @@ class StoreProfileTest : BaseEntityTest() { UpdatedStoreProfile.Zone( id = "zoneId", name = "Zone name", - countryCodes = listOf("RU", "UA"), - stateOrProvinceCodes = listOf("RU-73", "RU-77"), + countryCodes = listOf("GE", "UA"), + stateOrProvinceCodes = listOf("GE-AJ", "GE-TB"), postCodes = listOf("123456", "654321") ) ),