@pisell/pisellos 0.10.65 → 0.10.66

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.
@@ -51,6 +51,8 @@ import { buildProductOptionStringFromOrderLine } from "../../modules/BookingCont
51
51
  import { applyBookingsStatus, applyChildBookingStatus, resolveScheduleId, resolveStatusAfterTransition, restoreBookingsStatus, restoreChildBookingStatus } from "./utils/bookingStatus";
52
52
  import { resolveBestAddTimePlan as _resolveBestAddTimePlan } from "./utils/resolveBestAddTimePlan";
53
53
  import { createUuidV4 } from "../../modules/Order/utils";
54
+ import { extractCustomerContactInfo } from "../../modules/OpenData/contactInfo";
55
+ import { cloneDeep } from 'lodash-es';
54
56
  var OPEN_DATA_SECTION_CODES = ['sale', 'reservation', 'fulfillment', 'menu', 'workflow', 'documents'];
55
57
  var OPEN_DATA_CACHE_TTL = 5 * 60 * 1000;
56
58
  var USER_PLATFORM = ['pc', 'h5'];
@@ -452,29 +454,48 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
452
454
  return getOpenData;
453
455
  }()
454
456
  }, {
455
- key: "getInvoiceLayoutConfig",
457
+ key: "loadContactInfoOpenData",
456
458
  value: function () {
457
- var _getInvoiceLayoutConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
458
- var openData;
459
+ var _loadContactInfoOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
459
460
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
460
461
  while (1) switch (_context5.prev = _context5.next) {
461
462
  case 0:
462
- _context5.next = 2;
463
+ return _context5.abrupt("return", this.store.openData ? this.getOpenData() : _get(_getPrototypeOf(BookingTicketImpl.prototype), "loadContactInfoOpenData", this).call(this));
464
+ case 1:
465
+ case "end":
466
+ return _context5.stop();
467
+ }
468
+ }, _callee5, this);
469
+ }));
470
+ function loadContactInfoOpenData() {
471
+ return _loadContactInfoOpenData.apply(this, arguments);
472
+ }
473
+ return loadContactInfoOpenData;
474
+ }()
475
+ }, {
476
+ key: "getInvoiceLayoutConfig",
477
+ value: function () {
478
+ var _getInvoiceLayoutConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
479
+ var openData;
480
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
481
+ while (1) switch (_context6.prev = _context6.next) {
482
+ case 0:
483
+ _context6.next = 2;
463
484
  return this.loadOpenDataConfig();
464
485
  case 2:
465
- openData = _context5.sent;
486
+ openData = _context6.sent;
466
487
  if (openData) {
467
- _context5.next = 5;
488
+ _context6.next = 5;
468
489
  break;
469
490
  }
470
- return _context5.abrupt("return", getDefaultInvoiceLayoutConfig());
491
+ return _context6.abrupt("return", getDefaultInvoiceLayoutConfig());
471
492
  case 5:
472
- return _context5.abrupt("return", this.store.openData.getInvoiceLayoutConfig());
493
+ return _context6.abrupt("return", this.store.openData.getInvoiceLayoutConfig());
473
494
  case 6:
474
495
  case "end":
475
- return _context5.stop();
496
+ return _context6.stop();
476
497
  }
477
- }, _callee5, this);
498
+ }, _callee6, this);
478
499
  }));
479
500
  function getInvoiceLayoutConfig() {
480
501
  return _getInvoiceLayoutConfig.apply(this, arguments);
@@ -484,27 +505,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
484
505
  }, {
485
506
  key: "getInvoiceTemplateSettings",
486
507
  value: function () {
487
- var _getInvoiceTemplateSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
508
+ var _getInvoiceTemplateSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
488
509
  var openData;
489
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
490
- while (1) switch (_context6.prev = _context6.next) {
510
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
511
+ while (1) switch (_context7.prev = _context7.next) {
491
512
  case 0:
492
- _context6.next = 2;
513
+ _context7.next = 2;
493
514
  return this.loadOpenDataConfig();
494
515
  case 2:
495
- openData = _context6.sent;
516
+ openData = _context7.sent;
496
517
  if (openData) {
497
- _context6.next = 5;
518
+ _context7.next = 5;
498
519
  break;
499
520
  }
500
- return _context6.abrupt("return", getDefaultInvoiceTemplateSettings());
521
+ return _context7.abrupt("return", getDefaultInvoiceTemplateSettings());
501
522
  case 5:
502
- return _context6.abrupt("return", this.store.openData.getInvoiceTemplateSettings());
523
+ return _context7.abrupt("return", this.store.openData.getInvoiceTemplateSettings());
503
524
  case 6:
504
525
  case "end":
505
- return _context6.stop();
526
+ return _context7.stop();
506
527
  }
507
- }, _callee6, this);
528
+ }, _callee7, this);
508
529
  }));
509
530
  function getInvoiceTemplateSettings() {
510
531
  return _getInvoiceTemplateSettings.apply(this, arguments);
@@ -534,32 +555,32 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
534
555
  }, {
535
556
  key: "getShortNumberOrDeviceId",
536
557
  value: function () {
537
- var _getShortNumberOrDeviceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
558
+ var _getShortNumberOrDeviceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
538
559
  var getAsyncIotDeviceInfo, res;
539
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
540
- while (1) switch (_context7.prev = _context7.next) {
560
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
561
+ while (1) switch (_context8.prev = _context8.next) {
541
562
  case 0:
542
563
  getAsyncIotDeviceInfo = this.getAppData('async_iot_device_info');
543
564
  if (!getAsyncIotDeviceInfo) {
544
- _context7.next = 7;
565
+ _context8.next = 7;
545
566
  break;
546
567
  }
547
- _context7.next = 4;
568
+ _context8.next = 4;
548
569
  return getAsyncIotDeviceInfo === null || getAsyncIotDeviceInfo === void 0 ? void 0 : getAsyncIotDeviceInfo();
549
570
  case 4:
550
- res = _context7.sent;
571
+ res = _context8.sent;
551
572
  if (!(res !== null && res !== void 0 && res.short_number)) {
552
- _context7.next = 7;
573
+ _context8.next = 7;
553
574
  break;
554
575
  }
555
- return _context7.abrupt("return", res === null || res === void 0 ? void 0 : res.short_number);
576
+ return _context8.abrupt("return", res === null || res === void 0 ? void 0 : res.short_number);
556
577
  case 7:
557
- return _context7.abrupt("return", String(this.getAppData('device_id') || 0).slice(-2));
578
+ return _context8.abrupt("return", String(this.getAppData('device_id') || 0).slice(-2));
558
579
  case 8:
559
580
  case "end":
560
- return _context7.stop();
581
+ return _context8.stop();
561
582
  }
562
- }, _callee7, this);
583
+ }, _callee8, this);
563
584
  }));
564
585
  function getShortNumberOrDeviceId() {
565
586
  return _getShortNumberOrDeviceId.apply(this, arguments);
@@ -569,35 +590,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
569
590
  }, {
570
591
  key: "configureIdGeneratorFromOpenData",
571
592
  value: function () {
572
- var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
593
+ var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
573
594
  var _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
574
595
  var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode;
575
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
576
- while (1) switch (_context8.prev = _context8.next) {
596
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
597
+ while (1) switch (_context9.prev = _context9.next) {
577
598
  case 0:
578
599
  // 业务码切换或配置失败时不能复用上一次初始化的短号。
579
600
  this.setPaymentNumberDevicePrefix(null);
580
601
  idGenerator = this.getIdGeneratorPlugin();
581
602
  if (idGenerator !== null && idGenerator !== void 0 && idGenerator.configure) {
582
- _context8.next = 5;
603
+ _context9.next = 5;
583
604
  break;
584
605
  }
585
606
  console.warn('[BookingTicket] idGenerator 插件不可用,跳过配置');
586
- return _context8.abrupt("return");
607
+ return _context9.abrupt("return");
587
608
  case 5:
588
609
  openDataConfig = null;
589
- _context8.prev = 6;
590
- _context8.next = 9;
610
+ _context9.prev = 6;
611
+ _context9.next = 9;
591
612
  return this.loadOpenDataConfig();
592
613
  case 9:
593
- openDataConfig = _context8.sent;
594
- _context8.next = 16;
614
+ openDataConfig = _context9.sent;
615
+ _context9.next = 16;
595
616
  break;
596
617
  case 12:
597
- _context8.prev = 12;
598
- _context8.t0 = _context8["catch"](6);
599
- console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context8.t0);
600
- return _context8.abrupt("return");
618
+ _context9.prev = 12;
619
+ _context9.t0 = _context9["catch"](6);
620
+ console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context9.t0);
621
+ return _context9.abrupt("return");
601
622
  case 16:
602
623
  // if (!openDataConfig) return;
603
624
  receiptSequenceLength = this.normalizePositiveInteger((_openDataConfig = openDataConfig) === null || _openDataConfig === void 0 ? void 0 : _openDataConfig['sale.short_number_digits'], 5);
@@ -609,21 +630,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
609
630
  "type": "start_time",
610
631
  "time": "00:00"
611
632
  };
612
- _context8.next = 24;
633
+ _context9.next = 24;
613
634
  return this.getShortNumberOrDeviceId();
614
635
  case 24:
615
- deviceId = _context8.sent;
636
+ deviceId = _context9.sent;
616
637
  this.setPaymentNumberDevicePrefix(deviceId);
617
638
  businessCode = this.getBookingTicketBusinessCode();
618
639
  if (businessCode) {
619
- _context8.next = 30;
640
+ _context9.next = 30;
620
641
  break;
621
642
  }
622
643
  console.warn('[BookingTicket] businessCode 缺失,跳过 idGenerator 配置');
623
- return _context8.abrupt("return");
644
+ return _context9.abrupt("return");
624
645
  case 30:
625
- _context8.prev = 30;
626
- _context8.next = 33;
646
+ _context9.prev = 30;
647
+ _context9.next = 33;
627
648
  return idGenerator.configure({
628
649
  biz: businessCode,
629
650
  config: {
@@ -639,17 +660,17 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
639
660
  }
640
661
  });
641
662
  case 33:
642
- _context8.next = 38;
663
+ _context9.next = 38;
643
664
  break;
644
665
  case 35:
645
- _context8.prev = 35;
646
- _context8.t1 = _context8["catch"](30);
647
- console.warn('[BookingTicket] idGenerator 配置失败', _context8.t1);
666
+ _context9.prev = 35;
667
+ _context9.t1 = _context9["catch"](30);
668
+ console.warn('[BookingTicket] idGenerator 配置失败', _context9.t1);
648
669
  case 38:
649
670
  case "end":
650
- return _context8.stop();
671
+ return _context9.stop();
651
672
  }
