From 56e7cdc265de13684e9dad212a4f48739068481a Mon Sep 17 00:00:00 2001 From: Renat Ayzyatullen Date: Fri, 24 May 2024 17:18:11 +0400 Subject: [PATCH 1/5] ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order - added customerFiscalCode to FetchedOrder and UpdatedOrder --- src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt | 1 + .../com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt | 1 + .../com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt | 1 + .../apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt | 1 + 4 files changed, 4 insertions(+) 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 cf8dbcbd..c5109e85 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt @@ -91,6 +91,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder { orderExtraFields = orderExtraFields?.map(FetchedOrder.ExtraFieldsInfo::toUpdated), paymentReference = paymentReference, loyalty = loyalty?.toUpdated(), + customerFiscalCode = customerFiscalCode, ) } 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 06e86eb1..3953c5cc 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 @@ -95,6 +95,7 @@ data class UpdatedOrder( val orderExtraFields: List? = null, val paymentReference: String? = null, val loyalty: Loyalty? = null, + val customerFiscalCode: String? = null, ) : ApiUpdatedDTO { 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 f35a35c7..435060e2 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 @@ -116,6 +116,7 @@ data class FetchedOrder( val paymentReference: String? = null, val shippingLabelAvailableForShipment: Boolean = false, val loyalty: Loyalty? = null, + val customerFiscalCode: String? = null, ) : ApiFetchedDTO { diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt index 28d8f44f..5267b154 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedOrderRules.kt @@ -318,4 +318,5 @@ val fetchedOrderNullablePropertyRules: List> = listOf AllowNullable(FetchedOrder.Loyalty::redemption), AllowNullable(FetchedOrder.LoyaltyRedemption::id), AllowNullable(FetchedOrder.LoyaltyRedemption::amount), + AllowNullable(FetchedOrder::customerFiscalCode), ) From e5aaa6e919c9179a386489f63ecd5002d62ce252 Mon Sep 17 00:00:00 2001 From: Renat Ayzyatullen Date: Fri, 24 May 2024 19:08:06 +0400 Subject: [PATCH 2/5] ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order - changed customerFiscalCode default value to empty string (as in ApiOrder) in FetchedOrder and UpdatedOrder --- .../com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt | 2 +- .../com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 3953c5cc..9560f0d8 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 @@ -95,7 +95,7 @@ data class UpdatedOrder( val orderExtraFields: List? = null, val paymentReference: String? = null, val loyalty: Loyalty? = null, - val customerFiscalCode: String? = null, + val customerFiscalCode: String? = "", ) : ApiUpdatedDTO { 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 435060e2..2deab79f 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 @@ -116,7 +116,7 @@ data class FetchedOrder( val paymentReference: String? = null, val shippingLabelAvailableForShipment: Boolean = false, val loyalty: Loyalty? = null, - val customerFiscalCode: String? = null, + val customerFiscalCode: String? = "", ) : ApiFetchedDTO { From f1deb59f4b8dad4f5582ec20ae127626659b540a Mon Sep 17 00:00:00 2001 From: Renat Ayzyatullen Date: Fri, 24 May 2024 19:40:45 +0400 Subject: [PATCH 3/5] Revert "ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order - changed customerFiscalCode default value to empty string (as in ApiOrder) in FetchedOrder and UpdatedOrder" This reverts commit e5aaa6e919c9179a386489f63ecd5002d62ce252. --- .../com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt | 2 +- .../com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 9560f0d8..3953c5cc 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 @@ -95,7 +95,7 @@ data class UpdatedOrder( val orderExtraFields: List? = null, val paymentReference: String? = null, val loyalty: Loyalty? = null, - val customerFiscalCode: String? = "", + val customerFiscalCode: String? = null, ) : ApiUpdatedDTO { 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 2deab79f..435060e2 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 @@ -116,7 +116,7 @@ data class FetchedOrder( val paymentReference: String? = null, val shippingLabelAvailableForShipment: Boolean = false, val loyalty: Loyalty? = null, - val customerFiscalCode: String? = "", + val customerFiscalCode: String? = null, ) : ApiFetchedDTO { From afcd1ebab25d9c558cb5b262d30ef45c47622949 Mon Sep 17 00:00:00 2001 From: Renat Ayzyatullen Date: Fri, 24 May 2024 20:10:45 +0400 Subject: [PATCH 4/5] ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order - added customerFiscalCode cleanup to tests --- src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt | 3 ++- src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt index 829857fe..cab47d6f 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt @@ -696,6 +696,7 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder ) } ) - } + }, + customerFiscalCode = null, ) } diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt index f9d338aa..e2e85d0a 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt @@ -431,7 +431,8 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder items = items?.mapIndexed { index, item -> val requestItem = order.items?.get(index) item.cleanupForComparison(requestItem) - } + }, + customerFiscalCode = null, ) } From 6148e9f953f8f6bac9bfeda4d879b0ad4b38e164 Mon Sep 17 00:00:00 2001 From: Renat Ayzyatullen Date: Mon, 27 May 2024 15:30:47 +0400 Subject: [PATCH 5/5] ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order - added clarification --- src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt | 2 +- src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt index cab47d6f..66148360 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt @@ -697,6 +697,6 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder } ) }, - customerFiscalCode = null, + customerFiscalCode = null, // ApiOrder has empty string instead of null ) } diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt index e2e85d0a..2c7d7229 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt @@ -432,7 +432,7 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder val requestItem = order.items?.get(index) item.cleanupForComparison(requestItem) }, - customerFiscalCode = null, + customerFiscalCode = null, // ApiOrder has empty string instead of null ) }