@cloudcommerce/app-discounts 2.29.10 → 2.29.11

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.
@@ -106,7 +106,7 @@ export default async ({ params, application }) => {
106
106
  value = maxDiscount;
107
107
  }
108
108
  }
109
- return value;
109
+ return value !== undefined ? Number(value) : value;
110
110
  };
111
111
 
112
112
  const addDiscount = (discount, flag, label, maxDiscount) => {
@@ -537,10 +537,11 @@ export default async ({ params, application }) => {
537
537
  // show current discount rule as available discount to apply
538
538
  response.available_extra_discount = {
539
539
  label: label.substring(0, 50),
540
+ type: discount.type,
540
541
  };
541
- ['min_amount', 'type', 'value'].forEach((field) => {
542
+ ['min_amount', 'value'].forEach((field) => {
542
543
  if (discount[field]) {
543
- response.available_extra_discount[field] = discount[field];
544
+ response.available_extra_discount[field] = Number(discount[field]);
544
545
  }
545
546
  });
546
547
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "2.29.10",
4
+ "version": "2.29.11",
5
5
  "description": "e-com.plus Cloud Commerce app for complex discount rules",
6
6
  "main": "lib/discounts.js",
7
7
  "files": [
@@ -23,10 +23,10 @@
23
23
  "homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/apps/discounts#readme",
24
24
  "dependencies": {
25
25
  "@ecomplus/utils": "1.5.0-rc.6",
26
- "@cloudcommerce/api": "2.29.10"
26
+ "@cloudcommerce/api": "2.29.11"
27
27
  },
28
28
  "devDependencies": {
29
- "@cloudcommerce/types": "2.29.10"
29
+ "@cloudcommerce/types": "2.29.11"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "bash ../../../scripts/build-lib.sh"