Skip to content

Commit

Permalink
ECWID-134977 OE2: if an advanced discount is used for a product and m…
Browse files Browse the repository at this point in the history
…ore items are added to an order, the total is calculated incorrectly: added fields to calculated order
  • Loading branch information
zont163 committed Apr 2, 2024
1 parent f53a93e commit 3f128b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ data class OrderForCalculate(
val type: DiscountType? = null,
val base: DiscountBase? = null,
val orderTotal: Double? = null,
val description: String? = null
val description: String? = null,
val appliesToProducts: List<Int>? = null,
val appliesToItems: List<Long>? = null,
)

data class OrderItemDiscountInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ data class CalculateOrderDetailsResult(
val type: DiscountType? = null,
val base: DiscountBase? = null,
val orderTotal: Double? = null,
val description: String? = null
val description: String? = null,
val appliesToProducts: List<Int>? = null,
val appliesToItems: List<Long>? = null,
)

data class OrderItemDiscountInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ val calculateOrderDetailsResultNullablePropertyRules: List<NullablePropertyRule<
IgnoreNullable(CalculateOrderDetailsResult.DiscountInfo::orderTotal),
IgnoreNullable(CalculateOrderDetailsResult.DiscountInfo::type),
IgnoreNullable(CalculateOrderDetailsResult.DiscountInfo::value),
AllowNullable(CalculateOrderDetailsResult.DiscountInfo::appliesToProducts),
AllowNullable(CalculateOrderDetailsResult.DiscountInfo::appliesToItems),
IgnoreNullable(CalculateOrderDetailsResult.HandlingFeeInfo::description),
IgnoreNullable(CalculateOrderDetailsResult.HandlingFeeInfo::name),
AllowNullable(CalculateOrderDetailsResult.HandlingFeeInfo::taxes),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ val orderForCalculateNullablePropertyRules: List<NullablePropertyRule<*, *>> = l
IgnoreNullable(OrderForCalculate.DiscountInfo::orderTotal),
IgnoreNullable(OrderForCalculate.DiscountInfo::type),
IgnoreNullable(OrderForCalculate.DiscountInfo::value),
AllowNullable(OrderForCalculate.DiscountInfo::appliesToProducts),
AllowNullable(OrderForCalculate.DiscountInfo::appliesToItems),
AllowNullable(OrderForCalculate.HandlingFee::description),
AllowNullable(OrderForCalculate.HandlingFee::name),
AllowNullable(OrderForCalculate.HandlingFee::taxes),
Expand Down

0 comments on commit 3f128b5

Please sign in to comment.