@pisell/pisellos 2.2.167 → 2.2.169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +51 -15
  2. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +11 -1
  3. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +26 -2
  4. package/dist/modules/Customer/index.d.ts +6 -0
  5. package/dist/modules/Customer/index.js +122 -77
  6. package/dist/modules/Customer/types.d.ts +2 -0
  7. package/dist/modules/Discount/types.d.ts +1 -0
  8. package/dist/modules/Order/index.d.ts +5 -10
  9. package/dist/modules/Order/index.js +53 -9
  10. package/dist/modules/Order/types.d.ts +8 -0
  11. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  12. package/dist/modules/Order/utils/manualProductDiscount.js +212 -0
  13. package/dist/modules/Order/utils.d.ts +4 -0
  14. package/dist/modules/Order/utils.js +25 -10
  15. package/dist/modules/Rules/index.d.ts +4 -0
  16. package/dist/modules/Rules/index.js +26 -10
  17. package/dist/server/modules/order/utils/filterOrders.js +20 -6
  18. package/dist/solution/BaseSales/index.js +11 -5
  19. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +37 -6
  20. package/dist/solution/BaseSales/utils.js +11 -2
  21. package/dist/solution/BookingByStep/index.d.ts +1 -1
  22. package/dist/solution/BookingTicket/index.d.ts +9 -0
  23. package/dist/solution/BookingTicket/index.js +372 -192
  24. package/dist/solution/BookingTicket/utils/addProductDecision.js +3 -1
  25. package/dist/solution/ScanOrder/utils.js +11 -2
  26. package/dist/solution/VenueBooking/index.d.ts +1 -6
  27. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  28. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +42 -9
  29. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +11 -1
  30. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +22 -1
  31. package/lib/modules/Customer/index.d.ts +6 -0
  32. package/lib/modules/Customer/index.js +18 -3
  33. package/lib/modules/Customer/types.d.ts +2 -0
  34. package/lib/modules/Discount/types.d.ts +1 -0
  35. package/lib/modules/Order/index.d.ts +5 -10
  36. package/lib/modules/Order/index.js +52 -5
  37. package/lib/modules/Order/types.d.ts +8 -0
  38. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  39. package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
  40. package/lib/modules/Order/utils.d.ts +4 -0
  41. package/lib/modules/Order/utils.js +46 -10
  42. package/lib/modules/Rules/index.d.ts +4 -0
  43. package/lib/modules/Rules/index.js +22 -14
  44. package/lib/server/modules/order/utils/filterOrders.js +12 -4
  45. package/lib/solution/BaseSales/index.js +6 -0
  46. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +42 -4
  47. package/lib/solution/BaseSales/utils.js +10 -2
  48. package/lib/solution/BookingByStep/index.d.ts +1 -1
  49. package/lib/solution/BookingTicket/index.d.ts +9 -0
  50. package/lib/solution/BookingTicket/index.js +78 -1
  51. package/lib/solution/BookingTicket/utils/addProductDecision.js +3 -1
  52. package/lib/solution/ScanOrder/utils.js +10 -2
  53. package/lib/solution/VenueBooking/index.d.ts +1 -6
  54. package/package.json +1 -1
@@ -188,7 +188,188 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
188
188
  return _loadSalesDetail.apply(this, arguments);
189
189
  }
190
190
  return loadSalesDetail;
191
+ }())
192
+ }, {
193
+ key: "scanPromotionCode",
194
+ value: function () {
195
+ var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(code, customerId) {
196
+ var raw;
197
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
198
+ while (1) switch (_context3.prev = _context3.next) {
199
+ case 0:
200
+ if (this.store.order) {
201
+ _context3.next = 2;
202
+ break;
203
+ }
204
+ throw new Error('order 模块未初始化');
205
+ case 2:
206
+ _context3.next = 4;
207
+ return this.store.order.scanCode(code, customerId);
208
+ case 4:
209
+ raw = _context3.sent;
210
+ if (!raw.isAvailable) {
211
+ _context3.next = 11;
212
+ break;
213
+ }
214
+ _context3.next = 8;
215
+ return this.hydrateOrderCustomerFromScanDiscounts(raw.scannedDiscountList);
216
+ case 8:
217
+ _context3.next = 10;
218
+ return this.store.order.recalculateSummary({
219
+ createIfMissing: true
220
+ });
221
+ case 10:
222
+ this.store.order.persistTempOrder();
223
+ case 11:
224
+ return _context3.abrupt("return", {
225
+ isAvailable: raw.isAvailable,
226
+ type: raw.type,
227
+ unavailableReason: raw.unavailableReason
228
+ });
229
+ case 12:
230
+ case "end":
231
+ return _context3.stop();
232
+ }
233
+ }, _callee3, this);
234
+ }));
235
+ function scanPromotionCode(_x3, _x4) {
236
+ return _scanPromotionCode.apply(this, arguments);
237
+ }
238
+ return scanPromotionCode;
191
239
  }()