652
- }, _callee8, this, [[6, 12], [30, 35]]);
673
+ }, _callee9, this, [[6, 12], [30, 35]]);
653
674
  }));
654
675
  function configureIdGeneratorFromOpenData() {
655
676
  return _configureIdGeneratorFromOpenData.apply(this, arguments);
@@ -681,16 +702,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
681
702
  }, {
682
703
  key: "loadSalesDetail",
683
704
  value: (function () {
684
- var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(orderIdOrParams) {
705
+ var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(orderIdOrParams) {
685
706
  var _ref3;
686
707
  var sales, customerModule, detailCustomer, orderCustomerSnapshot, protocolCustomerId, protocolCustomer, selectedCustomer, _selectedCustomer$nam, _ref4, detailCustomerId, detailCustomerRest, rawId, customer;
687
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
688
- while (1) switch (_context9.prev = _context9.next) {
708
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
709
+ while (1) switch (_context10.prev = _context10.next) {
689
710
  case 0:
690
- _context9.next = 2;
711
+ _context10.next = 2;
691
712
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "loadSalesDetail", this).call(this, orderIdOrParams);
692
713
  case 2:
693
- sales = _context9.sent;
714
+ sales = _context10.sent;
694
715
  customerModule = this.store.customer;
695
716
  detailCustomer = sales === null || sales === void 0 ? void 0 : sales.customer;
696
717
  orderCustomerSnapshot = this.store.order.getOrderCustomerSnapshot();
@@ -722,12 +743,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
722
743
  });
723
744
  // await this.store.order.saveDraft();
724
745
  }
725
- return _context9.abrupt("return", sales);
746
+ return _context10.abrupt("return", sales);
726
747
  case 11:
727
748
  case "end":
728
- return _context9.stop();
749
+ return _context10.stop();
729
750
  }
730
- }, _callee9, this);
751
+ }, _callee10, this);
731
752
  }));
732
753
  function loadSalesDetail(_x3) {
733
754
  return _loadSalesDetail.apply(this, arguments);
@@ -737,56 +758,56 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
737
758
  }, {
738
759
  key: "scanPromotionCode",
739
760
  value: function () {
740
- var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(code, customerId) {
761
+ var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(code, customerId) {
741
762
  var raw, scannedList, extractedCustomerId, hasOrderCustomer, isUserPlatform, tempOrder;
742
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
743
- while (1) switch (_context10.prev = _context10.next) {
763
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
764
+ while (1) switch (_context11.prev = _context11.next) {
744
765
  case 0:
745
766
  if (this.store.order) {
746
- _context10.next = 2;
767
+ _context11.next = 2;
747
768
  break;
748
769
  }
749
770
  throw new Error('order 模块未初始化');
750
771
  case 2:
751
- _context10.next = 4;
772
+ _context11.next = 4;
752
773
  return this.store.order.scanCode(code, customerId);
753
774
  case 4:
754
- raw = _context10.sent;
775
+ raw = _context11.sent;
755
776
  scannedList = raw.scannedDiscountList || [];
756
777
  extractedCustomerId = this.getDiscountCustomerId(scannedList);
757
778
  hasOrderCustomer = Boolean(this.store.order.getOrderCustomer());
758
779
  isUserPlatform = USER_PLATFORM.includes(this.otherParams.platform); // 缺 Holder 等场景 isAvailable=false,但仍需把 Pass 归属客户带入订单,供 Holder 弹窗使用。
759
780
  if (!(!hasOrderCustomer && extractedCustomerId && !isUserPlatform)) {
760
- _context10.next = 18;
781
+ _context11.next = 18;
761
782
  break;
762
783
  }
763
- _context10.prev = 10;
764
- _context10.next = 13;
784
+ _context11.prev = 10;
785
+ _context11.next = 13;
765
786
  return this.hydrateOrderCustomerFromScanDiscounts(scannedList);
766
787
  case 13:
767
- _context10.next = 18;
788
+ _context11.next = 18;
768
789
  break;
769
790
  case 15:
770
- _context10.prev = 15;
771
- _context10.t0 = _context10["catch"](10);
791
+ _context11.prev = 15;
792
+ _context11.t0 = _context11["catch"](10);
772
793
  // 客户映射失败不能阻断原有 Pass 的可用性、展示或优惠处理。
773
794
  console.warn('[BookingTicket] scan discount customer resolve failed', {
774
795
  customerId: extractedCustomerId,
775
- error: _context10.t0
796
+ error: _context11.t0
776
797
  });
777
798
  case 18:
778
799
  if (!raw.isAvailable) {
779
- _context10.next = 25;
800
+ _context11.next = 25;
780
801
  break;
781
802
  }
782
- _context10.next = 21;
803
+ _context11.next = 21;
783
804
  return this.store.order.recalculateSummary({
784
805
  createIfMissing: true
785
806
  });
786
807
  case 21:
787
808
  this.store.order.persistTempOrder();
788
809
  tempOrder = this.store.order.ensureTempOrder();
789
- _context10.next = 25;
810
+ _context11.next = 25;
790
811
  return this.effectsEmit('onDiscountApplied', {
791
812
  productList: tempOrder.products || [],
792
813
  discountList: this.store.order.getDiscountList(),
@@ -794,7 +815,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
794
815
  tempOrder: tempOrder
795
816
  });
796
817
  case 25:
797
- return _context10.abrupt("return", _objectSpread(_objectSpread({
818
+ return _context11.abrupt("return", _objectSpread(_objectSpread({
798
819
  isAvailable: raw.isAvailable
799
820
  }, raw.isAccepted !== undefined ? {
800
821
  isAccepted: raw.isAccepted
@@ -805,9 +826,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
805
826
  }));
806
827
  case 26:
807
828
  case "end":
808
- return _context10.stop();
829
+ return _context11.stop();
809
830
  }
810
- }, _callee10, this, [[10, 15]]);
831
+ }, _callee11, this, [[10, 15]]);
811
832
  }));
812
833
  function scanPromotionCode(_x4, _x5) {
813
834
  return _scanPromotionCode.apply(this, arguments);
@@ -817,42 +838,42 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
817
838
  }, {
818
839
  key: "hydrateOrderCustomerFromScanDiscounts",
819
840
  value: function () {
820
- var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(discounts) {
841
+ var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(discounts) {
821
842
  var currentOrderCustomer, customerId, customer;
822
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
823
- while (1) switch (_context11.prev = _context11.next) {
843
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
844
+ while (1) switch (_context12.prev = _context12.next) {
824
845
  case 0:
825
846
  currentOrderCustomer = this.store.order.getOrderCustomer();
826
847
  if (!currentOrderCustomer) {
827
- _context11.next = 3;
848
+ _context12.next = 3;
828
849
  break;
829
850
  }
830
- return _context11.abrupt("return");
851
+ return _context12.abrupt("return");
831
852
  case 3:
832
853
  customerId = this.getDiscountCustomerId(discounts);
833
854
  if (customerId) {
834
- _context11.next = 6;
855
+ _context12.next = 6;
835
856
  break;
836
857
  }
837
- return _context11.abrupt("return");
858
+ return _context12.abrupt("return");
838
859
  case 6:
839
- _context11.next = 8;
860
+ _context12.next = 8;
840
861
  return this.resolveCustomerByDiscountCustomerId(customerId);
841
862
  case 8:
842
- customer = _context11.sent;
863
+ customer = _context12.sent;
843
864
  if (customer) {
844
- _context11.next = 11;
865
+ _context12.next = 11;
845
866
  break;
846
867
  }
847
- return _context11.abrupt("return");
868
+ return _context12.abrupt("return");
848
869
  case 11:
849
870
  this.store.customer.setSelectedCustomer(customer);
850
871
  this.setOrderCustomer(customer);
851
872
  case 13:
852
873
  case "end":
853
- return _context11.stop();
874
+ return _context12.stop();
854
875
  }
855
- }, _callee11, this);
876
+ }, _callee12, this);
856
877
  }));
857
878
  function hydrateOrderCustomerFromScanDiscounts(_x6) {
858
879
  return _hydrateOrderCustomerFromScanDiscounts.apply(this, arguments);
@@ -888,27 +909,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
888
909
  }, {
889
910
  key: "resolveCustomerById",
890
911
  value: function () {
891
- var _resolveCustomerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(customerId) {
912
+ var _resolveCustomerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(customerId) {
892
913
  var _this2 = this;
893
914
  var rawCustomerId, numericCustomerId, normalizedCustomerId, existingRequest, request;
894
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
895
- while (1) switch (_context12.prev = _context12.next) {
915
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
916
+ while (1) switch (_context13.prev = _context13.next) {
896
917
  case 0:
897
918
  rawCustomerId = String(customerId !== null && customerId !== void 0 ? customerId : '').trim();
898
919
  numericCustomerId = Number(rawCustomerId);
899
920
  if (!(!rawCustomerId || !Number.isInteger(numericCustomerId) || numericCustomerId <= 1)) {
900
- _context12.next = 4;
921
+ _context13.next = 4;
901
922
  break;
902
923
  }
903
- return _context12.abrupt("return", null);
924
+ return _context13.abrupt("return", null);
904
925
  case 4:
905
926
  normalizedCustomerId = String(numericCustomerId);
906
927
  existingRequest = this.customerResolveRequests.get(normalizedCustomerId);
907
928
  if (!existingRequest) {
908
- _context12.next = 8;
929
+ _context13.next = 8;
909
930
  break;
910
931
  }
911
- return _context12.abrupt("return", existingRequest);
932
+ return _context13.abrupt("return", existingRequest);
912
933
  case 8:
913
934
  request = this.request.post("/customer/resolve/".concat(encodeURIComponent(normalizedCustomerId)), {
914
935
  with_franchisor_data: 1,
@@ -928,12 +949,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
928
949
  }
929
950
  });
930
951
  this.customerResolveRequests.set(normalizedCustomerId, request);
931
- return _context12.abrupt("return", request);
952
+ return _context13.abrupt("return", request);
932
953
  case 11:
933
954
  case "end":
934
- return _context12.stop();
955
+ return _context13.stop();
935
956
  }
936
- }, _callee12, this);
957
+ }, _callee13, this);
937
958
  }));
