@pisell/pisellos 2.2.207 → 2.2.208

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.
@@ -234,53 +234,92 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
234
234
  return loadOpenDataConfig;
235
235
  }()
236
236
  }, {
237
- key: "configureIdGeneratorFromOpenData",
237
+ key: "getShortNumberOrDeviceId",
238
238
  value: function () {
239
- var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
240
- var openDataConfig, idGenerator, receiptSequenceLength, receiptSequenceStart, prefix, resetReceiptSequenceDaily, operatingDayBoundary;
239
+ var _getShortNumberOrDeviceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
240
+ var getAsyncIotDeviceInfo, res;
241
241
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
242
242
  while (1) switch (_context3.prev = _context3.next) {
243
243
  case 0:
244
- openDataConfig = null;
245
- _context3.prev = 1;
244
+ getAsyncIotDeviceInfo = this.getAppData('async_iot_device_info');
245
+ if (!getAsyncIotDeviceInfo) {
246
+ _context3.next = 7;
247
+ break;
248
+ }
246
249
  _context3.next = 4;
250
+ return getAsyncIotDeviceInfo === null || getAsyncIotDeviceInfo === void 0 ? void 0 : getAsyncIotDeviceInfo();
251
+ case 4:
252
+ res = _context3.sent;
253
+ if (!res.short_number) {
254
+ _context3.next = 7;
255
+ break;
256
+ }
257
+ return _context3.abrupt("return", res.short_number);
258
+ case 7:
259
+ return _context3.abrupt("return", this.getAppData('device_id') || 0);
260
+ case 8:
261
+ case "end":
262
+ return _context3.stop();
263
+ }
264
+ }, _callee3, this);
265
+ }));
266
+ function getShortNumberOrDeviceId() {
267
+ return _getShortNumberOrDeviceId.apply(this, arguments);
268
+ }
269
+ return getShortNumberOrDeviceId;
270
+ }()
271
+ }, {
272
+ key: "configureIdGeneratorFromOpenData",
273
+ value: function () {
274
+ var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
275
+ var openDataConfig, idGenerator, receiptSequenceLength, receiptSequenceStart, prefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId;
276
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
277
+ while (1) switch (_context4.prev = _context4.next) {
278
+ case 0:
279
+ openDataConfig = null;
280
+ _context4.prev = 1;
281
+ _context4.next = 4;
247
282
  return this.loadOpenDataConfig();
248
283
  case 4:
249
- openDataConfig = _context3.sent;
250
- _context3.next = 11;
284
+ openDataConfig = _context4.sent;
285
+ _context4.next = 11;
251
286
  break;
252
287
  case 7:
253
- _context3.prev = 7;
254
- _context3.t0 = _context3["catch"](1);
255
- console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context3.t0);
256
- return _context3.abrupt("return");
288
+ _context4.prev = 7;
289
+ _context4.t0 = _context4["catch"](1);
290
+ console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context4.t0);
291
+ return _context4.abrupt("return");
257
292
  case 11:
258
293
  if (openDataConfig) {
259
- _context3.next = 13;
294
+ _context4.next = 13;
260
295
  break;
261
296
  }
262
- return _context3.abrupt("return");
297
+ return _context4.abrupt("return");
263
298
  case 13:
264
299
  idGenerator = this.getIdGeneratorPlugin();
265
300
  if (idGenerator !== null && idGenerator !== void 0 && idGenerator.configure) {
266
- _context3.next = 17;
301
+ _context4.next = 17;
267
302
  break;
268
303
  }
269
304
  console.warn('[BookingTicket] idGenerator 插件不可用,跳过配置');
270
- return _context3.abrupt("return");
305
+ return _context4.abrupt("return");
271
306
  case 17:
272
307
  receiptSequenceLength = this.normalizePositiveInteger(openDataConfig['sale.short_number_digits'], 5);
273
308
  receiptSequenceStart = this.normalizePositiveInteger(openDataConfig['sale.short_number_start_number'], 1);
274
309
  prefix = this.normalizeIdPrefix(openDataConfig['sale.short_number_prefix'], 'R');
275
310
  resetReceiptSequenceDaily = typeof openDataConfig['sale.short_number_daily_reset'] === 'boolean' ? openDataConfig['sale.short_number_daily_reset'] : true;
276
311
  operatingDayBoundary = this.getAppData('operating_day_boundary');
277
- _context3.prev = 22;
278
- _context3.next = 25;
312
+ _context4.next = 24;
313
+ return this.getShortNumberOrDeviceId();
314
+ case 24:
315
+ deviceId = _context4.sent;
316
+ _context4.prev = 25;
317
+ _context4.next = 28;
279
318
  return idGenerator.configure({
280
319
  biz: 'ticket',
281
320
  config: {
282
321
  prefix: prefix,
283
- deviceCode: this.getAppData('device_id') || 0,
322
+ deviceCode: deviceId,
284
323
  // TODO 现在 picoding 没这个配置的 key
285
324
  padReceiptSequence: true,
286
325
  receiptSequenceLength: receiptSequenceLength,
@@ -289,18 +328,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
289
328
  receiptSequenceStart: receiptSequenceStart
290
329
  }
291
330
  });
292
- case 25:
293
- _context3.next = 30;
331
+ case 28:
332
+ _context4.next = 33;
294
333
  break;
295
- case 27:
296
- _context3.prev = 27;
297
- _context3.t1 = _context3["catch"](22);
298
- console.warn('[BookingTicket] idGenerator 配置失败', _context3.t1);
299
334
  case 30:
335
+ _context4.prev = 30;
336
+ _context4.t1 = _context4["catch"](25);
337
+ console.warn('[BookingTicket] idGenerator 配置失败', _context4.t1);
338
+ case 33:
300
339
  case "end":
301
- return _context3.stop();
340
+ return _context4.stop();
302
341
  }
303
- }, _callee3, this, [[1, 7], [22, 27]]);
342
+ }, _callee4, this, [[1, 7], [25, 30]]);
304
343
  }));