240
+ }, {
241
+ key: "hydrateOrderCustomerFromScanDiscounts",
242
+ value: function () {
243
+ var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(discounts) {
244
+ var currentOrderCustomer, customerId, customer;
245
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
246
+ while (1) switch (_context4.prev = _context4.next) {
247
+ case 0:
248
+ currentOrderCustomer = this.store.order.getOrderCustomer();
249
+ if (!currentOrderCustomer) {
250
+ _context4.next = 3;
251
+ break;
252
+ }
253
+ return _context4.abrupt("return");
254
+ case 3:
255
+ customerId = this.getDiscountCustomerId(discounts);
256
+ if (customerId) {
257
+ _context4.next = 6;
258
+ break;
259
+ }
260
+ return _context4.abrupt("return");
261
+ case 6:
262
+ _context4.next = 8;
263
+ return this.resolveCustomerByDiscountCustomerId(customerId);
264
+ case 8:
265
+ customer = _context4.sent;
266
+ if (customer) {
267
+ _context4.next = 11;
268
+ break;
269
+ }
270
+ return _context4.abrupt("return");
271
+ case 11:
272
+ this.store.customer.setSelectedCustomer(customer);
273
+ this.setOrderCustomer(customer);
274
+ case 13:
275
+ case "end":
276
+ return _context4.stop();
277
+ }
278
+ }, _callee4, this);
279
+ }));
280
+ function hydrateOrderCustomerFromScanDiscounts(_x5) {
281
+ return _hydrateOrderCustomerFromScanDiscounts.apply(this, arguments);
282
+ }
283
+ return hydrateOrderCustomerFromScanDiscounts;
284
+ }()
285
+ }, {
286
+ key: "getDiscountCustomerId",
287
+ value: function getDiscountCustomerId(discounts) {
288
+ var discount = discounts.find(function (item) {
289
+ return item.customer_id != null;
290
+ });
291
+ var customerId = Number(discount === null || discount === void 0 ? void 0 : discount.customer_id);
292
+ if (!Number.isFinite(customerId) || customerId <= 0) return null;
293
+ return customerId;
294
+ }
295
+ }, {
296
+ key: "resolveCustomerByDiscountCustomerId",
297
+ value: function () {
298
+ var _resolveCustomerByDiscountCustomerId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(customerId) {
299
+ var _result$list;
300
+ var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer;
301
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
302
+ while (1) switch (_context5.prev = _context5.next) {
303
+ case 0:
304
+ localCustomers = this.store.customer.getCustomers();
305
+ localCustomer = this.findCustomerById(localCustomers, customerId);
306
+ normalizedLocalCustomer = localCustomer ? this.normalizeCustomer(localCustomer) : null;
307
+ if (!(normalizedLocalCustomer && this.hasUsableCustomerDetails(normalizedLocalCustomer))) {
308
+ _context5.next = 5;
309
+ break;
310
+ }
311
+ return _context5.abrupt("return", normalizedLocalCustomer);
312
+ case 5:
313
+ _context5.next = 7;
314
+ return this.store.customer.queryCustomerList({
315
+ ids: [customerId],
316
+ skip: 1,
317
+ num: 1
318
+ });
319
+ case 7:
320
+ result = _context5.sent;
321
+ 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;
322
+ return _context5.abrupt("return", remoteCustomer ? this.normalizeCustomer(remoteCustomer) : null);
323
+ case 10:
324
+ case "end":
325
+ return _context5.stop();
326
+ }
327
+ }, _callee5, this);
328
+ }));
329
+ function resolveCustomerByDiscountCustomerId(_x6) {
330
+ return _resolveCustomerByDiscountCustomerId.apply(this, arguments);
331
+ }
332
+ return resolveCustomerByDiscountCustomerId;
333
+ }()
334
+ }, {
335
+ key: "findCustomerById",
336
+ value: function findCustomerById() {
337
+ var _this2 = this;
338
+ var customers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
339
+ var customerId = arguments.length > 1 ? arguments[1] : undefined;
340
+ return customers.find(function (customer) {
341
+ var rawId = _this2.getRawCustomerId(customer);
342
+ return rawId !== null && String(rawId) === String(customerId);
343
+ }) || null;
344
+ }
345
+ }, {
346
+ key: "normalizeCustomer",
347
+ value: function normalizeCustomer(customer) {
348
+ var _ref3, _ref4, _customer$phone, _ref5, _customer$email, _ref6, _customer$country_cal;
349
+ var raw = customer;
350
+ var rawId = this.getRawCustomerId(customer);
351
+ var name = customer.name || raw.display_name || raw.nickname || raw.customer_name || [raw.first_name, raw.last_name].filter(Boolean).join(' ') || '';
352
+ return _objectSpread(_objectSpread({}, customer), {}, {
353
+ id: rawId !== null && rawId !== void 0 ? rawId : customer.id,
354
+ name: name,
355
+ phone: (_ref3 = (_ref4 = (_customer$phone = customer.phone) !== null && _customer$phone !== void 0 ? _customer$phone : raw.phone) !== null && _ref4 !== void 0 ? _ref4 : raw.mobile) !== null && _ref3 !== void 0 ? _ref3 : '',
356
+ email: (_ref5 = (_customer$email = customer.email) !== null && _customer$email !== void 0 ? _customer$email : raw.email) !== null && _ref5 !== void 0 ? _ref5 : '',
357
+ country_calling_code: (_ref6 = (_customer$country_cal = customer.country_calling_code) !== null && _customer$country_cal !== void 0 ? _customer$country_cal : raw.country_calling_code) !== null && _ref6 !== void 0 ? _ref6 : ''
358
+ });
359
+ }
360
+ }, {
361
+ key: "getRawCustomerId",
362
+ value: function getRawCustomerId(customer) {
363
+ var _ref7, _ref8, _customer$id;
364
+ var raw = customer;
365
+ return (_ref7 = (_ref8 = (_customer$id = customer.id) !== null && _customer$id !== void 0 ? _customer$id : raw.customer_id) !== null && _ref8 !== void 0 ? _ref8 : raw.customerId) !== null && _ref7 !== void 0 ? _ref7 : null;
366
+ }
367
+ }, {
368
+ key: "hasUsableCustomerDetails",
369
+ value: function hasUsableCustomerDetails(customer) {
370
+ return !!(customer.name || customer.phone || customer.email || customer.display_name || customer.customer_name);
371
+ }
372
+
192
373
  /**
193
374
  * 更新当前预约的 appointment_status。
194
375
  *
@@ -203,66 +384,65 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
203
384
  * @param status 目标状态(如 'confirmed')
204
385
  * @returns 接口返回的 data
205
386
  */
206
- )
207
387
  }, {
208
388
  key: "setBookingStatus",
209
389
  value: (function () {
210
- var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(status) {
390
+ var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(status) {
211
391
  var _this$store$order, _this$store$order$get;
212
392
  var tempOrder, orderId, scheduleId, bookings, previous, _data, res;
213
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
214
- while (1) switch (_context3.prev = _context3.next) {
393
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
394
+ while (1) switch (_context6.prev = _context6.next) {
215
395
  case 0:
216
396
  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);
217
397
  if (tempOrder) {
218
- _context3.next = 3;
398
+ _context6.next = 3;
219
399
  break;
220
400
  }
221
401
  throw new Error('setBookingStatus: tempOrder 未加载');
222
402
  case 3:
223
403
  orderId = tempOrder.order_id;
224
404
  if (!(orderId === undefined || orderId === null)) {
225
- _context3.next = 6;
405
+ _context6.next = 6;
226
406
  break;
227
407
  }
228
408
  throw new Error('setBookingStatus: tempOrder.order_id 缺失');
229
409
  case 6:
230
410
  scheduleId = resolveScheduleId(tempOrder);
231
411
  if (!(scheduleId === null)) {
232
- _context3.next = 9;
412
+ _context6.next = 9;
233
413
  break;
234
414
  }
235
415
  throw new Error('setBookingStatus: 无法解析 schedule id(metadata 与 root booking 均缺失)');
236
416
  case 9:
237
417
  bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
238
418
  previous = applyBookingsStatus(bookings, status);
239
- _context3.prev = 11;
240
- _context3.next = 14;
419
+ _context6.prev = 11;
420
+ _context6.next = 14;
241
421
  return this.request.put("/schedule/booking/appointment-status/".concat(scheduleId), {
242
422
  appointment_status: status
243
423
  });
244
424
  case 14:
245
- res = _context3.sent;
246
- _context3.next = 17;
425
+ res = _context6.sent;
426
+ _context6.next = 17;
247
427
  return this.refreshSalesDetail();
248
428
  case 17:
249
429
  this.core.effects.emit("".concat(this.name, ":onBookingStatusChange"), {
250
430
  orderId: orderId,
251
431
  status: status
252
432
  });
253
- return _context3.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
433
+ return _context6.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
254
434
  case 21:
255
- _context3.prev = 21;
256
- _context3.t0 = _context3["catch"](11);
435
+ _context6.prev = 21;
436
+ _context6.t0 = _context6["catch"](11);
257
437
  restoreBookingsStatus(bookings, previous);
258
- throw _context3.t0;
438
+ throw _context6.t0;
259
439
  case 25:
260
440
  case "end":
261
- return _context3.stop();
441
+ return _context6.stop();
262
442
  }
263
- }, _callee3, this, [[11, 21]]);
443
+ }, _callee6, this, [[11, 21]]);
264
444
  }));
