Skip to content

Commit

Permalink
Merge pull request #394 from Ecwid/ECWID-134977
Browse files Browse the repository at this point in the history
ECWID-134977 OE2: if an advanced discount is used for a product and m…
  • Loading branch information
zont163 authored Apr 25, 2024
2 parents b9d88db + 3f128b5 commit c4a70f3
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ fun FetchedOrder.DiscountInfo.toUpdated(): UpdatedOrder.DiscountInfo {
type = type,
base = base,
orderTotal = orderTotal,
description = description
description = description,
appliesToProducts = appliesToProducts,
appliesToItems = appliesToItems,
)
}

Expand Down
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 @@ -108,7 +108,9 @@ data class UpdatedOrder(
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 DiscountCouponInfo(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.ecwid.apiclient.v3.dto.order.result

import com.ecwid.apiclient.v3.dto.common.*
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO
import com.ecwid.apiclient.v3.dto.common.ApiFetchedDTO.ModifyKind
import com.ecwid.apiclient.v3.dto.common.ExtendedOrderTax
import com.ecwid.apiclient.v3.dto.common.OrderedStringToListStringMap
import com.ecwid.apiclient.v3.dto.common.OrderedStringToStringMap
import com.ecwid.apiclient.v3.dto.order.enums.*
import com.ecwid.apiclient.v3.dto.order.request.UpdatedOrder
import java.util.*
Expand Down Expand Up @@ -126,7 +129,9 @@ data class FetchedOrder(
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 DiscountCouponInfo(
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 @@ -43,6 +43,8 @@ val fetchedOrderNullablePropertyRules: List<NullablePropertyRule<*, *>> = listOf
IgnoreNullable(FetchedOrder.DiscountInfo::orderTotal),
IgnoreNullable(FetchedOrder.DiscountInfo::type),
IgnoreNullable(FetchedOrder.DiscountInfo::value),
AllowNullable(FetchedOrder.DiscountInfo::appliesToProducts),
AllowNullable(FetchedOrder.DiscountInfo::appliesToItems),
AllowNullable(FetchedOrder.ExtraFieldsInfo::customerInputType),
AllowNullable(FetchedOrder.ExtraFieldsInfo::id),
AllowNullable(FetchedOrder.ExtraFieldsInfo::orderBy),
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 c4a70f3

Please sign in to comment.