938
959
  function resolveCustomerById(_x7) {
939
960
  return _resolveCustomerById.apply(this, arguments);
@@ -985,60 +1006,60 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
985
1006
  }, {
986
1007
  key: "setBookingStatus",
987
1008
  value: (function () {
988
- var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(status) {
1009
+ var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(status) {
989
1010
  var _this$store$order2, _this$store$order2$ge;
990
1011
  var tempOrder, orderId, scheduleId, bookings, previous, _data, res;
991
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
992
- while (1) switch (_context13.prev = _context13.next) {
1012
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1013
+ while (1) switch (_context14.prev = _context14.next) {
993
1014
  case 0:
994
1015
  tempOrder = (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || (_this$store$order2$ge = _this$store$order2.getTempOrder) === null || _this$store$order2$ge === void 0 ? void 0 : _this$store$order2$ge.call(_this$store$order2);
995
1016
  if (tempOrder) {
996
- _context13.next = 3;
1017
+ _context14.next = 3;
997
1018
  break;
998
1019
  }
999
1020
  throw new Error('setBookingStatus: tempOrder 未加载');
1000
1021
  case 3:
1001
1022
  orderId = tempOrder.order_id;
1002
1023
  if (!(orderId === undefined || orderId === null)) {
1003
- _context13.next = 6;
1024
+ _context14.next = 6;
1004
1025
  break;
1005
1026
  }
1006
1027
  throw new Error('setBookingStatus: tempOrder.order_id 缺失');
1007
1028
  case 6:
1008
1029
  scheduleId = resolveScheduleId(tempOrder);
1009
1030
  if (!(scheduleId === null)) {
1010
- _context13.next = 9;
1031
+ _context14.next = 9;
1011
1032
  break;
1012
1033
  }
1013
1034
  throw new Error('setBookingStatus: 无法解析 schedule id(metadata 与 root booking 均缺失)');
1014
1035
  case 9:
1015
1036
  bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
1016
1037
  previous = applyBookingsStatus(bookings, status);
1017
- _context13.prev = 11;
1018
- _context13.next = 14;
1038
+ _context14.prev = 11;
1039
+ _context14.next = 14;
1019
1040
  return this.request.put("/schedule/booking/appointment-status/".concat(scheduleId), {
1020
1041
  appointment_status: status
1021
1042
  });
1022
1043
  case 14:
1023
- res = _context13.sent;
1024
- _context13.next = 17;
1044
+ res = _context14.sent;
1045
+ _context14.next = 17;
1025
1046
  return this.refreshSalesDetail();
1026
1047
  case 17:
1027
1048
  this.core.effects.emit("".concat(this.name, ":onBookingStatusChange"), {
1028
1049
  orderId: orderId,
1029
1050
  status: status
1030
1051
  });
1031
- return _context13.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
1052
+ return _context14.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
1032
1053
  case 21:
1033
- _context13.prev = 21;
1034
- _context13.t0 = _context13["catch"](11);
1054
+ _context14.prev = 21;
1055
+ _context14.t0 = _context14["catch"](11);
1035
1056
  restoreBookingsStatus(bookings, previous);
1036
- throw _context13.t0;
1057
+ throw _context14.t0;
1037
1058
  case 25:
1038
1059
  case "end":
1039
- return _context13.stop();
1060
+ return _context14.stop();
1040
1061
  }
1041
- }, _callee13, this, [[11, 21]]);
1062
+ }, _callee14, this, [[11, 21]]);
1042
1063
  }));
1043
1064
  function setBookingStatus(_x8) {
1044
1065
  return _setBookingStatus.apply(this, arguments);
@@ -1069,35 +1090,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1069
1090
  }, {
1070
1091
  key: "transitionChildBooking",
1071
1092
  value: (function () {
1072
- var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
1093
+ var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
1073
1094
  var _this$store$order3, _this$store$order3$ge;
1074
1095
  var schedule_event_id, action, tempOrder, orderId, bookings, targetStatus, previous, _data2, res;
1075
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1076
- while (1) switch (_context14.prev = _context14.next) {
1096
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1097
+ while (1) switch (_context15.prev = _context15.next) {
1077
1098
  case 0:
1078
1099
  schedule_event_id = params.schedule_event_id, action = params.action;
1079
1100
  if (!(schedule_event_id === undefined || schedule_event_id === null || schedule_event_id === '')) {
1080
- _context14.next = 3;
1101
+ _context15.next = 3;
1081
1102
  break;
1082
1103
  }
1083
1104
  throw new Error('transitionChildBooking: schedule_event_id 不能为空');
1084
1105
  case 3:
1085
1106
  if (action) {
1086
- _context14.next = 5;
1107
+ _context15.next = 5;
1087
1108
  break;
1088
1109
  }
1089
1110
  throw new Error('transitionChildBooking: action 不能为空');
1090
1111
  case 5:
1091
1112
  tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getTempOrder) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3);
1092
1113
  if (tempOrder) {
1093
- _context14.next = 8;
1114
+ _context15.next = 8;
1094
1115
  break;
1095
1116
  }
1096
1117
  throw new Error('transitionChildBooking: tempOrder 未加载');
1097
1118
  case 8:
1098
1119
  orderId = tempOrder.order_id;
1099
1120
  if (!(orderId === undefined || orderId === null)) {
1100
- _context14.next = 11;
1121
+ _context15.next = 11;
1101
1122
  break;
1102
1123
  }
1103
1124
  throw new Error('transitionChildBooking: tempOrder.order_id 缺失');
@@ -1105,14 +1126,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1105
1126
  bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
1106
1127
  targetStatus = resolveStatusAfterTransition(action);
1107
1128
  previous = targetStatus !== null ? applyChildBookingStatus(bookings, schedule_event_id, targetStatus) : undefined;
1108
- _context14.prev = 14;
1109
- _context14.next = 17;
1129
+ _context15.prev = 14;
1130
+ _context15.next = 17;
1110
1131
  return this.request.post("/schedule/booking-transition/".concat(schedule_event_id), {
1111
1132
  action: action
1112
1133
  });
1113
1134
  case 17:
1114
- res = _context14.sent;
1115
- _context14.next = 20;
1135
+ res = _context15.sent;
1136
+ _context15.next = 20;
1116
1137
  return this.refreshSalesDetail();
1117
1138
  case 20:
1118
1139
  this.core.effects.emit("".concat(this.name, ":onChildBookingStatusChange"), {
@@ -1121,19 +1142,19 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1121
1142
  action: action,
1122
1143
  status: targetStatus
1123
1144
  });
1124
- return _context14.abrupt("return", (_data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _data2 !== void 0 ? _data2 : res);
1145
+ return _context15.abrupt("return", (_data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _data2 !== void 0 ? _data2 : res);
1125
1146
  case 24:
1126
- _context14.prev = 24;
1127
- _context14.t0 = _context14["catch"](14);
1147
+ _context15.prev = 24;
1148
+ _context15.t0 = _context15["catch"](14);
1128
1149
  if (previous !== undefined) {
1129
1150
  restoreChildBookingStatus(bookings, schedule_event_id, previous);
1130
1151
  }
1131
- throw _context14.t0;
1152
+ throw _context15.t0;
1132
1153
  case 28:
1133
1154
  case "end":
1134
- return _context14.stop();
1155
+ return _context15.stop();
1135
1156
  }
1136
- }, _callee14, this, [[14, 24]]);
1157
+ }, _callee15, this, [[14, 24]]);
1137
1158
  }));
1138
1159
  function transitionChildBooking(_x9) {
1139
1160
  return _transitionChildBooking.apply(this, arguments);
@@ -1154,19 +1175,19 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1154
1175
  }, {
1155
1176
  key: "refreshSalesDetail",
1156
1177
  value: (function () {
1157
- var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
1178
+ var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1158
1179
  var _this$store$order4, _this$store$order4$ge;
1159
1180
  var params,
1160
1181
  tempOrder,
1161
1182
  orderId,
1162
- _args15 = arguments;
1163
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1164
- while (1) switch (_context15.prev = _context15.next) {
1183
+ _args16 = arguments;
1184
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1185
+ while (1) switch (_context16.prev = _context16.next) {
1165
1186
  case 0:
1166
- params = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
1187
+ params = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
1167
1188
  tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 || (_this$store$order4$ge = _this$store$order4.getTempOrder) === null || _this$store$order4$ge === void 0 ? void 0 : _this$store$order4$ge.call(_this$store$order4);
1168
1189
  if (tempOrder) {
1169
- _context15.next = 4;
1190
+ _context16.next = 4;
1170
1191
  break;
1171
1192
  }
1172
1193
  throw new Error('refreshSalesDetail: tempOrder 未加载');
@@ -1174,21 +1195,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1174
1195
  debugger;
1175
1196
  orderId = tempOrder.order_id || tempOrder.external_sale_number;
1176
1197
  if (!(orderId === undefined || orderId === null)) {
1177
- _context15.next = 8;
1198
+ _context16.next = 8;
1178
1199
  break;
1179
1200
  }
1180
- return _context15.abrupt("return", {});
1201
+ return _context16.abrupt("return", {});
1181
1202
  case 8:
1182
- return _context15.abrupt("return", this.loadSalesDetail({
1203
+ return _context16.abrupt("return", this.loadSalesDetail({
1183
1204
  orderId: orderId,
1184
1205
  // merge: true
1185
1206
  forceRemote: params.forceRemote
1186
1207
  }));
1187
1208
  case 9:
1188
1209
  case "end":
1189
- return _context15.stop();
1210
+ return _context16.stop();
1190
1211
  }
1191
- }, _callee15, this);
1212
+ }, _callee16, this);
1192
1213
  }));