305
344
  function configureIdGeneratorFromOpenData() {
306
345
  return _configureIdGeneratorFromOpenData.apply(this, arguments);
@@ -332,16 +371,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
332
371
  }, {
333
372
  key: "loadSalesDetail",
334
373
  value: (function () {
335
- var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(orderIdOrParams) {
374
+ var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(orderIdOrParams) {
336
375
  var _ref;
337
376
  var sales, customerModule, detailCustomer, orderCustomerSnapshot, protocolCustomerId, protocolCustomer, selectedCustomer, _selectedCustomer$nam, _ref2, detailCustomerId, detailCustomerRest, rawId, customer;
338
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
339
- while (1) switch (_context4.prev = _context4.next) {
377
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
378
+ while (1) switch (_context5.prev = _context5.next) {
340
379
  case 0:
341
- _context4.next = 2;
380
+ _context5.next = 2;
342
381
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "loadSalesDetail", this).call(this, orderIdOrParams);
343
382
  case 2:
344
- sales = _context4.sent;
383
+ sales = _context5.sent;
345
384
  customerModule = this.store.customer;
346
385
  detailCustomer = sales === null || sales === void 0 ? void 0 : sales.customer;
347
386
  orderCustomerSnapshot = this.store.order.getOrderCustomerSnapshot();
@@ -355,7 +394,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
355
394
  } : null;
356
395
  selectedCustomer = (_ref = detailCustomer !== null && detailCustomer !== void 0 ? detailCustomer : orderCustomerSnapshot) !== null && _ref !== void 0 ? _ref : protocolCustomer;
357
396
  if (!(customerModule && selectedCustomer)) {
358
- _context4.next = 17;
397
+ _context5.next = 17;
359
398
  break;
360
399
  }
361
400
  _ref2 = selectedCustomer !== null && selectedCustomer !== void 0 ? selectedCustomer : {}, detailCustomerId = _ref2.id, detailCustomerRest = _objectWithoutProperties(_ref2, _excluded);
@@ -369,15 +408,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
369
408
  });
370
409
  customerModule.setSelectedCustomer(customer);
371
410
  this.setOrderCustomer(customer);
372
- _context4.next = 17;
411
+ _context5.next = 17;
373
412
  return this.store.order.saveDraft();
374
413
  case 17:
375
- return _context4.abrupt("return", sales);
414
+ return _context5.abrupt("return", sales);
376
415
  case 18:
377
416
  case "end":
378
- return _context4.stop();
417
+ return _context5.stop();
379
418
  }
380
- }, _callee4, this);
419
+ }, _callee5, this);
381
420
  }));
382
421
  function loadSalesDetail(_x2) {
383
422
  return _loadSalesDetail.apply(this, arguments);
@@ -387,45 +426,45 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
387
426
  }, {
388
427
  key: "scanPromotionCode",
389
428
  value: function () {
390
- var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, customerId) {
429
+ var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(code, customerId) {
391
430
  var raw;
392
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
393
- while (1) switch (_context5.prev = _context5.next) {
431
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
432
+ while (1) switch (_context6.prev = _context6.next) {
394
433
  case 0:
395
434
  if (this.store.order) {
396
- _context5.next = 2;
435
+ _context6.next = 2;
397
436
  break;
398
437
  }
399
438
  throw new Error('order 模块未初始化');
400
439
  case 2:
401
- _context5.next = 4;
440
+ _context6.next = 4;
402
441
  return this.store.order.scanCode(code, customerId);
403
442
  case 4:
404
- raw = _context5.sent;
443
+ raw = _context6.sent;
405
444
  if (!raw.isAvailable) {
406
- _context5.next = 11;
445
+ _context6.next = 11;
407
446
  break;
408
447
  }
409
- _context5.next = 8;
448
+ _context6.next = 8;
410
449
  return this.hydrateOrderCustomerFromScanDiscounts(raw.scannedDiscountList || []);
411
450
  case 8:
412
- _context5.next = 10;
451
+ _context6.next = 10;
413
452
  return this.store.order.recalculateSummary({
414
453
  createIfMissing: true
415
454
  });
416
455
  case 10:
417
456
  this.store.order.persistTempOrder();
418
457
  case 11:
419
- return _context5.abrupt("return", {
458
+ return _context6.abrupt("return", {
420
459
  isAvailable: raw.isAvailable,
421
460
  type: raw.type,
422
461
  unavailableReason: raw.unavailableReason
423
462
  });
424
463
  case 12:
425
464
  case "end":
426
- return _context5.stop();
465
+ return _context6.stop();
427
466
  }
428
- }, _callee5, this);
467
+ }, _callee6, this);
429
468
  }));
430
469
  function scanPromotionCode(_x3, _x4) {
431
470
  return _scanPromotionCode.apply(this, arguments);
@@ -435,42 +474,42 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
435
474
  }, {
436
475
  key: "hydrateOrderCustomerFromScanDiscounts",
437
476
  value: function () {
438
- var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(discounts) {
477
+ var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(discounts) {
439
478
  var currentOrderCustomer, customerId, customer;
440
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
441
- while (1) switch (_context6.prev = _context6.next) {
479
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
480
+ while (1) switch (_context7.prev = _context7.next) {
442
481
  case 0:
443
482
  currentOrderCustomer = this.store.order.getOrderCustomer();
444
483
  if (!currentOrderCustomer) {
445
- _context6.next = 3;
484
+ _context7.next = 3;
446
485
  break;
447
486
  }
448
- return _context6.abrupt("return");
487
+ return _context7.abrupt("return");
449
488
  case 3:
450
489
  customerId = this.getDiscountCustomerId(discounts);
451
490
  if (customerId) {
452
- _context6.next = 6;
491
+ _context7.next = 6;
453
492
  break;
454
493
  }
455
- return _context6.abrupt("return");
494
+ return _context7.abrupt("return");
456
495
  case 6:
457
- _context6.next = 8;
496
+ _context7.next = 8;
458
497
  return this.resolveCustomerByDiscountCustomerId(customerId);
459
498
  case 8:
460
- customer = _context6.sent;
499
+ customer = _context7.sent;
461
500
  if (customer) {
462
- _context6.next = 11;
501
+ _context7.next = 11;
463
502
  break;
464
503
  }
465
- return _context6.abrupt("return");
504
+ return _context7.abrupt("return");
466
505
  case 11:
467
506
  this.store.customer.setSelectedCustomer(customer);
468
507
  this.setOrderCustomer(customer);
469
508
  case 13:
470
509
  case "end":
471
- return _context6.stop();
510
+ return _context7.stop();
472
511
  }
473
- }, _callee6, this);
512
+ }, _callee7, this);
474
513
  }));
