@pisell/pisellos 2.3.68 → 2.3.70

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.
@@ -542,7 +542,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
542
542
  country_calling_code: selectedCustomer === null || selectedCustomer === void 0 ? void 0 : selectedCustomer.country_calling_code
543
543
  });
544
544
  customerModule.setSelectedCustomer(customer);
545
- this.setOrderCustomer(customer);
545
+ // 详情 hydrate 后仍需广播一次,让 CustomerContext 等 UI 订阅方拿到刚补齐的
546
+ // customerSnapshot;但它不是用户主动切换客户。通过 source 明确标记初始化事件,
547
+ // 商品报价/折扣订阅方即可跳过 prepare/config,其他旧订阅方仍可照常刷新 UI。
548
+ this.setOrderCustomer(customer, {
549
+ source: 'detailHydrate'
550
+ });
546
551
  // await this.store.order.saveDraft();
547
552
  }
548
553
  return _context6.abrupt("return", sales);
@@ -1558,7 +1563,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1558
1563
  */
1559
1564
  }, {
1560
1565
  key: "setOrderCustomer",
1561
- value: function setOrderCustomer(customer) {
1566
+ value: function setOrderCustomer(customer, options) {
1562
1567
  var _this$store$order$get3,
1563
1568
  _this3 = this;
1564
1569
  if (!customer) {
@@ -1581,12 +1586,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1581
1586
  var snapshotReplenished = !snapshotBeforeSet && Boolean(snapshotAfterOrderSet);
1582
1587
  if (snapshotReplenished) {
1583
1588
  var _next2 = this.buildOrderCustomerPayload();
1584
- this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), _next2);
1589
+ this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), _next2 && options !== null && options !== void 0 && options.source ? _objectSpread(_objectSpread({}, _next2), {}, {
1590
+ source: options.source
1591
+ }) : _next2);
1585
1592
  }
1586
1593
  return;
1587
1594
  }
1588
1595
  var next = this.buildOrderCustomerPayload();
1589
- this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), next);
1596
+ this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), next && options !== null && options !== void 0 && options.source ? _objectSpread(_objectSpread({}, next), {}, {
1597
+ source: options.source
1598
+ }) : next);
1590
1599
  this.refreshDiscountConfigAfterOrderCustomerChange(patch.customer_id);
1591
1600
  // 客户切换可能改变可用促销/赠品;触发一次重算(recursion-safe)。
