@bondsports/types 2.2.180 → 2.2.181

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,10 @@
1
+ import { CartItem } from '../../../cart/entities/cart-item.entity';
1
2
  import { InvoiceDiscountOnEnum } from '../../../payment/types/enums/discount.enums';
2
3
  export declare const discountOnMapper: {
3
4
  [key: string]: InvoiceDiscountOnEnum;
4
5
  };
6
+ /**
7
+ * Generates a unique key for a given cart item.
8
+ *
9
+ */
10
+ export declare const getUniqueKey: (cartItem: CartItem) => string;
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.discountOnMapper = void 0;
3
+ exports.getUniqueKey = exports.discountOnMapper = void 0;
4
4
  const discount_enums_1 = require("../../../payment/types/enums/discount.enums");
5
5
  exports.discountOnMapper = {
6
6
  [discount_enums_1.DiscountOnEnum.ITEM]: discount_enums_1.InvoiceDiscountOnEnum.LINE_ITEM,
7
7
  [discount_enums_1.DiscountOnEnum.ALL]: discount_enums_1.InvoiceDiscountOnEnum.INVOICE,
8
8
  };
9
+ /**
10
+ * Generates a unique key for a given cart item.
11
+ *
12
+ */
13
+ const getUniqueKey = (cartItem) => {
14
+ var _a;
15
+ return (_a = cartItem.id.toString()) !== null && _a !== void 0 ? _a : cartItem.unique;
16
+ };
17
+ exports.getUniqueKey = getUniqueKey;
9
18
  //# sourceMappingURL=invoice.consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invoice.consts.js","sourceRoot":"","sources":["../../../../../src/types/invoice/types/consts/invoice.consts.ts"],"names":[],"mappings":";;;AAAA,gFAAoG;AAEvF,QAAA,gBAAgB,GAA6C;IACzE,CAAC,+BAAc,CAAC,IAAI,CAAC,EAAE,sCAAqB,CAAC,SAAS;IACtD,CAAC,+BAAc,CAAC,GAAG,CAAC,EAAE,sCAAqB,CAAC,OAAO;CACnD,CAAC"}
1
+ {"version":3,"file":"invoice.consts.js","sourceRoot":"","sources":["../../../../../src/types/invoice/types/consts/invoice.consts.ts"],"names":[],"mappings":";;;AACA,gFAAoG;AAEvF,QAAA,gBAAgB,GAA6C;IACzE,CAAC,+BAAc,CAAC,IAAI,CAAC,EAAE,sCAAqB,CAAC,SAAS;IACtD,CAAC,+BAAc,CAAC,GAAG,CAAC,EAAE,sCAAqB,CAAC,OAAO;CACnD,CAAC;AAEF;;;GAGG;AACI,MAAM,YAAY,GAAmC,CAAC,QAAkB,EAAU,EAAE;;IAC1F,OAAO,MAAA,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,mCAAI,QAAQ,CAAC,MAAM,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bondsports/types",
3
- "version": "2.2.180",
3
+ "version": "2.2.181",
4
4
  "description": "backend types module for Bond-Sports",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {