From 7e44ac6f4b4bd52fd66e9a9ad994a5d128b9900f Mon Sep 17 00:00:00 2001 From: Alexander Blake Date: Fri, 29 Mar 2024 13:39:54 +0400 Subject: [PATCH] =?UTF-8?q?ECWID-137410=20ecwid-java-api-client:=20add=20c?= =?UTF-8?q?ustomerGroupId=20to=20order=20entities=20=E2=80=94=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt | 1 + .../ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt | 1 + .../com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt | 1 + .../com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt | 2 +- .../v3/rule/nullablepropertyrules/OrderForCalculateRules.kt | 1 + src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt index 37832bdf0..5e56638c3 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt @@ -37,6 +37,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder { customerId = customerId, customerGroup = customerGroup, + customerGroupId = customerGroupId, acceptMarketing = acceptMarketing, total = total, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt index 589c669f3..c8a72bb5b 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt @@ -11,6 +11,7 @@ data class OrderForCalculate( val email: String? = null, val ipAddress: String? = null, val customerId: Int? = null, + val customerGroupId: Int? = null, val customerTaxExempt: Boolean? = null, val customerTaxId: String? = null, val reversedTaxApplied: Boolean? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt index a98b3cb7a..340c95836 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt @@ -42,6 +42,7 @@ data class UpdatedOrder( val customerId: Int? = null, val customerGroup: String? = null, + val customerGroupId: Int? = null, val acceptMarketing: Boolean? = null, val total: Double? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt index b63b25b87..08ef8b337 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt @@ -56,7 +56,7 @@ data class FetchedOrder( val customerId: Int? = null, // TODO Figure out how to test val customerGroup: String? = null, - val customerGroupId: Long? = null, + val customerGroupId: Int? = null, val acceptMarketing: Boolean? = null, val giftCardRedemption: Double? = null, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/OrderForCalculateRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/OrderForCalculateRules.kt index 66744d2d8..29e90fb16 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/OrderForCalculateRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/OrderForCalculateRules.kt @@ -8,6 +8,7 @@ import com.ecwid.apiclient.v3.rule.NullablePropertyRule.IgnoreNullable val orderForCalculateNullablePropertyRules: List> = listOf( IgnoreNullable(OrderForCalculate::billingPerson), IgnoreNullable(OrderForCalculate::customerId), + AllowNullable(OrderForCalculate::customerGroupId), AllowNullable(OrderForCalculate::customerTaxId), AllowNullable(OrderForCalculate::customerTaxExempt), AllowNullable(OrderForCalculate::customSurcharges), diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt index f1ba2b1d6..eb7b30af7 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt @@ -50,6 +50,7 @@ fun generateTestOrder(): UpdatedOrder { externalTransactionId = randomAlphanumeric(16), customerGroup = "Group " + randomAlphanumeric(8), + customerGroupId = randomId(), acceptMarketing = randomBoolean(), total = totalPrice,