Skip to content

Commit 89a5602

Browse files
committed
ECWID-156302 - add absent enums to DiscountBase
1 parent 0909fd6 commit 89a5602

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
4040

4141
- name: Upload artifacts with checks results
42-
uses: actions/upload-artifact@v3
42+
uses: actions/upload-artifact@v4
4343
if: failure()
4444
with:
4545
name: check-results

src/test/kotlin/com/ecwid/apiclient/v3/util/OrderUtils.kt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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+
193217
private 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

Comments
 (0)