475
514
  function hydrateOrderCustomerFromScanDiscounts(_x5) {
476
515
  return _hydrateOrderCustomerFromScanDiscounts.apply(this, arguments);
@@ -490,36 +529,36 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
490
529
  }, {
491
530
  key: "resolveCustomerByDiscountCustomerId",
492
531
  value: function () {
493
- var _resolveCustomerByDiscountCustomerId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(customerId) {
532
+ var _resolveCustomerByDiscountCustomerId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(customerId) {
494
533
  var _result$list;
495
534
  var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer;
496
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
497
- while (1) switch (_context7.prev = _context7.next) {
535
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
536
+ while (1) switch (_context8.prev = _context8.next) {
498
537
  case 0:
499
538
  localCustomers = this.store.customer.getCustomers();
500
539
  localCustomer = this.findCustomerById(localCustomers, customerId);
501
540
  normalizedLocalCustomer = localCustomer ? this.normalizeCustomer(localCustomer) : null;
502
541
  if (!(normalizedLocalCustomer && this.hasUsableCustomerDetails(normalizedLocalCustomer))) {
503
- _context7.next = 5;
542
+ _context8.next = 5;
504
543
  break;
505
544
  }
506
- return _context7.abrupt("return", normalizedLocalCustomer);
545
+ return _context8.abrupt("return", normalizedLocalCustomer);
507
546
  case 5:
508
- _context7.next = 7;
547
+ _context8.next = 7;
509
548
  return this.store.customer.queryCustomerList({
510
549
  ids: [customerId],
511
550
  skip: 1,
512
551
  num: 1
513
552
  });
514
553
  case 7:
515
- result = _context7.sent;
554
+ result = _context8.sent;
516
555
  remoteCustomer = this.findCustomerById((result === null || result === void 0 ? void 0 : result.list) || [], customerId) || (result === null || result === void 0 || (_result$list = result.list) === null || _result$list === void 0 ? void 0 : _result$list[0]) || null;
517
- return _context7.abrupt("return", remoteCustomer ? this.normalizeCustomer(remoteCustomer) : null);
556
+ return _context8.abrupt("return", remoteCustomer ? this.normalizeCustomer(remoteCustomer) : null);
518
557
  case 10:
519
558
  case "end":
520
- return _context7.stop();
559
+ return _context8.stop();
521
560
  }
522
- }, _callee7, this);
561
+ }, _callee8, this);
523
562
  }));
524
563
  function resolveCustomerByDiscountCustomerId(_x6) {
525
564
  return _resolveCustomerByDiscountCustomerId.apply(this, arguments);
@@ -582,60 +621,60 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
582
621
  }, {
583
622
  key: "setBookingStatus",
584
623
  value: (function () {
585
- var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(status) {
624
+ var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(status) {
586
625
  var _this$store$order, _this$store$order$get;
587
626
  var tempOrder, orderId, scheduleId, bookings, previous, _data, res;
588
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
589
- while (1) switch (_context8.prev = _context8.next) {
627
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
628
+ while (1) switch (_context9.prev = _context9.next) {
590
629
  case 0:
591
630
  tempOrder = (_this$store$order = this.store.order) === null || _this$store$order === void 0 || (_this$store$order$get = _this$store$order.getTempOrder) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.call(_this$store$order);
592
631
  if (tempOrder) {
593
- _context8.next = 3;
632
+ _context9.next = 3;
594
633
  break;
595
634
  }
596
635
  throw new Error('setBookingStatus: tempOrder 未加载');
597
636
  case 3:
598
637
  orderId = tempOrder.order_id;
599
638
  if (!(orderId === undefined || orderId === null)) {
600
- _context8.next = 6;
639
+ _context9.next = 6;
601
640
  break;
602
641
  }
603
642
  throw new Error('setBookingStatus: tempOrder.order_id 缺失');
604
643
  case 6:
605
644
  scheduleId = resolveScheduleId(tempOrder);
606
645
  if (!(scheduleId === null)) {
607
- _context8.next = 9;
646
+ _context9.next = 9;
608
647
  break;
609
648
  }
610
649
  throw new Error('setBookingStatus: 无法解析 schedule id(metadata 与 root booking 均缺失)');
611
650
  case 9:
612
651
  bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
613
652
  previous = applyBookingsStatus(bookings, status);
614
- _context8.prev = 11;
615
- _context8.next = 14;
653
+ _context9.prev = 11;
654
+ _context9.next = 14;
616
655
  return this.request.put("/schedule/booking/appointment-status/".concat(scheduleId), {
617
656
  appointment_status: status
618
657
  });
619
658
  case 14:
620
- res = _context8.sent;
621
- _context8.next = 17;
659
+ res = _context9.sent;
660
+ _context9.next = 17;
622
661
  return this.refreshSalesDetail();
623
662
  case 17:
624
663
  this.core.effects.emit("".concat(this.name, ":onBookingStatusChange"), {
625
664
  orderId: orderId,
626
665
  status: status
627
666
  });
628
- return _context8.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
667
+ return _context9.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
629
668
  case 21:
630
- _context8.prev = 21;
631
- _context8.t0 = _context8["catch"](11);
669
+ _context9.prev = 21;
670
+ _context9.t0 = _context9["catch"](11);
632
671
  restoreBookingsStatus(bookings, previous);
633
- throw _context8.t0;
672
+ throw _context9.t0;
634
673
  case 25:
635
674
  case "end":
636
- return _context8.stop();
675
+ return _context9.stop();
637
676
  }
638
- }, _callee8, this, [[11, 21]]);
677
+ }, _callee9, this, [[11, 21]]);
639
678
  }));
