From 20c697e99e53458ad48f5bd2506394073f651a36 Mon Sep 17 00:00:00 2001 From: ringo Date: Mon, 24 Feb 2025 11:31:18 +0400 Subject: [PATCH 1/2] Add new values for CustomAppRequest.DiscountType --- .../com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt | 4 +++- .../com/ecwid/apiclient/v3/dto/order/enums/DiscountType.kt | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt index bdf12a511..82feee490 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/custom/CustomAppRequest.kt @@ -181,7 +181,9 @@ data class CustomAppRequest( ) enum class DiscountType { - ABS, PERCENT + ABS, + PERCENT, + FIXED_PRICE, } enum class DiscountBase { diff --git a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/DiscountType.kt b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/DiscountType.kt index e28833b00..1c1a0a4fc 100644 --- a/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/DiscountType.kt +++ b/src/main/kotlin/com/ecwid/apiclient/v3/dto/order/enums/DiscountType.kt @@ -2,5 +2,6 @@ package com.ecwid.apiclient.v3.dto.order.enums enum class DiscountType { ABS, - PERCENT + PERCENT, + FIXED_PRICE, } From 8f48c967e92c3b545cf9a3c6a00924ff3821d60e Mon Sep 17 00:00:00 2001 From: ringo Date: Tue, 4 Mar 2025 13:48:51 +0400 Subject: [PATCH 2/2] Temporarily exclude FIXED_PRICE from tests until it is released --- .../com/ecwid/apiclient/v3/util/OrderUtils.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 deb07ac5c..a117b7c92 100644 --- a/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt +++ b/src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt @@ -164,7 +164,7 @@ fun generateTestOrder(): UpdatedOrder { private fun generateTestOnTotalDiscountInfo() = UpdatedOrder.DiscountInfo( value = randomPrice(), - type = randomEnumValue(), + type = randomEnumValue(exclude = arrayOf(DiscountType.FIXED_PRICE)), base = DiscountBase.ON_TOTAL, orderTotal = randomPrice(), description = "On total discount " + randomAlphanumeric(8) @@ -172,14 +172,14 @@ private fun generateTestOnTotalDiscountInfo() = UpdatedOrder.DiscountInfo( private fun generateTestOnMembershipDiscountInfo() = UpdatedOrder.DiscountInfo( value = randomPrice(), - type = randomEnumValue(), + type = randomEnumValue(exclude = arrayOf(DiscountType.FIXED_PRICE)), base = DiscountBase.ON_MEMBERSHIP, description = "On membership discount " + randomAlphanumeric(8) ) private fun generateTestOnTotalAndMembershipDiscountInfo() = UpdatedOrder.DiscountInfo( value = randomPrice(), - type = randomEnumValue(), + type = randomEnumValue(exclude = arrayOf(DiscountType.FIXED_PRICE)), base = DiscountBase.ON_TOTAL_AND_MEMBERSHIP, orderTotal = randomPrice(), description = "On total and membership discount " + randomAlphanumeric(8) @@ -187,7 +187,7 @@ private fun generateTestOnTotalAndMembershipDiscountInfo() = UpdatedOrder.Discou private fun generateTestCustomDiscountInfo() = UpdatedOrder.DiscountInfo( value = randomPrice(), - type = randomEnumValue(), + type = randomEnumValue(exclude = arrayOf(DiscountType.FIXED_PRICE)), base = DiscountBase.CUSTOM, orderTotal = randomPrice(), description = "Custom discount " + randomAlphanumeric(8) @@ -195,7 +195,7 @@ private fun generateTestCustomDiscountInfo() = UpdatedOrder.DiscountInfo( private fun generateTestItemDiscountInfo() = UpdatedOrder.DiscountInfo( value = randomPrice(), - type = randomEnumValue(), + type = randomEnumValue(exclude = arrayOf(DiscountType.FIXED_PRICE)), base = DiscountBase.ITEM, orderTotal = randomPrice(), description = "On item discount " + randomAlphanumeric(8) @@ -203,7 +203,7 @@ private fun generateTestItemDiscountInfo() = UpdatedOrder.DiscountInfo( private fun generateTestShippingDiscountInfo() = UpdatedOrder.DiscountInfo( value = randomPrice(), - type = randomEnumValue(), + type = randomEnumValue(exclude = arrayOf(DiscountType.FIXED_PRICE)), base = DiscountBase.SHIPPING, orderTotal = randomPrice(), description = "On shipping discount " + randomAlphanumeric(8) @@ -211,7 +211,7 @@ private fun generateTestShippingDiscountInfo() = UpdatedOrder.DiscountInfo( private fun generateTestSubtotalDiscountInfo() = UpdatedOrder.DiscountInfo( value = randomPrice(), - type = randomEnumValue(), + type = randomEnumValue(exclude = arrayOf(DiscountType.FIXED_PRICE)), base = DiscountBase.SUBTOTAL, orderTotal = randomPrice(), description = "On subtotal discount " + randomAlphanumeric(8)