@@ -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,27 @@ 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+ description = " On item discount " + randomAlphanumeric(8 )
201+ )
202+
203+ private fun generateTestShippingDiscountInfo () = UpdatedOrder .DiscountInfo (
204+ value = randomPrice(),
205+ type = randomEnumValue<DiscountType >(),
206+ base = DiscountBase .SHIPPING ,
207+ description = " On shipping discount " + randomAlphanumeric(8 )
208+ )
209+
210+ private fun generateTestSubtotalDiscountInfo () = UpdatedOrder .DiscountInfo (
211+ value = randomPrice(),
212+ type = randomEnumValue<DiscountType >(),
213+ base = DiscountBase .SUBTOTAL ,
214+ description = " On subtotal discount " + randomAlphanumeric(8 )
215+ )
216+
193217private fun generateTestOrderItem () = UpdatedOrder .OrderItem (
194218 // var id: Int? = null, // TODO readonly
195219 // productId = com.ecwid.api.v3.randomId(), // TODO need to pass existing product id
0 commit comments