640
679
  function setBookingStatus(_x7) {
641
680
  return _setBookingStatus.apply(this, arguments);
@@ -666,35 +705,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
666
705
  }, {
667
706
  key: "transitionChildBooking",
668
707
  value: (function () {
669
- var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
708
+ var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
670
709
  var _this$store$order2, _this$store$order2$ge;
671
710
  var schedule_event_id, action, tempOrder, orderId, bookings, targetStatus, previous, _data2, res;
672
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
673
- while (1) switch (_context9.prev = _context9.next) {
711
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
712
+ while (1) switch (_context10.prev = _context10.next) {
674
713
  case 0:
675
714
  schedule_event_id = params.schedule_event_id, action = params.action;
676
715
  if (!(schedule_event_id === undefined || schedule_event_id === null || schedule_event_id === '')) {
677
- _context9.next = 3;
716
+ _context10.next = 3;
678
717
  break;
679
718
  }
680
719
  throw new Error('transitionChildBooking: schedule_event_id 不能为空');
681
720
  case 3:
682
721
  if (action) {
683
- _context9.next = 5;
722
+ _context10.next = 5;
684
723
  break;
685
724
  }
686
725
  throw new Error('transitionChildBooking: action 不能为空');
687
726
  case 5:
688
727
  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);
689
728
  if (tempOrder) {
690
- _context9.next = 8;
729
+ _context10.next = 8;
691
730
  break;
692
731
  }
693
732
  throw new Error('transitionChildBooking: tempOrder 未加载');
694
733
  case 8:
695
734
  orderId = tempOrder.order_id;
696
735
  if (!(orderId === undefined || orderId === null)) {
697
- _context9.next = 11;
736
+ _context10.next = 11;
698
737
  break;
699
738
  }
700
739
  throw new Error('transitionChildBooking: tempOrder.order_id 缺失');
@@ -702,14 +741,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
702
741
  bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
703
742
  targetStatus = resolveStatusAfterTransition(action);
704
743
  previous = targetStatus !== null ? applyChildBookingStatus(bookings, schedule_event_id, targetStatus) : undefined;
705
- _context9.prev = 14;
706
- _context9.next = 17;
744
+ _context10.prev = 14;
745
+ _context10.next = 17;
707
746
  return this.request.post("/schedule/booking-transition/".concat(schedule_event_id), {
708
747
  action: action
709
748
  });
710
749
  case 17:
711
- res = _context9.sent;
712
- _context9.next = 20;
750
+ res = _context10.sent;
751
+ _context10.next = 20;
713
752
  return this.refreshSalesDetail();
714
753
  case 20:
715
754
  this.core.effects.emit("".concat(this.name, ":onChildBookingStatusChange"), {
@@ -718,19 +757,19 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
718
757
  action: action,
719
758
  status: targetStatus
720
759
  });
721
- return _context9.abrupt("return", (_data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _data2 !== void 0 ? _data2 : res);
760
+ return _context10.abrupt("return", (_data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _data2 !== void 0 ? _data2 : res);
722
761
  case 24:
723
- _context9.prev = 24;
724
- _context9.t0 = _context9["catch"](14);
762
+ _context10.prev = 24;
763
+ _context10.t0 = _context10["catch"](14);
725
764
  if (previous !== undefined) {
726
765
  restoreChildBookingStatus(bookings, schedule_event_id, previous);
727
766
  }
728
- throw _context9.t0;
767
+ throw _context10.t0;
729
768
  case 28:
730
769
  case "end":
731
- return _context9.stop();
770
+ return _context10.stop();
732
771
  }
733
- }, _callee9, this, [[14, 24]]);
772
+ }, _callee10, this, [[14, 24]]);
734
773
  }));
735
774
  function transitionChildBooking(_x8) {
736
775
  return _transitionChildBooking.apply(this, arguments);
@@ -751,35 +790,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
751
790
  }, {
752
791
  key: "refreshSalesDetail",
753
792
  value: (function () {
754
- var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
793
+ var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
755
794
  var _this$store$order3, _this$store$order3$ge;
756
795
  var tempOrder, orderId;
757
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
758
- while (1) switch (_context10.prev = _context10.next) {
796
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
797
+ while (1) switch (_context11.prev = _context11.next) {
759
798
  case 0:
760
799
  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);
761
800
  if (tempOrder) {
762
- _context10.next = 3;
801
+ _context11.next = 3;
763
802
  break;
764
803
  }
765
804
  throw new Error('refreshSalesDetail: tempOrder 未加载');
766
805
  case 3:
767
806
  orderId = tempOrder.order_id;
768
807
  if (!(orderId === undefined || orderId === null)) {
769
- _context10.next = 6;
808
+ _context11.next = 6;
770
809
  break;
771
810
  }
772
811
  throw new Error('refreshSalesDetail: tempOrder.order_id 缺失');
773
812
  case 6:
774
- return _context10.abrupt("return", this.loadSalesDetail({
813
+ return _context11.abrupt("return", this.loadSalesDetail({
775
814
  orderId: Number(orderId),
776
815
  forceRemote: true
777
816
  }));
778
817
  case 7:
779
818
  case "end":
780
- return _context10.stop();
819
+ return _context11.stop();
781
820
  }
782
- }, _callee10, this);
821
+ }, _callee11, this);
783
822
  }));
784
823
  function refreshSalesDetail() {
785
824
  return _refreshSalesDetail.apply(this, arguments);
@@ -795,7 +834,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
795
834
  }, {
796
835
  key: "loadProducts",
797
836
  value: (function () {
798
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
837
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
799
838
  var params,
800
839
  options,
801
840
  schedule_date,
@@ -804,20 +843,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
804
843
  schedule_datetime,
805
844
  bookingDate,
806
845
  _result,
807
- _args11 = arguments;
808
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
809
- while (1) switch (_context11.prev = _context11.next) {
846
+ _args12 = arguments;
847
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
848
+ while (1) switch (_context12.prev = _context12.next) {
810
849
  case 0:
811
- params = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
812
- options = _args11.length > 1 ? _args11[1] : undefined;
850
+ params = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
851
+ options = _args12.length > 1 ? _args12[1] : undefined;
813
852
  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 对齐;
814
853
  // requiresDetail 弹窗仍通过 formatBookingDateForUI 只取日历日 YYYY-MM-DD。
815
854
  bookingDate = schedule_datetime || schedule_date || '';
816
855
  if (bookingDate) {
817
856
  this.setBookingDate(bookingDate);
818
857
  }
819
- _context11.prev = 5;
820
- _context11.next = 8;
858
+ _context12.prev = 5;
859
+ _context12.next = 8;
821
860
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
822
861
  with_count: ['bundleGroup', 'optionGroup'],
823
862
  with_schedule: 1
@@ -825,20 +864,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
825
864
  cacheId: this.cacheId
826
865
  }), options);
827
866
  case 8:
828
- _result = _context11.sent;
867
+ _result = _context12.sent;
829
868
  this.productCatalog = Array.isArray(_result) ? _toConsumableArray(_result) : [];
830
869
  this.core.effects.emit("".concat(this.name, ":onProductsLoaded"), _result);
831
- return _context11.abrupt("return", _result);
870
+ return _context12.abrupt("return", _result);
832
871
  case 14:
833
- _context11.prev = 14;
834
- _context11.t0 = _context11["catch"](5);
835
- console.error('Failed to load products:', _context11.t0);
836
- throw _context11.t0;
872
+ _context12.prev = 14;
873
+ _context12.t0 = _context12["catch"](5);
874
+ console.error('Failed to load products:', _context12.t0);
875
+ throw _context12.t0;
837
876
  case 18:
838
877
  case "end":
839
- return _context11.stop();
878
+ return _context12.stop();
840
879
  }
841
- }, _callee11, this, [[5, 14]]);
880
+ }, _callee12, this, [[5, 14]]);
842
881
  }));
