Skip to content

Commit

Permalink
Merge pull request #409 from Ecwid/ECWID-135200
Browse files Browse the repository at this point in the history
ECWID-135200 Recurring subscription orders are created without Tax ID although it's presented in the initial order
  • Loading branch information
renat-ayzyatullen authored May 27, 2024
2 parents 482be1f + 6148e9f commit dafb3e9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ fun FetchedOrder.toUpdated(): UpdatedOrder {
orderExtraFields = orderExtraFields?.map(FetchedOrder.ExtraFieldsInfo::toUpdated),
paymentReference = paymentReference,
loyalty = loyalty?.toUpdated(),
customerFiscalCode = customerFiscalCode,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ data class UpdatedOrder(
val orderExtraFields: List<OrderExtraFields>? = null,
val paymentReference: String? = null,
val loyalty: Loyalty? = null,
val customerFiscalCode: String? = null,

) : ApiUpdatedDTO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ data class FetchedOrder(
val paymentReference: String? = null,
val shippingLabelAvailableForShipment: Boolean = false,
val loyalty: Loyalty? = null,
val customerFiscalCode: String? = null,

) : ApiFetchedDTO {

Expand Down
3 changes: 2 additions & 1 deletion src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ private fun UpdatedOrder.cleanupForComparison(order: UpdatedOrder): UpdatedOrder
)
}
)
}
},
customerFiscalCode = null, // ApiOrder has empty string instead of null
)
}
3 changes: 2 additions & 1 deletion src/test/kotlin/com/ecwid/apiclient/v3/entity/OrdersTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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, // ApiOrder has empty string instead of null
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,5 @@ val fetchedOrderNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf
AllowNullable(FetchedOrder.Loyalty::redemption),
AllowNullable(FetchedOrder.LoyaltyRedemption::id),
AllowNullable(FetchedOrder.LoyaltyRedemption::amount),
AllowNullable(FetchedOrder::customerFiscalCode),
)

0 comments on commit dafb3e9

Please sign in to comment.