Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
)