From 4131a680b9e9baf46665807b3a737d5082f68f55 Mon Sep 17 00:00:00 2001 From: carl Date: Fri, 5 Jul 2024 00:22:42 +0400 Subject: [PATCH 1/2] ECWID-138159 Custom URL slugs for catalog pages: Product and categories export/import in CSV: add 'customLsug' field --- .../kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt | 1 + .../com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt | 1 + .../com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt | 1 + .../v3/rule/nullablepropertyrules/FetchedProductRules.kt | 1 + 4 files changed, 4 insertions(+) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt index 24afae77d..a08acb081 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt @@ -12,6 +12,7 @@ fun FetchedProduct.toUpdated(): UpdatedProduct { description = description, descriptionTranslated = descriptionTranslated, sku = sku, + customSlug = customSlug, enabled = enabled, quantity = quantity, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt index e21a7b107..af9c01e87 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/request/UpdatedProduct.kt @@ -11,6 +11,7 @@ data class UpdatedProduct( val description: String? = null, val descriptionTranslated: LocalizedValueMap? = null, val sku: String? = null, + val customSlug: String? = null, val isSampleProduct: Boolean? = null, val enabled: Boolean? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt index 1b8f913e8..fd03d5507 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt @@ -17,6 +17,7 @@ data class FetchedProduct( val sku: String = "", val isSampleProduct: Boolean? = null, val url: String? = null, + val customSlug: String? = null, val created: Date = Date(), val createTimestamp: Int = 0, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt index aac59f304..8cb31a625 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt @@ -89,6 +89,7 @@ val fetchedProductNullablePropertyRules: List> = list IgnoreNullable(FetchedProduct::tax), IgnoreNullable(FetchedProduct::unlimited), IgnoreNullable(FetchedProduct::url), + IgnoreNullable(FetchedProduct::customSlug), IgnoreNullable(FetchedProduct::warningLimit), IgnoreNullable(FetchedProduct::weight), IgnoreNullable(FetchedProduct::wholesalePrices), From ff65e661444794c6ae83ab602e92eb9524860cdb Mon Sep 17 00:00:00 2001 From: carl Date: Fri, 5 Jul 2024 12:47:35 +0400 Subject: [PATCH 2/2] ECWID-138159: allow 'customSlug' field to be nullable --- .../v3/rule/nullablepropertyrules/FetchedProductRules.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt index 8cb31a625..1113d8f84 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt @@ -89,7 +89,7 @@ val fetchedProductNullablePropertyRules: List> = list IgnoreNullable(FetchedProduct::tax), IgnoreNullable(FetchedProduct::unlimited), IgnoreNullable(FetchedProduct::url), - IgnoreNullable(FetchedProduct::customSlug), + AllowNullable(FetchedProduct::customSlug), IgnoreNullable(FetchedProduct::warningLimit), IgnoreNullable(FetchedProduct::weight), IgnoreNullable(FetchedProduct::wholesalePrices),