@pisell/pisellos 0.10.66 → 0.10.68

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.
@@ -2954,31 +2954,37 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2954
2954
  value: function () {
2955
2955
  var _validateContactInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
2956
2956
  var _order$_extend, _current$_extend;
2957
- var order, identity, customerId, config, current, missing;
2957
+ var order, customerId, identity, config, current, missing;
2958
2958
  return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2959
2959
  while (1) switch (_context26.prev = _context26.next) {
2960
2960
  case 0:
2961
2961
  order = this.getTempOrder();
2962
+ customerId = order === null || order === void 0 ? void 0 : order.customer_id; // Missing customer IDs and the reserved Walk-In IDs do not require contact info.
2963
+ if (!(!Number.isFinite(Number(customerId)) || Number(customerId) <= 1)) {
2964
+ _context26.next = 4;
2965
+ break;
2966
+ }
2967
+ return _context26.abrupt("return");
2968
+ case 4:
2962
2969
  identity = (order === null || order === void 0 || (_order$_extend = order._extend) === null || _order$_extend === void 0 ? void 0 : _order$_extend.localId) || (order === null || order === void 0 ? void 0 : order.external_sale_number) || (order === null || order === void 0 ? void 0 : order.order_id) || order;
2963
- customerId = order === null || order === void 0 ? void 0 : order.customer_id;
2964
- _context26.next = 5;
2970
+ _context26.next = 7;
2965
2971
  return this.getContactInfoConfig();
2966
- case 5:
2972
+ case 7:
2967
2973
  config = _context26.sent;
2968
2974
  current = this.getTempOrder();
2969
2975
  if (!(identity !== ((current === null || current === void 0 || (_current$_extend = current._extend) === null || _current$_extend === void 0 ? void 0 : _current$_extend.localId) || (current === null || current === void 0 ? void 0 : current.external_sale_number) || (current === null || current === void 0 ? void 0 : current.order_id) || current) || customerId !== (current === null || current === void 0 ? void 0 : current.customer_id))) {
2970
- _context26.next = 9;
2976
+ _context26.next = 11;
2971
2977
  break;
2972
2978
  }
2973
2979
  throw new Error('The order changed. Please try again.');
2974
- case 9:
2980
+ case 11:
2975
2981
  missing = getMissingContactInfoFields(config, current === null || current === void 0 ? void 0 : current.contacts_info);
2976
2982
  if (!missing.length) {
2977
- _context26.next = 12;
2983
+ _context26.next = 14;
2978
2984
  break;
2979
2985
  }
2980
2986
  throw new ContactInfoRequiredError(missing);
2981
- case 12:
2987
+ case 14:
2982
2988
  case "end":
2983
2989
  return _context26.stop();
2984
2990
  }
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
329
+ weekNum: 0 | 6 | 5 | 1 | 2 | 3 | 4;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -32,6 +32,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
32
32
  private orderCustomerDiscountRefreshCustomerId;
33
33
  private orderCustomerDiscountRefreshTarget;
34
34
  private orderCustomerPromotionRefreshInFlight;
35
+ private orderCustomerContactRequest;
35
36
  private readonly customerResolveRequests;
36
37
  protected loadOpenDataInFlight: Promise<OpenDataConfig> | null;
37
38
  protected loadOpenDataInFlightTarget: string | null;
@@ -276,6 +277,16 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
276
277
  setOrderCustomer(customer: ICustomer | null, options?: {
277
278
  source?: OrderCustomerChangePayload['source'];
278
279
  }): void;
280
+ private resetOrderCustomerContactInfo;
281
+ /** Explicit edits, including clearing the contact, must win over a pending default. */
282
+ updateTempOrderContactsInfo(contact: Record<string, any> | null): Record<string, any> | null;
283
+ private getCustomerContactScope;
284
+ private getCustomerContactOrderKey;
285
+ replaceTempOrder(...args: Parameters<BaseSalesImpl['replaceTempOrder']>): Promise<import("../../modules/Order/types").OrderTempOrder>;
286
+ private applyDefaultOrderCustomerContactInfo;
287
+ private prefillOrderCustomerContactInfo;
288
+ protected waitForOrderCustomerContactInfo(): Promise<void>;
289
+ validateContactInfo(): Promise<void>;
279
290
  /**
280
291
  * 读取 tempOrder 上的下单客户协议字段;customer_id 缺失时返回 null。
281
292
  */
@@ -468,7 +479,19 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
468
479
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
469
480
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
470
481
  */
471
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
482
+ decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
483
+ action: "reloadCatalog";
484
+ } | {
485
+ action: "add";
486
+ cacheItem: any;
487
+ } | {
488
+ action: "requiresDetail";
489
+ payload: AddProductRequiresDetailPayload;
490
+ } | {
491
+ action: "requiresBookingEdit";
492
+ cacheItem: any;
493
+ payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
494
+ };
472
495
  /** 规格弹窗 callback 后的第二段决策。 */
473
496
  decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
474
497
  /**