File tree Expand file tree Collapse file tree
main/kotlin/com/ecwid/apiclient/v3/dto/order/enums
test/kotlin/com/ecwid/apiclient/v3/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,5 +7,6 @@ enum class DiscountBase {
77 SHIPPING ,
88 ITEM ,
99 SUBTOTAL ,
10- CUSTOM
10+ CUSTOM ,
11+ PRICE_BOOK
1112}
Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ fun generateTestOrder(): UpdatedOrder {
7676 generateTestCustomDiscountInfo(),
7777 generateTestItemDiscountInfo(),
7878 generateTestShippingDiscountInfo(),
79- generateTestSubtotalDiscountInfo()
79+ generateTestSubtotalDiscountInfo(),
80+ generateTestPriceBookDiscountInfo()
8081 ),
8182
8283 // TODO Pass real discount coupon code when API client will support this
@@ -217,6 +218,14 @@ private fun generateTestSubtotalDiscountInfo() = UpdatedOrder.DiscountInfo(
217218 description = " On subtotal discount " + randomAlphanumeric(8 )
218219)
219220
221+ private fun generateTestPriceBookDiscountInfo () = UpdatedOrder .DiscountInfo (
222+ value = randomPrice(),
223+ type = randomEnumValue<DiscountType >(),
224+ base = DiscountBase .PRICE_BOOK ,
225+ orderTotal = randomPrice(),
226+ description = " Price book discount " + randomAlphanumeric(8 )
227+ )
228+
220229private fun generateTestOrderItem () = UpdatedOrder .OrderItem (
221230 // var id: Int? = null, // TODO readonly
222231 // productId = com.ecwid.api.v3.randomId(), // TODO need to pass existing product id
You can’t perform that action at this time.
0 commit comments