@darkpos/pricing 1.0.15 → 1.0.17

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.
Files changed (66) hide show
  1. package/__TEST__/mocks/order-credit.json +474 -0
  2. package/__TEST__/mocks/partially-paid/input-items.json +1 -0
  3. package/__TEST__/mocks/partially-paid/order-modifiers.json +53 -0
  4. package/__TEST__/mocks/partially-paid/order-partially-paid.json +890 -0
  5. package/__TEST__/mocks/scripts/calculate-partially-paid/index.js +27 -0
  6. package/__TEST__/mocks/scripts/calculate-unpaid/index.js +28 -0
  7. package/__TEST__/mocks/scripts/order-to-string.js +18 -0
  8. package/__TEST__/mocks/stores.js +435 -0
  9. package/__TEST__/mocks/unpaid/input-items.json +6 -0
  10. package/__TEST__/mocks/unpaid/order-modifiers.json +53 -0
  11. package/__TEST__/mocks/unpaid/order-not-paid.json +684 -0
  12. package/__TEST__/order/order.test.js +627 -0
  13. package/lib/item/addIndirectModifier.js +2 -3
  14. package/lib/item/calculate.js +1 -2
  15. package/lib/item/getBalance.js +9 -0
  16. package/lib/item/getItemModifiers.js +3 -14
  17. package/lib/item/getItems.js +5 -0
  18. package/lib/item/getTotal.js +1 -1
  19. package/lib/item/getTotalPrice.js +10 -0
  20. package/lib/item/getTotals.js +31 -18
  21. package/lib/item/index.js +12 -0
  22. package/lib/item/isFullyPaid.js +6 -0
  23. package/lib/item/markModifiersAsLocked.js +11 -0
  24. package/lib/item/removeModifier.js +10 -9
  25. package/lib/item/removePaymentModifiers.js +15 -0
  26. package/lib/modifier/create.js +2 -2
  27. package/lib/modifier/createAmountOverrideModifier.js +1 -3
  28. package/lib/modifier/createCreditModifier.js +2 -4
  29. package/lib/modifier/createDiscountModifier.js +1 -3
  30. package/lib/modifier/createIndirectModifier.js +14 -5
  31. package/lib/modifier/createPaymentModifier.js +12 -0
  32. package/lib/modifier/createSubscriptionModifier.js +1 -3
  33. package/lib/modifier/duplicate.js +1 -1
  34. package/lib/modifier/findById.js +4 -1
  35. package/lib/modifier/findByPaymentMethod.js +1 -1
  36. package/lib/modifier/findByPaymentType.js +1 -1
  37. package/lib/modifier/getItemModifiers.js +1 -3
  38. package/lib/modifier/getLockedModifiers.js +5 -0
  39. package/lib/modifier/getSplittedModifiers.js +4 -6
  40. package/lib/modifier/hasItems.js +8 -0
  41. package/lib/modifier/index.js +20 -4
  42. package/lib/modifier/isFixed.js +10 -0
  43. package/lib/modifier/isFixedDiscount.js +4 -0
  44. package/lib/modifier/isPaymentMethodModifier.js +8 -0
  45. package/lib/modifier/isPaymentModifier.js +7 -0
  46. package/lib/modifier/isPaymentTypeModifier.js +8 -0
  47. package/lib/modifier/isSubtract.js +10 -0
  48. package/lib/modifier/removeLocked.js +8 -0
  49. package/lib/order/addItem.js +104 -106
  50. package/lib/order/addItemModifier.js +0 -3
  51. package/lib/order/addModifier.js +14 -2
  52. package/lib/order/addModifiers.js +15 -0
  53. package/lib/order/autoSplit.js +34 -0
  54. package/lib/order/calculate.js +46 -68
  55. package/lib/order/getScheduleByCustomer.js +0 -1
  56. package/lib/order/index.js +10 -0
  57. package/lib/order/markModifiersAsLocked.js +14 -0
  58. package/lib/order/removeItem.js +0 -2
  59. package/lib/order/removeModifier.js +5 -1
  60. package/lib/order/removeModifiers.js +18 -0
  61. package/lib/order/splitByDepartments.js +10 -13
  62. package/lib/order/syncSubOrderItemsFromParent.js +24 -0
  63. package/package.json +3 -2
  64. package/__TEST__/order.test.js +0 -233
  65. package/lib/modifier/isPaymentMethods.js +0 -8
  66. package/lib/modifier/isPaymentTypes.js +0 -8