265
- function setBookingStatus(_x3) {
445
+ function setBookingStatus(_x7) {
266
446
  return _setBookingStatus.apply(this, arguments);
267
447
  }
268
448
  return setBookingStatus;
@@ -281,35 +461,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
281
461
  }, {
282
462
  key: "refreshSalesDetail",
283
463
  value: (function () {
284
- var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
464
+ var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
285
465
  var _this$store$order2, _this$store$order2$ge;
286
466
  var tempOrder, orderId;
287
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
288
- while (1) switch (_context4.prev = _context4.next) {
467
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
468
+ while (1) switch (_context7.prev = _context7.next) {
289
469
  case 0:
290
470
  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);
291
471
  if (tempOrder) {
292
- _context4.next = 3;
472
+ _context7.next = 3;
293
473
  break;
294
474
  }
295
475
  throw new Error('refreshSalesDetail: tempOrder 未加载');
296
476
  case 3:
297
477
  orderId = tempOrder.order_id;
298
478
  if (!(orderId === undefined || orderId === null)) {
299
- _context4.next = 6;
479
+ _context7.next = 6;
300
480
  break;
301
481
  }
302
482
  throw new Error('refreshSalesDetail: tempOrder.order_id 缺失');
303
483
  case 6:
304
- return _context4.abrupt("return", this.loadSalesDetail({
484
+ return _context7.abrupt("return", this.loadSalesDetail({
305
485
  orderId: Number(orderId),
306
486
  forceRemote: true
307
487
  }));
308
488
  case 7:
309
489
  case "end":
310
- return _context4.stop();
490
+ return _context7.stop();
311
491
  }
312
- }, _callee4, this);
492
+ }, _callee7, this);
313
493
  }));
