@pisell/pisellos 2.3.68 → 2.3.69

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 (39) hide show
  1. package/dist/core/index.d.ts +7 -0
  2. package/dist/core/index.js +109 -65
  3. package/dist/modules/Quotation/index.d.ts +6 -0
  4. package/dist/modules/Quotation/index.js +75 -19
  5. package/dist/plugins/request.d.ts +1 -0
  6. package/dist/server/index.d.ts +8 -2
  7. package/dist/server/index.js +206 -140
  8. package/dist/server/modules/floor-plan/index.d.ts +4 -0
  9. package/dist/server/modules/floor-plan/index.js +240 -98
  10. package/dist/server/modules/menu/index.js +48 -23
  11. package/dist/server/modules/order/index.d.ts +17 -7
  12. package/dist/server/modules/order/index.js +419 -207
  13. package/dist/server/modules/products/index.d.ts +8 -2
  14. package/dist/server/modules/products/index.js +167 -75
  15. package/dist/server/modules/resource/index.js +21 -13
  16. package/dist/solution/BaseSales/index.d.ts +10 -0
  17. package/dist/solution/BaseSales/index.js +861 -806
  18. package/dist/solution/BookingTicket/index.d.ts +3 -1
  19. package/dist/solution/BookingTicket/index.js +187 -149
  20. package/lib/core/index.d.ts +7 -0
  21. package/lib/core/index.js +20 -2
  22. package/lib/modules/Quotation/index.d.ts +6 -0
  23. package/lib/modules/Quotation/index.js +49 -5
  24. package/lib/plugins/request.d.ts +1 -0
  25. package/lib/server/index.d.ts +8 -2
  26. package/lib/server/index.js +52 -17
  27. package/lib/server/modules/floor-plan/index.d.ts +4 -0
  28. package/lib/server/modules/floor-plan/index.js +54 -6
  29. package/lib/server/modules/menu/index.js +31 -5
  30. package/lib/server/modules/order/index.d.ts +17 -7
  31. package/lib/server/modules/order/index.js +197 -40
  32. package/lib/server/modules/products/index.d.ts +8 -2
  33. package/lib/server/modules/products/index.js +97 -24
  34. package/lib/server/modules/resource/index.js +7 -2
  35. package/lib/solution/BaseSales/index.d.ts +10 -0
  36. package/lib/solution/BaseSales/index.js +32 -2
  37. package/lib/solution/BookingTicket/index.d.ts +3 -1
  38. package/lib/solution/BookingTicket/index.js +12 -0
  39. package/package.json +1 -1
@@ -1763,6 +1763,44 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1763
1763
  value: function waitForOrderCustomerPromotionRefresh() {
1764
1764
  return this.orderCustomerPromotionRefreshInFlight || Promise.resolve();
1765
1765
  }
