@cloudcommerce/app-discounts 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.turbo/turbo-build.log
CHANGED
|
@@ -352,7 +352,7 @@ export default async ({ params, application }) => {
|
|
|
352
352
|
) {
|
|
353
353
|
// list orders to check discount usage limits
|
|
354
354
|
// eslint-disable-next-line prefer-template
|
|
355
|
-
const endpoint = 'orders?fields=
|
|
355
|
+
const endpoint = 'orders?fields=status'
|
|
356
356
|
+ `&extra_discount.app.label${(discountRule.case_insensitive ? '%=' : '=')}`
|
|
357
357
|
+ encodeURIComponent(label);
|
|
358
358
|
const usageLimits = [{
|
|
@@ -372,7 +372,9 @@ export default async ({ params, application }) => {
|
|
|
372
372
|
// send Store API request to list orders with filters
|
|
373
373
|
// eslint-disable-next-line no-await-in-loop
|
|
374
374
|
const { data } = await api.get(`${endpoint}${query}`);
|
|
375
|
-
countOrders = data.result
|
|
375
|
+
countOrders = data.result
|
|
376
|
+
.filter(({ status }) => status !== 'cancelled')
|
|
377
|
+
.length;
|
|
376
378
|
} catch (err) {
|
|
377
379
|
return {
|
|
378
380
|
error: 'CANT_CHECK_USAGE_LIMITS',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-discounts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app for complex discount rules",
|
|
6
6
|
"main": "lib/discounts.js",
|
|
7
7
|
"repository": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/apps/discounts#readme",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@ecomplus/utils": "1.5.0-rc.3",
|
|
20
|
-
"@cloudcommerce/api": "0.
|
|
20
|
+
"@cloudcommerce/api": "0.11.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@cloudcommerce/types": "0.
|
|
23
|
+
"@cloudcommerce/types": "0.11.0"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "bash ../../../scripts/build-lib.sh"
|