314
494
  function refreshSalesDetail() {
315
495
  return _refreshSalesDetail.apply(this, arguments);
@@ -325,7 +505,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
325
505
  }, {
326
506
  key: "loadProducts",
327
507
  value: (function () {
328
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
508
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
329
509
  var params,
330
510
  options,
331
511
  schedule_date,
@@ -334,20 +514,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
334
514
  schedule_datetime,
335
515
  bookingDate,
336
516
  _result,
337
- _args5 = arguments;
338
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
339
- while (1) switch (_context5.prev = _context5.next) {
517
+ _args8 = arguments;
518
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
519
+ while (1) switch (_context8.prev = _context8.next) {
340
520
  case 0:
341
- params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
342
- options = _args5.length > 1 ? _args5[1] : undefined;
343
- schedule_date = params.schedule_date, customer_id = params.customer_id, menu_list_ids = params.menu_list_ids, schedule_datetime = params.schedule_datetime; // products 格式化器对齐日历日(YYYY-MM-DD);勿写入 schedule_datetime 全串,
344
- // 否则 requiresDetail 会把带时分秒的 date 传给弹窗,handleOpenProductModal 无法打开。
345
- bookingDate = schedule_date || (schedule_datetime ? String(schedule_datetime).slice(0, 10) : '');
521
+ params = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
522
+ options = _args8.length > 1 ? _args8[1] : undefined;
523
+ 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 对齐;
524
+ // requiresDetail 弹窗仍通过 formatBookingDateForUI 只取日历日 YYYY-MM-DD。
525
+ bookingDate = schedule_datetime || schedule_date || '';
346
526
  if (bookingDate) {
347
527
  this.setBookingDate(bookingDate);
348
528
  }
349
- _context5.prev = 5;
350
- _context5.next = 8;
529
+ _context8.prev = 5;
530
+ _context8.next = 8;
351
531
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
352
532
  with_count: ['bundleGroup', 'optionGroup'],
353
533
  with_schedule: 1
@@ -355,20 +535,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
355
535
  cacheId: this.cacheId
356
536
  }), options);
357
537
  case 8:
358
- _result = _context5.sent;
538
+ _result = _context8.sent;
359
539
  this.productCatalog = Array.isArray(_result) ? _toConsumableArray(_result) : [];
360
540
  this.core.effects.emit("".concat(this.name, ":onProductsLoaded"), _result);
361
- return _context5.abrupt("return", _result);
541
+ return _context8.abrupt("return", _result);
362
542
  case 14:
363
- _context5.prev = 14;
364
- _context5.t0 = _context5["catch"](5);
365
- console.error('Failed to load products:', _context5.t0);
366
- throw _context5.t0;
543
+ _context8.prev = 14;
544
+ _context8.t0 = _context8["catch"](5);
545
+ console.error('Failed to load products:', _context8.t0);
546
+ throw _context8.t0;
367
547
  case 18:
368
548
  case "end":
369
- return _context5.stop();
549
+ return _context8.stop();
370
550
  }
371
- }, _callee5, this, [[5, 14]]);
551
+ }, _callee8, this, [[5, 14]]);
372
552
  }));
373
553
  function loadProducts() {
374
554
  return _loadProducts.apply(this, arguments);
@@ -383,28 +563,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
383
563
  }, {
384
564
  key: "loadProductDetail",
385
565
  value: (function () {
386
- var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params, options) {
566
+ var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params, options) {
387
567
  var product_id, queryParams, products;
388
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
389
- while (1) switch (_context6.prev = _context6.next) {
568
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
569
+ while (1) switch (_context9.prev = _context9.next) {
390
570
  case 0:
391
571
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded2);
392
- _context6.next = 3;
572
+ _context9.next = 3;
393
573
  return this.loadProducts(_objectSpread(_objectSpread({}, queryParams), {}, {
394
574
  product_ids: [product_id]
395
575
  }), options);
396
576
  case 3:
397
- products = _context6.sent;
398
- return _context6.abrupt("return", products.find(function (product) {
577
+ products = _context9.sent;
578
+ return _context9.abrupt("return", products.find(function (product) {
399
579
  return Number(product.id) === Number(product_id);
400
580
  }));
401
581
  case 5:
402
582
  case "end":
403
- return _context6.stop();
583
+ return _context9.stop();
404
584
  }
405
- }, _callee6, this);
585
+ }, _callee9, this);
406
586
  }));
407
- function loadProductDetail(_x4, _x5) {
587
+ function loadProductDetail(_x8, _x9) {
408
588
  return _loadProductDetail.apply(this, arguments);
409
589
  }
410
590
  return loadProductDetail;
@@ -437,16 +617,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
437
617
  }, {
438
618
  key: "getProducts",
439
619
  value: (function () {
440
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
441
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
442
- while (1) switch (_context7.prev = _context7.next) {
620
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
621
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
622
+ while (1) switch (_context10.prev = _context10.next) {
443
623
  case 0:
444
- return _context7.abrupt("return", this.store.products.getProducts());
624
+ return _context10.abrupt("return", this.store.products.getProducts());
445
625
  case 1:
446
626
  case "end":
447
- return _context7.stop();
627
+ return _context10.stop();
448
628
  }
449
- }, _callee7, this);
629
+ }, _callee10, this);
450
630
  }));