1193
1214
  function refreshSalesDetail() {
1194
1215
  return _refreshSalesDetail.apply(this, arguments);
@@ -1204,7 +1225,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1204
1225
  }, {
1205
1226
  key: "loadProducts",
1206
1227
  value: (function () {
1207
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1228
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1208
1229
  var params,
1209
1230
  options,
1210
1231
  schedule_date,
@@ -1213,20 +1234,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1213
1234
  schedule_datetime,
1214
1235
  bookingDate,
1215
1236
  _result,
1216
- _args16 = arguments;
1217
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1218
- while (1) switch (_context16.prev = _context16.next) {
1237
+ _args17 = arguments;
1238
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1239
+ while (1) switch (_context17.prev = _context17.next) {
1219
1240
  case 0:
1220
- params = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
1221
- options = _args16.length > 1 ? _args16[1] : undefined;
1241
+ params = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
1242
+ options = _args17.length > 1 ? _args17[1] : undefined;
1222
1243
  schedule_date = params.schedule_date, customer_id = params.customer_id, menu_list_ids = params.menu_list_ids, schedule_datetime = params.schedule_datetime; // 优先写入 schedule_datetime(含时分),供加购 presetStartTime 与 TimeBar 对齐;
1223
1244
  // requiresDetail 弹窗仍通过 formatBookingDateForUI 只取日历日 YYYY-MM-DD。
1224
1245
  bookingDate = schedule_datetime || schedule_date || '';
1225
1246
  if (bookingDate) {
1226
1247
  this.setBookingDate(bookingDate);
1227
1248
  }
1228
- _context16.prev = 5;
1229
- _context16.next = 8;
1249
+ _context17.prev = 5;
1250
+ _context17.next = 8;
1230
1251
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
1231
1252
  with_count: ['bundleGroup', 'optionGroup'],
1232
1253
  with_schedule: 1
@@ -1234,20 +1255,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1234
1255
  cacheId: this.cacheId
1235
1256
  }), options);
1236
1257
  case 8:
1237
- _result = _context16.sent;
1258
+ _result = _context17.sent;
1238
1259
  this.productCatalog = Array.isArray(_result) ? _toConsumableArray(_result) : [];
1239
1260
  this.core.effects.emit("".concat(this.name, ":onProductsLoaded"), _result);
1240
- return _context16.abrupt("return", _result);
1261
+ return _context17.abrupt("return", _result);
1241
1262
  case 14:
1242
- _context16.prev = 14;
1243
- _context16.t0 = _context16["catch"](5);
1244
- console.error('Failed to load products:', _context16.t0);
1245
- throw _context16.t0;
1263
+ _context17.prev = 14;
1264
+ _context17.t0 = _context17["catch"](5);
1265
+ console.error('Failed to load products:', _context17.t0);
1266
+ throw _context17.t0;
1246
1267
  case 18:
1247
1268
  case "end":
1248
- return _context16.stop();
1269
+ return _context17.stop();
1249
1270
  }
1250
- }, _callee16, this, [[5, 14]]);
1271
+ }, _callee17, this, [[5, 14]]);
1251
1272
  }));
1252
1273
  function loadProducts() {
1253
1274
  return _loadProducts.apply(this, arguments);
@@ -1264,27 +1285,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1264
1285
  }, {
1265
1286
  key: "getAddTimeProducts",
1266
1287
  value: (function () {
1267
- var _getAddTimeProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1288
+ var _getAddTimeProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1268
1289
  var params,
1269
1290
  result,
1270
- _args17 = arguments;
1271
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1272
- while (1) switch (_context17.prev = _context17.next) {
1291
+ _args18 = arguments;
1292
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1293
+ while (1) switch (_context18.prev = _context18.next) {
1273
1294
  case 0:
1274
- params = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
1275
- _context17.next = 3;
1295
+ params = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
1296
+ _context18.next = 3;
1276
1297
  return this.store.products.getAddTimeProducts(_objectSpread(_objectSpread({}, params), {}, {
1277
1298
  cacheId: this.cacheId
1278
1299
  }));
1279
1300
  case 3:
1280
- result = _context17.sent;
1301
+ result = _context18.sent;
1281
1302
  this.addTimeProductsCatalog = Array.isArray(result) ? _toConsumableArray(result) : [];
1282
- return _context17.abrupt("return", result);
1303
+ return _context18.abrupt("return", result);
1283
1304
  case 6:
1284
1305
  case "end":
1285
- return _context17.stop();
1306
+ return _context18.stop();
1286
1307
  }
1287
- }, _callee17, this);
1308
+ }, _callee18, this);
1288
1309
  }));
1289
1310
  function getAddTimeProducts() {
1290
1311
  return _getAddTimeProducts.apply(this, arguments);
@@ -1309,14 +1330,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1309
1330
  }, {
1310
1331
  key: "queryProductDetail",
1311
1332
  value: (function () {
1312
- var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params, options) {
1333
+ var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params, options) {
1313
1334
  var product_id, queryParams, _result2, list;
1314
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1315
- while (1) switch (_context18.prev = _context18.next) {
1335
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1336
+ while (1) switch (_context19.prev = _context19.next) {
1316
1337
  case 0:
1317
1338
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded2);
1318
- _context18.prev = 1;
1319
- _context18.next = 4;
1339
+ _context19.prev = 1;
1340
+ _context19.next = 4;
1320
1341
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
1321
1342
  with_count: ['bundleGroup', 'optionGroup'],
1322
1343
  with_schedule: 1
@@ -1325,21 +1346,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1325
1346
  cacheId: this.cacheId
1326
1347
  }), options);
1327
1348
  case 4:
1328
- _result2 = _context18.sent;
1349
+ _result2 = _context19.sent;
1329
1350
  list = Array.isArray(_result2) ? _result2 : [];
1330
- return _context18.abrupt("return", list.find(function (product) {
1351
+ return _context19.abrupt("return", list.find(function (product) {
1331
1352
  return Number(product.id) === Number(product_id);
1332
1353
  }));
1333
1354
  case 9:
1334
- _context18.prev = 9;
1335
- _context18.t0 = _context18["catch"](1);
1336
- console.error('Failed to query product detail:', _context18.t0);
1337
- throw _context18.t0;
1355
+ _context19.prev = 9;
1356
+ _context19.t0 = _context19["catch"](1);
1357
+ console.error('Failed to query product detail:', _context19.t0);
1358
+ throw _context19.t0;
1338
1359
  case 13:
1339
1360
  case "end":
1340
- return _context18.stop();
1361
+ return _context19.stop();
1341
1362
  }
1342
- }, _callee18, this, [[1, 9]]);
1363
+ }, _callee19, this, [[1, 9]]);
1343
1364
  }));
1344
1365
  function queryProductDetail(_x10, _x11) {
1345
1366
  return _queryProductDetail.apply(this, arguments);
@@ -1354,26 +1375,26 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1354
1375
  }, {
1355
1376
  key: "loadProductDetail",
1356
1377
  value: (function () {
1357
- var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params, options) {
1378
+ var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params, options) {
1358
1379
  var product_id, queryParams, products;
1359
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1360
- while (1) switch (_context19.prev = _context19.next) {
1380
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1381
+ while (1) switch (_context20.prev = _context20.next) {
1361
1382
  case 0:
1362
1383
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded3);
1363
- _context19.next = 3;
1384
+ _context20.next = 3;
1364
1385
  return this.loadProducts(_objectSpread(_objectSpread({}, queryParams), {}, {
1365
1386
  product_ids: [product_id]
1366
1387
  }), options);
1367
1388
  case 3:
1368
- products = _context19.sent;
1369
- return _context19.abrupt("return", products.find(function (product) {
1389
+ products = _context20.sent;
1390
+ return _context20.abrupt("return", products.find(function (product) {
1370
1391
  return Number(product.id) === Number(product_id);
1371
1392
  }));
1372
1393
  case 5:
1373
1394
  case "end":
1374
- return _context19.stop();
1395
+ return _context20.stop();
1375
1396
  }
1376
- }, _callee19, this);
1397
+ }, _callee20, this);
1377
1398
  }));
1378
1399
  function loadProductDetail(_x12, _x13) {
1379
1400
  return _loadProductDetail.apply(this, arguments);
@@ -1408,16 +1429,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1408
1429
  }, {
1409
1430
  key: "getProducts",
1410
1431
  value: (function () {
1411
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1412
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1413
- while (1) switch (_context20.prev = _context20.next) {
1432
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1433
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1434
+ while (1) switch (_context21.prev = _context21.next) {
1414
1435
  case 0:
1415
- return _context20.abrupt("return", this.store.products.getProducts());
1436
+ return _context21.abrupt("return", this.store.products.getProducts());
1416
1437
  case 1:
1417
1438
  case "end":
1418
- return _context20.stop();
1439
+ return _context21.stop();
1419
1440
  }
1420
- }, _callee20, this);
1441
+ }, _callee21, this);
1421
1442
  }));
