meemup-library 1.5.11 → 1.5.12

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.
@@ -6,9 +6,8 @@ export default new class CustomerFacingDisplayPacketController {
6
6
  order.products.forEach(product => {
7
7
  let extPro = [];
8
8
  let pro;
9
- if (product.hasOwnProperty('extras')) {
10
- const _product = product;
11
- _product.extras.forEach(ext => {
9
+ if (product.productId !== null) {
10
+ product.extras.forEach(ext => {
12
11
  extPro.push({
13
12
  q: ext.quantity,
14
13
  s: ext.pizzaSide,
@@ -17,18 +16,17 @@ export default new class CustomerFacingDisplayPacketController {
17
16
  });
18
17
  });
19
18
  pro = {
20
- q: _product.quantity,
21
- t: _product.title,
22
- p: MoneyController.round(_product.totalAmount),
19
+ q: product.quantity,
20
+ t: product.title,
21
+ p: MoneyController.round(product.totalAmount),
23
22
  e: extPro
24
23
  };
25
24
  }
26
25
  else {
27
- const _product = product;
28
26
  pro = {
29
- q: _product.quantity,
30
- t: _product.text,
31
- p: MoneyController.round(_product.quantity * (_product.price - _product.discount)),
27
+ q: product.quantity,
28
+ t: product.title,
29
+ p: MoneyController.round(product.quantity * (product.price - (product.discount || 0))),
32
30
  e: extPro
33
31
  };
34
32
  }
@@ -11,7 +11,7 @@ import EnumPickupInstruction from "../../enums/EnumPickupInstruction";
11
11
  import IPointOfSaleOrderTransaction from "./IPointOfSaleOrderTransaction";
12
12
  import IPointOfSaleElavonTerminalDevice from "./IPointOfSaleElavonTerminalDevice";
13
13
  import EnumChannels from "../../enums/EnumChannels";
14
- import TPointOfSaleOrderProduct from "../../types/TPointOfSaleOrderProduct";
14
+ import IPointOfSaleOrderItem from "./IPointOfSaleOrderItem";
15
15
  interface IPointOfSaleOrder {
16
16
  id: number;
17
17
  number: number;
@@ -43,7 +43,7 @@ interface IPointOfSaleOrder {
43
43
  tableNo: string;
44
44
  tableId: number | null;
45
45
  seat: number;
46
- products: TPointOfSaleOrderProduct[];
46
+ products: IPointOfSaleOrderItem[];
47
47
  tipType: EnumTipType;
48
48
  tip: number;
49
49
  onlineStoreTip: number;
@@ -2,7 +2,7 @@ import IPointOfSaleOrderExtraItem from "./IPointOfSaleOrderExtraItem";
2
2
  interface IPointOfSaleOrderItem {
3
3
  id: number;
4
4
  categoryId: number;
5
- productId: number;
5
+ productId: number | null;
6
6
  title: string;
7
7
  quantity: number;
8
8
  price: number;
@@ -22,5 +22,7 @@ interface IPointOfSaleOrderItem {
22
22
  taxable: boolean | null;
23
23
  productName: string;
24
24
  tags: string[] | null;
25
+ _id?: string;
26
+ discount?: number;
25
27
  }
26
28
  export default IPointOfSaleOrderItem;
@@ -1,7 +1,7 @@
1
1
  import IOrderDetailProductsExtra from "./IOrderDetailProductsExtra";
2
2
  interface IOrderDetailProduct {
3
3
  id: number;
4
- productId: number;
4
+ productId: number | null;
5
5
  categoryId: number;
6
6
  categoryTitle: string;
7
7
  title: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meemup-library",
3
- "version": "1.5.11",
3
+ "version": "1.5.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "remove:one": "rimraf dist",
12
12
  "remove:two": "rimraf ./src/dist",
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
14
- "commit": "git add . && git commit -m \"version.1.5.11\" && git push origin "
14
+ "commit": "git add . && git commit -m \"version.1.5.12\" && git push origin "
15
15
  },
16
16
  "files": [
17
17
  "/dist"
@@ -1,4 +0,0 @@
1
- import IPointOfSaleOrderItem from "../interfaces/pos/IPointOfSaleOrderItem";
2
- import IPointOfSaleCustomOrderItem from "../interfaces/pos/IPointOfSaleCustomOrderItem";
3
- type TPointOfSaleOrderProduct = IPointOfSaleOrderItem | IPointOfSaleCustomOrderItem;
4
- export default TPointOfSaleOrderProduct;
@@ -1 +0,0 @@
1
- export {};