451
631
  function getProducts() {
452
632
  return _getProducts.apply(this, arguments);
@@ -499,18 +679,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
499
679
  }, {
500
680
  key: "getProductByIds",
501
681
  value: (function () {
502
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(ids) {
503
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
504
- while (1) switch (_context8.prev = _context8.next) {
682
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(ids) {
683
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
684
+ while (1) switch (_context11.prev = _context11.next) {
505
685
  case 0:
506
- return _context8.abrupt("return", this.store.products.getProductByIds(ids));
686
+ return _context11.abrupt("return", this.store.products.getProductByIds(ids));
507
687
  case 1:
508
688
  case "end":
509
- return _context8.stop();
689
+ return _context11.stop();
510
690
  }
511
- }, _callee8, this);
691
+ }, _callee11, this);
512
692
  }));
513
- function getProductByIds(_x6) {
693
+ function getProductByIds(_x10) {
514
694
  return _getProductByIds.apply(this, arguments);
515
695
  }
516
696
  return getProductByIds;
@@ -524,27 +704,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
524
704
  }, {
525
705
  key: "getScheduleTimePoints",
526
706
  value: (function () {
527
- var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
707
+ var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(params) {
528
708
  var result;
529
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
530
- while (1) switch (_context9.prev = _context9.next) {
709
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
710
+ while (1) switch (_context12.prev = _context12.next) {
531
711
  case 0:
532
- _context9.next = 2;
712
+ _context12.next = 2;
533
713
  return this.request.post('/menu/schedule-time-points', {
534
714
  menu_list_ids: params.menu_list_ids
535
715
  }, {
536
716
  osServer: true
537
717
  });
538
718
  case 2:
539
- result = _context9.sent;
540
- return _context9.abrupt("return", result.data || []);
719
+ result = _context12.sent;
720
+ return _context12.abrupt("return", result.data || []);
541
721
  case 4:
542
722
  case "end":
543
- return _context9.stop();
723
+ return _context12.stop();
544
724
  }
545
- }, _callee9, this);
725
+ }, _callee12, this);
546
726
  }));
547
- function getScheduleTimePoints(_x7) {
727
+ function getScheduleTimePoints(_x11) {
548
728
  return _getScheduleTimePoints.apply(this, arguments);
549
729
  }
550
730
  return getScheduleTimePoints;
@@ -558,30 +738,30 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
558
738
  }, {
559
739
  key: "getCustomerList",
560
740
  value: (function () {
561
- var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
741
+ var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
562
742
  var params,
563
743
  _result2,
564
- _args10 = arguments;
565
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
566
- while (1) switch (_context10.prev = _context10.next) {
744
+ _args13 = arguments;
745
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
746
+ while (1) switch (_context13.prev = _context13.next) {
567
747
  case 0:
568
- params = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : {};
569
- _context10.prev = 1;
570
- _context10.next = 4;
748
+ params = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
749
+ _context13.prev = 1;
750
+ _context13.next = 4;
571
751
  return this.store.customer.getCustomerList(params);
572
752
  case 4:
573
- _result2 = _context10.sent;
574
- return _context10.abrupt("return", _result2);
753
+ _result2 = _context13.sent;
754
+ return _context13.abrupt("return", _result2);
575
755
  case 8:
576
- _context10.prev = 8;
577
- _context10.t0 = _context10["catch"](1);
578
- console.error('Failed to get customer list:', _context10.t0);
579
- throw _context10.t0;
756
+ _context13.prev = 8;
757
+ _context13.t0 = _context13["catch"](1);
758
+ console.error('Failed to get customer list:', _context13.t0);
759
+ throw _context13.t0;
580
760
  case 12:
581
761
  case "end":
582
- return _context10.stop();
762
+ return _context13.stop();
583
763
  }
584
- }, _callee10, this, [[1, 8]]);
764
+ }, _callee13, this, [[1, 8]]);
585
765
  }));
586
766
  function getCustomerList() {
587
767
  return _getCustomerList.apply(this, arguments);
@@ -725,7 +905,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
725
905
  value: function clearOrderCustomer() {
726
906
  var _discountModule$setOr,
727
907
  _discountModule$setDi,
728
- _this2 = this;
908
+ _this3 = this;
729
909
  this.store.order.clearOrderCustomer();
730
910
  var orderStore = this.store.order.store || {};
731
911
  var discountModule = orderStore.discount;
@@ -735,7 +915,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
735
915
  void this.store.order.recalculateSummary({
736
916
  createIfMissing: true
737
917
  }).then(function () {
738
- return _this2.store.order.persistTempOrder();
918
+ return _this3.store.order.persistTempOrder();
739
919
  }).catch(function (error) {
740
920
  console.error('Failed to recalculate summary after clearing customer:', error);
741
921
  });
@@ -754,24 +934,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
754
934
  }, {
755
935
  key: "restoreOrder",
756
936
  value: (function () {
757
- var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
937
+ var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
758
938
  var _this$store$customer;
759
939
  var tempOrder;
760
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
761
- while (1) switch (_context11.prev = _context11.next) {
940
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
941
+ while (1) switch (_context14.prev = _context14.next) {
762
942
  case 0:
763
- _context11.next = 2;
943
+ _context14.next = 2;
764
944
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "restoreOrder", this).call(this);
765
945
  case 2:
766
- tempOrder = _context11.sent;
946
+ tempOrder = _context14.sent;
767
947
  this.clearOrderCustomer();
768
948
  (_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.setSelectedCustomer(null);
769
- return _context11.abrupt("return", tempOrder);
949
+ return _context14.abrupt("return", tempOrder);
770
950
  case 6:
771
951
  case "end":
772
- return _context11.stop();
952
+ return _context14.stop();
773
953
  }
774
- }, _callee11, this);
954
+ }, _callee14, this);
775
955
  }));