1592
1601
  var promotionRefreshTask = this.store.order.applyPromotion().then(function () {
@@ -1763,6 +1772,44 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1763
1772
  value: function waitForOrderCustomerPromotionRefresh() {
1764
1773
  return this.orderCustomerPromotionRefreshInFlight || Promise.resolve();
1765
1774
  }
1775
+ }, {
1776
+ key: "prepareProductPriceQueryContext",
1777
+ value: function () {
1778
+ var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(customerId) {
1779
+ var normalizedCustomerId, refreshTask, shouldWait;
1780
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1781
+ while (1) switch (_context23.prev = _context23.next) {
1782
+ case 0:
1783
+ _context23.next = 2;
1784
+ return Promise.resolve();
1785
+ case 2:
1786
+ normalizedCustomerId = Number(customerId || 0);
1787
+ refreshTask = this.orderCustomerDiscountRefreshInFlight;
1788
+ shouldWait = normalizedCustomerId > 1 && this.orderCustomerDiscountRefreshCustomerId === normalizedCustomerId && Boolean(refreshTask);
1789
+ if (!(shouldWait && refreshTask)) {
1790
+ _context23.next = 8;
1791
+ break;
1792
+ }
1793
+ _context23.next = 8;
1794
+ return refreshTask;
1795
+ case 8:
1796
+ case "end":
1797
+ return _context23.stop();
1798
+ }
1799
+ }, _callee23, this);
1800
+ }));
1801
+ function prepareProductPriceQueryContext(_x16) {
1802
+ return _prepareProductPriceQueryContext.apply(this, arguments);
1803
+ }
1804
+ return prepareProductPriceQueryContext;
1805
+ }()
1806
+ }, {
1807
+ key: "preferAuthoritativeProductQueryPrice",
1808
+ value: function preferAuthoritativeProductQueryPrice() {
1809
+ // BookingTicket 的 /product/query 已按预约时间、客户及 Wallet 上下文执行
1810
+ // 智能定价;再次应用 legacy quotation 会把最终价覆盖成另一套时段价格。
1811
+ return true;
1812
+ }
1766
1813
 
1767
1814
  /**
1768
1815
  * 获取客户分页信息
@@ -1804,29 +1851,29 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1804
1851
  }, {
1805
1852
  key: "changeCustomerPage",
1806
1853
  value: (function () {
1807
- var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(page, pageSize) {
1854
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(page, pageSize) {
1808
1855
  var _result4;
1809
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1810
- while (1) switch (_context23.prev = _context23.next) {
1856
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1857
+ while (1) switch (_context24.prev = _context24.next) {
1811
1858
  case 0:
1812
- _context23.prev = 0;
1813
- _context23.next = 3;
1859
+ _context24.prev = 0;
1860
+ _context24.next = 3;
1814
1861
  return this.store.customer.changeCustomerPage(page, pageSize);
1815
1862
  case 3:
1816
- _result4 = _context23.sent;
1817
- return _context23.abrupt("return", _result4);
1863
+ _result4 = _context24.sent;
1864
+ return _context24.abrupt("return", _result4);
1818
1865
  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;
1866
+ _context24.prev = 7;
1867
+ _context24.t0 = _context24["catch"](0);
1868
+ console.error('Failed to change customer page:', _context24.t0);
1869
+ throw _context24.t0;
1823
1870
  case 11:
1824
1871
  case "end":
1825
- return _context23.stop();
1872
+ return _context24.stop();
1826
1873
  }
1827
- }, _callee23, this, [[0, 7]]);
1874
+ }, _callee24, this, [[0, 7]]);
1828
1875
  }));
1829
- function changeCustomerPage(_x16, _x17) {
1876
+ function changeCustomerPage(_x17, _x18) {
1830
1877
  return _changeCustomerPage.apply(this, arguments);
1831
1878
  }
1832
1879
  return changeCustomerPage;
@@ -1839,28 +1886,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1839
1886
  }, {
1840
1887
  key: "loadMoreCustomers",
1841
1888
  value: (function () {
1842
- var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1889
+ var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1843
1890
  var _result5;
1844
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1845
- while (1) switch (_context24.prev = _context24.next) {
1891
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1892
+ while (1) switch (_context25.prev = _context25.next) {
1846
1893
  case 0:
1847
- _context24.prev = 0;
1848
- _context24.next = 3;
1894
+ _context25.prev = 0;
1895
+ _context25.next = 3;
1849
1896
  return this.store.customer.loadMoreCustomers();
1850
1897
  case 3:
1851
- _result5 = _context24.sent;
1898
+ _result5 = _context25.sent;
1852
1899
  this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
1853
- return _context24.abrupt("return", _result5);
1900
+ return _context25.abrupt("return", _result5);
1854
1901
  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;
1902
+ _context25.prev = 8;
1903
+ _context25.t0 = _context25["catch"](0);
1904
+ console.error('Failed to load more customers:', _context25.t0);
1905
+ throw _context25.t0;
1859
1906
  case 12:
1860
1907
  case "end":
1861
- return _context24.stop();
1908
+ return _context25.stop();
1862
1909
  }
1863
- }, _callee24, this, [[0, 8]]);
1910
+ }, _callee25, this, [[0, 8]]);
1864
1911
  }));
1865
1912
  function loadMoreCustomers() {
1866
1913
  return _loadMoreCustomers.apply(this, arguments);
@@ -1876,31 +1923,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1876
1923
  }, {
1877
1924
  key: "resetAndLoadCustomers",
1878
1925
  value: (function () {
1879
- var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1926
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1880
1927
  var params,
1881
1928
  _result6,
1882
- _args25 = arguments;
1883
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1884
- while (1) switch (_context25.prev = _context25.next) {
1929
+ _args26 = arguments;
1930
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1931
+ while (1) switch (_context26.prev = _context26.next) {
1885
1932
  case 0:
1886
- params = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
1887
- _context25.prev = 1;
1888
- _context25.next = 4;
1933
+ params = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
1934
+ _context26.prev = 1;
1935
+ _context26.next = 4;
1889
1936
  return this.store.customer.resetAndLoadCustomers(params);
1890
1937
  case 4:
1891
- _result6 = _context25.sent;
1938
+ _result6 = _context26.sent;
1892
1939
  this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
1893
- return _context25.abrupt("return", _result6);
1940
+ return _context26.abrupt("return", _result6);
1894
1941
  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;
1942
+ _context26.prev = 9;
1943
+ _context26.t0 = _context26["catch"](1);
1944
+ console.error('Failed to reset and load customers:', _context26.t0);
1945
+ throw _context26.t0;
1899
1946
  case 13:
1900
1947
  case "end":
1901
- return _context25.stop();
1948
+ return _context26.stop();
1902
1949
  }
1903
- }, _callee25, this, [[1, 9]]);
1950
+ }, _callee26, this, [[1, 9]]);
1904
1951
  }));
1905
1952
  function resetAndLoadCustomers() {
1906
1953
  return _resetAndLoadCustomers.apply(this, arguments);
@@ -2061,16 +2108,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2061
2108
  }, {
2062
2109
  key: "getOtherParams",
2063
2110
  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) {
2111
+ var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
2112
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2113
+ while (1) switch (_context27.prev = _context27.next) {
2067
2114
  case 0:
2068
- return _context26.abrupt("return", this.otherParams);
2115
+ return _context27.abrupt("return", this.otherParams);
2069
2116
  case 1:
2070
2117
  case "end":
2071
- return _context26.stop();
2118
+ return _context27.stop();
2072
2119
  }
2073
- }, _callee26, this);
2120
+ }, _callee27, this);
2074
2121
  }));
2075
2122
  function getOtherParams() {
2076
2123
  return _getOtherParams.apply(this, arguments);
@@ -2389,18 +2436,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2389
2436
  }, {
2390
2437
  key: "updateProductInOrder",
2391
2438
  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) {
2439
+ var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
2440
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2441
+ while (1) switch (_context28.prev = _context28.next) {
2395
2442
  case 0:
2396
- return _context27.abrupt("return", this.updateOrderProduct(params));
2443
+ return _context28.abrupt("return", this.updateOrderProduct(params));
2397
2444
  case 1:
2398
2445
  case "end":
2399
- return _context27.stop();
2446
+ return _context28.stop();
2400
2447
  }
2401
- }, _callee27, this);
2448
+ }, _callee28, this);
2402
2449
  }));
2403
- function updateProductInOrder(_x18) {
2450
+ function updateProductInOrder(_x19) {
2404
2451
  return _updateProductInOrder.apply(this, arguments);
2405
2452
  }
2406
2453
  return updateProductInOrder;
@@ -2422,47 +2469,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2422
2469
  }, {
2423
2470
  key: "handleGlobalScanCode",
2424
2471
  value: (function () {
2425
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(code, bridge) {
2472
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(code, bridge) {
2426
2473
  var _this7 = this;
2427
2474
  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) {
2475
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2476
+ while (1) switch (_context29.prev = _context29.next) {
2430
2477
  case 0:
2431
2478
  trimmed = typeof code === 'string' ? code.trim() : '';
2432
2479
  if (trimmed) {
2433
- _context28.next = 4;
2480
+ _context29.next = 4;
2434
2481
  break;
2435
2482
  }
2436
2483
  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", {
2484
+ return _context29.abrupt("return", {
2438
2485
  status: 'failed',
2439
2486
  reason: 'empty_code'
2440
2487
  });
2441
2488
  case 4:
2442
- _context28.prev = 4;
2489
+ _context29.prev = 4;
2443
2490
  localSearch = function localSearch(v) {
2444
2491
  return _this7.store.products.findProductsByCodeOrBarcode(v);
2445
2492
  };
2446
2493
  scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
2447
- _context28.next = 9;
2494
+ _context29.next = 9;
2448
2495
  return scanCallback({
2449
2496
  type: 'nativeScanner',
2450
2497
  value: trimmed
2451
2498
  });
2452
2499
  case 9:
2453
- raw = _context28.sent;
2500
+ raw = _context29.sent;
2454
2501
  formatted = formatGlobalScanResult(raw, trimmed);
2455
2502
  if (formatted) {
2456
- _context28.next = 14;
2503
+ _context29.next = 14;
2457
2504
  break;
2458
2505
  }
2459
2506
  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", {
2507
+ return _context29.abrupt("return", {
2461
2508
  status: 'failed',
2462
2509
  reason: 'not_found'
2463
2510
  });
2464
2511
  case 14:
2465
- _context28.next = 16;
2512
+ _context29.next = 16;
2466
2513
  return applyGlobalScan({
2467
2514
  setOrderCustomer: function setOrderCustomer(customer) {
2468
2515
  return _this7.setOrderCustomer(customer);
@@ -2497,25 +2544,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2497
2544
  }
2498
2545
  }, formatted, bridge);
2499
2546
  case 16:
2500
- _result7 = _context28.sent;
2547
+ _result7 = _context29.sent;
2501
2548
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
2502
- return _context28.abrupt("return", _result7);
2549
+ return _context29.abrupt("return", _result7);
2503
2550
  case 21:
2504
- _context28.prev = 21;
2505
- _context28.t0 = _context28["catch"](4);
2506
- console.error('[BookingTicket] handleGlobalScanCode failed', _context28.t0);
2551
+ _context29.prev = 21;
2552
+ _context29.t0 = _context29["catch"](4);
2553
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context29.t0);
2507
2554
  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", {
2555
+ return _context29.abrupt("return", {
2509
2556
  status: 'failed',
2510
2557
  reason: 'not_found'
2511
2558
  });
2512
2559
  case 26:
2513
2560
  case "end":
2514
- return _context28.stop();
2561
+ return _context29.stop();
2515
2562
  }
2516
- }, _callee28, this, [[4, 21]]);
2563
+ }, _callee29, this, [[4, 21]]);
2517
2564
  }));
2518
- function handleGlobalScanCode(_x19, _x20) {
2565
+ function handleGlobalScanCode(_x20, _x21) {
2519
2566
  return _handleGlobalScanCode.apply(this, arguments);
2520
2567
  }
2521
2568
  return handleGlobalScanCode;
@@ -2597,11 +2644,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2597
2644
  }, {
2598
2645
  key: "addAddTimeProductToBooking",
2599
2646
  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) {
2647
+ var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(input) {
2648
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2649
+ while (1) switch (_context30.prev = _context30.next) {
2603
2650
  case 0:
2604
- return _context29.abrupt("return", this.addAddTimeProductsToBooking({
2651
+ return _context30.abrupt("return", this.addAddTimeProductsToBooking({
2605
2652
  booking: input.booking,
2606
2653
  products: [input],
2607
2654
  coveredMinutes: input.coveredMinutes,
@@ -2609,11 +2656,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2609
2656
  }));
2610
2657
  case 1:
2611
2658
  case "end":
2612
- return _context29.stop();
2659
+ return _context30.stop();
2613
2660
  }
2614
- }, _callee29, this);
2661
+ }, _callee30, this);
2615
2662
  }));
2616
- function addAddTimeProductToBooking(_x21) {
2663
+ function addAddTimeProductToBooking(_x22) {
2617
2664
  return _addAddTimeProductToBooking.apply(this, arguments);
2618
2665
  }
2619
2666
  return addAddTimeProductToBooking;
@@ -2631,16 +2678,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2631
2678
  }, {
2632
2679
  key: "addAddTimeProductsToBooking",
2633
2680
  value: (function () {
2634
- var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(input) {
2681
+ var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(input) {
2635
2682
  var _this8 = this,
2636
2683
  _input$bookingPatch;
2637
2684
  var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
2638
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2639
- while (1) switch (_context30.prev = _context30.next) {
2685
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2686
+ while (1) switch (_context31.prev = _context31.next) {
2640
2687
  case 0:
2641
2688
  bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
2642
2689
  if (bookingUid) {
2643
- _context30.next = 3;
2690
+ _context31.next = 3;
2644
2691
  break;
2645
2692
  }
2646
2693
  throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
@@ -2651,7 +2698,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2651
2698
  };
2652
2699
  });
2653
2700
  if (this.store.order) {
2654
- _context30.next = 6;
2701
+ _context31.next = 6;
2655
2702
  break;
2656
2703
  }
2657
2704
  throw new Error('order 模块未初始化');
@@ -2665,55 +2712,55 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2665
2712
  });
2666
2713
  }
2667
2714
  if (!(typeof this.store.order.addProductsToOrder === 'function')) {
2668
- _context30.next = 11;
2715
+ _context31.next = 11;
2669
2716
  break;
2670
2717
  }
2671
- return _context30.abrupt("return", this.store.order.addProductsToOrder(orderLines));
2718
+ return _context31.abrupt("return", this.store.order.addProductsToOrder(orderLines));
2672
2719
  case 11:
2673
2720
  result = [];
2674
2721
  _iterator2 = _createForOfIteratorHelper(orderLines);
2675
- _context30.prev = 13;
2722
+ _context31.prev = 13;
2676
2723
  _iterator2.s();
2677
2724
  case 15:
2678
2725
  if ((_step2 = _iterator2.n()).done) {
2679
- _context30.next = 29;
2726
+ _context31.next = 29;
2680
2727
  break;
2681
2728
  }
2682
2729
  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;
2730
+ _context31.t0 = result.splice;
2731
+ _context31.t1 = result;
2732
+ _context31.t2 = [0, result.length];
2733
+ _context31.t3 = _toConsumableArray;
2734
+ _context31.next = 23;
2688
2735
  return this.addProductToOrder(line.product);
2689
2736
  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);
2737
+ _context31.t4 = _context31.sent;
2738
+ _context31.t5 = (0, _context31.t3)(_context31.t4);
2739
+ _context31.t6 = _context31.t2.concat.call(_context31.t2, _context31.t5);
2740
+ _context31.t0.apply.call(_context31.t0, _context31.t1, _context31.t6);
2694
2741
  case 27:
2695
- _context30.next = 15;
2742
+ _context31.next = 15;
2696
2743
  break;
2697
2744
  case 29:
2698
- _context30.next = 34;
2745
+ _context31.next = 34;
2699
2746
  break;
2700
2747
  case 31:
2701
- _context30.prev = 31;
2702
- _context30.t7 = _context30["catch"](13);
2703
- _iterator2.e(_context30.t7);
2748
+ _context31.prev = 31;
2749
+ _context31.t7 = _context31["catch"](13);
2750
+ _iterator2.e(_context31.t7);
2704
2751
  case 34:
2705
- _context30.prev = 34;
2752
+ _context31.prev = 34;
2706
2753
  _iterator2.f();
2707
- return _context30.finish(34);
2754
+ return _context31.finish(34);
2708
2755
  case 37:
2709
- return _context30.abrupt("return", result);
2756
+ return _context31.abrupt("return", result);
2710
2757
  case 38:
2711
2758
  case "end":
2712
- return _context30.stop();
2759
+ return _context31.stop();
2713
2760
  }
2714
- }, _callee30, this, [[13, 31, 34, 37]]);
2761
+ }, _callee31, this, [[13, 31, 34, 37]]);
2715
2762
  }));
2716
- function addAddTimeProductsToBooking(_x22) {
2763
+ function addAddTimeProductsToBooking(_x23) {
2717
2764
  return _addAddTimeProductsToBooking.apply(this, arguments);
2718
2765
  }
2719
2766
  return addAddTimeProductsToBooking;
@@ -2721,33 +2768,33 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2721
2768
  }, {
2722
2769
  key: "setOtherParams",
2723
2770
  value: function () {
2724
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
2771
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
2725
2772
  var _ref19,
2726
2773
  _ref19$cover,
2727
2774
  cover,
2728
- _args31 = arguments;
2729
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2730
- while (1) switch (_context31.prev = _context31.next) {
2775
+ _args32 = arguments;
2776
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2777
+ while (1) switch (_context32.prev = _context32.next) {
2731
2778
  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;
2779
+ _ref19 = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
2780
+ _context32.next = 3;
2734
2781
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
2735
2782
  cover: cover
2736
2783
  });
2737
2784
  case 3:
2738
2785
  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;
2786
+ _context32.next = 6;
2740
2787
  break;
2741
2788
  }
2742
- _context31.next = 6;
2789
+ _context32.next = 6;
2743
2790
  return this.configureIdGeneratorFromOpenData();
2744
2791
  case 6:
2745
2792
  case "end":
2746
- return _context31.stop();
2793
+ return _context32.stop();
2747
2794
  }
2748
- }, _callee31, this);
2795
+ }, _callee32, this);
2749
2796
  }));
2750
- function setOtherParams(_x23) {
2797
+ function setOtherParams(_x24) {
2751
2798
  return _setOtherParams.apply(this, arguments);
2752
2799
  }
2753
2800
  return setOtherParams;
@@ -2764,15 +2811,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2764
2811
  }, {
2765
2812
  key: "handlePrintWristband",
2766
2813
  value: function () {
2767
- var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
2814
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
2768
2815
  var _this$getOrderIdentit;
2769
2816
  var deviceTask, deviceId, idempotencyKey;
2770
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2771
- while (1) switch (_context32.prev = _context32.next) {
2817
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2818
+ while (1) switch (_context33.prev = _context33.next) {
2772
2819
  case 0:
2773
2820
  deviceTask = this.getDeviceTaskPlugin();
2774
2821
  if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
2775
- _context32.next = 4;
2822
+ _context33.next = 4;
2776
2823
  break;
2777
2824
  }
2778
2825
  this.logger.addLog({
@@ -2782,7 +2829,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2782
2829
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2783
2830
  }
2784
2831
  });
2785
- return _context32.abrupt("return");
2832
+ return _context33.abrupt("return");
2786
2833
  case 4:
2787
2834
  this.logger.addLog({
2788
2835
  type: 'info',
@@ -2791,10 +2838,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2791
2838
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2792
2839
  }
2793
2840
  });
2794
- _context32.next = 7;
2841
+ _context33.next = 7;
2795
2842
  return this.getShortNumberOrDeviceId();
2796
2843
  case 7:
2797
- deviceId = _context32.sent;
2844
+ deviceId = _context33.sent;
2798
2845
  idempotencyKey = createUuidV4();
2799
2846
  deviceTask.dispatch({
2800
2847
  action: 'print_all',
@@ -2814,11 +2861,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2814
2861
  });
2815
2862
  case 10:
2816
2863
  case "end":
2817
- return _context32.stop();
2864
+ return _context33.stop();
2818
2865
  }
2819
- }, _callee32, this);
2866
+ }, _callee33, this);
2820
2867
  }));
2821
- function handlePrintWristband(_x24) {
2868
+ function handlePrintWristband(_x25) {
2822
2869
  return _handlePrintWristband.apply(this, arguments);
2823
2870
  }
2824
2871
  return handlePrintWristband;
@@ -2826,11 +2873,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2826
2873
  }, {
2827
2874
  key: "handleRedeem",
2828
2875
  value: function () {
2829
- var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
2876
+ var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(params) {
2830
2877
  var _this$store$order5, _this$store$order5$ge, _this$store$order6, _ref20, _tempOrder$order_id2;
2831
2878
  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) {
2879
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2880
+ while (1) switch (_context34.prev = _context34.next) {
2834
2881
  case 0:
2835
2882
  voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
2836
2883
  status = params.is_checkin ? 'used' : 'unused';
@@ -2854,20 +2901,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2854
2901
  });
2855
2902
  });
2856
2903
  if (!(tempOrder && hasUpdatedVoucher)) {
2857
- _context33.next = 11;
2904
+ _context34.next = 11;
2858
2905
  break;
2859
2906
  }
2860
- _context33.next = 11;
2907
+ _context34.next = 11;
2861
2908
  return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
2862
2909
  vouchers: nextVouchers
2863
2910
  }));
2864
2911
  case 11:
2865
2912
  this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
2866
2913
  if (!(voucherIds.length === 0)) {
2867
- _context33.next = 14;
2914
+ _context34.next = 14;
2868
2915
  break;
2869
2916
  }
2870
- return _context33.abrupt("return", {
2917
+ return _context34.abrupt("return", {
2871
2918
  code: 200,
2872
2919
  status: true,
2873
2920
  message: '',
@@ -2878,7 +2925,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2878
2925
  externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
2879
2926
  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
2927
  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', {
2928
+ return _context34.abrupt("return", this.request.post('/machinecode/batch', {
2882
2929
  ids: voucherIds,
2883
2930
  status: status,
2884
2931
  order_lookup: orderLookup,
@@ -2889,11 +2936,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2889
2936
  }));
2890
2937
  case 19:
2891
2938
  case "end":
2892
- return _context33.stop();
2939
+ return _context34.stop();
2893
2940
  }
2894
- }, _callee33, this);
2941
+ }, _callee34, this);
2895
2942
  }));
2896
- function handleRedeem(_x25) {
2943
+ function handleRedeem(_x26) {
2897
2944
  return _handleRedeem.apply(this, arguments);
2898
2945
  }
2899
2946
  return handleRedeem;
@@ -2905,12 +2952,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2905
2952
  }, {
2906
2953
  key: "destroy",
2907
2954
  value: (function () {
2908
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
2955
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
2909
2956
  var _this$scan;
2910
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2911
- while (1) switch (_context34.prev = _context34.next) {
2957
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
2958
+ while (1) switch (_context35.prev = _context35.next) {
2912
2959
  case 0:
2913
- _context34.next = 2;
2960
+ _context35.next = 2;
2914
2961
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
2915
2962
  case 2:
2916
2963
  try {
@@ -2921,9 +2968,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2921
2968
  scanCache.clear();
2922
2969
  case 4:
2923
2970
  case "end":
2924
- return _context34.stop();
2971
+ return _context35.stop();
2925
2972
  }
2926
- }, _callee34, this);
2973
+ }, _callee35, this);
2927
2974
  }));
2928
2975
  function destroy() {
2929
2976
  return _destroy.apply(this, arguments);