1422
1443
  function getProducts() {
1423
1444
  return _getProducts.apply(this, arguments);
@@ -1482,33 +1503,33 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1482
1503
  }, {
1483
1504
  key: "getProductByIds",
1484
1505
  value: (function () {
1485
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(ids, options) {
1506
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(ids, options) {
1486
1507
  var _this$getOrderCustome, _this$getOrderCustome2, _this$getOrderCustome3;
1487
1508
  var normalizedIds, localProducts, localProductIds, missingIds, rawBookingDate, bookingDate, customerId, loadedProducts, productById;
1488
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1489
- while (1) switch (_context21.prev = _context21.next) {
1509
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1510
+ while (1) switch (_context22.prev = _context22.next) {
1490
1511
  case 0:
1491
1512
  normalizedIds = Array.from(new Set((ids || []).map(function (id) {
1492
1513
  return Number(id);
1493
1514
  }).filter(function (id) {
1494
1515
  return Number.isFinite(id);
1495
1516
  })));
1496
- _context21.next = 3;
1517
+ _context22.next = 3;
1497
1518
  return this.store.products.getProductByIds(normalizedIds);
1498
1519
  case 3:
1499
- _context21.t0 = _context21.sent;
1500
- if (_context21.t0) {
1501
- _context21.next = 6;
1520
+ _context22.t0 = _context22.sent;
1521
+ if (_context22.t0) {
1522
+ _context22.next = 6;
1502
1523
  break;
1503
1524
  }
1504
- _context21.t0 = [];
1525
+ _context22.t0 = [];
1505
1526
  case 6:
1506
- localProducts = _context21.t0;
1527
+ localProducts = _context22.t0;
1507
1528
  if (options !== null && options !== void 0 && options.loadMissing) {
1508
- _context21.next = 9;
1529
+ _context22.next = 9;
1509
1530
  break;
1510
1531
  }
1511
- return _context21.abrupt("return", localProducts);
1532
+ return _context22.abrupt("return", localProducts);
1512
1533
  case 9:
1513
1534
  localProductIds = new Set(localProducts.map(function (product) {
1514
1535
  return Number(product.id);
@@ -1517,15 +1538,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1517
1538
  return !localProductIds.has(id);
1518
1539
  });
1519
1540
  if (missingIds.length) {
1520
- _context21.next = 13;
1541
+ _context22.next = 13;
1521
1542
  break;
1522
1543
  }
1523
- return _context21.abrupt("return", localProducts);
1544
+ return _context22.abrupt("return", localProducts);
1524
1545
  case 13:
1525
1546
  rawBookingDate = this.getBookingDate();
1526
1547
  bookingDate = rawBookingDate && dayjs(rawBookingDate).isValid() ? dayjs(rawBookingDate) : null;
1527
1548
  customerId = Number((_this$getOrderCustome = (_this$getOrderCustome2 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome2 === void 0 ? void 0 : _this$getOrderCustome2.id) !== null && _this$getOrderCustome !== void 0 ? _this$getOrderCustome : (_this$getOrderCustome3 = this.getOrderCustomer()) === null || _this$getOrderCustome3 === void 0 ? void 0 : _this$getOrderCustome3.customer_id);
1528
- _context21.next = 18;
1549
+ _context22.next = 18;
1529
1550
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
1530
1551
  product_ids: missingIds,
1531
1552
  with_count: ['bundleGroup', 'optionGroup'],
@@ -1538,7 +1559,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1538
1559
  customer_id: customerId
1539
1560
  } : {}));
1540
1561
  case 18:
1541
- loadedProducts = _context21.sent;
1562
+ loadedProducts = _context22.sent;
1542
1563
  productById = new Map();
1543
1564
  [].concat(_toConsumableArray(localProducts), _toConsumableArray(loadedProducts || [])).forEach(function (product) {
1544
1565
  var productId = Number(product.id);
@@ -1546,16 +1567,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1546
1567
  productById.set(productId, product);
1547
1568
  }
1548
1569
  });
1549
- return _context21.abrupt("return", normalizedIds.map(function (id) {
1570
+ return _context22.abrupt("return", normalizedIds.map(function (id) {
1550
1571
  return productById.get(id);
1551
1572
  }).filter(function (product) {
1552
1573
  return Boolean(product);
1553
1574
  }));
1554
1575
  case 22:
1555
1576
  case "end":
1556
- return _context21.stop();
1577
+ return _context22.stop();
1557
1578
  }
1558
- }, _callee21, this);
1579
+ }, _callee22, this);
1559
1580
  }));
1560
1581
  function getProductByIds(_x14, _x15) {
1561
1582
  return _getProductByIds.apply(this, arguments);
@@ -1571,25 +1592,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1571
1592
  }, {
1572
1593
  key: "getScheduleTimePoints",
1573
1594
  value: (function () {
1574
- var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
1595
+ var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
1575
1596
  var result;
1576
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1577
- while (1) switch (_context22.prev = _context22.next) {
1597
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1598
+ while (1) switch (_context23.prev = _context23.next) {
1578
1599
  case 0:
1579
- _context22.next = 2;
1600
+ _context23.next = 2;
1580
1601
  return this.request.post('/menu/schedule-time-points', {
1581
1602
  menu_list_ids: params.menu_list_ids
1582
1603
  }, {
1583
1604
  osServer: true
1584
1605
  });
1585
1606
  case 2:
1586
- result = _context22.sent;
1587
- return _context22.abrupt("return", result.data || []);
1607
+ result = _context23.sent;
1608
+ return _context23.abrupt("return", result.data || []);
1588
1609
  case 4:
1589
1610
  case "end":
1590
- return _context22.stop();
1611
+ return _context23.stop();
1591
1612
  }
1592
- }, _callee22, this);
1613
+ }, _callee23, this);
1593
1614
  }));
1594
1615
  function getScheduleTimePoints(_x16) {
1595
1616
  return _getScheduleTimePoints.apply(this, arguments);
@@ -1605,30 +1626,30 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1605
1626
  }, {
1606
1627
  key: "getCustomerList",
1607
1628
  value: (function () {
1608
- var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1629
+ var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1609
1630
  var params,
1610
1631
  _result3,
1611
- _args23 = arguments;
1612
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1613
- while (1) switch (_context23.prev = _context23.next) {
1632
+ _args24 = arguments;
1633
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1634
+ while (1) switch (_context24.prev = _context24.next) {
1614
1635
  case 0:
1615
- params = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
1616
- _context23.prev = 1;
1617
- _context23.next = 4;
1636
+ params = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
1637
+ _context24.prev = 1;
1638
+ _context24.next = 4;
1618
1639
  return this.store.customer.getCustomerList(params);
1619
1640
  case 4:
1620
- _result3 = _context23.sent;
1621
- return _context23.abrupt("return", _result3);
1641
+ _result3 = _context24.sent;
1642
+ return _context24.abrupt("return", _result3);
1622
1643
  case 8:
1623
- _context23.prev = 8;
1624
- _context23.t0 = _context23["catch"](1);
1625
- console.error('Failed to get customer list:', _context23.t0);
1626
- throw _context23.t0;
1644
+ _context24.prev = 8;
1645
+ _context24.t0 = _context24["catch"](1);
1646
+ console.error('Failed to get customer list:', _context24.t0);
1647
+ throw _context24.t0;
1627
1648
  case 12:
1628
1649
  case "end":
1629
- return _context23.stop();
1650
+ return _context24.stop();
1630
1651
  }
1631
- }, _callee23, this, [[1, 8]]);
1652
+ }, _callee24, this, [[1, 8]]);
1632
1653
  }));
1633
1654
  function getCustomerList() {
1634
1655
  return _getCustomerList.apply(this, arguments);
@@ -1738,7 +1759,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1738
1759
  var _this$store$order$get3,
1739
1760
  _this3 = this;
1740
1761
  if (!customer) {
1741
- this.clearOrderCustomer();
1762
+ this.clearOrderCustomer({
1763
+ preserveContactInfo: (options === null || options === void 0 ? void 0 : options.source) === 'detailHydrate'
1764
+ });
1742
1765
  return;
1743
1766
  }
1744
1767
  var previousCustomerId = (_this$store$order$get3 = this.store.order.getOrderCustomer()) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.customer_id;
@@ -1749,6 +1772,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1749
1772
  this.discountConfigCacheKey = null;
1750
1773
  this.hasManualDiscountSelection = false;
1751
1774
  }
1775
+ if (!customerUnchanged && (options === null || options === void 0 ? void 0 : options.source) !== 'detailHydrate') {
1776
+ this.store.order.updateTempOrderContactsInfo(cloneDeep(extractCustomerContactInfo(customer)));
1777
+ }
1752
1778
  this.store.order.setOrderCustomer(patch, customer);
1753
1779
  var snapshotAfterOrderSet = this.store.order.getOrderCustomerSnapshot();
1754
1780
  if (customerUnchanged) {
@@ -1806,10 +1832,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1806
1832
  */
1807
1833
  }, {
1808
1834
  key: "clearOrderCustomer",
1809
- value: function clearOrderCustomer() {
1835
+ value: function clearOrderCustomer(options) {
1810
1836
  var _discountModule$setOr,
1811
1837
  _discountModule$setDi,
1812
1838
  _this4 = this;
1839
+ if (!(options !== null && options !== void 0 && options.preserveContactInfo)) this.store.order.updateTempOrderContactsInfo(null);
1813
1840
  this.store.order.clearOrderCustomer();
1814
1841
  this.discountConfigCacheKey = null;
1815
1842
  this.hasManualDiscountSelection = false;
@@ -1848,24 +1875,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1848
1875
  }, {
1849
1876
  key: "restoreOrder",
1850
1877
  value: (function () {
1851
- var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1878
+ var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1852
1879
  var _this$store$customer;
1853
1880
  var tempOrder;
1854
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1855
- while (1) switch (_context24.prev = _context24.next) {
1881
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1882
+ while (1) switch (_context25.prev = _context25.next) {
1856
1883
  case 0:
1857
- _context24.next = 2;
1884
+ _context25.next = 2;
1858
1885
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "restoreOrder", this).call(this);
1859
1886
  case 2:
1860
- tempOrder = _context24.sent;
1887
+ tempOrder = _context25.sent;
1861
1888
  this.clearOrderCustomer();
1862
1889
  (_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.setSelectedCustomer(null);
1863
- return _context24.abrupt("return", tempOrder);
1890
+ return _context25.abrupt("return", tempOrder);
1864
1891
  case 6:
1865
1892
  case "end":
1866
- return _context24.stop();
1893
+ return _context25.stop();
1867
1894
  }
1868
- }, _callee24, this);
1895
+ }, _callee25, this);
1869
1896
  }));
1870
1897
  function restoreOrder() {
1871
1898
  return _restoreOrder.apply(this, arguments);
@@ -1900,27 +1927,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1900
1927
  return this.orderCustomerDiscountRefreshInFlight;
1901
1928
  }
1902
1929
  var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
1903
- var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1930
+ var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1904
1931
  var _this5$store$order$ge, _this5$store$order, _this5$getOrderIdenti;
1905
1932
  var currentCustomer, currentTempOrder, currentOrderIdentity, currentOrderId, currentAction, currentOrderTarget;