776
956
  function restoreOrder() {
777
957
  return _restoreOrder.apply(this, arguments);
@@ -791,51 +971,51 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
791
971
  }, {
792
972
  key: "refreshDiscountConfigAfterOrderCustomerChange",
793
973
  value: function refreshDiscountConfigAfterOrderCustomerChange(customerId) {
794
- var _this3 = this;
974
+ var _this4 = this;
795
975
  if (!customerId || customerId === 1) return;
796
976
  if (this.orderCustomerDiscountRefreshInFlight && this.orderCustomerDiscountRefreshCustomerId === customerId) {
797
977
  return;
798
978
  }
799
979
  var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
800
- var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
980
+ var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
801
981
  var currentCustomer;
802
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
803
- while (1) switch (_context12.prev = _context12.next) {
982
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
983
+ while (1) switch (_context15.prev = _context15.next) {
804
984
  case 0:
805
985
  if (!previousRefresh) {
806
- _context12.next = 3;
986
+ _context15.next = 3;
807
987
  break;
808
988
  }
809
- _context12.next = 3;
989
+ _context15.next = 3;
810
990
  return previousRefresh.catch(function () {
811
991
  return undefined;
812
992
  });
813
993
  case 3:
814
- currentCustomer = _this3.store.order.getOrderCustomer();
994
+ currentCustomer = _this4.store.order.getOrderCustomer();
815
995
  if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
816
- _context12.next = 6;
996
+ _context15.next = 6;
817
997
  break;
818
998
  }
819
- return _context12.abrupt("return");
999
+ return _context15.abrupt("return");
820
1000
  case 6:
821
- _context12.next = 8;
822
- return _this3.loadDiscountConfig({
1001
+ _context15.next = 8;
1002
+ return _this4.loadDiscountConfig({
823
1003
  customerId: customerId
824
1004
  });
825
1005
  case 8:
826
1006
  case "end":
827
- return _context12.stop();
1007
+ return _context15.stop();
828
1008
  }
829
- }, _callee12);
1009
+ }, _callee15);
830
1010
  }))();
831
1011
  this.orderCustomerDiscountRefreshInFlight = refreshTask;
832
1012
  this.orderCustomerDiscountRefreshCustomerId = customerId;
833
1013
  refreshTask.catch(function (error) {
834
1014
  console.error('Failed to load discount config after customer change:', error);
835
1015
  }).finally(function () {
836
- if (_this3.orderCustomerDiscountRefreshInFlight !== refreshTask) return;
837
- _this3.orderCustomerDiscountRefreshInFlight = null;
838
- _this3.orderCustomerDiscountRefreshCustomerId = null;
1016
+ if (_this4.orderCustomerDiscountRefreshInFlight !== refreshTask) return;
1017
+ _this4.orderCustomerDiscountRefreshInFlight = null;
1018
+ _this4.orderCustomerDiscountRefreshCustomerId = null;
839
1019
  });
840
1020
  }
841
1021
 
@@ -879,29 +1059,29 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
879
1059
  }, {
880
1060
  key: "changeCustomerPage",
881
1061
  value: (function () {
882
- var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(page, pageSize) {
1062
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(page, pageSize) {
883
1063
  var _result3;
884
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
885
- while (1) switch (_context13.prev = _context13.next) {
1064
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1065
+ while (1) switch (_context16.prev = _context16.next) {
886
1066
  case 0:
887
- _context13.prev = 0;
888
- _context13.next = 3;
1067
+ _context16.prev = 0;
1068
+ _context16.next = 3;
889
1069
  return this.store.customer.changeCustomerPage(page, pageSize);
890
1070
  case 3:
891
- _result3 = _context13.sent;
892
- return _context13.abrupt("return", _result3);
1071
+ _result3 = _context16.sent;
1072
+ return _context16.abrupt("return", _result3);
893
1073
  case 7:
894
- _context13.prev = 7;
895
- _context13.t0 = _context13["catch"](0);
896
- console.error('Failed to change customer page:', _context13.t0);
897
- throw _context13.t0;
1074
+ _context16.prev = 7;
1075
+ _context16.t0 = _context16["catch"](0);
1076
+ console.error('Failed to change customer page:', _context16.t0);
1077
+ throw _context16.t0;
898
1078
  case 11:
899
1079
  case "end":
900
- return _context13.stop();
1080
+ return _context16.stop();
901
1081
  }
902
- }, _callee13, this, [[0, 7]]);
1082
+ }, _callee16, this, [[0, 7]]);
903
1083
  }));
