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 7017c9396..2c4e69260 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 @@ -269,8 +269,8 @@ data class UpdatedProduct( data class ProductOptionChoice( val text: String = "", val textTranslated: LocalizedValueMap? = null, - val priceModifier: Double = 0.0, - val priceModifierType: PriceModifierType = PriceModifierType.ABSOLUTE + val priceModifier: Double? = null, + val priceModifierType: PriceModifierType? = null, ) data class ShippingSettings( diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt index e3324b614..527c01e75 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt @@ -6,6 +6,7 @@ import com.ecwid.apiclient.v3.dto.category.request.CategoriesSearchRequest.Paren import com.ecwid.apiclient.v3.dto.category.request.CategoryCreateRequest import com.ecwid.apiclient.v3.dto.category.request.UpdatedCategory import com.ecwid.apiclient.v3.dto.common.* +import com.ecwid.apiclient.v3.dto.product.enums.PriceModifierType import com.ecwid.apiclient.v3.dto.product.enums.ShippingSettingsType import com.ecwid.apiclient.v3.dto.product.request.* import com.ecwid.apiclient.v3.dto.product.request.GetProductFiltersRequest.* @@ -1571,7 +1572,7 @@ private fun generateProductOptionChoice(): ProductOptionChoice { "en" to enText ), priceModifier = randomModifier(), - priceModifierType = randomEnumValue() + priceModifierType = randomEnumValue() ) } diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/VariationsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/VariationsTest.kt index 315f6c2b7..ed58909e2 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/VariationsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/VariationsTest.kt @@ -3,6 +3,7 @@ package com.ecwid.apiclient.v3.entity import com.ecwid.apiclient.v3.converter.toUpdated import com.ecwid.apiclient.v3.dto.common.AsyncPictureData import com.ecwid.apiclient.v3.dto.common.UploadFileData +import com.ecwid.apiclient.v3.dto.product.enums.PriceModifierType import com.ecwid.apiclient.v3.dto.product.request.ProductCreateRequest import com.ecwid.apiclient.v3.dto.product.request.ProductDetailsRequest import com.ecwid.apiclient.v3.dto.product.request.UpdatedProduct @@ -340,7 +341,7 @@ private fun generateProductSelectOption(name: String, values: List): Upd private fun generateProductOptionChoice(value: String) = UpdatedProduct.ProductOptionChoice( text = value, priceModifier = randomModifier(), - priceModifierType = randomEnumValue() + priceModifierType = randomEnumValue() ) private fun generateProductRadioOption(name: String, values: List): UpdatedProduct.ProductOption.RadioOption { diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonnullPropertyRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonnullPropertyRules.kt index a90c2c731..5ebf15894 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonnullPropertyRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/NonnullPropertyRules.kt @@ -14,14 +14,6 @@ import kotlin.reflect.KProperty1 val nonnullPropertyRules: List> = listOf( AllowNonnull(ApiUpdatedDTO.ModifyKind.ReadWrite::fetchedDTOClass), - AllowNonnull(UpdatedProduct.ProductOption.CheckboxOption::required), - AllowNonnull(UpdatedProduct.ProductOption.DateOption::required), - AllowNonnull(UpdatedProduct.ProductOption.FilesOption::required), - AllowNonnull(UpdatedProduct.ProductOption.RadioOption::required), - AllowNonnull(UpdatedProduct.ProductOption.SelectOption::required), - AllowNonnull(UpdatedProduct.ProductOption.SizeOption::required), - AllowNonnull(UpdatedProduct.ProductOption.TextAreaOption::required), - AllowNonnull(UpdatedProduct.ProductOption.TextFieldOption::required), AllowNonnull(UpdatedProduct.CustomPriceTier::value), AllowNonnull(UpdatedStorageData::key), @@ -39,18 +31,13 @@ val nonnullPropertyRules: List> = listOf( IgnoreNonnull(UpdatedProduct.ProductOption.DateOption::name), IgnoreNonnull(UpdatedProduct.ProductOption.FilesOption::name), IgnoreNonnull(UpdatedProduct.ProductOption.RadioOption::choices), - IgnoreNonnull(UpdatedProduct.ProductOption.RadioOption::defaultChoice), IgnoreNonnull(UpdatedProduct.ProductOption.RadioOption::name), IgnoreNonnull(UpdatedProduct.ProductOption.SelectOption::choices), - IgnoreNonnull(UpdatedProduct.ProductOption.SelectOption::defaultChoice), IgnoreNonnull(UpdatedProduct.ProductOption.SelectOption::name), IgnoreNonnull(UpdatedProduct.ProductOption.SizeOption::choices), - IgnoreNonnull(UpdatedProduct.ProductOption.SizeOption::defaultChoice), IgnoreNonnull(UpdatedProduct.ProductOption.SizeOption::name), IgnoreNonnull(UpdatedProduct.ProductOption.TextAreaOption::name), IgnoreNonnull(UpdatedProduct.ProductOption.TextFieldOption::name), - IgnoreNonnull(UpdatedProduct.ProductOptionChoice::priceModifier), - IgnoreNonnull(UpdatedProduct.ProductOptionChoice::priceModifierType), IgnoreNonnull(UpdatedProduct.ProductOptionChoice::text), IgnoreNonnull(UpdatedProduct.RecurringChargeSettings::recurringInterval), IgnoreNonnull(UpdatedProduct.RecurringChargeSettings::recurringIntervalCount),