From 3f4f1be48b5d201675374b16ce6756f781fe23c7 Mon Sep 17 00:00:00 2001 From: Denis Fomichev Date: Wed, 11 Oct 2023 15:05:14 +0400 Subject: [PATCH 1/2] ECWID-127184 Custom URL slugs for catalog pages: Enable new URL format on Instant sites - add slugsWithoutIdsEnabled to storeProfile to get it in vuega --- .../com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt | 3 ++- .../apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt | 3 ++- .../apiclient/v3/dto/profile/result/FetchedStoreProfile.kt | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt index e6e203822..5c5dc66d0 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedStoreProfile.kt @@ -34,7 +34,8 @@ fun FetchedStoreProfile.GeneralInfo.toUpdated(): UpdatedStoreProfile.GeneralInfo fun FetchedStoreProfile.InstantSiteInfo.toUpdated(): UpdatedStoreProfile.InstantSiteInfo { return UpdatedStoreProfile.InstantSiteInfo( ecwidSubdomain = ecwidSubdomain, - customDomain = customDomain + customDomain = customDomain, + slugsWithoutIdsEnabled = slugsWithoutIdsEnabled ) } diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt index 9b0a8ed71..6fcc3f748 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/profile/request/UpdatedStoreProfile.kt @@ -32,7 +32,8 @@ data class UpdatedStoreProfile( data class InstantSiteInfo( val ecwidSubdomain: String? = null, - val customDomain: String? = null + val customDomain: String? = null, + val slugsWithoutIdsEnabled: Boolean? = null, ) @Suppress("unused") 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 6f5985aa3..3db81e29a 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 @@ -46,7 +46,8 @@ data class FetchedStoreProfile( val customDomain: String? = null, val generatedUrl: String? = null, val storeLogoUrl: String? = null, - val ecwidSubdomainSuffix: String? = null + val ecwidSubdomainSuffix: String? = null, + val slugsWithoutIdsEnabled: Boolean? = null, ) @Suppress("unused") From f8bfb1fe0acc7e792b73c2417a7dacca54a25ba6 Mon Sep 17 00:00:00 2001 From: Denis Fomichev Date: Wed, 11 Oct 2023 15:50:37 +0400 Subject: [PATCH 2/2] fix rules --- .../com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt | 1 + .../v3/rule/nullablepropertyrules/FetchedStoreProfileRules.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt index 8229e0ca1..e9d872287 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonUpdatablePropertyRules.kt @@ -240,6 +240,7 @@ val nonUpdatablePropertyRules: List> = listOf( ReadOnly(FetchedStoreProfile.Settings::googleProductCategoryName), ReadOnly(FetchedStoreProfile.TikTokPixelSettings::code), ReadOnly(FetchedStoreProfile.InstantSiteInfo::ecwidSubdomainSuffix), + ReadOnly(FetchedStoreProfile.InstantSiteInfo::slugsWithoutIdsEnabled), ReadOnly(FetchedStoreProfile.PaymentOptionInfo::id), ReadOnly(FetchedStoreProfile.PaymentOptionInfo::paymentProcessorTitle), 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 c98c434d6..ff1e596a2 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 @@ -362,4 +362,5 @@ val fetchedStoreProfileNullablePropertyRules: List> = AllowNullable(FetchedStoreProfile.Settings::googleProductCategory), AllowNullable(FetchedStoreProfile.Settings::googleProductCategoryName), AllowNullable(FetchedStoreProfile.InstantSiteInfo::ecwidSubdomainSuffix), + AllowNullable(FetchedStoreProfile.InstantSiteInfo::slugsWithoutIdsEnabled), )