904
- function changeCustomerPage(_x8, _x9) {
1084
+ function changeCustomerPage(_x12, _x13) {
905
1085
  return _changeCustomerPage.apply(this, arguments);
906
1086
  }
907
1087
  return changeCustomerPage;
@@ -914,28 +1094,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
914
1094
  }, {
915
1095
  key: "loadMoreCustomers",
916
1096
  value: (function () {
917
- var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
1097
+ var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
918
1098
  var _result4;
919
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
920
- while (1) switch (_context14.prev = _context14.next) {
1099
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1100
+ while (1) switch (_context17.prev = _context17.next) {
921
1101
  case 0:
922
- _context14.prev = 0;
923
- _context14.next = 3;
1102
+ _context17.prev = 0;
1103
+ _context17.next = 3;
924
1104
  return this.store.customer.loadMoreCustomers();
925
1105
  case 3:
926
- _result4 = _context14.sent;
1106
+ _result4 = _context17.sent;
927
1107
  this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result4);
928
- return _context14.abrupt("return", _result4);
1108
+ return _context17.abrupt("return", _result4);
929
1109
  case 8:
930
- _context14.prev = 8;
931
- _context14.t0 = _context14["catch"](0);
932
- console.error('Failed to load more customers:', _context14.t0);
933
- throw _context14.t0;
1110
+ _context17.prev = 8;
1111
+ _context17.t0 = _context17["catch"](0);
1112
+ console.error('Failed to load more customers:', _context17.t0);
1113
+ throw _context17.t0;
934
1114
  case 12:
935
1115
  case "end":
936
- return _context14.stop();
1116
+ return _context17.stop();
937
1117
  }
938
- }, _callee14, this, [[0, 8]]);
1118
+ }, _callee17, this, [[0, 8]]);
939
1119
  }));
940
1120
  function loadMoreCustomers() {
941
1121
  return _loadMoreCustomers.apply(this, arguments);
@@ -951,31 +1131,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
951
1131
  }, {
952
1132
  key: "resetAndLoadCustomers",
953
1133
  value: (function () {
954
- var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
1134
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
955
1135
  var params,
956
1136
  _result5,
957
- _args15 = arguments;
958
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
959
- while (1) switch (_context15.prev = _context15.next) {
1137
+ _args18 = arguments;
1138
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1139
+ while (1) switch (_context18.prev = _context18.next) {
960
1140
  case 0:
961
- params = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
962
- _context15.prev = 1;
963
- _context15.next = 4;
1141
+ params = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
1142
+ _context18.prev = 1;
1143
+ _context18.next = 4;
964
1144
  return this.store.customer.resetAndLoadCustomers(params);
965
1145
  case 4:
966
- _result5 = _context15.sent;
1146
+ _result5 = _context18.sent;
967
1147
  this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result5);
968
- return _context15.abrupt("return", _result5);
1148
+ return _context18.abrupt("return", _result5);
969
1149
  case 9:
970
- _context15.prev = 9;
971
- _context15.t0 = _context15["catch"](1);
972
- console.error('Failed to reset and load customers:', _context15.t0);
973
- throw _context15.t0;
1150
+ _context18.prev = 9;
1151
+ _context18.t0 = _context18["catch"](1);
1152
+ console.error('Failed to reset and load customers:', _context18.t0);
1153
+ throw _context18.t0;
974
1154
  case 13:
975
1155
  case "end":
976
- return _context15.stop();
1156
+ return _context18.stop();
977
1157
  }
978
- }, _callee15, this, [[1, 9]]);
1158
+ }, _callee18, this, [[1, 9]]);
979
1159
  }));
980
1160
  function resetAndLoadCustomers() {
981
1161
  return _resetAndLoadCustomers.apply(this, arguments);
@@ -1020,9 +1200,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1020
1200
  }, {
1021
1201
  key: "scanGlobalListener",
1022
1202
  value: function scanGlobalListener(callback) {
1023
- var _this4 = this;
1203
+ var _this5 = this;
1024
1204
  var localSearch = function localSearch(v) {
1025
- return _this4.store.products.findProductsByCodeOrBarcode(v);
1205
+ return _this5.store.products.findProductsByCodeOrBarcode(v);
1026
1206
  };
1027
1207
  var scanCallback = handleGlobalScan(this.request, localSearch);
1028
1208
  var safeCallback = function safeCallback(d) {
@@ -1137,15 +1317,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1137
1317
  }, {
1138
1318
  key: "setOtherParams",
1139
1319
  value: (function () {
1140
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
1141
- var _ref4,
1142
- _ref4$cover,
1320
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
1321
+ var _ref10,
1322
+ _ref10$cover,
1143
1323
  cover,
1144
- _args16 = arguments;
1145
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1146
- while (1) switch (_context16.prev = _context16.next) {
1324
+ _args19 = arguments;
1325
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1326
+ while (1) switch (_context19.prev = _context19.next) {
1147
1327
  case 0:
1148
- _ref4 = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : {}, _ref4$cover = _ref4.cover, cover = _ref4$cover === void 0 ? false : _ref4$cover;
1328
+ _ref10 = _args19.length > 1 && _args19[1] !== undefined ? _args19[1] : {}, _ref10$cover = _ref10.cover, cover = _ref10$cover === void 0 ? false : _ref10$cover;
1149
1329
  if (cover) {
1150
1330
  this.otherParams = params;
1151
1331
  } else {
@@ -1153,11 +1333,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1153
1333
  }
1154
1334
  case 2:
1155
1335
  case "end":
1156
- return _context16.stop();
1336
+ return _context19.stop();
1157
1337
  }
1158
- }, _callee16, this);
1338
+ }, _callee19, this);
1159
1339
  }));