1906
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1907
- while (1) switch (_context25.prev = _context25.next) {
1933
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1934
+ while (1) switch (_context26.prev = _context26.next) {
1908
1935
  case 0:
1909
1936
  if (!previousRefresh) {
1910
- _context25.next = 3;
1937
+ _context26.next = 3;
1911
1938
  break;
1912
1939
  }
1913
- _context25.next = 3;
1940
+ _context26.next = 3;
1914
1941
  return previousRefresh.catch(function () {
1915
1942
  return undefined;
1916
1943
  });
1917
1944
  case 3:
1918
1945
  currentCustomer = _this5.store.order.getOrderCustomer();
1919
1946
  if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
1920
- _context25.next = 6;
1947
+ _context26.next = 6;
1921
1948
  break;
1922
1949
  }
1923
- return _context25.abrupt("return");
1950
+ return _context26.abrupt("return");
1924
1951
  case 6:
1925
1952
  currentTempOrder = (_this5$store$order$ge = (_this5$store$order = _this5.store.order).getTempOrder) === null || _this5$store$order$ge === void 0 ? void 0 : _this5$store$order$ge.call(_this5$store$order);
1926
1953
  currentOrderIdentity = (_this5$getOrderIdenti = _this5.getOrderIdentity) === null || _this5$getOrderIdenti === void 0 ? void 0 : _this5$getOrderIdenti.call(_this5);
@@ -1928,12 +1955,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1928
1955
  currentAction = !currentOrderId || String(currentOrderId).startsWith('local_order') ? 'create' : 'edit';
1929
1956
  currentOrderTarget = currentOrderId ? "order:".concat(String(currentOrderId)) : "external:".concat(String((currentTempOrder === null || currentTempOrder === void 0 ? void 0 : currentTempOrder.external_sale_number) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.externalSaleNumber) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.localId) || 'new'));
1930
1957
  if (!("".concat(customerId, ":").concat(currentAction, ":").concat(currentOrderTarget) !== refreshTarget)) {
1931
- _context25.next = 13;
1958
+ _context26.next = 13;
1932
1959
  break;
1933
1960
  }
1934
- return _context25.abrupt("return");
1961
+ return _context26.abrupt("return");
1935
1962
  case 13:
1936
- _context25.next = 15;
1963
+ _context26.next = 15;
1937
1964
  return _this5.loadDiscountConfig({
1938
1965
  customerId: customerId,
1939
1966
  action: action,
@@ -1941,9 +1968,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1941
1968
  });
1942
1969
  case 15:
1943
1970
  case "end":
1944
- return _context25.stop();
1971
+ return _context26.stop();
1945
1972
  }
1946
- }, _callee25);
1973
+ }, _callee26);
1947
1974
  }))();
1948
1975
  this.orderCustomerDiscountRefreshInFlight = refreshTask;
1949
1976
  this.orderCustomerDiscountRefreshCustomerId = customerId;
@@ -1966,28 +1993,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1966
1993
  }, {
1967
1994
  key: "prepareProductPriceQueryContext",
1968
1995
  value: function () {
1969
- var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(customerId) {
1996
+ var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(customerId) {
1970
1997
  var normalizedCustomerId, refreshTask, shouldWait;
1971
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1972
- while (1) switch (_context26.prev = _context26.next) {
1998
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1999
+ while (1) switch (_context27.prev = _context27.next) {
1973
2000
  case 0:
1974
- _context26.next = 2;
2001
+ _context27.next = 2;
1975
2002
  return Promise.resolve();
1976
2003
  case 2:
1977
2004
  normalizedCustomerId = Number(customerId || 0);
1978
2005
  refreshTask = this.orderCustomerDiscountRefreshInFlight;
1979
2006
  shouldWait = normalizedCustomerId > 1 && this.orderCustomerDiscountRefreshCustomerId === normalizedCustomerId && Boolean(refreshTask);
1980
2007
  if (!(shouldWait && refreshTask)) {
1981
- _context26.next = 8;
2008
+ _context27.next = 8;
1982
2009
  break;
1983
2010
  }
1984
- _context26.next = 8;
2011
+ _context27.next = 8;
1985
2012
  return refreshTask;
1986
2013
  case 8:
1987
2014
  case "end":
1988
- return _context26.stop();
2015
+ return _context27.stop();
1989
2016
  }
1990
- }, _callee26, this);
2017
+ }, _callee27, this);
1991
2018
  }));
1992
2019
  function prepareProductPriceQueryContext(_x17) {
1993
2020
  return _prepareProductPriceQueryContext.apply(this, arguments);
@@ -2042,27 +2069,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2042
2069
  }, {
2043
2070
  key: "changeCustomerPage",
2044
2071
  value: (function () {
2045
- var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(page, pageSize) {
2072
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(page, pageSize) {
2046
2073
  var _result4;
2047
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2048
- while (1) switch (_context27.prev = _context27.next) {
2074
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2075
+ while (1) switch (_context28.prev = _context28.next) {
2049
2076
  case 0:
2050
- _context27.prev = 0;
2051
- _context27.next = 3;
2077
+ _context28.prev = 0;
2078
+ _context28.next = 3;
2052
2079
  return this.store.customer.changeCustomerPage(page, pageSize);
2053
2080
  case 3:
2054
- _result4 = _context27.sent;
2055
- return _context27.abrupt("return", _result4);
2081
+ _result4 = _context28.sent;
2082
+ return _context28.abrupt("return", _result4);
2056
2083
  case 7:
2057
- _context27.prev = 7;
2058
- _context27.t0 = _context27["catch"](0);
2059
- console.error('Failed to change customer page:', _context27.t0);
2060
- throw _context27.t0;
2084
+ _context28.prev = 7;
2085
+ _context28.t0 = _context28["catch"](0);
2086
+ console.error('Failed to change customer page:', _context28.t0);
2087
+ throw _context28.t0;
2061
2088
  case 11:
2062
2089
  case "end":
2063
- return _context27.stop();
2090
+ return _context28.stop();
2064
2091
  }
2065
- }, _callee27, this, [[0, 7]]);
2092
+ }, _callee28, this, [[0, 7]]);
2066
2093
  }));
2067
2094
  function changeCustomerPage(_x18, _x19) {
2068
2095
  return _changeCustomerPage.apply(this, arguments);
@@ -2077,28 +2104,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2077
2104
  }, {
2078
2105
  key: "loadMoreCustomers",
2079
2106
  value: (function () {
2080
- var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2107
+ var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2081
2108
  var _result5;
2082
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2083
- while (1) switch (_context28.prev = _context28.next) {
2109
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2110
+ while (1) switch (_context29.prev = _context29.next) {
2084
2111
  case 0:
2085
- _context28.prev = 0;
2086
- _context28.next = 3;
2112
+ _context29.prev = 0;
2113
+ _context29.next = 3;
2087
2114
  return this.store.customer.loadMoreCustomers();
2088
2115
  case 3:
2089
- _result5 = _context28.sent;
2116
+ _result5 = _context29.sent;
2090
2117
  this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
2091
- return _context28.abrupt("return", _result5);
2118
+ return _context29.abrupt("return", _result5);
2092
2119
  case 8:
2093
- _context28.prev = 8;
2094
- _context28.t0 = _context28["catch"](0);
2095
- console.error('Failed to load more customers:', _context28.t0);
2096
- throw _context28.t0;
2120
+ _context29.prev = 8;
2121
+ _context29.t0 = _context29["catch"](0);
2122
+ console.error('Failed to load more customers:', _context29.t0);
2123
+ throw _context29.t0;
2097
2124
  case 12:
2098
2125
  case "end":
2099
- return _context28.stop();
2126
+ return _context29.stop();
2100
2127
  }
2101
- }, _callee28, this, [[0, 8]]);
2128
+ }, _callee29, this, [[0, 8]]);
2102
2129
  }));
2103
2130
  function loadMoreCustomers() {
2104
2131
  return _loadMoreCustomers.apply(this, arguments);
@@ -2114,31 +2141,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2114
2141
  }, {
2115
2142
  key: "resetAndLoadCustomers",
2116
2143
  value: (function () {
2117
- var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2144
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2118
2145
  var params,
2119
2146
  _result6,
2120
- _args29 = arguments;
2121
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2122
- while (1) switch (_context29.prev = _context29.next) {
2147
+ _args30 = arguments;
2148
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2149
+ while (1) switch (_context30.prev = _context30.next) {
2123
2150
  case 0:
2124
- params = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
2125
- _context29.prev = 1;
2126
- _context29.next = 4;
2151
+ params = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {};
2152
+ _context30.prev = 1;
2153
+ _context30.next = 4;
2127
2154
  return this.store.customer.resetAndLoadCustomers(params);
2128
2155
  case 4:
2129
- _result6 = _context29.sent;
2156
+ _result6 = _context30.sent;
2130
2157
  this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
2131
- return _context29.abrupt("return", _result6);
2158
+ return _context30.abrupt("return", _result6);
2132
2159
  case 9:
2133
- _context29.prev = 9;
2134
- _context29.t0 = _context29["catch"](1);
2135
- console.error('Failed to reset and load customers:', _context29.t0);
2136
- throw _context29.t0;
2160
+ _context30.prev = 9;
2161
+ _context30.t0 = _context30["catch"](1);
2162
+ console.error('Failed to reset and load customers:', _context30.t0);
2163
+ throw _context30.t0;
2137
2164
  case 13:
2138
2165
  case "end":
2139
- return _context29.stop();
2166
+ return _context30.stop();
2140
2167
  }
2141
- }, _callee29, this, [[1, 9]]);
2168
+ }, _callee30, this, [[1, 9]]);
2142
2169
  }));
2143
2170
  function resetAndLoadCustomers() {
2144
2171
  return _resetAndLoadCustomers.apply(this, arguments);
@@ -2299,16 +2326,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2299
2326
  }, {
2300
2327
  key: "getOtherParams",
2301
2328
  value: (function () {
2302
- var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2303
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2304
- while (1) switch (_context30.prev = _context30.next) {
2329
+ var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
2330
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2331
+ while (1) switch (_context31.prev = _context31.next) {
2305
2332
  case 0:
2306
- return _context30.abrupt("return", this.otherParams);
2333
+ return _context31.abrupt("return", this.otherParams);
2307
2334
  case 1:
2308
2335
  case "end":
2309
- return _context30.stop();
2336
+ return _context31.stop();
2310
2337
  }
2311
- }, _callee30, this);
2338
+ }, _callee31, this);
2312
2339
  }));
