diff --git a/.DS_Store b/.DS_Store index ac96bd15..94ec7715 100644 Binary files a/.DS_Store and b/.DS_Store differ 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 2a7407d5..82487f6b 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedProduct.kt @@ -72,6 +72,7 @@ fun FetchedProduct.toUpdated(): UpdatedProduct { minPurchaseQuantity = minPurchaseQuantity, maxPurchaseQuantity = maxPurchaseQuantity, reviewsCollectingAllowed = reviewsCollectingAllowed, + batteryIncluded = batteryIncluded, ) } 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 9e4675af..f2075d0e 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 @@ -72,6 +72,7 @@ data class UpdatedProduct( val minPurchaseQuantity: Int? = null, val maxPurchaseQuantity: Int? = null, val reviewsCollectingAllowed: Boolean? = null, + val batteryIncluded: Boolean? = null, ) : ApiUpdatedDTO { data class Ribbon( 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 f0c31b35..b1971dd0 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 @@ -140,6 +140,7 @@ data class FetchedProduct( val minPurchaseQuantity: Int? = null, val maxPurchaseQuantity: Int? = null, val reviewsCollectingAllowed: Boolean? = null, + val batteryIncluded: Boolean? = null, val rating: Double? = null, val reviewsModerated: Int? = null, val reviewsPublished: Int? = null, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CustomersTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CustomersTest.kt index d87b640a..456df987 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CustomersTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CustomersTest.kt @@ -13,6 +13,7 @@ import com.ecwid.apiclient.v3.exception.EcwidApiException import com.ecwid.apiclient.v3.util.randomAlphanumeric import com.ecwid.apiclient.v3.util.randomBoolean import com.ecwid.apiclient.v3.util.randomEmail +import com.ecwid.apiclient.v3.util.randomNumeric import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Disabled @@ -419,7 +420,7 @@ private fun generateTestCustomerForCreate(customerGroupId: Int?): UpdatedCustome generateShippingAddress(), generateShippingAddress() ), - taxId = randomAlphanumeric(8), + taxId = randomNumeric(8), taxIdValid = randomBoolean(), taxExempt = randomBoolean(), acceptMarketing = randomBoolean(), @@ -444,7 +445,7 @@ private fun generateTestCustomerForUpdate( generateShippingAddress(oldShippingAddresses?.get(2)?.id), generateShippingAddress(oldShippingAddresses?.get(3)?.id) ), - taxId = randomAlphanumeric(8), + taxId = randomNumeric(8), taxIdValid = randomBoolean(), taxExempt = randomBoolean(), acceptMarketing = randomBoolean(), 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 4bd20bc2..2842314d 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 @@ -73,6 +73,7 @@ val fetchedProductNullablePropertyRules: List> = list AllowNullable(FetchedProduct::rating), IgnoreNullable(FetchedProduct::relatedProducts), AllowNullable(FetchedProduct::reviewsCollectingAllowed), + AllowNullable(FetchedProduct::batteryIncluded), AllowNullable(FetchedProduct::reviewsModerated), AllowNullable(FetchedProduct::reviewsPublished), IgnoreNullable(FetchedProduct::ribbon), diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt b/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt index c5ea6fd1..422b7e5a 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/util/RandomUtils.kt @@ -62,6 +62,14 @@ internal fun randomAlphanumeric(size: Int): String { .joinToString("") } +internal fun randomNumeric(size: Int): String { + val digits = ('0'..'9').toList() + return (1..size) + .map { Random.nextInt(0, digits.size) } + .map(digits::get) + .joinToString("") +} + internal inline fun > randomEnumValue(vararg exclude: E): E { return E::class.java.enumConstants .toSortedSet()