@darkpos/pricing 1.0.122 → 1.0.125

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.
@@ -1599,7 +1599,7 @@ describe('Order actions', () => {
1599
1599
  return 0;
1600
1600
  });
1601
1601
 
1602
- expect(subOrders[0].displayId).toBe('1-1');
1602
+ expect(subOrders[0].displayId).toBe('');
1603
1603
  expect(subOrders[0].items.map(item => item.name)).toEqual([
1604
1604
  'Box Shirt - Fold',
1605
1605
  'Pants',
@@ -20,8 +20,8 @@ module.exports = ({
20
20
 
21
21
  return { ...order, ...actions.getTotals(order.orders) };
22
22
  }
23
- const startRequestDate = order.start ? order.start.requestDate : null;
24
- const endRequestDate = order.end ? order.end.requestDate : null;
23
+ const startRequestDate = actions.getStartDate({ order });
24
+ const endRequestDate = actions.getEndDate({ order });
25
25
 
26
26
  const options = {
27
27
  ...opts,
@@ -1,4 +1,4 @@
1
1
  module.exports = ({ _ }) =>
2
2
  function getStartDate({ order }) {
3
- return _.get(order, 'start.actualDate', '');
3
+ return _.get(order, 'start.requestDate', '');
4
4
  };
@@ -2,11 +2,7 @@ module.exports = ({ actions }) =>
2
2
  function mapSubOrders({ parentOrder, newSubOrders }) {
3
3
  let subOrders = parentOrder.orders || [];
4
4
 
5
- // reassign displayIds
6
- subOrders = [...subOrders, ...newSubOrders].map((subOrder, index) => ({
7
- ...subOrder,
8
- displayId: `${parentOrder.displayId}-${index + 1}`,
9
- }));
5
+ subOrders = [...subOrders, ...newSubOrders];
10
6
 
11
7
  subOrders = actions.spreadModifiers({
12
8
  parentOrder,
@@ -74,9 +74,8 @@ module.exports = ({ _, actions, utils }) => {
74
74
 
75
75
  let subOrders = [];
76
76
  if (newOrder && subOrdersToMerge && subOrdersToMerge.length > 0) {
77
- subOrders = subOrdersToMerge.map((s, index) => ({
77
+ subOrders = subOrdersToMerge.map(s => ({
78
78
  ...s,
79
- displayId: `${newOrder.displayId || ''}-${index + 1}`,
80
79
  parentId: newOrder._id,
81
80
  customer: newOrder.customer,
82
81
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkpos/pricing",
3
- "version": "1.0.122",
3
+ "version": "1.0.125",
4
4
  "description": "Pricing calculator",
5
5
  "author": "Dark POS",
6
6
  "license": "ISC",
@@ -55,5 +55,5 @@
55
55
  "supertest": "^6.2.3",
56
56
  "supervisor": "^0.12.0"
57
57
  },
58
- "gitHead": "b31fc15b593be32a295002440e550e5fd6a7e1da"
58
+ "gitHead": "75e2c7fc1237e4cb3fd5f019390d314ada58229f"
59
59
  }