@@ -0,0 +1,890 @@
1
+ {
2
+ "__typename": "Order",
3
+ "_createdAt": "2022-12-06T16:47:37.671Z",
4
+ "_updatedAt": "2022-12-06T16:48:23.450Z",
5
+ "totalPaid": 34,
6
+ "user": {
7
+ "__typename": "User",
8
+ "_id": "63652e1daa91c400196496e3",
9
+ "firstName": "nov4",
10
+ "lastName": "nov4",
11
+ "username": "nov4"
12
+ },
13
+ "items": [{
14
+ "__typename": "OrderItem",
15
+ "modifiers": [{
16
+ "__typename": "Modifier",
17
+ "addModifiers": [],
18
+ "delModifiers": [],
19
+ "conditions": null,
20
+ "compute": null,
21
+ "_createdAt": "2022-12-06T16:47:37.671Z",
22
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
23
+ "_id": "638f7208e6994f736b714de4",
24
+ "modifierId": "63652e1eed087c0012dbddda",
25
+ "_parentId": null,
26
+ "locked": null,
27
+ "name": "Dry Cleaning",
28
+ "sku": "",
29
+ "description": "",
30
+ "group": "",
31
+ "type": null,
32
+ "attributes": ["department"],
33
+ "color": "",
34
+ "backgroundColor": null,
35
+ "icon": null,
36
+ "url": "",
37
+ "tags": null,
38
+ "order": 1,
39
+ "included": false,
40
+ "direct": true,
41
+ "hidden": true,
42
+ "print": false,
43
+ "required": true,
44
+ "recommended": false,
45
+ "default": false,
46
+ "code": "D",
47
+ "properties": {
48
+ "department": {
49
+ "tagSize": "Small",
50
+ "customerTagsExtend": null,
51
+ "maxItems": 4
52
+ }
53
+ },
54
+ "_computed": {
55
+ "amount": 0,
56
+ "description": "Dry Cleaning ($0.00)"
57
+ }
58
+ }, {
59
+ "__typename": "Modifier",
60
+ "addModifiers": [],
61
+ "delModifiers": [],
62
+ "conditions": null,
63
+ "compute": {
64
+ "__typename": "Compute",
65
+ "type": "fixed",
66
+ "action": "subtract",
67
+ "amount": 2.36
68
+ },
69
+ "_createdAt": "2022-12-06T16:47:37.671Z",
70
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
71
+ "_id": "638f72294dc5daa063e13981",
72
+ "modifierId": "638f7210e6994f736b714dee",
73
+ "_parentId": "638f7210e6994f736b714dee",
74
+ "locked": false,
75
+ "name": "$10.00 discount",
76
+ "sku": "",
77
+ "description": "",
78
+ "group": "",
79
+ "type": "discount",
80
+ "attributes": [],
81
+ "color": "",
82
+ "backgroundColor": "",
83
+ "icon": "",
84
+ "url": "",
85
+ "tags": [],
86
+ "order": 0,
87
+ "included": false,
88
+ "direct": false,
89
+ "hidden": false,
90
+ "print": true,
91
+ "required": false,
92
+ "recommended": false,
93
+ "default": false,
94
+ "code": "",
95
+ "properties": {
96
+ "ignoreQuantity": true
97
+ },
98
+ "_computed": {
99
+ "amount": -2.36,
100
+ "description": "$10.00 discount (-$2.36)"
101
+ }
102
+ }, {
103
+ "__typename": "Modifier",
104
+ "addModifiers": [],
105
+ "delModifiers": [],
106
+ "conditions": {
107
+ "__typename": "Conditions",
108
+ "paymentTypes": ["cash"],
109
+ "paymentMethods": [],
110
+ "modifiers": [],
111
+ "minItemQuantity": 0,
112
+ "minItemPieces": 0
113
+ },
114
+ "compute": {
115
+ "__typename": "Compute",
116
+ "type": "fixed",
117
+ "action": "add",
118
+ "amount": 0.48
119
+ },
120
+ "_createdAt": "2022-11-08T16:09:49.227Z",
121
+ "_updatedAt": "2022-11-28T18:44:16.821Z",
122
+ "_id": "638f72544dc5daa063e13986",
123
+ "modifierId": "636a7f3ec19c040636f3da9a",
124
+ "_parentId": "638f72544dc5daa063e13985",
125
+ "locked": true,
126
+ "name": "Cash fee",
127
+ "sku": "",
128
+ "description": "",
129
+ "group": "",
130
+ "type": "fee",
131
+ "attributes": [],
132
+ "color": "",
133
+ "backgroundColor": "",
134
+ "icon": "",
135
+ "url": "",
136
+ "tags": ["default"],
137
+ "order": 0,
138
+ "included": false,
139
+ "direct": false,
140
+ "hidden": false,
141
+ "print": true,
142
+ "required": false,
143
+ "recommended": false,
144
+ "default": false,
145
+ "code": "",
146
+ "properties": {
147
+ "ignoreQuantity": true
148
+ },
149
+ "_computed": {
150
+ "amount": 0.48,
151
+ "description": "Cash fee ($0.48)"
152
+ }
153
+ }],
154
+ "notes": [],
155
+ "totalPaid": 8.07,
156
+ "status": {
157
+ "picked": {
158
+ "value": true,
159
+ "date": "2022-12-06T16:48:16.800Z"
160
+ },
161
+ "paid": {
162
+ "value": true,
163
+ "date": "2022-12-06T16:48:21.864Z"
164
+ },
165
+ "tracker": []
166
+ },
167
+ "_id": "638f7208e6994f736b714de3",
168
+ "itemId": "63652e1eed087c0012dbde60",
169
+ "name": "Army 2pc Uniform",
170
+ "description": null,
171
+ "modifiersTotalAmount": 0,
172
+ "location": null,
173
+ "price": 9.95,
174
+ "pieces": 2,
175
+ "quantity": 1,
176
+ "path": ["menuCategories", "0"],
177
+ "menuId": "63652e1faa91c40019649787",
178
+ "serial": null,
179
+ "sku": null,
180
+ "total": 8.07,
181
+ "subTotals": {
182
+ "_included": 0,
183
+ "_xincluded": -1.88,
184
+ "_direct": 0,
185
+ "_xdirect": -1.88,
186
+ "_simple": 9.95,
187
+ "_actual": 9.95,
188
+ "discount": -2.36,
189
+ "fee": 0.48
190
+ },
191
+ "taxes": [],
192
+ "properties": false
193
+ }, {
194
+ "__typename": "OrderItem",
195
+ "modifiers": [{
196
+ "__typename": "Modifier",
197
+ "addModifiers": [],
198
+ "delModifiers": [],
199
+ "conditions": null,
200
+ "compute": null,
201
+ "_createdAt": "2022-12-06T16:47:37.671Z",
202
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
203
+ "_id": "638f7206e6994f736b714de2",
204
+ "modifierId": "63652e1eed087c0012dbddda",
205
+ "_parentId": null,
206
+ "locked": null,
207
+ "name": "Dry Cleaning",
208
+ "sku": "",
209
+ "description": "",
210
+ "group": "",
211
+ "type": null,
212
+ "attributes": ["department"],
213
+ "color": "",
214
+ "backgroundColor": null,
215
+ "icon": null,
216
+ "url": "",
217
+ "tags": null,
218
+ "order": 1,
219
+ "included": false,
220
+ "direct": true,
221
+ "hidden": true,
222
+ "print": false,
223
+ "required": true,
224
+ "recommended": false,
225
+ "default": false,
226
+ "code": "D",
227
+ "properties": {
228
+ "department": {
229
+ "tagSize": "Small",
230
+ "customerTagsExtend": null,
231
+ "maxItems": 4
232
+ }
233
+ },
234
+ "_computed": {
235
+ "amount": 0,
236
+ "description": "Dry Cleaning ($0.00)"
237
+ }
238
+ }, {
239
+ "__typename": "Modifier",
240
+ "addModifiers": [],
241
+ "delModifiers": [],
242
+ "conditions": null,
243
+ "compute": {
244
+ "__typename": "Compute",
245
+ "type": "fixed",
246
+ "action": "subtract",
247
+ "amount": 2.23
248
+ },
249
+ "_createdAt": "2022-12-06T16:47:37.671Z",
250
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
251
+ "_id": "638f72294dc5daa063e13982",
252
+ "modifierId": "638f7210e6994f736b714dee",
253
+ "_parentId": "638f7210e6994f736b714dee",
254
+ "locked": false,
255
+ "name": "$10.00 discount",
256
+ "sku": "",
257
+ "description": "",
258
+ "group": "",
259
+ "type": "discount",
260
+ "attributes": [],
261
+ "color": "",
262
+ "backgroundColor": "",
263
+ "icon": "",
264
+ "url": "",
265
+ "tags": [],
266
+ "order": 0,
267
+ "included": false,
268
+ "direct": false,
269
+ "hidden": false,
270
+ "print": true,
271
+ "required": false,
272
+ "recommended": false,
273
+ "default": false,
274
+ "code": "",
275
+ "properties": null,
276
+ "_computed": {
277
+ "amount": -2.23,
278
+ "description": "$10.00 discount (-$2.23)"
279
+ }
280
+ }, {
281
+ "__typename": "Modifier",
282
+ "addModifiers": [],
283
+ "delModifiers": [],
284
+ "conditions": {
285
+ "__typename": "Conditions",
286
+ "paymentTypes": ["cash"],
287
+ "paymentMethods": [],
288
+ "modifiers": [],
289
+ "minItemQuantity": 0,
290
+ "minItemPieces": 0
291
+ },
292
+ "compute": {
293
+ "__typename": "Compute",
294
+ "type": "fixed",
295
+ "action": "add",
296
+ "amount": 0.44
297
+ },
298
+ "_createdAt": "2022-11-08T16:09:49.227Z",
299
+ "_updatedAt": "2022-11-28T18:44:16.821Z",
300
+ "_id": "638f72544dc5daa063e13987",
301
+ "modifierId": "636a7f3ec19c040636f3da9a",
302
+ "_parentId": "638f72544dc5daa063e13985",
303
+ "locked": true,
304
+ "name": "Cash fee",
305
+ "sku": "",
306
+ "description": "",
307
+ "group": "",
308
+ "type": "fee",
309
+ "attributes": [],
310
+ "color": "",
311
+ "backgroundColor": "",
312
+ "icon": "",
313
+ "url": "",
314
+ "tags": ["default"],
315
+ "order": 0,
316
+ "included": false,
317
+ "direct": false,
318
+ "hidden": false,
319
+ "print": true,
320
+ "required": false,
321
+ "recommended": false,
322
+ "default": false,
323
+ "code": "",
324
+ "properties": null,
325
+ "_computed": {
326
+ "amount": 0.44,
327
+ "description": "Cash fee ($0.44)"
328
+ }
329
+ }],
330
+ "notes": [],
331
+ "totalPaid": 7.71,
332
+ "status": {
333
+ "picked": {
334
+ "value": true,
335
+ "date": "2022-12-06T16:48:16.800Z"
336
+ },
337
+ "paid": {
338
+ "value": true,
339
+ "date": "2022-12-06T16:48:21.864Z"
340
+ },
341
+ "tracker": []
342
+ },
343
+ "_id": "638f7206e6994f736b714de1",
344
+ "itemId": "63652e1eed087c0012dbde61",
345
+ "name": "Sport Men's 2pc Suit",
346
+ "description": "",
347
+ "modifiersTotalAmount": 0,
348
+ "location": null,
349
+ "price": 9.5,
350
+ "pieces": 2,
351
+ "quantity": 1,
352
+ "path": ["menuCategories", "0"],
353
+ "menuId": "63652e1faa91c40019649787",
354
+ "serial": null,
355
+ "sku": null,
356
+ "total": 7.71,
357
+ "subTotals": {
358
+ "_included": 0,
359
+ "_xincluded": -1.79,
360
+ "_direct": 0,
361
+ "_xdirect": -1.79,
362
+ "_simple": 9.5,
363
+ "_actual": 9.5,
364
+ "discount": -2.23,
365
+ "fee": 0.44
366
+ },
367
+ "taxes": [],
368
+ "properties": false
369
+ }, {
370
+ "__typename": "OrderItem",
371
+ "modifiers": [{
372
+ "__typename": "Modifier",
373
+ "addModifiers": [],
374
+ "delModifiers": [],
375
+ "conditions": null,
376
+ "compute": null,
377
+ "_createdAt": "2022-12-06T16:47:37.671Z",
378
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
379
+ "_id": "638f7206e6994f736b714de0",
380
+ "modifierId": "63652e1eed087c0012dbddda",
381
+ "_parentId": null,
382
+ "locked": null,
383
+ "name": "Dry Cleaning",
384
+ "sku": "",
385
+ "description": "",
386
+ "group": "",
387
+ "type": null,
388
+ "attributes": ["department"],
389
+ "color": "",
390
+ "backgroundColor": null,
391
+ "icon": null,
392
+ "url": "",
393
+ "tags": null,
394
+ "order": 1,
395
+ "included": false,
396
+ "direct": true,
397
+ "hidden": true,
398
+ "print": false,
399
+ "required": true,
400
+ "recommended": false,
401
+ "default": false,
402
+ "code": "D",
403
+ "properties": {
404
+ "department": {
405
+ "tagSize": "Small",
406
+ "customerTagsExtend": null,
407
+ "maxItems": 4
408
+ }
409
+ },
410
+ "_computed": {
411
+ "amount": 0,
412
+ "description": "Dry Cleaning ($0.00)"
413
+ }
414
+ }, {
415
+ "__typename": "Modifier",
416
+ "addModifiers": [],
417
+ "delModifiers": [],
418
+ "conditions": null,
419
+ "compute": {
420
+ "__typename": "Compute",
421
+ "type": "fixed",
422
+ "action": "subtract",
423
+ "amount": 3.29
424
+ },
425
+ "_createdAt": "2022-12-06T16:47:37.671Z",
426
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
427
+ "_id": "638f72294dc5daa063e13983",
428
+ "modifierId": "638f7210e6994f736b714dee",
429
+ "_parentId": "638f7210e6994f736b714dee",
430
+ "locked": false,
431
+ "name": "$10.00 discount",
432
+ "sku": "",
433
+ "description": "",
434
+ "group": "",
435
+ "type": "discount",
436
+ "attributes": [],
437
+ "color": "",
438
+ "backgroundColor": "",
439
+ "icon": "",
440
+ "url": "",
441
+ "tags": [],
442
+ "order": 0,
443
+ "included": false,
444
+ "direct": false,
445
+ "hidden": false,
446
+ "print": true,
447
+ "required": false,
448
+ "recommended": false,
449
+ "default": false,
450
+ "code": "",
451
+ "properties": null,
452
+ "_computed": {
453
+ "amount": -3.29,
454
+ "description": "$10.00 discount (-$3.29)"
455
+ }
456
+ }, {
457
+ "__typename": "Modifier",
458
+ "addModifiers": [],
459
+ "delModifiers": [],
460
+ "conditions": {
461
+ "__typename": "Conditions",
462
+ "paymentTypes": ["cash"],
463
+ "paymentMethods": [],
464
+ "modifiers": [],
465
+ "minItemQuantity": 0,
466
+ "minItemPieces": 0
467
+ },
468
+ "compute": {
469
+ "__typename": "Compute",
470
+ "type": "fixed",
471
+ "action": "add",
472
+ "amount": 0.66
473
+ },
474
+ "_createdAt": "2022-11-08T16:09:49.227Z",
475
+ "_updatedAt": "2022-11-28T18:44:16.821Z",
476
+ "_id": "638f72544dc5daa063e13988",
477
+ "modifierId": "636a7f3ec19c040636f3da9a",
478
+ "_parentId": "638f72544dc5daa063e13985",
479
+ "locked": true,
480
+ "name": "Cash fee",
481
+ "sku": "",
482
+ "description": "",
483
+ "group": "",
484
+ "type": "fee",
485
+ "attributes": [],
486
+ "color": "",
487
+ "backgroundColor": "",
488
+ "icon": "",
489
+ "url": "",
490
+ "tags": ["default"],
491
+ "order": 0,
492
+ "included": false,
493
+ "direct": false,
494
+ "hidden": false,
495
+ "print": true,
496
+ "required": false,
497
+ "recommended": false,
498
+ "default": false,
499
+ "code": "",
500
+ "properties": null,
501
+ "_computed": {
502
+ "amount": 0.66,
503
+ "description": "Cash fee ($0.66)"
504
+ }
505
+ }],
506
+ "notes": [],
507
+ "totalPaid": 11.37,
508
+ "status": {
509
+ "picked": {
510
+ "value": true,
511
+ "date": "2022-12-06T16:48:16.800Z"
512
+ },
513
+ "paid": {
514
+ "value": true,
515
+ "date": "2022-12-06T16:48:21.864Z"
516
+ },
517
+ "tracker": []
518
+ },
519
+ "_id": "638f7206e6994f736b714ddf",
520
+ "itemId": "63652e1eed087c0012dbde5f",
521
+ "name": "M-L 3pc Suit",
522
+ "description": null,
523
+ "modifiersTotalAmount": 0,
524
+ "location": null,
525
+ "price": 14,
526
+ "pieces": 3,
527
+ "quantity": 1,
528
+ "path": ["menuCategories", "0"],
529
+ "menuId": "63652e1faa91c40019649787",
530
+ "serial": null,
531
+ "sku": null,
532
+ "total": 11.37,
533
+ "subTotals": {
534
+ "_included": 0,
535
+ "_xincluded": -2.63,
536
+ "_direct": 0,
537
+ "_xdirect": -2.63,
538
+ "_simple": 14,
539
+ "_actual": 14,
540
+ "discount": -3.29,
541
+ "fee": 0.66
542
+ },
543
+ "taxes": [],
544
+ "properties": false
545
+ }, {
546
+ "__typename": "OrderItem",
547
+ "modifiers": [{
548
+ "__typename": "Modifier",
549
+ "addModifiers": [],
550
+ "delModifiers": [],
551
+ "conditions": null,
552
+ "compute": null,
553
+ "_createdAt": "2022-12-06T16:47:37.671Z",
554
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
555
+ "_id": "638f7205e6994f736b714dde",
556
+ "modifierId": "63652e1eed087c0012dbddda",
557
+ "_parentId": null,
558
+ "locked": null,
559
+ "name": "Dry Cleaning",
560
+ "sku": "",
561
+ "description": "",
562
+ "group": "",
563
+ "type": null,
564
+ "attributes": ["department"],
565
+ "color": "",
566
+ "backgroundColor": null,
567
+ "icon": null,
568
+ "url": "",
569
+ "tags": null,
570
+ "order": 1,
571
+ "included": false,
572
+ "direct": true,
573
+ "hidden": true,
574
+ "print": false,
575
+ "required": true,
576
+ "recommended": false,
577
+ "default": false,
578
+ "code": "D",
579
+ "properties": {
580
+ "department": {
581
+ "tagSize": "Small",
582
+ "customerTagsExtend": null,
583
+ "maxItems": 4
584
+ }
585
+ },
586
+ "_computed": {
587
+ "amount": 0,
588
+ "description": "Dry Cleaning ($0.00)"
589
+ }
590
+ }, {
591
+ "__typename": "Modifier",
592
+ "addModifiers": [],
593
+ "delModifiers": [],
594
+ "conditions": null,
595
+ "compute": {
596
+ "__typename": "Compute",
597
+ "type": "fixed",
598
+ "action": "subtract",
599
+ "amount": 2.12
600
+ },
601
+ "_createdAt": "2022-12-06T16:47:37.671Z",
602
+ "_updatedAt": "2022-12-06T16:47:37.671Z",
603
+ "_id": "638f72294dc5daa063e13984",
604
+ "modifierId": "638f7210e6994f736b714dee",
605
+ "_parentId": "638f7210e6994f736b714dee",
606
+ "locked": false,
607
+ "name": "$10.00 discount",
608
+ "sku": "",
609
+ "description": "",
610
+ "group": "",
611
+ "type": "discount",
612
+ "attributes": [],
613
+ "color": "",
614
+ "backgroundColor": "",
615
+ "icon": "",
616
+ "url": "",
617
+ "tags": [],
618
+ "order": 0,
619
+ "included": false,
620
+ "direct": false,
621
+ "hidden": false,
622
+ "print": true,
623
+ "required": false,
624
+ "recommended": false,
625
+ "default": false,
626
+ "code": "",
627
+ "properties": null,
628
+ "_computed": {
629
+ "amount": -2.12,
630
+ "description": "$10.00 discount (-$2.12)"
631
+ }
632
+ }, {
633
+ "__typename": "Modifier",
634
+ "addModifiers": [],
635
+ "delModifiers": [],
636
+ "conditions": {
637
+ "__typename": "Conditions",
638
+ "paymentTypes": ["cash"],
639
+ "paymentMethods": [],
640
+ "modifiers": [],
641
+ "minItemQuantity": 0,
642
+ "minItemPieces": 0
643
+ },
644
+ "compute": {
645
+ "__typename": "Compute",
646
+ "type": "fixed",
647
+ "action": "add",
648
+ "amount": 0.42
649
+ },
650
+ "_createdAt": "2022-11-08T16:09:49.227Z",
651
+ "_updatedAt": "2022-11-28T18:44:16.821Z",
652
+ "_id": "638f72544dc5daa063e13989",
653
+ "modifierId": "636a7f3ec19c040636f3da9a",
654
+ "_parentId": "638f72544dc5daa063e13985",
655
+ "locked": true,
656
+ "name": "Cash fee",
657
+ "sku": "",
658
+ "description": "",
659
+ "group": "",
660
+ "type": "fee",
661
+ "attributes": [],
662
+ "color": "",
663
+ "backgroundColor": "",
664
+ "icon": "",
665
+ "url": "",
666
+ "tags": ["default"],
667
+ "order": 0,
668
+ "included": false,
669
+ "direct": false,
670
+ "hidden": false,
671
+ "print": true,
672
+ "required": false,
673
+ "recommended": false,
674
+ "default": false,
675
+ "code": "",
676
+ "properties": null,
677
+ "_computed": {
678
+ "amount": 0.42,
679
+ "description": "Cash fee ($0.42)"
680
+ }
681
+ }],
682
+ "notes": [],
683
+ "totalPaid": 6.85,
684
+ "status": {
685
+ "picked": {
686
+ "value": true,
687
+ "date": "2022-12-06T16:48:16.800Z"
688
+ },
689
+ "paid": {
690
+ "value": false,
691
+ "date": "2022-12-06T16:48:21.864Z"
692
+ },
693
+ "tracker": []
694
+ },
695
+ "_id": "638f7205e6994f736b714ddd",
696
+ "itemId": "63652e1eed087c0012dbde5e",
697
+ "name": "M-L 2pc Suit",
698
+ "description": null,
699
+ "modifiersTotalAmount": 0,
700
+ "location": null,
701
+ "price": 9,
702
+ "pieces": 2,
703
+ "quantity": 1,
704
+ "path": ["menuCategories", "0"],
705
+ "menuId": "63652e1faa91c40019649787",
706
+ "serial": null,
707
+ "sku": null,
708
+ "total": 7.3,
709
+ "subTotals": {
710
+ "_included": 0,
711
+ "_xincluded": -1.7,
712
+ "_direct": 0,
713
+ "_xdirect": -1.7,
714
+ "_simple": 9,
715
+ "_actual": 9,
716
+ "discount": -2.12,
717
+ "fee": 0.42
718
+ },
719
+ "taxes": [],
720
+ "properties": false
721
+ }],
722
+ "notes": [{
723
+ "__typename": "Note",
724
+ "user": {
725
+ "__typename": "User",
726
+ "_id": "63652e1daa91c400196496e3",
727
+ "firstName": "nov4",
728
+ "lastName": "nov4"
729
+ },
730
+ "message": "This order was split from order #193",
731
+ "attributes": [],
732
+ "name": null,
733
+ "type": null,
734
+ "date": "2022-12-06T16:47:37.315Z",
735
+ "url": ""
736
+ }],
737
+ "start": {
738
+ "__typename": "OrderStart",
739
+ "actualDate": "2022-12-06T16:42:12.568Z",
740
+ "requestDate": "2022-12-06T16:42:12.568Z",
741
+ "location": null
742
+ },
743
+ "end": {
744
+ "__typename": "OrderEnd",
745
+ "actualDate": null,
746
+ "requestDate": "2022-12-08T22:00:00.000Z",
747
+ "location": {
748
+ "name": "nov4",
749
+ "locationType": "store",
750
+ "storeId": "63652e1ced087c0012dbddc3"
751
+ }
752
+ },
753
+ "customer": {
754
+ "__typename": "Customer",
755
+ "_id": "637e99678c3a0690e8565397",
756
+ "firstName": "Test",
757
+ "lastName": "1",
758
+ "tags": ["default", "all"],
759
+ "notes": [],
760
+ "modifiers": [],
761
+ "properties": {
762
+ "events": [],
763
+ "relationships": [{
764
+ "name": "dark",
765
+ "type": "_company",
766
+ "__typename": "Relationship"
767
+ }]
768
+ }
769
+ },
770
+ "modifiers": [{
771
+ "__typename": "Modifier",
772
+ "addModifiers": [],
773
+ "delModifiers": [],
774
+ "conditions": null,
775
+ "compute": {
776
+ "__typename": "Compute",
777
+ "type": "fixed",
778
+ "action": "subtract",
779
+ "amount": 10
780
+ },
781
+ "_createdAt": "2022-12-06T16:48:20.610Z",
782
+ "_updatedAt": "2022-12-06T16:48:20.610Z",
783
+ "_id": "638f7210e6994f736b714dee",
784
+ "modifierId": null,
785
+ "_parentId": null,
786
+ "locked": false,
787
+ "name": "$10.00 discount",
788
+ "sku": "",
789
+ "description": "",
790
+ "group": "",
791
+ "type": "discount",
792
+ "attributes": [],
793
+ "color": "",
794
+ "backgroundColor": "",
795
+ "icon": "",
796
+ "url": "",
797
+ "tags": [],
798
+ "order": 0,
799
+ "included": false,
800
+ "direct": true,
801
+ "hidden": false,
802
+ "print": true,
803
+ "required": false,
804
+ "recommended": false,
805
+ "default": false,
806
+ "code": "",
807
+ "properties": null,
808
+ "_computed": null
809
+ }, {
810
+ "__typename": "Modifier",
811
+ "addModifiers": [],
812
+ "delModifiers": [],
813
+ "conditions": {
814
+ "__typename": "Conditions",
815
+ "paymentTypes": ["cash"],
816
+ "paymentMethods": [],
817
+ "modifiers": [],
818
+ "minItemQuantity": 0,
819
+ "minItemPieces": 0
820
+ },
821
+ "compute": {
822
+ "__typename": "Compute",
823
+ "type": "fixed",
824
+ "action": "add",
825
+ "amount": 2
826
+ },
827
+ "_createdAt": "2022-12-06T16:48:20.610Z",
828
+ "_updatedAt": "2022-12-06T16:48:20.610Z",
829
+ "_id": "638f72544dc5daa063e13985",
830
+ "modifierId": "636a7f3ec19c040636f3da9a",
831
+ "_parentId": null,
832
+ "locked": true,
833
+ "name": "Cash fee",
834
+ "sku": "",
835
+ "description": "",
836
+ "group": "",
837
+ "type": "fee",
838
+ "attributes": [],
839
+ "color": "",
840
+ "backgroundColor": "",
841
+ "icon": "",
842
+ "url": "",
843
+ "tags": ["default"],
844
+ "order": 0,
845
+ "included": false,
846
+ "direct": true,
847
+ "hidden": false,
848
+ "print": true,
849
+ "required": false,
850
+ "recommended": false,
851
+ "default": false,
852
+ "code": "",
853
+ "properties": null,
854
+ "_computed": null
855
+ }],
856
+ "_storeId": "63652e1ced087c0012dbddc3",
857
+ "_id": "638f7225e6994f736b714dfd",
858
+ "parentId": "638f7200e6994f736b714dcf",
859
+ "isParent": false,
860
+ "subTotal": 42.45,
861
+ "tax": 0,
862
+ "discount": 0,
863
+ "total": 34.45,
864
+ "displayId": "193-1",
865
+ "description": "",
866
+ "type": "",
867
+ "fee": 0,
868
+ "location": null,
869
+ "status": {
870
+ "order": "open",
871
+ "kitchen": "open",
872
+ "delivery": "none",
873
+ "detailed": true,
874
+ "fullyPaid": false,
875
+ "fullyPicked": true,
876
+ "invoice": "partial"
877
+ },
878
+ "attributes": [],
879
+ "properties": {
880
+ "notify": {
881
+ "sms": false
882
+ },
883
+ "pieces": [],
884
+ "split": "manual"
885
+ },
886
+ "subTotals": {
887
+ "discount": -10,
888
+ "fee": 2
889
+ }
890
+ }