From 3ec34620cc3256d24a4fababed681b9bd64ac041 Mon Sep 17 00:00:00 2001 From: carl Date: Tue, 27 Aug 2024 00:08:52 +0400 Subject: [PATCH] ECWID-147482: Custom URL slugs for catalog pages: Product and categories export/import in CSV: Custom slugs for categories is not filled after import: set up missing 'customSlug' property --- .../kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt | 1 + .../ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt | 3 ++- .../ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt | 1 + .../v3/rule/nullablepropertyrules/FetchedCategoryRules.kt | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt index 8b1efcaf..5b0b09cd 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt @@ -19,5 +19,6 @@ fun FetchedCategory.toUpdated(): UpdatedCategory { seoDescription = seoDescription, seoDescriptionTranslated = seoDescriptionTranslated, alt = alt?.toUpdated(), + customSlug = customSlug, ) } diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt index a9507a17..4a383995 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt @@ -20,7 +20,8 @@ data class UpdatedCategory( val seoTitleTranslated: LocalizedValueMap? = null, val seoDescription: String? = null, val seoDescriptionTranslated: LocalizedValueMap? = null, - val alt: UpdatedAlt? = null + val alt: UpdatedAlt? = null, + val customSlug: String? = null, ) : ApiUpdatedDTO { override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCategory::class) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt index 98a860bb..135a3b7e 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt @@ -26,6 +26,7 @@ data class FetchedCategory( val originalImageUrl: String? = null, val originalImage: PictureInfo? = null, val url: String? = null, + val customSlug: String? = "", val productCount: Int? = null, val productCountWithoutSubcategories: Int? = null, val enabledProductCount: Int? = null, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCategoryRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCategoryRules.kt index 64fcb26a..d8c7f17f 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCategoryRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCategoryRules.kt @@ -26,6 +26,7 @@ val fetchedCategoryNullablePropertyRules: List> = lis AllowNullable(FetchedCategory::seoTitle), AllowNullable(FetchedCategory::seoTitleTranslated), AllowNullable(FetchedCategory::seoDescription), + AllowNullable(FetchedCategory::customSlug), AllowNullable(FetchedCategory::seoDescriptionTranslated), AllowNullable(FetchedCategory::alt), AllowNullable(FetchedAlt::main),