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 82487f6b..bf16af4d 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt @@ -73,6 +73,7 @@ fun FetchedProduct.toUpdated(): UpdatedProduct { maxPurchaseQuantity = maxPurchaseQuantity, reviewsCollectingAllowed = reviewsCollectingAllowed, batteryIncluded = batteryIncluded, + euGuaranteeLabelSettings = euGuaranteeLabelSettings?.toUpdated(), ) } @@ -251,3 +252,11 @@ fun FetchedProduct.LowestPriceSettings.toUpdated() = UpdatedProduct.LowestPriceS lowestPriceEnabled = lowestPriceEnabled, manualLowestPrice = manualLowestPrice ) + +fun FetchedProduct.EuGuaranteeLabelSettings.toUpdated() = UpdatedProduct.EuGuaranteeLabelSettings( + modelNumber = modelNumber, + brand = brand, + guaranteeYears = guaranteeYears, + acknowledged = acknowledged, + enabled = enabled +) 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 f2075d0e..eae47291 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 @@ -73,6 +73,7 @@ data class UpdatedProduct( val maxPurchaseQuantity: Int? = null, val reviewsCollectingAllowed: Boolean? = null, val batteryIncluded: Boolean? = null, + val euGuaranteeLabelSettings: EuGuaranteeLabelSettings? = null, ) : ApiUpdatedDTO { data class Ribbon( @@ -414,5 +415,13 @@ data class UpdatedProduct( val manualLowestPrice: Double? = null, ) + data class EuGuaranteeLabelSettings( + val modelNumber: String? = null, + val brand: String? = null, + val guaranteeYears: Double? = null, + val acknowledged: Boolean? = null, + val enabled: Boolean? = 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 b1971dd0..6a5a198b 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 @@ -145,6 +145,7 @@ data class FetchedProduct( val reviewsModerated: Int? = null, val reviewsPublished: Int? = null, val compositeComponents: List? = null, + val euGuaranteeLabelSettings: EuGuaranteeLabelSettings? = null, ) : ApiFetchedDTO, ApiResultDTO { data class BorderInfo( @@ -411,4 +412,12 @@ data class FetchedProduct( val defaultDisplayedAutomaticLowestPrice: Double? = null, val defaultDisplayedAutomaticLowestPriceFormatted: String? = null, ) + + data class EuGuaranteeLabelSettings( + val modelNumber: String? = null, + val brand: String? = null, + val guaranteeYears: Double? = null, + val acknowledged: Boolean? = null, + val enabled: Boolean? = null + ) } 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 2842314d..4372c02d 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 @@ -74,6 +74,7 @@ val fetchedProductNullablePropertyRules: List> = list IgnoreNullable(FetchedProduct::relatedProducts), AllowNullable(FetchedProduct::reviewsCollectingAllowed), AllowNullable(FetchedProduct::batteryIncluded), + AllowNullable(FetchedProduct::euGuaranteeLabelSettings), AllowNullable(FetchedProduct::reviewsModerated), AllowNullable(FetchedProduct::reviewsPublished), IgnoreNullable(FetchedProduct::ribbon), @@ -174,4 +175,9 @@ val fetchedProductNullablePropertyRules: List> = list AllowNullable(FetchedProduct::maxPurchaseQuantity), AllowNullable(FetchedProduct::locationInventory), AllowNullable(FetchedProduct::compositeComponents), + AllowNullable(FetchedProduct.EuGuaranteeLabelSettings::modelNumber), + AllowNullable(FetchedProduct.EuGuaranteeLabelSettings::brand), + AllowNullable(FetchedProduct.EuGuaranteeLabelSettings::guaranteeYears), + AllowNullable(FetchedProduct.EuGuaranteeLabelSettings::acknowledged), + AllowNullable(FetchedProduct.EuGuaranteeLabelSettings::enabled), )