2313
2340
  function getOtherParams() {
2314
2341
  return _getOtherParams.apply(this, arguments);
@@ -2632,16 +2659,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2632
2659
  }, {
2633
2660
  key: "updateProductInOrder",
2634
2661
  value: (function () {
2635
- var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
2636
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2637
- while (1) switch (_context31.prev = _context31.next) {
2662
+ var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
2663
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2664
+ while (1) switch (_context32.prev = _context32.next) {
2638
2665
  case 0:
2639
- return _context31.abrupt("return", this.updateOrderProduct(params));
2666
+ return _context32.abrupt("return", this.updateOrderProduct(params));
2640
2667
  case 1:
2641
2668
  case "end":
2642
- return _context31.stop();
2669
+ return _context32.stop();
2643
2670
  }
2644
- }, _callee31, this);
2671
+ }, _callee32, this);
2645
2672
  }));
2646
2673
  function updateProductInOrder(_x20) {
2647
2674
  return _updateProductInOrder.apply(this, arguments);
@@ -2665,24 +2692,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2665
2692
  }, {
2666
2693
  key: "handleGlobalScanCode",
2667
2694
  value: (function () {
2668
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(code, bridge) {
2695
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(code, bridge) {
2669
2696
  var _this7 = this;
2670
2697
  var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, _promotion$isAccepted, promotion, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
2671
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2672
- while (1) switch (_context32.prev = _context32.next) {
2698
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2699
+ while (1) switch (_context33.prev = _context33.next) {
2673
2700
  case 0:
2674
2701
  trimmed = typeof code === 'string' ? code.trim() : '';
2675
2702
  if (trimmed) {
2676
- _context32.next = 4;
2703
+ _context33.next = 4;
2677
2704
  break;
2678
2705
  }
2679
2706
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2680
- return _context32.abrupt("return", {
2707
+ return _context33.abrupt("return", {
2681
2708
  status: 'failed',
2682
2709
  reason: 'empty_code'
2683
2710
  });
2684
2711
  case 4:
2685
- _context32.prev = 4;
2712
+ _context33.prev = 4;
2686
2713
  // Capture before lookup/UI awaits, so a result cannot land in a new cart.
2687
2714
  // Unscoped POS Order modules return a no-op guard.
2688
2715
  beforeScanCommit = this.store.order.createCartIntentCommitGuard('add_product');
@@ -2709,23 +2736,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2709
2736
  } : undefined
2710
2737
  }) : undefined;
2711
2738
  if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
2712
- _context32.next = 16;
2739
+ _context33.next = 16;
2713
2740
  break;
2714
2741
  }
2715
2742
  if (guardedBridge.applyPromotionCode) {
2716
- _context32.next = 12;
2743
+ _context33.next = 12;
2717
2744
  break;
2718
2745
  }
2719
- return _context32.abrupt("return", {
2746
+ return _context33.abrupt("return", {
2720
2747
  status: 'failed',
2721
2748
  reason: 'no_bridge'
2722
2749
  });
2723
2750
  case 12:
2724
- _context32.next = 14;
2751
+ _context33.next = 14;
2725
2752
  return guardedBridge.applyPromotionCode(trimmed);
2726
2753
  case 14:
2727
- promotion = _context32.sent;
2728
- return _context32.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
2754
+ promotion = _context33.sent;
2755
+ return _context33.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
2729
2756
  status: 'success',
2730
2757
  kind: 'promotion'
2731
2758
  } : {
@@ -2737,25 +2764,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2737
2764
  return _this7.store.products.findProductsByCodeOrBarcode(v);
2738
2765
  };
2739
2766
  scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
2740
- _context32.next = 20;
2767
+ _context33.next = 20;
2741
2768
  return scanCallback({
2742
2769
  type: 'nativeScanner',
2743
2770
  value: trimmed
2744
2771
  });
2745
2772
  case 20:
2746
- raw = _context32.sent;
2773
+ raw = _context33.sent;
2747
2774
  formatted = formatGlobalScanResult(raw, trimmed);
2748
2775
  if (formatted) {
2749
- _context32.next = 25;
2776
+ _context33.next = 25;
2750
2777
  break;
2751
2778
  }
2752
2779
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2753
- return _context32.abrupt("return", {
2780
+ return _context33.abrupt("return", {
2754
2781
  status: 'failed',
2755
2782
  reason: 'not_found'
2756
2783
  });
2757
2784
  case 25:
2758
- _context32.next = 27;
2785
+ _context33.next = 27;
2759
2786
  return applyGlobalScan({
2760
2787
  setOrderCustomer: function setOrderCustomer(customer) {
2761
2788
  beforeScanCommit();
@@ -2796,23 +2823,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2796
2823
  }
2797
2824
  }, formatted, guardedBridge);
2798
2825
  case 27:
2799
- _result7 = _context32.sent;
2826
+ _result7 = _context33.sent;
2800
2827
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
2801
- return _context32.abrupt("return", _result7);
2828
+ return _context33.abrupt("return", _result7);
2802
2829
  case 32:
2803
- _context32.prev = 32;
2804
- _context32.t0 = _context32["catch"](4);
2805
- console.error('[BookingTicket] handleGlobalScanCode failed', _context32.t0);
2830
+ _context33.prev = 32;
2831
+ _context33.t0 = _context33["catch"](4);
2832
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context33.t0);
2806
2833
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2807
- return _context32.abrupt("return", {
2834
+ return _context33.abrupt("return", {
2808
2835
  status: 'failed',
2809
2836
  reason: 'not_found'
2810
2837
  });
2811
2838
  case 37:
2812
2839
  case "end":
2813
- return _context32.stop();
2840
+ return _context33.stop();
2814
2841
  }
2815
- }, _callee32, this, [[4, 32]]);
2842
+ }, _callee33, this, [[4, 32]]);
2816
2843
  }));
2817
2844
  function handleGlobalScanCode(_x21, _x22) {
2818
2845
  return _handleGlobalScanCode.apply(this, arguments);
@@ -2822,37 +2849,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2822
2849
  }, {
2823
2850
  key: "getGlobalScanCodeType",
2824
2851
  value: (function () {
2825
- var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(code) {
2852
+ var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(code) {
2826
2853
  var _this8 = this,
2827
2854
  _formatGlobalScanResu,
2828
2855
  _formatGlobalScanResu2;
2829
2856
  var trimmed, scan, raw;
2830
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2831
- while (1) switch (_context33.prev = _context33.next) {
2857
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2858
+ while (1) switch (_context34.prev = _context34.next) {
2832
2859
  case 0:
2833
2860
  trimmed = typeof code === 'string' ? code.trim() : '';
2834
2861
  if (trimmed) {
2835
- _context33.next = 3;
2862
+ _context34.next = 3;
2836
2863
  break;
2837
2864
  }
2838
- return _context33.abrupt("return", null);
2865
+ return _context34.abrupt("return", null);
2839
2866
  case 3:
2840
2867
  scan = handleGlobalScan(this.request, function (value) {
2841
2868
  return _this8.store.products.findProductsByCodeOrBarcode(value);
2842
2869
  }, this.getSubmitOrderSalesChannel());
2843
- _context33.next = 6;
2870
+ _context34.next = 6;
2844
2871
  return scan({
2845
2872
  type: 'nativeScanner',
2846
2873
  value: trimmed
2847
2874
  });
2848
2875
  case 6:
2849
- raw = _context33.sent;
2850
- return _context33.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
2876
+ raw = _context34.sent;
2877
+ return _context34.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
2851
2878
  case 8:
2852
2879
  case "end":
2853
- return _context33.stop();
2880
+ return _context34.stop();
2854
2881
  }
2855
- }, _callee33, this);
2882
+ }, _callee34, this);
2856
2883
  }));
2857
2884
  function getGlobalScanCodeType(_x23) {
2858
2885
  return _getGlobalScanCodeType.apply(this, arguments);
@@ -2936,11 +2963,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2936
2963
  }, {
2937
2964
  key: "addAddTimeProductToBooking",
2938
2965
  value: (function () {
2939
- var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(input) {
2940
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2941
- while (1) switch (_context34.prev = _context34.next) {
2966
+ var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(input) {
2967
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
2968
+ while (1) switch (_context35.prev = _context35.next) {
2942
2969
  case 0:
2943
- return _context34.abrupt("return", this.addAddTimeProductsToBooking({
2970
+ return _context35.abrupt("return", this.addAddTimeProductsToBooking({
2944
2971
  booking: input.booking,
2945
2972
  products: [input],
2946
2973
  coveredMinutes: input.coveredMinutes,
@@ -2948,9 +2975,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2948
2975
  }));
2949
2976
  case 1:
2950
2977
  case "end":
2951
- return _context34.stop();
2978
+ return _context35.stop();
2952
2979
  }
2953
- }, _callee34, this);
2980
+ }, _callee35, this);
2954
2981
  }));
2955
2982
  function addAddTimeProductToBooking(_x24) {
2956
2983
  return _addAddTimeProductToBooking.apply(this, arguments);
@@ -2970,16 +2997,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2970
2997
  }, {
2971
2998
  key: "addAddTimeProductsToBooking",
2972
2999
  value: (function () {
2973
- var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(input) {
3000
+ var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(input) {
2974
3001
  var _this9 = this,
2975
3002
  _input$bookingPatch;
2976
3003
  var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
2977
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
2978
- while (1) switch (_context35.prev = _context35.next) {
3004
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
3005
+ while (1) switch (_context36.prev = _context36.next) {
2979
3006
  case 0:
2980
3007
  bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
2981
3008
  if (bookingUid) {
2982
- _context35.next = 3;
3009
+ _context36.next = 3;
2983
3010
  break;
2984
3011
  }
2985
3012
  throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
@@ -2990,7 +3017,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2990
3017
  };
2991
3018
  });
2992
3019
  if (this.store.order) {
2993
- _context35.next = 6;
3020
+ _context36.next = 6;
2994
3021
  break;
2995
3022
  }
2996
3023
  throw new Error('order 模块未初始化');
@@ -3004,53 +3031,53 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3004
3031
  });
3005
3032
  }
3006
3033
  if (!(typeof this.store.order.addProductsToOrder === 'function')) {
3007
- _context35.next = 11;
3034
+ _context36.next = 11;
3008
3035
  break;
3009
3036
  }
3010
- return _context35.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3037
+ return _context36.abrupt("return", this.store.order.addProductsToOrder(orderLines));
3011
3038
  case 11:
3012
3039
  result = [];
3013
3040
  _iterator2 = _createForOfIteratorHelper(orderLines);
3014
- _context35.prev = 13;
3041
+ _context36.prev = 13;
3015
3042
  _iterator2.s();
3016
3043
  case 15:
3017
3044
  if ((_step2 = _iterator2.n()).done) {
3018
- _context35.next = 29;
3045
+ _context36.next = 29;
3019
3046
  break;
3020
3047
  }
3021
3048
  line = _step2.value;
3022
- _context35.t0 = result.splice;
3023
- _context35.t1 = result;
3024
- _context35.t2 = [0, result.length];
3025
- _context35.t3 = _toConsumableArray;
3026
- _context35.next = 23;
3049
+ _context36.t0 = result.splice;
3050
+ _context36.t1 = result;
3051
+ _context36.t2 = [0, result.length];
3052
+ _context36.t3 = _toConsumableArray;
3053
+ _context36.next = 23;
3027
3054
  return this.addProductToOrder(line.product);
3028
3055
  case 23:
3029
- _context35.t4 = _context35.sent;
3030
- _context35.t5 = (0, _context35.t3)(_context35.t4);
3031
- _context35.t6 = _context35.t2.concat.call(_context35.t2, _context35.t5);
3032
- _context35.t0.apply.call(_context35.t0, _context35.t1, _context35.t6);
3056
+ _context36.t4 = _context36.sent;
3057
+ _context36.t5 = (0, _context36.t3)(_context36.t4);
3058
+ _context36.t6 = _context36.t2.concat.call(_context36.t2, _context36.t5);
3059
+ _context36.t0.apply.call(_context36.t0, _context36.t1, _context36.t6);
3033
3060
  case 27:
3034
- _context35.next = 15;
3061
+ _context36.next = 15;
3035
3062
  break;
3036
3063
  case 29:
3037
- _context35.next = 34;
3064
+ _context36.next = 34;
3038
3065
  break;
3039
3066
  case 31:
3040
- _context35.prev = 31;
3041
- _context35.t7 = _context35["catch"](13);
3042
- _iterator2.e(_context35.t7);
3067
+ _context36.prev = 31;
3068
+ _context36.t7 = _context36["catch"](13);
3069
+ _iterator2.e(_context36.t7);
3043
3070
  case 34:
3044
- _context35.prev = 34;
3071
+ _context36.prev = 34;
3045
3072
  _iterator2.f();
3046
- return _context35.finish(34);
3073
+ return _context36.finish(34);
3047
3074
  case 37:
3048
- return _context35.abrupt("return", result);
3075
+ return _context36.abrupt("return", result);
3049
3076
  case 38:
3050
3077
  case "end":
3051
- return _context35.stop();
3078
+ return _context36.stop();
3052
3079
  }
3053
- }, _callee35, this, [[13, 31, 34, 37]]);
3080
+ }, _callee36, this, [[13, 31, 34, 37]]);
3054
3081
  }));
