@@ -73,7 +73,10 @@ fun generateTestOrder(): UpdatedOrder {
7373 generateTestOnTotalDiscountInfo(),
7474 generateTestOnMembershipDiscountInfo(),
7575 generateTestOnTotalAndMembershipDiscountInfo(),
76- generateTestCustomDiscountInfo()
76+ generateTestCustomDiscountInfo(),
77+ generateTestItemDiscountInfo(),
78+ generateTestShippingDiscountInfo(),
79+ generateTestSubtotalDiscountInfo()
7780 ),
7881
7982 // TODO Pass real discount coupon code when API client will support this
@@ -190,6 +193,30 @@ private fun generateTestCustomDiscountInfo() = UpdatedOrder.DiscountInfo(
190193 description = " Custom discount " + randomAlphanumeric(8 )
191194)
192195
196+ private fun generateTestItemDiscountInfo () = UpdatedOrder .DiscountInfo (
197+ value = randomPrice(),
198+ type = randomEnumValue<DiscountType >(),
199+ base = DiscountBase .ITEM ,
200+ orderTotal = randomPrice(),
201+ description = " On item discount " + randomAlphanumeric(8 )
202+ )
203+
204+ private fun generateTestShippingDiscountInfo () = UpdatedOrder .DiscountInfo (
205+ value = randomPrice(),
206+ type = randomEnumValue<DiscountType >(),
207+ base = DiscountBase .SHIPPING ,
208+ orderTotal = randomPrice(),
209+ description = " On shipping discount " + randomAlphanumeric(8 )
210+ )
211+
212+ private fun generateTestSubtotalDiscountInfo () = UpdatedOrder .DiscountInfo (
213+ value = randomPrice(),
214+ type = randomEnumValue<DiscountType >(),
215+ base = DiscountBase .SUBTOTAL ,
216+ orderTotal = randomPrice(),
217+ description = " On subtotal discount " + randomAlphanumeric(8 )
218+ )
219+
193220private fun generateTestOrderItem () = UpdatedOrder .OrderItem (
194221 // var id: Int? = null, // TODO readonly
195222 // productId = com.ecwid.api.v3.randomId(), // TODO need to pass existing product id
0 commit comments