From 60e0b9c80497b43b52d89a807186a6cf6fb43bb8 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Mon, 4 Dec 2023 19:53:40 +0100 Subject: [PATCH 1/7] ECWID-116234 Implement alt-text support for all category images | Add alt text proprety in ecwid-java-api-client for category --- .../com/ecwid/apiclient/v3/converter/FetchedCategory.kt | 8 +++++++- .../apiclient/v3/dto/category/request/UpdatedCategory.kt | 8 +++++++- .../apiclient/v3/dto/category/result/FetchedCategory.kt | 8 +++++++- .../v3/rule/nullablepropertyrules/FetchedCategoryRules.kt | 5 ++++- 4 files changed, 25 insertions(+), 4 deletions(-) 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 e5b45d632..db876b3a3 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt @@ -17,6 +17,12 @@ fun FetchedCategory.toUpdated(): UpdatedCategory { seoTitle = seoTitle, seoTitleTranslated = seoTitleTranslated, seoDescription = seoDescription, - seoDescriptionTranslated = seoDescriptionTranslated + seoDescriptionTranslated = seoDescriptionTranslated, + imageAlt = imageAlt?.toUpdated() ) } + +fun FetchedCategory.Alt.toUpdated() = UpdatedCategory.Alt( + main = main, + translated = translated +) 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 bd2ecf9fb..e110a981d 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 @@ -18,8 +18,14 @@ data class UpdatedCategory( val seoTitle: String? = null, val seoTitleTranslated: LocalizedValueMap? = null, val seoDescription: String? = null, - val seoDescriptionTranslated: LocalizedValueMap? = null + val seoDescriptionTranslated: LocalizedValueMap? = null, + val imageAlt: Alt? = null ) : ApiUpdatedDTO { override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCategory::class) + + data class Alt( + val main: String? = null, + val translated: LocalizedValueMap? = null + ) } 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 8f7f02300..3f6935110 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 @@ -32,8 +32,14 @@ data class FetchedCategory( val seoTitle: String? = null, val seoTitleTranslated: LocalizedValueMap? = null, val seoDescription: String? = null, - val seoDescriptionTranslated: LocalizedValueMap? = null + val seoDescriptionTranslated: LocalizedValueMap? = null, + val imageAlt: Alt? = null ) : ApiFetchedDTO, ApiResultDTO { override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCategory::class) + + data class Alt( + val main: String? = null, + val translated: LocalizedValueMap? = 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 a93379381..d54905570 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 @@ -25,5 +25,8 @@ val fetchedCategoryNullablePropertyRules: List> = lis AllowNullable(FetchedCategory::seoTitle), AllowNullable(FetchedCategory::seoTitleTranslated), AllowNullable(FetchedCategory::seoDescription), - AllowNullable(FetchedCategory::seoDescriptionTranslated) + AllowNullable(FetchedCategory::seoDescriptionTranslated), + AllowNullable(FetchedCategory::imageAlt), + AllowNullable(FetchedCategory.Alt::main), + AllowNullable(FetchedCategory.Alt::translated) ) From ee65fadc508e3c5eb908ba3b10dbba2e4cc32327 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Fri, 29 Dec 2023 12:15:53 +0800 Subject: [PATCH 2/7] ECWID-116234 Implement alt-text support for all category images | Replace imageAlt proprety with alt --- .../kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt | 2 +- .../ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt | 2 +- .../ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt | 2 +- .../v3/rule/nullablepropertyrules/FetchedCategoryRules.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 db876b3a3..8881a7c26 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt @@ -18,7 +18,7 @@ fun FetchedCategory.toUpdated(): UpdatedCategory { seoTitleTranslated = seoTitleTranslated, seoDescription = seoDescription, seoDescriptionTranslated = seoDescriptionTranslated, - imageAlt = imageAlt?.toUpdated() + alt = alt?.toUpdated() ) } 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 e110a981d..e3d5ca578 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 @@ -19,7 +19,7 @@ data class UpdatedCategory( val seoTitleTranslated: LocalizedValueMap? = null, val seoDescription: String? = null, val seoDescriptionTranslated: LocalizedValueMap? = null, - val imageAlt: Alt? = null + val alt: Alt? = 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 3f6935110..0c35d46c1 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 @@ -33,7 +33,7 @@ data class FetchedCategory( val seoTitleTranslated: LocalizedValueMap? = null, val seoDescription: String? = null, val seoDescriptionTranslated: LocalizedValueMap? = null, - val imageAlt: Alt? = null + val alt: Alt? = null ) : ApiFetchedDTO, ApiResultDTO { override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCategory::class) 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 d54905570..4fd6c695d 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,7 +26,7 @@ val fetchedCategoryNullablePropertyRules: List> = lis AllowNullable(FetchedCategory::seoTitleTranslated), AllowNullable(FetchedCategory::seoDescription), AllowNullable(FetchedCategory::seoDescriptionTranslated), - AllowNullable(FetchedCategory::imageAlt), + AllowNullable(FetchedCategory::alt), AllowNullable(FetchedCategory.Alt::main), AllowNullable(FetchedCategory.Alt::translated) ) From 9716710d3850cdd0d6a0c5c296695247924b96a0 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Wed, 17 Jan 2024 11:34:34 +0100 Subject: [PATCH 3/7] ECWID-116234 Implement alt-text support for all category images | Create Alt data class for product and category --- .../apiclient/v3/converter/FetchedCategory.kt | 7 +------ .../apiclient/v3/converter/FetchedProduct.kt | 5 ----- .../v3/dto/category/request/UpdatedCategory.kt | 7 ++----- .../v3/dto/category/result/FetchedCategory.kt | 7 ++----- .../com/ecwid/apiclient/v3/dto/common/Alt.kt | 18 ++++++++++++++++++ .../v3/dto/product/request/UpdatedProduct.kt | 9 ++------- .../v3/dto/product/result/FetchedProduct.kt | 9 ++------- .../FetchedCategoryRules.kt | 2 -- .../FetchedProductRules.kt | 2 -- 9 files changed, 27 insertions(+), 39 deletions(-) create mode 100644 src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt 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 8881a7c26..8b1efcafe 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt @@ -18,11 +18,6 @@ fun FetchedCategory.toUpdated(): UpdatedCategory { seoTitleTranslated = seoTitleTranslated, seoDescription = seoDescription, seoDescriptionTranslated = seoDescriptionTranslated, - alt = alt?.toUpdated() + alt = alt?.toUpdated(), ) } - -fun FetchedCategory.Alt.toUpdated() = UpdatedCategory.Alt( - main = main, - translated = translated -) 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 c18d73858..6ac98608c 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt @@ -224,11 +224,6 @@ fun FetchedProduct.ProductImage.toUpdated() = UpdatedProduct.ProductImage( alt = alt?.toUpdated() ) -fun FetchedProduct.ProductImage.Alt.toUpdated() = UpdatedProduct.ProductImage.Alt( - main = main, - translated = translated -) - fun FetchedProduct.TaxInfo.toUpdated() = UpdatedProduct.TaxInfo( taxable = taxable, enabledManualTaxes = enabledManualTaxes, 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 e3d5ca578..a9507a173 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 @@ -4,6 +4,7 @@ import com.ecwid.apiclient.v3.dto.category.result.FetchedCategory import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO import com.ecwid.apiclient.v3.dto.common.ApiUpdatedDTO.ModifyKind import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap +import com.ecwid.apiclient.v3.dto.common.UpdatedAlt data class UpdatedCategory( val parentId: Int? = null, @@ -19,13 +20,9 @@ data class UpdatedCategory( val seoTitleTranslated: LocalizedValueMap? = null, val seoDescription: String? = null, val seoDescriptionTranslated: LocalizedValueMap? = null, - val alt: Alt? = null + val alt: UpdatedAlt? = null ) : ApiUpdatedDTO { override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCategory::class) - data class Alt( - val main: String? = null, - val translated: LocalizedValueMap? = null - ) } 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 0c35d46c1..98a860bb4 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 @@ -4,6 +4,7 @@ import com.ecwid.apiclient.v3.dto.category.request.UpdatedCategory import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind import com.ecwid.apiclient.v3.dto.common.ApiResultDTO +import com.ecwid.apiclient.v3.dto.common.FetchedAlt import com.ecwid.apiclient.v3.dto.common.LocalizedValueMap import com.ecwid.apiclient.v3.dto.common.PictureInfo @@ -33,13 +34,9 @@ data class FetchedCategory( val seoTitleTranslated: LocalizedValueMap? = null, val seoDescription: String? = null, val seoDescriptionTranslated: LocalizedValueMap? = null, - val alt: Alt? = null + val alt: FetchedAlt? = null ) : ApiFetchedDTO, ApiResultDTO { override fun getModifyKind() = ModifyKind.ReadWrite(UpdatedCategory::class) - data class Alt( - val main: String? = null, - val translated: LocalizedValueMap? = null - ) } diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt new file mode 100644 index 000000000..82435a2ee --- /dev/null +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt @@ -0,0 +1,18 @@ +package com.ecwid.apiclient.v3.dto.common + +data class FetchedAlt( + val main: String? = null, + val translated: LocalizedValueMap? = null, +) { + fun toUpdated(): UpdatedAlt{ + return UpdatedAlt( + main = main, + translated = translated + ) + } +} + +data class UpdatedAlt( + val main: String? = null, + val translated: LocalizedValueMap? = null, +) 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 994e4b8e4..d19f3a366 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 @@ -373,13 +373,8 @@ data class UpdatedProduct( data class ProductImage( val id: String = "0", val orderBy: Int = 0, - val alt: Alt? = null - ) { - data class Alt( - val main: String? = null, - val translated: LocalizedValueMap? = null - ) - } + val alt: UpdatedAlt? = null + ) override fun getModifyKind() = ModifyKind.ReadWrite(FetchedProduct::class) } 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 80356f44f..8e80fb8a1 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 @@ -345,13 +345,8 @@ data class FetchedProduct( val image800pxUrl: String? = null, val image1500pxUrl: String? = null, val imageOriginalUrl: String? = null, - val alt: Alt? = null - ) { - data class Alt( - val main: String? = null, - val translated: LocalizedValueMap? = null - ) - } + val alt: FetchedAlt? = null + ) data class ProductVideo( val id: String = "0", 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 4fd6c695d..5f88ee61e 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 @@ -27,6 +27,4 @@ val fetchedCategoryNullablePropertyRules: List> = lis AllowNullable(FetchedCategory::seoDescription), AllowNullable(FetchedCategory::seoDescriptionTranslated), AllowNullable(FetchedCategory::alt), - AllowNullable(FetchedCategory.Alt::main), - AllowNullable(FetchedCategory.Alt::translated) ) 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 721d01b2c..c529c6e71 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 @@ -99,8 +99,6 @@ val fetchedProductNullablePropertyRules: List> = list IgnoreNullable(FetchedProduct.ProductImage::image800pxUrl), IgnoreNullable(FetchedProduct.ProductImage::imageOriginalUrl), AllowNullable(FetchedProduct.ProductImage::alt), - AllowNullable(FetchedProduct.ProductImage.Alt::main), - AllowNullable(FetchedProduct.ProductImage.Alt::translated), AllowNullable(FetchedProduct.ProductVideo::videoCoverId), AllowNullable(FetchedProduct.ProductVideo::image160pxUrl), AllowNullable(FetchedProduct.ProductVideo::image400pxUrl), From e2118e2e392408444700cfbd4916e52f3d7bb6c0 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Wed, 17 Jan 2024 11:47:11 +0100 Subject: [PATCH 4/7] ECWID-116234 Implement alt-text support for all category images | Code clean --- src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt index 82435a2ee..9b953fd3c 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/common/Alt.kt @@ -4,7 +4,7 @@ data class FetchedAlt( val main: String? = null, val translated: LocalizedValueMap? = null, ) { - fun toUpdated(): UpdatedAlt{ + fun toUpdated(): UpdatedAlt { return UpdatedAlt( main = main, translated = translated From 2feb363fc4df16f17812402822ecc9edc9618cd3 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Wed, 17 Jan 2024 11:47:20 +0100 Subject: [PATCH 5/7] ECWID-116234 Implement alt-text support for all category images | Code clean --- .../dto/subscriptions/request/SubscriptionsSearchRequest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt index 32134343b..4802874a4 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt @@ -65,8 +65,8 @@ data class SubscriptionsSearchRequest( orderTotal?.let { put("orderTotal", it.toString()) } orderCreatedFrom?.let { put("orderCreatedFrom", TimeUnit.MILLISECONDS.toSeconds(it.time).toString()) } orderCreatedTo?.let { put("orderCreatedTo", TimeUnit.MILLISECONDS.toSeconds(it.time).toString()) } - offset?.let { put("offset", it.toString()) } - limit?.let { put("limit", it.toString()) } + offset.let { put("offset", it.toString()) } + limit.let { put("limit", it.toString()) } put("sortBy", sortBy.name) lang?.let { put("lang", it) } }.toMap() From cff908449f671d0ab27af252b718aa7fbc0a36d4 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Wed, 24 Jan 2024 14:52:24 +0100 Subject: [PATCH 6/7] ECWID-116234 Implement alt-text support for all category images | Add nullable rule for FetchedAlt --- .../v3/rule/nullablepropertyrules/FetchedCategoryRules.kt | 3 +++ .../v3/rule/nullablepropertyrules/FetchedProductRules.kt | 3 +++ 2 files changed, 6 insertions(+) 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 5f88ee61e..64fcb26a9 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 @@ -1,6 +1,7 @@ package com.ecwid.apiclient.v3.rule.nullablepropertyrules import com.ecwid.apiclient.v3.dto.category.result.FetchedCategory +import com.ecwid.apiclient.v3.dto.common.FetchedAlt import com.ecwid.apiclient.v3.rule.NullablePropertyRule import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable import com.ecwid.apiclient.v3.rule.NullablePropertyRule.IgnoreNullable @@ -27,4 +28,6 @@ val fetchedCategoryNullablePropertyRules: List> = lis AllowNullable(FetchedCategory::seoDescription), AllowNullable(FetchedCategory::seoDescriptionTranslated), AllowNullable(FetchedCategory::alt), + AllowNullable(FetchedAlt::main), + AllowNullable(FetchedAlt::translated), ) 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 c529c6e71..e8cdaf9b4 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 @@ -1,5 +1,6 @@ package com.ecwid.apiclient.v3.rule.nullablepropertyrules +import com.ecwid.apiclient.v3.dto.common.FetchedAlt import com.ecwid.apiclient.v3.dto.product.result.FetchedProduct import com.ecwid.apiclient.v3.rule.NullablePropertyRule import com.ecwid.apiclient.v3.rule.NullablePropertyRule.AllowNullable @@ -99,6 +100,8 @@ val fetchedProductNullablePropertyRules: List> = list IgnoreNullable(FetchedProduct.ProductImage::image800pxUrl), IgnoreNullable(FetchedProduct.ProductImage::imageOriginalUrl), AllowNullable(FetchedProduct.ProductImage::alt), + AllowNullable(FetchedAlt::main), + AllowNullable(FetchedAlt::translated), AllowNullable(FetchedProduct.ProductVideo::videoCoverId), AllowNullable(FetchedProduct.ProductVideo::image160pxUrl), AllowNullable(FetchedProduct.ProductVideo::image400pxUrl), From 185bac3f99eba3861e88d09c2dda78da35e6b568 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Wed, 24 Jan 2024 15:08:14 +0100 Subject: [PATCH 7/7] ECWID-116234 Implement alt-text support for all category images | Code clean --- .../dto/subscriptions/request/SubscriptionsSearchRequest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt index 4802874a4..32134343b 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/request/SubscriptionsSearchRequest.kt @@ -65,8 +65,8 @@ data class SubscriptionsSearchRequest( orderTotal?.let { put("orderTotal", it.toString()) } orderCreatedFrom?.let { put("orderCreatedFrom", TimeUnit.MILLISECONDS.toSeconds(it.time).toString()) } orderCreatedTo?.let { put("orderCreatedTo", TimeUnit.MILLISECONDS.toSeconds(it.time).toString()) } - offset.let { put("offset", it.toString()) } - limit.let { put("limit", it.toString()) } + offset?.let { put("offset", it.toString()) } + limit?.let { put("limit", it.toString()) } put("sortBy", sortBy.name) lang?.let { put("lang", it) } }.toMap()