@sdflc/backend-helpers 1.0.97 → 1.0.98

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/build/BaseCore.js CHANGED
@@ -703,11 +703,17 @@ class BaseCore {
703
703
  },
704
704
  });
705
705
  if (lastRecord.length > 0) {
706
- const order = new utils_1.StrOrderHelpers({
707
- start: lastRecord[0]?.orderNo || constants_1.DEFAULT_ORDER_NO,
708
- step: constants_1.DEFAULT_ORDER_NO_STEP,
709
- });
710
- params.orderNo = order.increase();
706
+ if (this.config.orderNoAsDecimal === true) {
707
+ params.orderNo =
708
+ lastRecord[0]?.orderNo != null ? lastRecord[0]?.orderNo + constants_1.DEFAULT_ORDER_NO : constants_1.DEFAULT_ORDER_NO;
709
+ }
710
+ else {
711
+ const order = new utils_1.StrOrderHelpers({
712
+ start: lastRecord[0]?.orderNo || constants_1.DEFAULT_ORDER_NO,
713
+ step: constants_1.DEFAULT_ORDER_NO_STEP,
714
+ });
715
+ params.orderNo = order.increase();
716
+ }
711
717
  }
712
718
  }
713
719
  }
@@ -697,11 +697,17 @@ class BaseCore {
697
697
  },
698
698
  });
699
699
  if (lastRecord.length > 0) {
700
- const order = new StrOrderHelpers({
701
- start: lastRecord[0]?.orderNo || DEFAULT_ORDER_NO,
702
- step: DEFAULT_ORDER_NO_STEP,
703
- });
704
- params.orderNo = order.increase();
700
+ if (this.config.orderNoAsDecimal === true) {
701
+ params.orderNo =
702
+ lastRecord[0]?.orderNo != null ? lastRecord[0]?.orderNo + DEFAULT_ORDER_NO : DEFAULT_ORDER_NO;
703
+ }
704
+ else {
705
+ const order = new StrOrderHelpers({
706
+ start: lastRecord[0]?.orderNo || DEFAULT_ORDER_NO,
707
+ step: DEFAULT_ORDER_NO_STEP,
708
+ });
709
+ params.orderNo = order.increase();
710
+ }
705
711
  }
706
712
  }
707
713
  }
@@ -32,5 +32,6 @@ export interface BaseCorePropsInterface {
32
32
  jwtSecret?: string;
33
33
  verifyTokenArgs?: VerifyUserTokenArgs;
34
34
  hasOrderNo?: boolean;
35
+ orderNoAsDecimal?: boolean;
35
36
  idType?: ID_TYPES;
36
37
  }
@@ -32,5 +32,6 @@ export interface BaseCorePropsInterface {
32
32
  jwtSecret?: string;
33
33
  verifyTokenArgs?: VerifyUserTokenArgs;
34
34
  hasOrderNo?: boolean;
35
+ orderNoAsDecimal?: boolean;
35
36
  idType?: ID_TYPES;
36
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdflc/backend-helpers",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
4
  "description": "Set of helper functions and classes to simplify building backend apps within @sdflc ecosystem",
5
5
  "type": "commonjs",
6
6
  "exports": {