843
882
  function loadProducts() {
844
883
  return _loadProducts.apply(this, arguments);
@@ -863,14 +902,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
863
902
  }, {
864
903
  key: "queryProductDetail",
865
904
  value: (function () {
866
- var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(params, options) {
905
+ var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params, options) {
867
906
  var product_id, queryParams, _result2, list;
868
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
869
- while (1) switch (_context12.prev = _context12.next) {
907
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
908
+ while (1) switch (_context13.prev = _context13.next) {
870
909
  case 0:
871
910
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded2);
872
- _context12.prev = 1;
873
- _context12.next = 4;
911
+ _context13.prev = 1;
912
+ _context13.next = 4;
874
913
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
875
914
  with_count: ['bundleGroup', 'optionGroup'],
876
915
  with_schedule: 1
@@ -879,21 +918,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
879
918
  cacheId: this.cacheId
880
919
  }), options);
881
920
  case 4:
882
- _result2 = _context12.sent;
921
+ _result2 = _context13.sent;
883
922
  list = Array.isArray(_result2) ? _result2 : [];
884
- return _context12.abrupt("return", list.find(function (product) {
923
+ return _context13.abrupt("return", list.find(function (product) {
885
924
  return Number(product.id) === Number(product_id);
886
925
  }));
887
926
  case 9:
888
- _context12.prev = 9;
889
- _context12.t0 = _context12["catch"](1);
890
- console.error('Failed to query product detail:', _context12.t0);
891
- throw _context12.t0;
927
+ _context13.prev = 9;
928
+ _context13.t0 = _context13["catch"](1);
929
+ console.error('Failed to query product detail:', _context13.t0);
930
+ throw _context13.t0;
892
931
  case 13:
893
932
  case "end":
894
- return _context12.stop();
933
+ return _context13.stop();
895
934
  }
896
- }, _callee12, this, [[1, 9]]);
935
+ }, _callee13, this, [[1, 9]]);
897
936
  }));
898
937
  function queryProductDetail(_x9, _x10) {
899
938
  return _queryProductDetail.apply(this, arguments);
@@ -908,26 +947,26 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
908
947
  }, {
909
948
  key: "loadProductDetail",
910
949
  value: (function () {
911
- var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params, options) {
950
+ var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params, options) {
912
951
  var product_id, queryParams, products;
913
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
914
- while (1) switch (_context13.prev = _context13.next) {
952
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
953
+ while (1) switch (_context14.prev = _context14.next) {
915
954
  case 0:
916
955
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded3);
917
- _context13.next = 3;
956
+ _context14.next = 3;
918
957
  return this.loadProducts(_objectSpread(_objectSpread({}, queryParams), {}, {
919
958
  product_ids: [product_id]
920
959
  }), options);
921
960
  case 3:
922
- products = _context13.sent;
923
- return _context13.abrupt("return", products.find(function (product) {
961
+ products = _context14.sent;
962
+ return _context14.abrupt("return", products.find(function (product) {
924
963
  return Number(product.id) === Number(product_id);
925
964
  }));
926
965
  case 5:
927
966
  case "end":
928
- return _context13.stop();
967
+ return _context14.stop();
929
968
  }
930
- }, _callee13, this);
969
+ }, _callee14, this);
931
970
  }));
932
971
  function loadProductDetail(_x11, _x12) {
933
972
  return _loadProductDetail.apply(this, arguments);
@@ -962,16 +1001,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
962
1001
  }, {
963
1002
  key: "getProducts",
964
1003
  value: (function () {
965
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
966
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
967
- while (1) switch (_context14.prev = _context14.next) {
1004
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
1005
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1006
+ while (1) switch (_context15.prev = _context15.next) {
968
1007
  case 0:
969
- return _context14.abrupt("return", this.store.products.getProducts());
1008
+ return _context15.abrupt("return", this.store.products.getProducts());
970
1009
  case 1:
971
1010
  case "end":
972
- return _context14.stop();
1011
+ return _context15.stop();
973
1012
  }
974
- }, _callee14, this);
1013
+ }, _callee15, this);
975
1014
  }));
976
1015
  function getProducts() {
977
1016
  return _getProducts.apply(this, arguments);
@@ -1024,16 +1063,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1024
1063
  }, {
1025
1064
  key: "getProductByIds",
1026
1065
  value: (function () {
1027
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(ids) {
1028
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1029
- while (1) switch (_context15.prev = _context15.next) {
1066
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(ids) {
1067
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1068
+ while (1) switch (_context16.prev = _context16.next) {
1030
1069
  case 0:
1031
- return _context15.abrupt("return", this.store.products.getProductByIds(ids));
1070
+ return _context16.abrupt("return", this.store.products.getProductByIds(ids));
1032
1071
  case 1:
1033
1072
  case "end":
1034
- return _context15.stop();
1073
+ return _context16.stop();
1035
1074
  }
1036
- }, _callee15, this);
1075
+ }, _callee16, this);
1037
1076
  }));