1766
+ }, {
1767
+ key: "prepareProductPriceQueryContext",
1768
+ value: function () {
1769
+ var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(customerId) {
1770
+ var normalizedCustomerId, refreshTask, shouldWait;
1771
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1772
+ while (1) switch (_context23.prev = _context23.next) {
1773
+ case 0:
1774
+ _context23.next = 2;
1775
+ return Promise.resolve();
1776
+ case 2:
1777
+ normalizedCustomerId = Number(customerId || 0);
1778
+ refreshTask = this.orderCustomerDiscountRefreshInFlight;
1779
+ shouldWait = normalizedCustomerId > 1 && this.orderCustomerDiscountRefreshCustomerId === normalizedCustomerId && Boolean(refreshTask);
1780
+ if (!(shouldWait && refreshTask)) {
1781
+ _context23.next = 8;
1782
+ break;
1783
+ }
1784
+ _context23.next = 8;
1785
+ return refreshTask;
1786
+ case 8:
1787
+ case "end":
1788
+ return _context23.stop();
1789
+ }
1790
+ }, _callee23, this);
1791
+ }));
1792
+ function prepareProductPriceQueryContext(_x16) {
1793
+ return _prepareProductPriceQueryContext.apply(this, arguments);
1794
+ }
1795
+ return prepareProductPriceQueryContext;
1796
+ }()
1797
+ }, {
1798
+ key: "preferAuthoritativeProductQueryPrice",
1799
+ value: function preferAuthoritativeProductQueryPrice() {
1800
+ // BookingTicket 的 /product/query 已按预约时间、客户及 Wallet 上下文执行
1801
+ // 智能定价;再次应用 legacy quotation 会把最终价覆盖成另一套时段价格。
1802
+ return true;
1803
+ }
1766
1804
 
1767
1805
  /**
1768
1806
  * 获取客户分页信息
@@ -1804,29 +1842,29 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1804
1842
  }, {
1805
1843
  key: "changeCustomerPage",
1806
1844
  value: (function () {
1807
- var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(page, pageSize) {
1845
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(page, pageSize) {
1808
1846
  var _result4;
1809
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1810
- while (1) switch (_context23.prev = _context23.next) {
1847
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1848
+ while (1) switch (_context24.prev = _context24.next) {
1811
1849
  case 0:
1812
- _context23.prev = 0;
1813
- _context23.next = 3;
1850
+ _context24.prev = 0;
1851
+ _context24.next = 3;
1814
1852
  return this.store.customer.changeCustomerPage(page, pageSize);
1815
1853
  case 3:
1816
- _result4 = _context23.sent;
1817
- return _context23.abrupt("return", _result4);
1854
+ _result4 = _context24.sent;
1855
+ return _context24.abrupt("return", _result4);
1818
1856
  case 7:
1819
- _context23.prev = 7;
1820
- _context23.t0 = _context23["catch"](0);
1821
- console.error('Failed to change customer page:', _context23.t0);
1822
- throw _context23.t0;
1857
+ _context24.prev = 7;
1858
+ _context24.t0 = _context24["catch"](0);
1859
+ console.error('Failed to change customer page:', _context24.t0);
1860
+ throw _context24.t0;
1823
1861
  case 11:
1824
1862
  case "end":
1825
- return _context23.stop();
1863
+ return _context24.stop();
1826
1864
  }
1827
- }, _callee23, this, [[0, 7]]);
1865
+ }, _callee24, this, [[0, 7]]);
1828
1866
  }));
1829
- function changeCustomerPage(_x16, _x17) {
1867
+ function changeCustomerPage(_x17, _x18) {
1830
1868
  return _changeCustomerPage.apply(this, arguments);
1831
1869
  }
1832
1870
  return changeCustomerPage;
@@ -1839,28 +1877,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1839
1877
  }, {
1840
1878
  key: "loadMoreCustomers",
1841
1879
  value: (function () {
1842
- var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1880
+ var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1843
1881
  var _result5;
1844
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1845
- while (1) switch (_context24.prev = _context24.next) {
1882
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1883
+ while (1) switch (_context25.prev = _context25.next) {
1846
1884
  case 0:
1847
- _context24.prev = 0;
1848
- _context24.next = 3;
1885
+ _context25.prev = 0;
1886
+ _context25.next = 3;
1849
1887
  return this.store.customer.loadMoreCustomers();
1850
1888
  case 3:
1851
- _result5 = _context24.sent;
1889
+ _result5 = _context25.sent;
1852
1890
  this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
1853
- return _context24.abrupt("return", _result5);
1891
+ return _context25.abrupt("return", _result5);
1854
1892
  case 8:
1855
- _context24.prev = 8;
1856
- _context24.t0 = _context24["catch"](0);
1857
- console.error('Failed to load more customers:', _context24.t0);
1858
- throw _context24.t0;
1893
+ _context25.prev = 8;
1894
+ _context25.t0 = _context25["catch"](0);
1895
+ console.error('Failed to load more customers:', _context25.t0);
1896
+ throw _context25.t0;
1859
1897
  case 12:
1860
1898
  case "end":
1861
- return _context24.stop();
1899
+ return _context25.stop();
1862
1900
  }
1863
- }, _callee24, this, [[0, 8]]);
1901
+ }, _callee25, this, [[0, 8]]);
1864
1902
  }));
1865
1903
  function loadMoreCustomers() {
1866
1904
  return _loadMoreCustomers.apply(this, arguments);
@@ -1876,31 +1914,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1876
1914
  }, {
1877
1915
  key: "resetAndLoadCustomers",
1878
1916
  value: (function () {
1879
- var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1917
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1880
1918
  var params,
1881
1919
  _result6,
1882
- _args25 = arguments;
1883
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1884
- while (1) switch (_context25.prev = _context25.next) {
1920
+ _args26 = arguments;
1921
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1922
+ while (1) switch (_context26.prev = _context26.next) {
1885
1923
  case 0:
1886
- params = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
1887
- _context25.prev = 1;
1888
- _context25.next = 4;
1924
+ params = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
1925
+ _context26.prev = 1;
1926
+ _context26.next = 4;
1889
1927
  return this.store.customer.resetAndLoadCustomers(params);
1890
1928
  case 4:
1891
- _result6 = _context25.sent;
1929
+ _result6 = _context26.sent;
1892
1930
  this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
1893
- return _context25.abrupt("return", _result6);
1931
+ return _context26.abrupt("return", _result6);
1894
1932
  case 9:
1895
- _context25.prev = 9;
1896
- _context25.t0 = _context25["catch"](1);
1897
- console.error('Failed to reset and load customers:', _context25.t0);
1898
- throw _context25.t0;
1933
+ _context26.prev = 9;
1934
+ _context26.t0 = _context26["catch"](1);
1935
+ console.error('Failed to reset and load customers:', _context26.t0);
1936
+ throw _context26.t0;
1899
1937
  case 13:
1900
1938
  case "end":
1901
- return _context25.stop();
1939
+ return _context26.stop();
1902
1940
  }
1903
- }, _callee25, this, [[1, 9]]);
1941
+ }, _callee26, this, [[1, 9]]);
1904
1942
  }));
1905
1943
  function resetAndLoadCustomers() {
1906
1944
  return _resetAndLoadCustomers.apply(this, arguments);
@@ -2061,16 +2099,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2061
2099
  }, {
2062
2100
  key: "getOtherParams",
2063
2101
  value: (function () {
2064
- var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
2065
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2066
- while (1) switch (_context26.prev = _context26.next) {
2102
+ var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
2103
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2104
+ while (1) switch (_context27.prev = _context27.next) {
2067
2105
  case 0:
2068
- return _context26.abrupt("return", this.otherParams);
2106
+ return _context27.abrupt("return", this.otherParams);
2069
2107
  case 1:
2070
2108
  case "end":
2071
- return _context26.stop();
2109
+ return _context27.stop();
2072
2110
  }
2073
- }, _callee26, this);
2111
+ }, _callee27, this);
2074
2112
  }));
2075
2113
  function getOtherParams() {
2076
2114
  return _getOtherParams.apply(this, arguments);
@@ -2389,18 +2427,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2389
2427
  }, {
2390
2428
  key: "updateProductInOrder",
2391
2429
  value: (function () {
2392
- var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
2393
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2394
- while (1) switch (_context27.prev = _context27.next) {
2430
+ var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
2431
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2432
+ while (1) switch (_context28.prev = _context28.next) {
2395
2433
  case 0:
2396
- return _context27.abrupt("return", this.updateOrderProduct(params));
2434
+ return _context28.abrupt("return", this.updateOrderProduct(params));
2397
2435
  case 1:
2398
2436
  case "end":
2399
- return _context27.stop();
2437
+ return _context28.stop();
2400
2438
  }
2401
- }, _callee27, this);
2439
+ }, _callee28, this);
2402
2440
  }));
2403
- function updateProductInOrder(_x18) {
2441
+ function updateProductInOrder(_x19) {
2404
2442
  return _updateProductInOrder.apply(this, arguments);
2405
2443
  }
2406
2444
  return updateProductInOrder;
@@ -2422,47 +2460,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2422
2460
  }, {
2423
2461
  key: "handleGlobalScanCode",
2424
2462
  value: (function () {
2425
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(code, bridge) {
2463
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(code, bridge) {
2426
2464
  var _this7 = this;
2427
2465
  var trimmed, _bridge$onNotify, _bridge$refresh, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
2428
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2429
- while (1) switch (_context28.prev = _context28.next) {
2466
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2467
+ while (1) switch (_context29.prev = _context29.next) {
2430
2468
  case 0:
2431
2469
  trimmed = typeof code === 'string' ? code.trim() : '';
2432
2470
  if (trimmed) {
2433
- _context28.next = 4;
2471
+ _context29.next = 4;
2434
2472
  break;
2435
2473
  }
2436
2474
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2437
- return _context28.abrupt("return", {
2475
+ return _context29.abrupt("return", {
2438
2476
  status: 'failed',
2439
2477
  reason: 'empty_code'
2440
2478
  });
2441
2479
  case 4:
2442
- _context28.prev = 4;
2480
+ _context29.prev = 4;
2443
2481
  localSearch = function localSearch(v) {
2444
2482
  return _this7.store.products.findProductsByCodeOrBarcode(v);
2445
2483
  };
2446
2484
  scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
2447
- _context28.next = 9;
2485
+ _context29.next = 9;
2448
2486
  return scanCallback({
2449
2487
  type: 'nativeScanner',
2450
2488
  value: trimmed
2451
2489
  });
2452
2490
  case 9:
2453
- raw = _context28.sent;
2491
+ raw = _context29.sent;
2454
2492
  formatted = formatGlobalScanResult(raw, trimmed);
2455
2493
  if (formatted) {
2456
- _context28.next = 14;
2494
+ _context29.next = 14;
2457
2495
  break;
2458
2496
  }
2459
2497
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2460
- return _context28.abrupt("return", {
2498
+ return _context29.abrupt("return", {
2461
2499
  status: 'failed',
2462
2500
  reason: 'not_found'
2463
2501
  });
2464
2502
  case 14:
2465
- _context28.next = 16;
2503
+ _context29.next = 16;
2466
2504
  return applyGlobalScan({
2467
2505
  setOrderCustomer: function setOrderCustomer(customer) {
2468
2506
  return _this7.setOrderCustomer(customer);
@@ -2497,25 +2535,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2497
2535
  }
2498
2536
  }, formatted, bridge);
2499
2537
  case 16:
2500
- _result7 = _context28.sent;
2538
+ _result7 = _context29.sent;
2501
2539
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
2502
- return _context28.abrupt("return", _result7);
2540
+ return _context29.abrupt("return", _result7);
2503
2541
  case 21:
2504
- _context28.prev = 21;
2505
- _context28.t0 = _context28["catch"](4);
2506
- console.error('[BookingTicket] handleGlobalScanCode failed', _context28.t0);
2542
+ _context29.prev = 21;
2543
+ _context29.t0 = _context29["catch"](4);
2544
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context29.t0);
2507
2545
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2508
- return _context28.abrupt("return", {
2546
+ return _context29.abrupt("return", {
2509
2547
  status: 'failed',
2510
2548
  reason: 'not_found'
2511
2549
  });
2512
2550
  case 26:
2513
2551
  case "end":
2514
- return _context28.stop();
2552
+ return _context29.stop();
2515
2553
  }
2516
- }, _callee28, this, [[4, 21]]);
2554
+ }, _callee29, this, [[4, 21]]);
2517
2555
  }));
2518
- function handleGlobalScanCode(_x19, _x20) {
2556
+ function handleGlobalScanCode(_x20, _x21) {
2519
2557
  return _handleGlobalScanCode.apply(this, arguments);
2520
2558
  }
2521
2559
  return handleGlobalScanCode;
@@ -2597,11 +2635,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2597
2635
  }, {
2598
2636
  key: "addAddTimeProductToBooking",
2599
2637
  value: (function () {
2600
- var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(input) {
2601
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2602
- while (1) switch (_context29.prev = _context29.next) {
2638
+ var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(input) {
2639
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2640
+ while (1) switch (_context30.prev = _context30.next) {
2603
2641
  case 0:
2604
- return _context29.abrupt("return", this.addAddTimeProductsToBooking({
2642
+ return _context30.abrupt("return", this.addAddTimeProductsToBooking({
2605
2643
  booking: input.booking,
2606
2644
  products: [input],
2607
2645
  coveredMinutes: input.coveredMinutes,
@@ -2609,11 +2647,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2609
2647
  }));
2610
2648
  case 1:
2611
2649
  case "end":
2612
- return _context29.stop();
2650
+ return _context30.stop();
2613
2651
  }
2614
- }, _callee29, this);
2652
+ }, _callee30, this);
2615
2653
  }));
2616
- function addAddTimeProductToBooking(_x21) {
2654
+ function addAddTimeProductToBooking(_x22) {
2617
2655
  return _addAddTimeProductToBooking.apply(this, arguments);
2618
2656
  }
2619
2657
  return addAddTimeProductToBooking;
@@ -2631,16 +2669,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2631
2669
  }, {
2632
2670
  key: "addAddTimeProductsToBooking",
2633
2671
  value: (function () {
2634
- var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(input) {
2672
+ var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(input) {
2635
2673
  var _this8 = this,
2636
2674
  _input$bookingPatch;
2637
2675
  var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
2638
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2639
- while (1) switch (_context30.prev = _context30.next) {
2676
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2677
+ while (1) switch (_context31.prev = _context31.next) {
2640
2678
  case 0:
2641
2679
  bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
2642
2680
  if (bookingUid) {
2643
- _context30.next = 3;
2681
+ _context31.next = 3;
2644
2682
  break;
2645
2683
  }
2646
2684
  throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
@@ -2651,7 +2689,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2651
2689
  };
2652
2690
  });
2653
2691
  if (this.store.order) {
2654
- _context30.next = 6;
2692
+ _context31.next = 6;
2655
2693
  break;
2656
2694
  }
2657
2695
  throw new Error('order 模块未初始化');
@@ -2665,55 +2703,55 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2665
2703
  });
2666
2704
  }
2667
2705
  if (!(typeof this.store.order.addProductsToOrder === 'function')) {
2668
- _context30.next = 11;
2706
+ _context31.next = 11;
2669
2707
  break;
2670
2708
  }
2671
- return _context30.abrupt("return", this.store.order.addProductsToOrder(orderLines));
2709
+ return _context31.abrupt("return", this.store.order.addProductsToOrder(orderLines));
2672
2710
  case 11:
2673
2711
  result = [];
2674
2712
  _iterator2 = _createForOfIteratorHelper(orderLines);
2675
- _context30.prev = 13;
2713
+ _context31.prev = 13;
2676
2714
  _iterator2.s();
2677
2715
  case 15:
2678
2716
  if ((_step2 = _iterator2.n()).done) {
2679
- _context30.next = 29;
2717
+ _context31.next = 29;
2680
2718
  break;
2681
2719
  }
2682
2720
  line = _step2.value;
2683
- _context30.t0 = result.splice;
2684
- _context30.t1 = result;
2685
- _context30.t2 = [0, result.length];
2686
- _context30.t3 = _toConsumableArray;
2687
- _context30.next = 23;
2721
+ _context31.t0 = result.splice;
2722
+ _context31.t1 = result;
2723
+ _context31.t2 = [0, result.length];
2724
+ _context31.t3 = _toConsumableArray;
2725
+ _context31.next = 23;
2688
2726
  return this.addProductToOrder(line.product);
2689
2727
  case 23:
2690
- _context30.t4 = _context30.sent;
2691
- _context30.t5 = (0, _context30.t3)(_context30.t4);
2692
- _context30.t6 = _context30.t2.concat.call(_context30.t2, _context30.t5);
2693
- _context30.t0.apply.call(_context30.t0, _context30.t1, _context30.t6);
2728
+ _context31.t4 = _context31.sent;
2729
+ _context31.t5 = (0, _context31.t3)(_context31.t4);
2730
+ _context31.t6 = _context31.t2.concat.call(_context31.t2, _context31.t5);
2731
+ _context31.t0.apply.call(_context31.t0, _context31.t1, _context31.t6);
2694
2732
  case 27:
2695
- _context30.next = 15;
2733
+ _context31.next = 15;
2696
2734
  break;
2697
2735
  case 29:
2698
- _context30.next = 34;
2736
+ _context31.next = 34;
2699
2737
  break;
2700
2738
  case 31:
2701
- _context30.prev = 31;
2702
- _context30.t7 = _context30["catch"](13);
2703
- _iterator2.e(_context30.t7);
2739
+ _context31.prev = 31;
2740
+ _context31.t7 = _context31["catch"](13);
2741
+ _iterator2.e(_context31.t7);
2704
2742
  case 34:
2705
- _context30.prev = 34;
2743
+ _context31.prev = 34;
2706
2744
  _iterator2.f();
2707
- return _context30.finish(34);
2745
+ return _context31.finish(34);
2708
2746
  case 37:
2709
- return _context30.abrupt("return", result);
2747
+ return _context31.abrupt("return", result);
2710
2748
  case 38:
2711
2749
  case "end":
2712
- return _context30.stop();
2750
+ return _context31.stop();
2713
2751
  }
2714
- }, _callee30, this, [[13, 31, 34, 37]]);
2752
+ }, _callee31, this, [[13, 31, 34, 37]]);
2715
2753
  }));
2716
- function addAddTimeProductsToBooking(_x22) {
2754
+ function addAddTimeProductsToBooking(_x23) {
2717
2755
  return _addAddTimeProductsToBooking.apply(this, arguments);
2718
2756
  }
2719
2757
  return addAddTimeProductsToBooking;
@@ -2721,33 +2759,33 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2721
2759
  }, {
2722
2760
  key: "setOtherParams",
2723
2761
  value: function () {
2724
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
2762
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
2725
2763
  var _ref19,
2726
2764
  _ref19$cover,
2727
2765
  cover,
2728
- _args31 = arguments;
2729
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2730
- while (1) switch (_context31.prev = _context31.next) {
2766
+ _args32 = arguments;
2767
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2768
+ while (1) switch (_context32.prev = _context32.next) {
2731
2769
  case 0:
2732
- _ref19 = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
2733
- _context31.next = 3;
2770
+ _ref19 = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
2771
+ _context32.next = 3;
2734
2772
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
2735
2773
  cover: cover
2736
2774
  });
2737
2775
  case 3:
2738
2776
  if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
2739
- _context31.next = 6;
2777
+ _context32.next = 6;
2740
2778
  break;
2741
2779
  }
2742
- _context31.next = 6;
2780
+ _context32.next = 6;
2743
2781
  return this.configureIdGeneratorFromOpenData();
2744
2782
  case 6:
2745
2783
  case "end":
2746
- return _context31.stop();
2784
+ return _context32.stop();
2747
2785
  }
2748
- }, _callee31, this);
2786
+ }, _callee32, this);
2749
2787
  }));
2750
- function setOtherParams(_x23) {
2788
+ function setOtherParams(_x24) {
2751
2789
  return _setOtherParams.apply(this, arguments);
2752
2790
  }
2753
2791
  return setOtherParams;
@@ -2764,15 +2802,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2764
2802
  }, {
2765
2803
  key: "handlePrintWristband",
2766
2804
  value: function () {
2767
- var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
2805
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
2768
2806
  var _this$getOrderIdentit;
2769
2807
  var deviceTask, deviceId, idempotencyKey;
2770
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2771
- while (1) switch (_context32.prev = _context32.next) {
2808
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2809
+ while (1) switch (_context33.prev = _context33.next) {
2772
2810
  case 0:
2773
2811
  deviceTask = this.getDeviceTaskPlugin();
2774
2812
  if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
2775
- _context32.next = 4;
2813
+ _context33.next = 4;
2776
2814
  break;
2777
2815
  }
2778
2816
  this.logger.addLog({
@@ -2782,7 +2820,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2782
2820
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2783
2821
  }
2784
2822
  });
2785
- return _context32.abrupt("return");
2823
+ return _context33.abrupt("return");
2786
2824
  case 4:
2787
2825
  this.logger.addLog({
2788
2826
  type: 'info',
@@ -2791,10 +2829,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2791
2829
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2792
2830
  }
2793
2831
  });
2794
- _context32.next = 7;
2832
+ _context33.next = 7;
2795
2833
  return this.getShortNumberOrDeviceId();
2796
2834
  case 7:
2797
- deviceId = _context32.sent;
2835
+ deviceId = _context33.sent;
2798
2836
  idempotencyKey = createUuidV4();
2799
2837
  deviceTask.dispatch({
2800
2838
  action: 'print_all',
@@ -2814,11 +2852,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2814
2852
  });
2815
2853
  case 10:
2816
2854
  case "end":
2817
- return _context32.stop();
2855
+ return _context33.stop();
2818
2856
  }
2819
- }, _callee32, this);
2857
+ }, _callee33, this);
2820
2858
  }));
2821
- function handlePrintWristband(_x24) {
2859
+ function handlePrintWristband(_x25) {
2822
2860
  return _handlePrintWristband.apply(this, arguments);
2823
2861
  }
2824
2862
  return handlePrintWristband;
@@ -2826,11 +2864,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2826
2864
  }, {
2827
2865
  key: "handleRedeem",
2828
2866
  value: function () {
2829
- var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
2867
+ var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(params) {
2830
2868
  var _this$store$order5, _this$store$order5$ge, _this$store$order6, _ref20, _tempOrder$order_id2;
2831
2869
  var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
2832
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2833
- while (1) switch (_context33.prev = _context33.next) {
2870
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2871
+ while (1) switch (_context34.prev = _context34.next) {
2834
2872
  case 0:
2835
2873
  voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
2836
2874
  status = params.is_checkin ? 'used' : 'unused';
@@ -2854,20 +2892,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2854
2892
  });
2855
2893
  });
2856
2894
  if (!(tempOrder && hasUpdatedVoucher)) {
2857
- _context33.next = 11;
2895
+ _context34.next = 11;
2858
2896
  break;
2859
2897
  }
2860
- _context33.next = 11;
2898
+ _context34.next = 11;
2861
2899
  return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
2862
2900
  vouchers: nextVouchers
2863
2901
  }));
2864
2902
  case 11:
2865
2903
  this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
2866
2904
  if (!(voucherIds.length === 0)) {
2867
- _context33.next = 14;
2905
+ _context34.next = 14;
2868
2906
  break;
2869
2907
  }
2870
- return _context33.abrupt("return", {
2908
+ return _context34.abrupt("return", {
2871
2909
  code: 200,
2872
2910
  status: true,
2873
2911
  message: '',
@@ -2878,7 +2916,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2878
2916
  externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
2879
2917
  orderId = (_ref20 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref20 !== void 0 ? _ref20 : undefined;
2880
2918
  orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
2881
- return _context33.abrupt("return", this.request.post('/machinecode/batch', {
2919
+ return _context34.abrupt("return", this.request.post('/machinecode/batch', {
2882
2920
  ids: voucherIds,
2883
2921
  status: status,
2884
2922
  order_lookup: orderLookup,
@@ -2889,11 +2927,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2889
2927
  }));
2890
2928
  case 19:
2891
2929
  case "end":
2892
- return _context33.stop();
2930
+ return _context34.stop();
2893
2931
  }
2894
- }, _callee33, this);
2932
+ }, _callee34, this);
2895
2933
  }));
2896
- function handleRedeem(_x25) {
2934
+ function handleRedeem(_x26) {
2897
2935
  return _handleRedeem.apply(this, arguments);
2898
2936
  }
2899
2937
  return handleRedeem;
@@ -2905,12 +2943,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2905
2943
  }, {
2906
2944
  key: "destroy",
2907
2945
  value: (function () {
2908
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
2946
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
2909
2947
  var _this$scan;
2910
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2911
- while (1) switch (_context34.prev = _context34.next) {
2948
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
2949
+ while (1) switch (_context35.prev = _context35.next) {
2912
2950
  case 0:
2913
- _context34.next = 2;
2951
+ _context35.next = 2;
2914
2952
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
2915
2953
  case 2:
2916
2954
  try {
@@ -2921,9 +2959,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2921
2959
  scanCache.clear();
2922
2960
  case 4:
2923
2961
  case "end":
2924
- return _context34.stop();
2962
+ return _context35.stop();
2925
2963
  }
2926
- }, _callee34, this);
2964
+ }, _callee35, this);
2927
2965
  }));
2928
2966
  function destroy() {
2929
2967
  return _destroy.apply(this, arguments);