Skip to content

Commit 049caf4

Browse files
committed
ECOM-7571 Add taxOnHandling field to items taxes info
`taxOnHandling` includes only tax on handling breakdown for item, while `taxOnShipping` includes tax on shipping plus handling.
1 parent 126ce48 commit 049caf4

14 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ fun FetchedOrder.OrderItemTax.toUpdated(): UpdatedOrder.OrderItemTax {
209209
total = total,
210210
taxOnDiscountedSubtotal = taxOnDiscountedSubtotal,
211211
taxOnShipping = taxOnShipping,
212+
taxOnHandling = taxOnHandling,
212213
includeInPrice = includeInPrice,
213214
taxType = taxType,
214215
)

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/request/OrderForCalculate.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ data class OrderForCalculate(
202202
val includeInPrice: Boolean? = null,
203203
val taxType: OrderItemTaxType? = null,
204204
val taxOnDiscountedSubtotal: Double? = null,
205-
val taxOnShipping: Double? = null
205+
val taxOnShipping: Double? = null,
206+
val taxOnHandling: Double? = null,
206207
) : BaseOrderTax
207208

208209
data class OrderItemProductFile(

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/CalculateOrderDetailsResult.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ data class CalculateOrderDetailsResult(
189189
val includeInPrice: Boolean? = null,
190190
val taxType: OrderItemTaxType? = null,
191191
val taxOnDiscountedSubtotal: Double? = null,
192-
val taxOnShipping: Double? = null
192+
val taxOnShipping: Double? = null,
193+
val taxOnHandling: Double? = null,
193194
) : BaseOrderTax
194195

195196
data class OrderItemProductFile(

src/main/kotlin/com/ecwid/apiclient/v3/dto/cart/result/FetchedCart.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ data class FetchedCart(
182182
val taxType: OrderItemTaxType? = null,
183183
val includeInPrice: Boolean? = null,
184184
val taxOnDiscountedSubtotal: Double? = null,
185-
val taxOnShipping: Double? = null
185+
val taxOnShipping: Double? = null,
186+
val taxOnHandling: Double? = null,
186187
) : BaseOrderTax
187188

188189
data class OrderItemProductFile(

src/main/kotlin/com/ecwid/apiclient/v3/dto/order/request/UpdatedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ data class UpdatedOrder(
276276
override val total: Double? = null,
277277
val taxOnDiscountedSubtotal: Double? = null,
278278
val taxOnShipping: Double? = null,
279+
val taxOnHandling: Double? = null,
279280
val includeInPrice: Boolean? = null,
280281
val taxType: OrderItemTaxType? = null,
281282
) : BaseOrderTax

src/main/kotlin/com/ecwid/apiclient/v3/dto/order/result/FetchedOrder.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ data class FetchedOrder(
264264
override val total: Double? = null,
265265
val taxOnDiscountedSubtotal: Double? = null,
266266
val taxOnShipping: Double? = null,
267+
val taxOnHandling: Double? = null,
267268
override val includeInPrice: Boolean? = null,
268269
val sourceTaxRateId: Int? = null,
269270
val sourceTaxRateType: RateType? = null,

src/main/kotlin/com/ecwid/apiclient/v3/dto/subscriptions/result/FetchedSubscription.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ data class FetchedSubscription(
154154
val total: Double? = null,
155155
val taxOnDiscountedSubtotal: Double? = null,
156156
val taxOnShipping: Double? = null,
157+
val taxOnHandling: Double? = null,
157158
val includeInPrice: Boolean? = null
158159
)
159160

src/test/kotlin/com/ecwid/apiclient/v3/entity/CartsTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class CartsTest : BaseEntityTest() {
125125
assertEquals(orderTaxes.total, cartTaxes.total)
126126
assertEquals(orderTaxes.taxOnDiscountedSubtotal, cartTaxes.taxOnDiscountedSubtotal)
127127
assertEquals(orderTaxes.taxOnShipping, cartTaxes.taxOnShipping)
128+
assertEquals(orderTaxes.taxOnHandling, cartTaxes.taxOnHandling)
128129
assertEquals(orderTaxes.includeInPrice, cartTaxes.includeInPrice)
129130
assertEquals(orderTaxes.taxType, cartTaxes.taxType)
130131
}

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/CalculateOrderDetailsResultRules.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ val calculateOrderDetailsResultNullablePropertyRules: List<NullablePropertyRule<
9696
IgnoreNullable(CalculateOrderDetailsResult.OrderItemTax::name),
9797
IgnoreNullable(CalculateOrderDetailsResult.OrderItemTax::taxOnDiscountedSubtotal),
9898
IgnoreNullable(CalculateOrderDetailsResult.OrderItemTax::taxOnShipping),
99+
AllowNullable(CalculateOrderDetailsResult.OrderItemTax::taxOnHandling),
99100
IgnoreNullable(CalculateOrderDetailsResult.OrderItemTax::total),
100101
IgnoreNullable(CalculateOrderDetailsResult.OrderItemTax::value),
101102
IgnoreNullable(CalculateOrderDetailsResult.PersonInfo::city),

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCartRules.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ val fetchedCartNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf(
144144
IgnoreNullable(FetchedCart.OrderItemTax::name),
145145
IgnoreNullable(FetchedCart.OrderItemTax::taxOnDiscountedSubtotal),
146146
IgnoreNullable(FetchedCart.OrderItemTax::taxOnShipping),
147+
AllowNullable(FetchedCart.OrderItemTax::taxOnHandling),
147148
IgnoreNullable(FetchedCart.OrderItemTax::total),
148149
IgnoreNullable(FetchedCart.OrderItemTax::value),
149150
IgnoreNullable(FetchedCart.PersonInfo::city),

0 commit comments

Comments
 (0)