1160
- function setOtherParams(_x10) {
1340
+ function setOtherParams(_x14) {
1161
1341
  return _setOtherParams.apply(this, arguments);
1162
1342
  }
1163
1343
  return setOtherParams;
@@ -1170,16 +1350,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1170
1350
  }, {
1171
1351
  key: "getOtherParams",
1172
1352
  value: (function () {
1173
- var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1174
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1175
- while (1) switch (_context17.prev = _context17.next) {
1353
+ var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1354
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1355
+ while (1) switch (_context20.prev = _context20.next) {
1176
1356
  case 0:
1177
- return _context17.abrupt("return", this.otherParams);
1357
+ return _context20.abrupt("return", this.otherParams);
1178
1358
  case 1:
1179
1359
  case "end":
1180
- return _context17.stop();
1360
+ return _context20.stop();
1181
1361
  }
1182
- }, _callee17, this);
1362
+ }, _callee20, this);
1183
1363
  }));
1184
1364
  function getOtherParams() {
1185
1365
  return _getOtherParams.apply(this, arguments);
@@ -1345,10 +1525,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1345
1525
  }, {
1346
1526
  key: "buildAddProductCtx",
1347
1527
  value: function buildAddProductCtx(extra) {
1348
- var _extra$date2, _ref5, _this$getOrderCustome, _this$getOrderCustome2, _this$store$order$get3, _extra$presetStartTim2;
1528
+ var _extra$date2, _ref11, _this$getOrderCustome, _this$getOrderCustome2, _this$store$order$get3, _extra$presetStartTim2;
1349
1529
  var bookingContextState = this.store.bookingContext.getState();
1350
1530
  var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
1351
- var orderCustomerId = (_ref5 = (_this$getOrderCustome = (_this$getOrderCustome2 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome2 === void 0 ? void 0 : _this$getOrderCustome2.id) !== null && _this$getOrderCustome !== void 0 ? _this$getOrderCustome : (_this$store$order$get3 = this.store.order.getTempOrder()) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.customer_id) !== null && _ref5 !== void 0 ? _ref5 : undefined;
1531
+ var orderCustomerId = (_ref11 = (_this$getOrderCustome = (_this$getOrderCustome2 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome2 === void 0 ? void 0 : _this$getOrderCustome2.id) !== null && _this$getOrderCustome !== void 0 ? _this$getOrderCustome : (_this$store$order$get3 = this.store.order.getTempOrder()) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.customer_id) !== null && _ref11 !== void 0 ? _ref11 : undefined;
1352
1532
  return _objectSpread({
1353
1533
  bookingConfig: bookingContextState.bookingConfig,
1354
1534
  resourcesOrigin: bookingContextState.resourcesOrigin,
@@ -1448,18 +1628,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1448
1628
  }, {
1449
1629
  key: "updateProductInOrder",
1450
1630
  value: (function () {
1451
- var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params) {
1452
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1453
- while (1) switch (_context18.prev = _context18.next) {
1631
+ var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
1632
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1633
+ while (1) switch (_context21.prev = _context21.next) {
1454
1634
  case 0:
1455
- return _context18.abrupt("return", this.updateOrderProduct(params));
1635
+ return _context21.abrupt("return", this.updateOrderProduct(params));
1456
1636
  case 1:
1457
1637
  case "end":
1458
- return _context18.stop();
1638
+ return _context21.stop();
1459
1639
  }
1460
- }, _callee18, this);
1640
+ }, _callee21, this);
1461
1641
  }));
1462
- function updateProductInOrder(_x11) {
1642
+ function updateProductInOrder(_x15) {
1463
1643
  return _updateProductInOrder.apply(this, arguments);
1464
1644
  }
1465
1645
  return updateProductInOrder;
@@ -1472,12 +1652,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1472
1652
  }, {
1473
1653
  key: "destroy",
1474
1654
  value: (function () {
1475
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1655
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1476
1656
  var _this$scan;
1477
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1478
- while (1) switch (_context19.prev = _context19.next) {
1657
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1658
+ while (1) switch (_context22.prev = _context22.next) {
1479
1659
  case 0:
1480
- _context19.next = 2;
1660
+ _context22.next = 2;
1481
1661
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
1482
1662
  case 2:
1483
1663
  try {
@@ -1488,9 +1668,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1488
1668
  scanCache.clear();
1489
1669
  case 4:
1490
1670
  case "end":
1491
- return _context19.stop();
1671
+ return _context22.stop();
1492
1672
  }
1493
- }, _callee19, this);
1673
+ }, _callee22, this);
1494
1674
  }));
1495
1675
  function destroy() {
1496
1676
  return _destroy.apply(this, arguments);