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 555b9b826..7ffd23a30 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt @@ -145,6 +145,7 @@ fun FetchedOrder.OrderItem.toUpdated(): UpdatedOrder.OrderItem { price = price, productPrice = productPrice, shipping = shipping, + handlingFee = handlingFee, tax = tax, fixedShippingRate = fixedShippingRate, couponAmount = couponAmount, @@ -209,6 +210,7 @@ fun FetchedOrder.OrderItemTax.toUpdated(): UpdatedOrder.OrderItemTax { total = total, taxOnDiscountedSubtotal = taxOnDiscountedSubtotal, taxOnShipping = taxOnShipping, + taxOnHandlingFee = taxOnHandlingFee, includeInPrice = includeInPrice, taxType = taxType, ) 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 82d7f95e6..f2ec8eb15 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 @@ -85,6 +85,7 @@ data class OrderForCalculate( val isCustomerSetPrice: Boolean? = null, val selectedPrice: SelectedPrice? = null, val shipping: Double? = null, + val handlingFee: Double? = null, val tax: Double? = null, val fixedShippingRate: Double? = null, val couponAmount: Double? = null, @@ -202,7 +203,8 @@ data class OrderForCalculate( val includeInPrice: Boolean? = null, val taxType: OrderItemTaxType? = null, val taxOnDiscountedSubtotal: Double? = null, - val taxOnShipping: Double? = null + val taxOnShipping: Double? = null, + val taxOnHandlingFee: Double? = null, ) : BaseOrderTax data class OrderItemProductFile( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt index 24d0d6114..cc2213be3 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt @@ -140,6 +140,7 @@ data class CalculateOrderDetailsResult( val priceWithoutTax: Double? = null, val productPrice: Double? = null, val shipping: Double? = null, + val handlingFee: Double? = null, val tax: Double? = null, val fixedShippingRate: Double? = null, val couponAmount: Double? = null, @@ -189,7 +190,8 @@ data class CalculateOrderDetailsResult( val includeInPrice: Boolean? = null, val taxType: OrderItemTaxType? = null, val taxOnDiscountedSubtotal: Double? = null, - val taxOnShipping: Double? = null + val taxOnShipping: Double? = null, + val taxOnHandlingFee: Double? = null, ) : BaseOrderTax data class OrderItemProductFile( diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt index 8c9a34504..8b4a0a4e9 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt @@ -132,6 +132,7 @@ data class FetchedCart( val price: Double? = null, val productPrice: Double? = null, val shipping: Double? = null, + val handlingFee: Double? = null, val tax: Double? = null, val fixedShippingRate: Double? = null, val couponAmount: Double? = null, @@ -182,7 +183,8 @@ data class FetchedCart( val taxType: OrderItemTaxType? = null, val includeInPrice: Boolean? = null, val taxOnDiscountedSubtotal: Double? = null, - val taxOnShipping: Double? = null + val taxOnShipping: Double? = null, + val taxOnHandlingFee: Double? = null, ) : BaseOrderTax data class OrderItemProductFile( 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 9ad9a12ac..13b550724 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 @@ -153,6 +153,7 @@ data class UpdatedOrder( val isCustomerSetPrice: Boolean? = null, val selectedPrice: SelectedPrice? = null, val shipping: Double? = null, + val handlingFee: Double? = null, val tax: Double? = null, val taxable: Boolean? = null, val fixedShippingRate: Double? = null, @@ -276,6 +277,7 @@ data class UpdatedOrder( override val total: Double? = null, val taxOnDiscountedSubtotal: Double? = null, val taxOnShipping: Double? = null, + val taxOnHandlingFee: Double? = null, val includeInPrice: Boolean? = null, val taxType: OrderItemTaxType? = null, ) : BaseOrderTax 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 aef85ee24..1abde70aa 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 @@ -183,6 +183,7 @@ data class FetchedOrder( val selectedPrice: SelectedPrice? = null, val priceWithoutTax: Double? = null, val shipping: Double? = null, + val handlingFee: Double? = null, val tax: Double? = null, val fixedShippingRate: Double? = null, val couponAmount: Double? = null, @@ -264,6 +265,7 @@ data class FetchedOrder( override val total: Double? = null, val taxOnDiscountedSubtotal: Double? = null, val taxOnShipping: Double? = null, + val taxOnHandlingFee: Double? = null, override val includeInPrice: Boolean? = null, val sourceTaxRateId: Int? = null, val sourceTaxRateType: RateType? = null, diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt index 8149503b4..9b63fcbbc 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt @@ -107,6 +107,7 @@ data class FetchedSubscription( val price: Double? = null, val productPrice: Double? = null, val shipping: Double? = null, + val handlingFee: Double? = null, val tax: Double? = null, val fixedShippingRate: Double? = null, @@ -154,6 +155,7 @@ data class FetchedSubscription( val total: Double? = null, val taxOnDiscountedSubtotal: Double? = null, val taxOnShipping: Double? = null, + val taxOnHandlingFee: Double? = null, val includeInPrice: Boolean? = null ) 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 03a891a60..7689e57d2 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt @@ -11,6 +11,7 @@ import com.ecwid.apiclient.v3.dto.order.request.UpdatedOrder import com.ecwid.apiclient.v3.util.* import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNotNull +import org.junit.jupiter.api.Assertions.assertNull import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -86,6 +87,7 @@ class CartsTest : BaseEntityTest() { assertEquals(orderItem.price, cartItem.price) assertEquals(orderItem.productPrice, cartItem.productPrice) assertEquals(orderItem.shipping, cartItem.shipping) + assertEquals(orderItem.handlingFee, cartItem.handlingFee) assertEquals(orderItem.tax, cartItem.tax) assertEquals(orderItem.fixedShippingRate, cartItem.fixedShippingRate) assertEquals(orderItem.couponAmount, cartItem.couponAmount) @@ -125,6 +127,7 @@ class CartsTest : BaseEntityTest() { assertEquals(orderTaxes.total, cartTaxes.total) assertEquals(orderTaxes.taxOnDiscountedSubtotal, cartTaxes.taxOnDiscountedSubtotal) assertEquals(orderTaxes.taxOnShipping, cartTaxes.taxOnShipping) + assertEquals(orderTaxes.taxOnHandlingFee, cartTaxes.taxOnHandlingFee) assertEquals(orderTaxes.includeInPrice, cartTaxes.includeInPrice) assertEquals(orderTaxes.taxType, cartTaxes.taxType) } @@ -295,6 +298,7 @@ class CartsTest : BaseEntityTest() { assertEquals(forCalculateItem.price, calculatedItem.price) assertEquals(forCalculateItem.productPrice, calculatedItem.productPrice) assertEquals(0.0, calculatedItem.shipping) + assertNull(calculatedItem.handlingFee) assertEquals(forCalculateItem.fixedShippingRate, calculatedItem.fixedShippingRate) assertEquals( null, @@ -479,6 +483,7 @@ class CartsTest : BaseEntityTest() { price = 22.2, productPrice = 33.3, shipping = 44.4, + handlingFee = 77.7, tax = 55.5, fixedShippingRate = 66.6, couponAmount = 15.0, diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/CalculateOrderDetailsResultRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/CalculateOrderDetailsResultRules.kt index a19568394..68de0ddc6 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/CalculateOrderDetailsResultRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/CalculateOrderDetailsResultRules.kt @@ -60,6 +60,7 @@ val calculateOrderDetailsResultNullablePropertyRules: List> = listOf( IgnoreNullable(FetchedCart.OrderItem::selectedOptions), AllowNullable(FetchedCart.OrderItem::combinationId), IgnoreNullable(FetchedCart.OrderItem::shipping), + AllowNullable(FetchedCart.OrderItem::handlingFee), IgnoreNullable(FetchedCart.OrderItem::shortDescription), IgnoreNullable(FetchedCart.OrderItem::sku), IgnoreNullable(FetchedCart.OrderItem::tax), @@ -144,6 +145,7 @@ val fetchedCartNullablePropertyRules: List> = listOf( IgnoreNullable(FetchedCart.OrderItemTax::name), IgnoreNullable(FetchedCart.OrderItemTax::taxOnDiscountedSubtotal), IgnoreNullable(FetchedCart.OrderItemTax::taxOnShipping), + AllowNullable(FetchedCart.OrderItemTax::taxOnHandlingFee), IgnoreNullable(FetchedCart.OrderItemTax::total), IgnoreNullable(FetchedCart.OrderItemTax::value), IgnoreNullable(FetchedCart.PersonInfo::city), 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 7aae1547c..2b1f5b02b 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 @@ -87,6 +87,7 @@ val fetchedOrderNullablePropertyRules: List> = listOf AllowNullable(FetchedOrder.OrderItem::combinationId), AllowNullable(FetchedOrder.OrderItem::selectedPrice), IgnoreNullable(FetchedOrder.OrderItem::shipping), + AllowNullable(FetchedOrder.OrderItem::handlingFee), IgnoreNullable(FetchedOrder.OrderItem::shortDescription), AllowNullable(FetchedOrder.OrderItem::shortDescriptionTranslated), IgnoreNullable(FetchedOrder.OrderItem::sku), @@ -133,6 +134,7 @@ val fetchedOrderNullablePropertyRules: List> = listOf IgnoreNullable(FetchedOrder.OrderItemTax::name), IgnoreNullable(FetchedOrder.OrderItemTax::taxOnDiscountedSubtotal), IgnoreNullable(FetchedOrder.OrderItemTax::taxOnShipping), + AllowNullable(FetchedOrder.OrderItemTax::taxOnHandlingFee), IgnoreNullable(FetchedOrder.OrderItemTax::total), IgnoreNullable(FetchedOrder.OrderItemTax::value), IgnoreNullable(FetchedOrder.OrderItemTax::sourceTaxRateId), diff --git a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedSubscriptionRules.kt b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedSubscriptionRules.kt index c8780e6ce..4ce3c732b 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedSubscriptionRules.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedSubscriptionRules.kt @@ -52,6 +52,7 @@ val fetchedSubscriptionsNullablePropertyRules: List> AllowNullable(FetchedSubscription.OrderItem::price), AllowNullable(FetchedSubscription.OrderItem::productPrice), AllowNullable(FetchedSubscription.OrderItem::shipping), + AllowNullable(FetchedSubscription.OrderItem::handlingFee), AllowNullable(FetchedSubscription.OrderItem::tax), AllowNullable(FetchedSubscription.OrderItem::fixedShippingRate), AllowNullable(FetchedSubscription.OrderItem::sku), @@ -90,6 +91,7 @@ val fetchedSubscriptionsNullablePropertyRules: List> AllowNullable(FetchedSubscription.Taxes::total), AllowNullable(FetchedSubscription.Taxes::taxOnDiscountedSubtotal), AllowNullable(FetchedSubscription.Taxes::taxOnShipping), + AllowNullable(FetchedSubscription.Taxes::taxOnHandlingFee), AllowNullable(FetchedSubscription.Taxes::includeInPrice), AllowNullable(FetchedSubscription.Dimensions::length), 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 08cac60a6..d6a790109 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 @@ -90,6 +90,7 @@ val orderForCalculateNullablePropertyRules: List> = l IgnoreNullable(OrderForCalculate.OrderItem::selectedOptions), AllowNullable(OrderForCalculate.OrderItem::combinationId), IgnoreNullable(OrderForCalculate.OrderItem::shipping), + AllowNullable(OrderForCalculate.OrderItem::handlingFee), IgnoreNullable(OrderForCalculate.OrderItem::shortDescription), IgnoreNullable(OrderForCalculate.OrderItem::sku), IgnoreNullable(OrderForCalculate.OrderItem::tax), @@ -127,6 +128,7 @@ val orderForCalculateNullablePropertyRules: List> = l IgnoreNullable(OrderForCalculate.OrderItemTax::name), IgnoreNullable(OrderForCalculate.OrderItemTax::taxOnDiscountedSubtotal), IgnoreNullable(OrderForCalculate.OrderItemTax::taxOnShipping), + AllowNullable(OrderForCalculate.OrderItemTax::taxOnHandlingFee), IgnoreNullable(OrderForCalculate.OrderItemTax::total), IgnoreNullable(OrderForCalculate.OrderItemTax::value), AllowNullable(OrderForCalculate.PaymentOption::paymentId), 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 a7c38a69c..0f54173ae 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt @@ -225,6 +225,7 @@ private fun generateTestOrderItem() = UpdatedOrder.OrderItem( price = randomPrice(), productPrice = randomPrice(), shipping = randomPrice(), + handlingFee = randomPrice(), tax = randomPrice(), fixedShippingRate = randomPrice(), couponAmount = randomPrice(), @@ -327,6 +328,7 @@ private fun generateTestOrderItemTax(): UpdatedOrder.OrderItemTax { total = randomPrice(), taxOnDiscountedSubtotal = randomPrice(), taxOnShipping = randomPrice(), + taxOnHandlingFee = randomPrice(), includeInPrice = randomBoolean() ) }