1038
1077
  function getProductByIds(_x13) {
1039
1078
  return _getProductByIds.apply(this, arguments);
@@ -1049,25 +1088,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1049
1088
  }, {
1050
1089
  key: "getScheduleTimePoints",
1051
1090
  value: (function () {
1052
- var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
1091
+ var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params) {
1053
1092
  var result;
1054
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1055
- while (1) switch (_context16.prev = _context16.next) {
1093
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1094
+ while (1) switch (_context17.prev = _context17.next) {
1056
1095
  case 0:
1057
- _context16.next = 2;
1096
+ _context17.next = 2;
1058
1097
  return this.request.post('/menu/schedule-time-points', {
1059
1098
  menu_list_ids: params.menu_list_ids
1060
1099
  }, {
1061
1100
  osServer: true
1062
1101
  });
1063
1102
  case 2:
1064
- result = _context16.sent;
1065
- return _context16.abrupt("return", result.data || []);
1103
+ result = _context17.sent;
1104
+ return _context17.abrupt("return", result.data || []);
1066
1105
  case 4:
1067
1106
  case "end":
1068
- return _context16.stop();
1107
+ return _context17.stop();
1069
1108
  }
1070
- }, _callee16, this);
1109
+ }, _callee17, this);
1071
1110
  }));
1072
1111
  function getScheduleTimePoints(_x14) {
1073
1112
  return _getScheduleTimePoints.apply(this, arguments);
@@ -1083,30 +1122,30 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1083
1122
  }, {
1084
1123
  key: "getCustomerList",
1085
1124
  value: (function () {
1086
- var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1125
+ var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1087
1126
  var params,
1088
1127
  _result3,
1089
- _args17 = arguments;
1090
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1091
- while (1) switch (_context17.prev = _context17.next) {
1128
+ _args18 = arguments;
1129
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1130
+ while (1) switch (_context18.prev = _context18.next) {
1092
1131
  case 0:
1093
- params = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
1094
- _context17.prev = 1;
1095
- _context17.next = 4;
1132
+ params = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
1133
+ _context18.prev = 1;
1134
+ _context18.next = 4;
1096
1135
  return this.store.customer.getCustomerList(params);
1097
1136
  case 4:
1098
- _result3 = _context17.sent;
1099
- return _context17.abrupt("return", _result3);
1137
+ _result3 = _context18.sent;
1138
+ return _context18.abrupt("return", _result3);
1100
1139
  case 8:
1101
- _context17.prev = 8;
1102
- _context17.t0 = _context17["catch"](1);
1103
- console.error('Failed to get customer list:', _context17.t0);
1104
- throw _context17.t0;
1140
+ _context18.prev = 8;
1141
+ _context18.t0 = _context18["catch"](1);
1142
+ console.error('Failed to get customer list:', _context18.t0);
1143
+ throw _context18.t0;
1105
1144
  case 12:
1106
1145
  case "end":
1107
- return _context17.stop();
1146
+ return _context18.stop();
1108
1147
  }
1109
- }, _callee17, this, [[1, 8]]);
1148
+ }, _callee18, this, [[1, 8]]);
1110
1149
  }));
1111
1150
  function getCustomerList() {
1112
1151
  return _getCustomerList.apply(this, arguments);
@@ -1304,24 +1343,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1304
1343
  }, {
1305
1344
  key: "restoreOrder",
1306
1345
  value: (function () {
1307
- var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1346
+ var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1308
1347
  var _this$store$customer;
1309
1348
  var tempOrder;
1310
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1311
- while (1) switch (_context18.prev = _context18.next) {
1349
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1350
+ while (1) switch (_context19.prev = _context19.next) {
1312
1351
  case 0:
1313
- _context18.next = 2;
1352
+ _context19.next = 2;
1314
1353
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "restoreOrder", this).call(this);
1315
1354
  case 2:
1316
- tempOrder = _context18.sent;
1355
+ tempOrder = _context19.sent;
1317
1356
  this.clearOrderCustomer();
1318
1357
  (_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.setSelectedCustomer(null);
1319
- return _context18.abrupt("return", tempOrder);
1358
+ return _context19.abrupt("return", tempOrder);
1320
1359
  case 6:
1321
1360
  case "end":
1322
- return _context18.stop();
1361
+ return _context19.stop();
1323
1362
  }
1324
- }, _callee18, this);
1363
+ }, _callee19, this);
1325
1364
  }));
1326
1365
  function restoreOrder() {
1327
1366
  return _restoreOrder.apply(this, arguments);
@@ -1347,36 +1386,36 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1347
1386
  return;
1348
1387
  }
1349
1388
  var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
1350
- var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1389
+ var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1351
1390
  var currentCustomer;
1352
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1353
- while (1) switch (_context19.prev = _context19.next) {
1391
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1392
+ while (1) switch (_context20.prev = _context20.next) {
1354
1393
  case 0:
1355
1394
  if (!previousRefresh) {
1356
- _context19.next = 3;
1395
+ _context20.next = 3;
1357
1396
  break;
1358
1397
  }
1359
- _context19.next = 3;
1398
+ _context20.next = 3;
1360
1399
  return previousRefresh.catch(function () {
1361
1400
  return undefined;
1362
1401
  });
1363
1402
  case 3:
1364
1403
  currentCustomer = _this4.store.order.getOrderCustomer();
1365
1404
  if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
1366
- _context19.next = 6;
1405
+ _context20.next = 6;
1367
1406
  break;
1368
1407
  }
1369
- return _context19.abrupt("return");
1408
+ return _context20.abrupt("return");
1370
1409
  case 6:
1371
- _context19.next = 8;
1410
+ _context20.next = 8;
1372
1411
  return _this4.loadDiscountConfig({
1373
1412
  customerId: customerId
1374
1413
  });
1375
1414
  case 8:
1376
1415
  case "end":
1377
- return _context19.stop();
1416
+ return _context20.stop();
1378
1417
  }
1379
- }, _callee19);
1418
+ }, _callee20);
1380
1419
  }))();
1381
1420
  this.orderCustomerDiscountRefreshInFlight = refreshTask;
1382
1421
  this.orderCustomerDiscountRefreshCustomerId = customerId;