3055
3082
  function addAddTimeProductsToBooking(_x25) {
3056
3083
  return _addAddTimeProductsToBooking.apply(this, arguments);
@@ -3060,40 +3087,40 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3060
3087
  }, {
3061
3088
  key: "setOtherParams",
3062
3089
  value: function () {
3063
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(params) {
3090
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(params) {
3064
3091
  var _ref19,
3065
3092
  _ref19$cover,
3066
3093
  cover,
3067
3094
  invoiceContextChanged,
3068
- _args36 = arguments;
3069
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
3070
- while (1) switch (_context36.prev = _context36.next) {
3095
+ _args37 = arguments;
3096
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3097
+ while (1) switch (_context37.prev = _context37.next) {
3071
3098
  case 0:
3072
- _ref19 = _args36.length > 1 && _args36[1] !== undefined ? _args36[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
3073
- _context36.next = 3;
3099
+ _ref19 = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
3100
+ _context37.next = 3;
3074
3101
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
3075
3102
  cover: cover
3076
3103
  });
3077
3104
  case 3:
3078
3105
  invoiceContextChanged = (params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || (params === null || params === void 0 ? void 0 : params.channel) !== undefined || (params === null || params === void 0 ? void 0 : params.platform) !== undefined || Object.prototype.hasOwnProperty.call(params, 'openData');
3079
3106
  if (!invoiceContextChanged) {
3080
- _context36.next = 7;
3107
+ _context37.next = 7;
3081
3108
  break;
3082
3109
  }
3083
- _context36.next = 7;
3110
+ _context37.next = 7;
3084
3111
  return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
3085
3112
  case 7:
3086
3113
  if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
3087
- _context36.next = 10;
3114
+ _context37.next = 10;
3088
3115
  break;
3089
3116
  }
3090
- _context36.next = 10;
3117
+ _context37.next = 10;
3091
3118
  return this.configureIdGeneratorFromOpenData();
3092
3119
  case 10:
3093
3120
  case "end":
3094
- return _context36.stop();
3121
+ return _context37.stop();
3095
3122
  }
3096
- }, _callee36, this);
3123
+ }, _callee37, this);
3097
3124
  }));
3098
3125
  function setOtherParams(_x26) {
3099
3126
  return _setOtherParams.apply(this, arguments);
@@ -3112,15 +3139,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3112
3139
  }, {
3113
3140
  key: "handlePrintWristband",
3114
3141
  value: function () {
3115
- var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(params) {
3142
+ var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(params) {
3116
3143
  var _this$getOrderIdentit2;
3117
3144
  var deviceTask, deviceId, idempotencyKey;
3118
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3119
- while (1) switch (_context37.prev = _context37.next) {
3145
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3146
+ while (1) switch (_context38.prev = _context38.next) {
3120
3147
  case 0:
3121
3148
  deviceTask = this.getDeviceTaskPlugin();
3122
3149
  if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
3123
- _context37.next = 4;
3150
+ _context38.next = 4;
3124
3151
  break;
3125
3152
  }
3126
3153
  this.logger.addLog({
@@ -3130,7 +3157,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3130
3157
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3131
3158
  }
3132
3159
  });
3133
- return _context37.abrupt("return");
3160
+ return _context38.abrupt("return");
3134
3161
  case 4:
3135
3162
  this.logger.addLog({
3136
3163
  type: 'info',
@@ -3139,10 +3166,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3139
3166
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3140
3167
  }
3141
3168
  });
3142
- _context37.next = 7;
3169
+ _context38.next = 7;
3143
3170
  return this.getShortNumberOrDeviceId();
3144
3171
  case 7:
3145
- deviceId = _context37.sent;
3172
+ deviceId = _context38.sent;
3146
3173
  idempotencyKey = createUuidV4();
3147
3174
  deviceTask.dispatch({
3148
3175
  action: 'print_all',
@@ -3162,9 +3189,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3162
3189
  });
3163
3190
  case 10:
3164
3191
  case "end":
3165
- return _context37.stop();
3192
+ return _context38.stop();
3166
3193
  }
3167
- }, _callee37, this);
3194
+ }, _callee38, this);
3168
3195
  }));
3169
3196
  function handlePrintWristband(_x27) {
3170
3197
  return _handlePrintWristband.apply(this, arguments);
@@ -3174,11 +3201,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3174
3201
  }, {
3175
3202
  key: "handleRedeem",
3176
3203
  value: function () {
3177
- var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(params) {
3204
+ var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(params) {
3178
3205
  var _this$store$order8, _this$store$order8$ge, _this$store$order9, _ref20, _tempOrder$order_id2;
3179
3206
  var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
3180
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3181
- while (1) switch (_context38.prev = _context38.next) {
3207
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3208
+ while (1) switch (_context39.prev = _context39.next) {
3182
3209
  case 0:
3183
3210
  voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
3184
3211
  status = params.is_checkin ? 'used' : 'unused';
@@ -3202,20 +3229,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3202
3229
  });
3203
3230
  });
3204
3231
  if (!(tempOrder && hasUpdatedVoucher)) {
3205
- _context38.next = 11;
3232
+ _context39.next = 11;
3206
3233
  break;
3207
3234
  }
3208
- _context38.next = 11;
3235
+ _context39.next = 11;
3209
3236
  return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
3210
3237
  vouchers: nextVouchers
3211
3238
  }));
3212
3239
  case 11:
3213
3240
  this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
3214
3241
  if (!(voucherIds.length === 0)) {
3215
- _context38.next = 14;
3242
+ _context39.next = 14;
3216
3243
  break;
3217
3244
  }
3218
- return _context38.abrupt("return", {
3245
+ return _context39.abrupt("return", {
3219
3246
  code: 200,
3220
3247
  status: true,
3221
3248
  message: '',
@@ -3226,7 +3253,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3226
3253
  externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
3227
3254
  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;
3228
3255
  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;
3229
- return _context38.abrupt("return", this.request.post('/machinecode/batch', {
3256
+ return _context39.abrupt("return", this.request.post('/machinecode/batch', {
3230
3257
  ids: voucherIds,
3231
3258
  status: status,
3232
3259
  order_lookup: orderLookup,
@@ -3237,9 +3264,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3237
3264
  }));
3238
3265
  case 19:
3239
3266
  case "end":
3240
- return _context38.stop();
3267
+ return _context39.stop();
3241
3268
  }
3242
- }, _callee38, this);
3269
+ }, _callee39, this);
3243
3270
  }));
3244
3271
  function handleRedeem(_x28) {
3245
3272
  return _handleRedeem.apply(this, arguments);
@@ -3253,12 +3280,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3253
3280
  }, {
3254
3281
  key: "destroy",
3255
3282
  value: (function () {
3256
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3283
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3257
3284
  var _this$scan;
3258
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3259
- while (1) switch (_context39.prev = _context39.next) {
3285
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3286
+ while (1) switch (_context40.prev = _context40.next) {
3260
3287
  case 0:
3261
- _context39.next = 2;
3288
+ _context40.next = 2;
3262
3289
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
3263
3290
  case 2:
3264
3291
  try {
@@ -3269,9 +3296,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3269
3296
  scanCache.clear();
3270
3297
  case 4:
3271
3298
  case "end":
3272
- return _context39.stop();
3299
+ return _context40.stop();
3273
3300
  }
3274
- }, _callee39, this);
3301
+ }, _callee40, this);
3275
3302
  }));
3276
3303
  function destroy() {
3277
3304
  return _destroy.apply(this, arguments);