@pisell/pisellos 0.10.67 → 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
  }
@@ -360,7 +360,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
360
360
  * 获取当前的客户搜索条件
361
361
  * @returns 当前搜索条件
362
362
  */
363
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
363
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
364
364
  /**
365
365
  * 获取客户列表状态(包含滚动加载相关状态)
366
366
  * @returns 客户状态
@@ -1,46 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
7
- enumerable: true,
8
- get: function () {
9
- return _examples.BUY_X_GET_Y_FREE_STRATEGY;
10
- }
11
- });
12
- Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
13
- enumerable: true,
14
- get: function () {
15
- return _examples.ITEM_REWARD_STRATEGY;
16
- }
17
- });
18
- Object.defineProperty(exports, "PromotionAdapter", {
19
- enumerable: true,
20
- get: function () {
21
- return _adapter.PromotionAdapter;
22
- }
23
- });
24
- Object.defineProperty(exports, "PromotionEvaluator", {
25
- enumerable: true,
26
- get: function () {
27
- return _evaluator.PromotionEvaluator;
28
- }
29
- });
30
- Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
31
- enumerable: true,
32
- get: function () {
33
- return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
34
- }
35
- });
36
- Object.defineProperty(exports, "default", {
37
- enumerable: true,
38
- get: function () {
39
- return _adapter.default;
40
- }
41
- });
42
- var _evaluator = require("./evaluator");
43
- var _adapter = _interopRequireWildcard(require("./adapter"));
44
- var _examples = require("./examples");
45
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
46
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
1
+ "use strict";
@@ -1918,8 +1918,10 @@ class BaseSalesImpl extends _BaseModule.BaseModule {
1918
1918
  }
1919
1919
  async validateContactInfo() {
1920
1920
  const order = this.getTempOrder();
1921
- const identity = order?._extend?.localId || order?.external_sale_number || order?.order_id || order;
1922
1921
  const customerId = order?.customer_id;
1922
+ // Missing customer IDs and the reserved Walk-In IDs do not require contact info.
1923
+ if (!Number.isFinite(Number(customerId)) || Number(customerId) <= 1) return;
1924
+ const identity = order?._extend?.localId || order?.external_sale_number || order?.order_id || order;
1923
1925
  const config = await this.getContactInfoConfig();
1924
1926
  const current = this.getTempOrder();
1925
1927
  if (identity !== (current?._extend?.localId || current?.external_sale_number || current?.order_id || current) || customerId !== current?.customer_id) {
@@ -360,7 +360,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
360
360
  * 获取当前的客户搜索条件
361
361
  * @returns 当前搜索条件
362
362
  */
363
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
363
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
364
364
  /**
365
365
  * 获取客户列表状态(包含滚动加载相关状态)
366
366
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.67",
4
+ "version": "0.10.68",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",