@@ -1429,27 +1468,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1429
1468
  }, {
1430
1469
  key: "changeCustomerPage",
1431
1470
  value: (function () {
1432
- var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(page, pageSize) {
1471
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(page, pageSize) {
1433
1472
  var _result4;
1434
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1435
- while (1) switch (_context20.prev = _context20.next) {
1473
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1474
+ while (1) switch (_context21.prev = _context21.next) {
1436
1475
  case 0:
1437
- _context20.prev = 0;
1438
- _context20.next = 3;
1476
+ _context21.prev = 0;
1477
+ _context21.next = 3;
1439
1478
  return this.store.customer.changeCustomerPage(page, pageSize);
1440
1479
  case 3:
1441
- _result4 = _context20.sent;
1442
- return _context20.abrupt("return", _result4);
1480
+ _result4 = _context21.sent;
1481
+ return _context21.abrupt("return", _result4);
1443
1482
  case 7:
1444
- _context20.prev = 7;
1445
- _context20.t0 = _context20["catch"](0);
1446
- console.error('Failed to change customer page:', _context20.t0);
1447
- throw _context20.t0;
1483
+ _context21.prev = 7;
1484
+ _context21.t0 = _context21["catch"](0);
1485
+ console.error('Failed to change customer page:', _context21.t0);
1486
+ throw _context21.t0;
1448
1487
  case 11:
1449
1488
  case "end":
1450
- return _context20.stop();
1489
+ return _context21.stop();
1451
1490
  }
1452
- }, _callee20, this, [[0, 7]]);
1491
+ }, _callee21, this, [[0, 7]]);
1453
1492
  }));
1454
1493
  function changeCustomerPage(_x15, _x16) {
1455
1494
  return _changeCustomerPage.apply(this, arguments);
@@ -1464,28 +1503,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1464
1503
  }, {
1465
1504
  key: "loadMoreCustomers",
1466
1505
  value: (function () {
1467
- var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1506
+ var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1468
1507
  var _result5;
1469
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1470
- while (1) switch (_context21.prev = _context21.next) {
1508
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1509
+ while (1) switch (_context22.prev = _context22.next) {
1471
1510
  case 0:
1472
- _context21.prev = 0;
1473
- _context21.next = 3;
1511
+ _context22.prev = 0;
1512
+ _context22.next = 3;
1474
1513
  return this.store.customer.loadMoreCustomers();
1475
1514
  case 3:
1476
- _result5 = _context21.sent;
1515
+ _result5 = _context22.sent;
1477
1516
  this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
1478
- return _context21.abrupt("return", _result5);
1517
+ return _context22.abrupt("return", _result5);
1479
1518
  case 8:
1480
- _context21.prev = 8;
1481
- _context21.t0 = _context21["catch"](0);
1482
- console.error('Failed to load more customers:', _context21.t0);
1483
- throw _context21.t0;
1519
+ _context22.prev = 8;
1520
+ _context22.t0 = _context22["catch"](0);
1521
+ console.error('Failed to load more customers:', _context22.t0);
1522
+ throw _context22.t0;
1484
1523
  case 12:
1485
1524
  case "end":
1486
- return _context21.stop();
1525
+ return _context22.stop();
1487
1526
  }
1488
- }, _callee21, this, [[0, 8]]);
1527
+ }, _callee22, this, [[0, 8]]);
1489
1528
  }));
1490
1529
  function loadMoreCustomers() {
1491
1530
  return _loadMoreCustomers.apply(this, arguments);
@@ -1501,31 +1540,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1501
1540
  }, {
1502
1541
  key: "resetAndLoadCustomers",
1503
1542
  value: (function () {
1504
- var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1543
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1505
1544
  var params,
1506
1545
  _result6,
1507
- _args22 = arguments;
1508
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1509
- while (1) switch (_context22.prev = _context22.next) {
1546
+ _args23 = arguments;
1547
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1548
+ while (1) switch (_context23.prev = _context23.next) {
1510
1549
  case 0:
1511
- params = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
1512
- _context22.prev = 1;
1513
- _context22.next = 4;
1550
+ params = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
1551
+ _context23.prev = 1;
1552
+ _context23.next = 4;
1514
1553
  return this.store.customer.resetAndLoadCustomers(params);
1515
1554
  case 4:
1516
- _result6 = _context22.sent;
1555
+ _result6 = _context23.sent;
1517
1556
  this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
1518
- return _context22.abrupt("return", _result6);
1557
+ return _context23.abrupt("return", _result6);
1519
1558
  case 9:
1520
- _context22.prev = 9;
1521
- _context22.t0 = _context22["catch"](1);
1522
- console.error('Failed to reset and load customers:', _context22.t0);
1523
- throw _context22.t0;
1559
+ _context23.prev = 9;
1560
+ _context23.t0 = _context23["catch"](1);
1561
+ console.error('Failed to reset and load customers:', _context23.t0);
1562
+ throw _context23.t0;
1524
1563
  case 13:
1525
1564
  case "end":
1526
- return _context22.stop();
1565
+ return _context23.stop();
1527
1566
  }
1528
- }, _callee22, this, [[1, 9]]);
1567
+ }, _callee23, this, [[1, 9]]);
1529
1568
  }));
1530
1569
  function resetAndLoadCustomers() {
1531
1570
  return _resetAndLoadCustomers.apply(this, arguments);
@@ -1687,15 +1726,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1687
1726
  }, {
1688
1727
  key: "setOtherParams",
1689
1728
  value: (function () {
1690
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
1729
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(params) {
1691
1730
  var _ref10,
1692
1731
  _ref10$cover,
1693
1732
  cover,
1694
- _args23 = arguments;
1695
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1696
- while (1) switch (_context23.prev = _context23.next) {
1733
+ _args24 = arguments;
1734
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1735
+ while (1) switch (_context24.prev = _context24.next) {
1697
1736
  case 0:
1698
- _ref10 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, _ref10$cover = _ref10.cover, cover = _ref10$cover === void 0 ? false : _ref10$cover;
1737
+ _ref10 = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {}, _ref10$cover = _ref10.cover, cover = _ref10$cover === void 0 ? false : _ref10$cover;
1699
1738
  if (cover) {
1700
1739
  this.otherParams = params;
1701
1740
  } else {
@@ -1703,9 +1742,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1703
1742
  }
1704
1743
  case 2:
1705
1744
  case "end":
1706
- return _context23.stop();
1745
+ return _context24.stop();
1707
1746
  }
1708
- }, _callee23, this);
1747
+ }, _callee24, this);
1709
1748
  }));
