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 c93c758a..cf8dbcbd 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedOrder.kt @@ -107,7 +107,9 @@ fun FetchedOrder.DiscountInfo.toUpdated(): UpdatedOrder.DiscountInfo { type = type, base = base, orderTotal = orderTotal, - description = description + description = description, + appliesToProducts = appliesToProducts, + appliesToItems = appliesToItems, ) } 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 589c669f..a5b27a50 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 @@ -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? = null, + val appliesToItems: List? = null, ) data class OrderItemDiscountInfo( 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 6fd2f141..efc3823a 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 @@ -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? = null, + val appliesToItems: List? = null, ) data class OrderItemDiscountInfo( 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 cebae62b..06e86eb1 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 @@ -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? = null, + val appliesToItems: List? = null, ) data class DiscountCouponInfo( 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 b03c7438..f35a35c7 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 @@ -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.* @@ -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? = null, + val appliesToItems: List? = null, ) data class DiscountCouponInfo( 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 ff133251..e2e1b409 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 @@ -26,6 +26,8 @@ val calculateOrderDetailsResultNullablePropertyRules: List> = 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), 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 66744d2d..3f4da7d1 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 @@ -52,6 +52,8 @@ val orderForCalculateNullablePropertyRules: List> = 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),