1710
1749
  function setOtherParams(_x17) {
1711
1750
  return _setOtherParams.apply(this, arguments);
@@ -1720,16 +1759,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1720
1759
  }, {
1721
1760
  key: "getOtherParams",
1722
1761
  value: (function () {
1723
- var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1724
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1725
- while (1) switch (_context24.prev = _context24.next) {
1762
+ var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1763
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1764
+ while (1) switch (_context25.prev = _context25.next) {
1726
1765
  case 0:
1727
- return _context24.abrupt("return", this.otherParams);
1766
+ return _context25.abrupt("return", this.otherParams);
1728
1767
  case 1:
1729
1768
  case "end":
1730
- return _context24.stop();
1769
+ return _context25.stop();
1731
1770
  }
1732
- }, _callee24, this);
1771
+ }, _callee25, this);
1733
1772
  }));
1734
1773
  function getOtherParams() {
1735
1774
  return _getOtherParams.apply(this, arguments);
@@ -2047,16 +2086,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2047
2086
  }, {
2048
2087
  key: "updateProductInOrder",
2049
2088
  value: (function () {
2050
- var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(params) {
2051
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2052
- while (1) switch (_context25.prev = _context25.next) {
2089
+ var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
2090
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2091
+ while (1) switch (_context26.prev = _context26.next) {
2053
2092
  case 0:
2054
- return _context25.abrupt("return", this.updateOrderProduct(params));
2093
+ return _context26.abrupt("return", this.updateOrderProduct(params));
2055
2094
  case 1:
2056
2095
  case "end":
2057
- return _context25.stop();
2096
+ return _context26.stop();
2058
2097
  }
2059
- }, _callee25, this);
2098
+ }, _callee26, this);
2060
2099
  }));
2061
2100
  function updateProductInOrder(_x18) {
2062
2101
  return _updateProductInOrder.apply(this, arguments);
@@ -2080,47 +2119,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2080
2119
  }, {
2081
2120
  key: "handleGlobalScanCode",
2082
2121
  value: (function () {
2083
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(code, bridge) {
2122
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(code, bridge) {
2084
2123
  var _this6 = this;
2085
2124
  var trimmed, _bridge$onNotify, _bridge$refresh, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
2086
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2087
- while (1) switch (_context26.prev = _context26.next) {
2125
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2126
+ while (1) switch (_context27.prev = _context27.next) {
2088
2127
  case 0:
2089
2128
  trimmed = typeof code === 'string' ? code.trim() : '';
2090
2129
  if (trimmed) {
2091
- _context26.next = 4;
2130
+ _context27.next = 4;
2092
2131
  break;
2093
2132
  }
2094
2133
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2095
- return _context26.abrupt("return", {
2134
+ return _context27.abrupt("return", {
2096
2135
  status: 'failed',
2097
2136
  reason: 'empty_code'
2098
2137
  });
2099
2138
  case 4:
2100
- _context26.prev = 4;
2139
+ _context27.prev = 4;
2101
2140
  localSearch = function localSearch(v) {
2102
2141
  return _this6.store.products.findProductsByCodeOrBarcode(v);
2103
2142
  };
2104
2143
  scanCallback = handleGlobalScan(this.request, localSearch);
2105
- _context26.next = 9;
2144
+ _context27.next = 9;
2106
2145
  return scanCallback({
2107
2146
  type: 'nativeScanner',
2108
2147
  value: trimmed
2109
2148
  });
2110
2149
  case 9:
2111
- raw = _context26.sent;
2150
+ raw = _context27.sent;
2112
2151
  formatted = formatGlobalScanResult(raw, trimmed);
2113
2152
  if (formatted) {
2114
- _context26.next = 14;
2153
+ _context27.next = 14;
2115
2154
  break;
2116
2155
  }
2117
2156
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2118
- return _context26.abrupt("return", {
2157
+ return _context27.abrupt("return", {
2119
2158
  status: 'failed',
2120
2159
  reason: 'not_found'
2121
2160
  });
2122
2161
  case 14:
2123
- _context26.next = 16;
2162
+ _context27.next = 16;
2124
2163
  return applyGlobalScan({
2125
2164
  setOrderCustomer: function setOrderCustomer(customer) {
2126
2165
  return _this6.setOrderCustomer(customer);
@@ -2149,23 +2188,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2149
2188
  }
2150
2189
  }, formatted, bridge);
2151
2190
  case 16:
2152
- _result7 = _context26.sent;
2191
+ _result7 = _context27.sent;
2153
2192
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
2154
- return _context26.abrupt("return", _result7);
2193
+ return _context27.abrupt("return", _result7);
2155
2194
  case 21:
2156
- _context26.prev = 21;
2157
- _context26.t0 = _context26["catch"](4);
2158
- console.error('[BookingTicket] handleGlobalScanCode failed', _context26.t0);
2195
+ _context27.prev = 21;
2196
+ _context27.t0 = _context27["catch"](4);
2197
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context27.t0);
2159
2198
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2160
- return _context26.abrupt("return", {
2199
+ return _context27.abrupt("return", {
2161
2200
  status: 'failed',
2162
2201
  reason: 'not_found'
2163
2202
  });
2164
2203
  case 26:
2165
2204
  case "end":
2166
- return _context26.stop();
2205
+ return _context27.stop();
2167
2206
  }
2168
- }, _callee26, this, [[4, 21]]);
2207
+ }, _callee27, this, [[4, 21]]);
2169
2208
  }));
2170
2209
  function handleGlobalScanCode(_x19, _x20) {
2171
2210
  return _handleGlobalScanCode.apply(this, arguments);
@@ -2180,12 +2219,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2180
2219
  }, {
2181
2220
  key: "destroy",
2182
2221
  value: (function () {
2183
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
2222
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2184
2223
  var _this$scan;
2185
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2186
- while (1) switch (_context27.prev = _context27.next) {
2224
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2225
+ while (1) switch (_context28.prev = _context28.next) {
2187
2226
  case 0:
2188
- _context27.next = 2;
2227
+ _context28.next = 2;
2189
2228
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
2190
2229
  case 2:
2191
2230
  try {
@@ -2196,9 +2235,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2196
2235
  scanCache.clear();
2197
2236
  case 4:
2198
2237
  case "end":
2199
- return _context27.stop();
2238
+ return _context28.stop();
2200
2239
  }
2201
- }, _callee27, this);
2240
+ }, _callee28, this);
2202
2241
  }));
2203
2242
  function destroy() {
2204
2243
  return _destroy.apply(this, arguments);