@pisell/pisellos 2.2.42 → 2.2.43

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 (99) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/model/index.d.ts +1 -0
  4. package/dist/model/index.js +1 -0
  5. package/dist/model/strategy/adapter/index.d.ts +3 -0
  6. package/dist/model/strategy/adapter/index.js +4 -0
  7. package/dist/model/strategy/adapter/type.d.ts +28 -0
  8. package/dist/model/strategy/adapter/type.js +1 -0
  9. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
  10. package/dist/model/strategy/adapter/walletPass/evaluator.js +497 -0
  11. package/dist/model/strategy/adapter/walletPass/example.d.ts +4 -0
  12. package/dist/model/strategy/adapter/walletPass/example.js +258 -0
  13. package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
  14. package/dist/model/strategy/adapter/walletPass/index.js +182 -0
  15. package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  16. package/dist/model/strategy/adapter/walletPass/locales.js +23 -0
  17. package/dist/model/strategy/adapter/walletPass/type.d.ts +165 -0
  18. package/dist/model/strategy/adapter/walletPass/type.js +1 -0
  19. package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  20. package/dist/model/strategy/adapter/walletPass/utils.js +965 -0
  21. package/dist/model/strategy/index.d.ts +94 -0
  22. package/dist/model/strategy/index.js +551 -0
  23. package/dist/model/strategy/strategy-example.d.ts +5 -0
  24. package/dist/model/strategy/strategy-example.js +331 -0
  25. package/dist/model/strategy/type.d.ts +228 -0
  26. package/dist/model/strategy/type.js +94 -0
  27. package/dist/modules/Cart/types.d.ts +2 -0
  28. package/dist/modules/Cart/utils/cartProduct.js +11 -0
  29. package/dist/modules/Discount/types.d.ts +15 -0
  30. package/dist/modules/Payment/index.d.ts +2 -1
  31. package/dist/modules/Payment/index.js +10 -7
  32. package/dist/modules/Payment/utils.js +3 -0
  33. package/dist/modules/Payment/walletpass.d.ts +23 -0
  34. package/dist/modules/Payment/walletpass.js +196 -95
  35. package/dist/modules/Rules/index.d.ts +8 -3
  36. package/dist/modules/Rules/index.js +143 -23
  37. package/dist/modules/Rules/types.d.ts +1 -0
  38. package/dist/modules/Schedule/index.d.ts +0 -9
  39. package/dist/modules/Schedule/index.js +2 -18
  40. package/dist/modules/Summary/types.d.ts +2 -0
  41. package/dist/modules/Summary/utils.d.ts +6 -0
  42. package/dist/modules/Summary/utils.js +21 -0
  43. package/dist/plugins/window.d.ts +2 -0
  44. package/dist/solution/BookingByStep/index.d.ts +1 -0
  45. package/dist/solution/Checkout/index.js +24 -23
  46. package/dist/solution/RegisterAndLogin/config.js +1 -339
  47. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  48. package/dist/solution/ShopDiscount/index.js +13 -3
  49. package/dist/solution/ShopDiscount/types.d.ts +1 -0
  50. package/lib/index.d.ts +1 -0
  51. package/lib/index.js +3 -1
  52. package/lib/model/index.d.ts +1 -0
  53. package/lib/model/index.js +23 -0
  54. package/lib/model/strategy/adapter/index.d.ts +3 -0
  55. package/lib/model/strategy/adapter/index.js +45 -0
  56. package/lib/model/strategy/adapter/type.d.ts +28 -0
  57. package/lib/model/strategy/adapter/type.js +17 -0
  58. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
  59. package/lib/model/strategy/adapter/walletPass/evaluator.js +421 -0
  60. package/lib/model/strategy/adapter/walletPass/example.d.ts +4 -0
  61. package/lib/model/strategy/adapter/walletPass/example.js +207 -0
  62. package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
  63. package/lib/model/strategy/adapter/walletPass/index.js +142 -0
  64. package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  65. package/lib/model/strategy/adapter/walletPass/locales.js +51 -0
  66. package/lib/model/strategy/adapter/walletPass/type.d.ts +165 -0
  67. package/lib/model/strategy/adapter/walletPass/type.js +17 -0
  68. package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  69. package/lib/model/strategy/adapter/walletPass/utils.js +660 -0
  70. package/lib/model/strategy/index.d.ts +94 -0
  71. package/lib/model/strategy/index.js +413 -0
  72. package/lib/model/strategy/strategy-example.d.ts +5 -0
  73. package/lib/model/strategy/strategy-example.js +318 -0
  74. package/lib/model/strategy/type.d.ts +228 -0
  75. package/lib/model/strategy/type.js +44 -0
  76. package/lib/modules/Cart/types.d.ts +2 -0
  77. package/lib/modules/Cart/utils/cartProduct.js +9 -0
  78. package/lib/modules/Discount/types.d.ts +15 -0
  79. package/lib/modules/Payment/index.d.ts +2 -1
  80. package/lib/modules/Payment/index.js +1 -0
  81. package/lib/modules/Payment/utils.js +3 -0
  82. package/lib/modules/Payment/walletpass.d.ts +23 -0
  83. package/lib/modules/Payment/walletpass.js +99 -17
  84. package/lib/modules/Rules/index.d.ts +8 -3
  85. package/lib/modules/Rules/index.js +352 -187
  86. package/lib/modules/Rules/types.d.ts +1 -0
  87. package/lib/modules/Schedule/index.d.ts +0 -9
  88. package/lib/modules/Schedule/index.js +0 -11
  89. package/lib/modules/Summary/types.d.ts +2 -0
  90. package/lib/modules/Summary/utils.d.ts +6 -0
  91. package/lib/modules/Summary/utils.js +15 -0
  92. package/lib/plugins/window.d.ts +2 -0
  93. package/lib/solution/BookingByStep/index.d.ts +1 -0
  94. package/lib/solution/Checkout/index.js +3 -3
  95. package/lib/solution/RegisterAndLogin/config.js +1 -265
  96. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  97. package/lib/solution/ShopDiscount/index.js +8 -2
  98. package/lib/solution/ShopDiscount/types.d.ts +1 -0
  99. package/package.json +1 -1
@@ -1,10 +1,14 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
9
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
14
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
@@ -29,6 +33,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
29
33
  _defineProperty(this, "userIdentificationCodes", []);
30
34
  _defineProperty(this, "searchResults", []);
31
35
  _defineProperty(this, "walletParams", null);
36
+ _defineProperty(this, "walletInitData", null);
32
37
  this.paymentModule = paymentModule;
33
38
  }
34
39
 
@@ -97,6 +102,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
97
102
  order_wait_pay_amount: walletParams.order_wait_pay_amount,
98
103
  products_count: ((_walletParams$product = walletParams.products) === null || _walletParams$product === void 0 ? void 0 : _walletParams$product.length) || 0
99
104
  });
105
+ this.walletInitData = {
106
+ transformList: [],
107
+ noApplicableVoucher: [],
108
+ products: products || []
109
+ };
100
110
  return walletParams;
101
111
  }
102
112
 
@@ -142,7 +152,10 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
142
152
  }
143
153
  return _context.abrupt("return", {
144
154
  walletRecommendList: [],
145
- userIdentificationCodes: []
155
+ userIdentificationCodes: [],
156
+ transformList: [],
157
+ noApplicableVoucher: [],
158
+ products: []
146
159
  });
147
160
  case 4:
148
161
  if (![1, 0].includes((walletParams === null || walletParams === void 0 ? void 0 : walletParams.customer_id) || 0)) {
@@ -216,53 +229,121 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
216
229
  return initializeWalletDataFromBusinessAsync;
217
230
  }()
218
231
  /**
219
- * 初始化钱包数据
220
- * 先获取推荐列表,再获取用户识别码列表(顺序执行)
232
+ * 获取订单基础详情
221
233
  */
222
234
  )
223
235
  }, {
224
- key: "initializeWalletDataAsync",
236
+ key: "getOrderBasicDetailAsync",
225
237
  value: (function () {
226
- var _initializeWalletDataAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(baseParams) {
227
- var walletRecommendList, identificationParams, userIdentificationCodes;
238
+ var _getOrderBasicDetailAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderId) {
239
+ var response;
228
240
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
229
241
  while (1) switch (_context2.prev = _context2.next) {
230
242
  case 0:
231
243
  _context2.prev = 0;
232
244
  _context2.next = 3;
233
- return this.getWalletPassRecommendListAsync(baseParams);
245
+ return this.paymentModule.request.get("/order/order/".concat(orderId, "/basic-detail"));
234
246
  case 3:
235
- walletRecommendList = _context2.sent;
247
+ response = _context2.sent;
248
+ return _context2.abrupt("return", (response === null || response === void 0 ? void 0 : response.data) || {});
249
+ case 7:
250
+ _context2.prev = 7;
251
+ _context2.t0 = _context2["catch"](0);
252
+ throw _context2.t0;
253
+ case 10:
254
+ case "end":
255
+ return _context2.stop();
256
+ }
257
+ }, _callee2, this, [[0, 7]]);
258
+ }));
259
+ function getOrderBasicDetailAsync(_x2) {
260
+ return _getOrderBasicDetailAsync.apply(this, arguments);
261
+ }
262
+ return getOrderBasicDetailAsync;
263
+ }()
264
+ /**
265
+ * 初始化钱包数据
266
+ * 先获取推荐列表,再获取用户识别码列表(顺序执行)
267
+ */
268
+ )
269
+ }, {
270
+ key: "initializeWalletDataAsync",
271
+ value: (function () {
272
+ var _initializeWalletDataAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(baseParams) {
273
+ var _this$paymentModule$w, _this$paymentModule$w2, identificationParams, _yield$Promise$all, _yield$Promise$all2, allList, orderBasicDetail, walletPassEvaluator, products, res, recommended, transformList, noApplicableVoucher, recommendedAmount;
274
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
275
+ while (1) switch (_context3.prev = _context3.next) {
276
+ case 0:
277
+ _context3.prev = 0;
236
278
  // 格式化用户识别码列表参数
237
279
  identificationParams = _objectSpread(_objectSpread({}, baseParams), {}, {
238
280
  available: 2,
239
- prepare_payments: this.formatWalletPassList2PreparePayments(walletRecommendList),
281
+ prepare_payments: [],
240
282
  other_exact_codes: [],
241
283
  filter_prepare_wallet_pass: 1
242
- }); // 再获取用户识别码列表
243
- _context2.next = 7;
244
- return this.getUserIdentificationCodeListAsync(identificationParams);
245
- case 7:
246
- userIdentificationCodes = _context2.sent;
247
- return _context2.abrupt("return", {
248
- walletRecommendList: walletRecommendList,
249
- userIdentificationCodes: userIdentificationCodes
284
+ }); // 并行获取用户识别码列表和订单详情
285
+ _context3.next = 4;
286
+ return Promise.all([this.getUserIdentificationCodeListAsync(identificationParams), baseParams.payment_order_id ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)]);
287
+ case 4:
288
+ _yield$Promise$all = _context3.sent;
289
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
290
+ allList = _yield$Promise$all2[0];
291
+ orderBasicDetail = _yield$Promise$all2[1];
292
+ walletPassEvaluator = (_this$paymentModule$w = this.paymentModule.window) === null || _this$paymentModule$w === void 0 || (_this$paymentModule$w2 = _this$paymentModule$w.getWalletPassEvaluator) === null || _this$paymentModule$w2 === void 0 ? void 0 : _this$paymentModule$w2.call(_this$paymentModule$w);
293
+ if (walletPassEvaluator) {
294
+ _context3.next = 11;
295
+ break;
296
+ }
297
+ return _context3.abrupt("return", {
298
+ walletRecommendList: [],
299
+ userIdentificationCodes: [],
300
+ transformList: [],
301
+ noApplicableVoucher: [],
302
+ products: []
250
303
  });
251
304
  case 11:
252
- _context2.prev = 11;
253
- _context2.t0 = _context2["catch"](0);
254
- this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context2.t0, {
305
+ products = (orderBasicDetail === null || orderBasicDetail === void 0 ? void 0 : orderBasicDetail.detail) || baseParams.products;
306
+ res = walletPassEvaluator === null || walletPassEvaluator === void 0 ? void 0 : walletPassEvaluator.getRecommendedVouchers({
307
+ orderTotalAmount: baseParams.order_wait_pay_amount,
308
+ products: products,
309
+ vouchers: allList
310
+ });
311
+ recommended = res.recommended, transformList = res.transformList, noApplicableVoucher = res.noApplicableVoucher, recommendedAmount = res.recommendedAmount;
312
+ console.log(res, 'resres12');
313
+ this.walletRecommendList = recommended;
314
+
315
+ // 存储初始化数据到内存中,供 useWalletPass 使用
316
+ this.walletInitData = {
317
+ transformList: transformList,
318
+ noApplicableVoucher: noApplicableVoucher,
319
+ products: products || []
320
+ };
321
+
322
+ // // 再获取用户识别码列表
323
+ // const userIdentificationCodes =
324
+ // await this.getUserIdentificationCodeListAsync(identificationParams);
325
+ return _context3.abrupt("return", {
326
+ walletRecommendList: recommended,
327
+ userIdentificationCodes: allList,
328
+ transformList: transformList,
329
+ noApplicableVoucher: noApplicableVoucher,
330
+ products: products || []
331
+ });
332
+ case 20:
333
+ _context3.prev = 20;
334
+ _context3.t0 = _context3["catch"](0);
335
+ this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context3.t0, {
255
336
  customer_id: baseParams.customer_id,
256
337
  order_expect_amount: baseParams.order_expect_amount
257
338
  });
258
- throw _context2.t0;
259
- case 15:
339
+ throw _context3.t0;
340
+ case 24:
260
341
  case "end":
261
- return _context2.stop();
342
+ return _context3.stop();
262
343
  }
263
- }, _callee2, this, [[0, 11]]);
344
+ }, _callee3, this, [[0, 20]]);
264
345
  }));
265
- function initializeWalletDataAsync(_x2) {
346
+ function initializeWalletDataAsync(_x3) {
266
347
  return _initializeWalletDataAsync.apply(this, arguments);
267
348
  }
268
349
  return initializeWalletDataAsync;
@@ -270,23 +351,23 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
270
351
  }, {
271
352
  key: "getWalletPassRecommendListAsync",
272
353
  value: function () {
273
- var _getWalletPassRecommendListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
354
+ var _getWalletPassRecommendListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
274
355
  var _this$walletParams, response;
275
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
276
- while (1) switch (_context3.prev = _context3.next) {
356
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
357
+ while (1) switch (_context4.prev = _context4.next) {
277
358
  case 0:
278
- _context3.prev = 0;
359
+ _context4.prev = 0;
279
360
  this.paymentModule.logInfo('[WalletPass] 开始获取钱包推荐列表', {
280
361
  customer_id: params.customer_id,
281
362
  order_expect_amount: params.order_expect_amount,
282
363
  sale_channel: params.sale_channel,
283
364
  payment_order_id: (_this$walletParams = this.walletParams) === null || _this$walletParams === void 0 ? void 0 : _this$walletParams.payment_order_id
284
365
  });
285
- _context3.next = 4;
366
+ _context4.next = 4;
286
367
  return this.paymentModule.request.post('/machinecode/prepare/deduction/recommend', params // 将 params 作为请求体数据
287
368
  );
288
369
  case 4:
289
- response = _context3.sent;
370
+ response = _context4.sent;
290
371
  this.walletRecommendList = (response === null || response === void 0 ? void 0 : response.data) || [];
291
372
 
292
373
  // 发送钱包推荐列表更新事件(使用专用的WalletPassHooks)
@@ -304,24 +385,24 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
304
385
  };
305
386
  })
306
387
  });
307
- return _context3.abrupt("return", this.walletRecommendList);
388
+ return _context4.abrupt("return", this.walletRecommendList);
308
389
  case 11:
309
- _context3.prev = 11;
310
- _context3.t0 = _context3["catch"](0);
311
- this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context3.t0, {
390
+ _context4.prev = 11;
391
+ _context4.t0 = _context4["catch"](0);
392
+ this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context4.t0, {
312
393
  customer_id: params.customer_id,
313
394
  order_expect_amount: params.order_expect_amount,
314
395
  sale_channel: params.sale_channel
315
396
  });
316
397
  // throw error;
317
- return _context3.abrupt("return", []);
398
+ return _context4.abrupt("return", []);
318
399
  case 15:
319
400
  case "end":
320
- return _context3.stop();
401
+ return _context4.stop();
321
402
  }
322
- }, _callee3, this, [[0, 11]]);
403
+ }, _callee4, this, [[0, 11]]);
323
404
  }));
324
- function getWalletPassRecommendListAsync(_x3) {
405
+ function getWalletPassRecommendListAsync(_x4) {
325
406
  return _getWalletPassRecommendListAsync.apply(this, arguments);
326
407
  }
327
408
  return getWalletPassRecommendListAsync;
@@ -334,12 +415,12 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
334
415
  }, {
335
416
  key: "getUserIdentificationCodeListAsync",
336
417
  value: function () {
337
- var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
418
+ var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
338
419
  var _newParams$prepare_pa, _this$walletParams2, newParams, response, sortedData;
339
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
340
- while (1) switch (_context4.prev = _context4.next) {
420
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
421
+ while (1) switch (_context5.prev = _context5.next) {
341
422
  case 0:
342
- _context4.prev = 0;
423
+ _context5.prev = 0;
343
424
  newParams = _objectSpread(_objectSpread({}, this.walletParams), params);
344
425
  this.paymentModule.logInfo('[WalletPass] 开始获取用户识别码列表', {
345
426
  customer_id: newParams.customer_id,
@@ -348,10 +429,10 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
348
429
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
349
430
  payment_order_id: (_this$walletParams2 = this.walletParams) === null || _this$walletParams2 === void 0 ? void 0 : _this$walletParams2.payment_order_id
350
431
  });
351
- _context4.next = 5;
432
+ _context5.next = 5;
352
433
  return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
353
434
  case 5:
354
- response = _context4.sent;
435
+ response = _context5.sent;
355
436
  // 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
356
437
  sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
357
438
  this.userIdentificationCodes = sortedData;
@@ -370,22 +451,22 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
370
451
  };
371
452
  })
372
453
  });
373
- return _context4.abrupt("return", this.userIdentificationCodes);
454
+ return _context5.abrupt("return", this.userIdentificationCodes);
374
455
  case 13:
375
- _context4.prev = 13;
376
- _context4.t0 = _context4["catch"](0);
377
- this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context4.t0, {
456
+ _context5.prev = 13;
457
+ _context5.t0 = _context5["catch"](0);
458
+ this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context5.t0, {
378
459
  customer_id: params.customer_id,
379
460
  available: params.available
380
461
  });
381
- return _context4.abrupt("return", []);
462
+ return _context5.abrupt("return", []);
382
463
  case 17:
383
464
  case "end":
384
- return _context4.stop();
465
+ return _context5.stop();
385
466
  }
386
- }, _callee4, this, [[0, 13]]);
467
+ }, _callee5, this, [[0, 13]]);
387
468
  }));
388
- function getUserIdentificationCodeListAsync(_x4) {
469
+ function getUserIdentificationCodeListAsync(_x5) {
389
470
  return _getUserIdentificationCodeListAsync.apply(this, arguments);
390
471
  }
391
472
  return getUserIdentificationCodeListAsync;
@@ -399,7 +480,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
399
480
  }, {
400
481
  key: "searchIdentificationCodeAsync",
401
482
  value: (function () {
402
- var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
483
+ var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
403
484
  var config,
404
485
  code,
405
486
  isWalletCode,
@@ -413,12 +494,12 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
413
494
  _this$searchResults,
414
495
  existingCodes,
415
496
  newResults,
416
- _args5 = arguments;
417
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
418
- while (1) switch (_context5.prev = _context5.next) {
497
+ _args6 = arguments;
498
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
499
+ while (1) switch (_context6.prev = _context6.next) {
419
500
  case 0:
420
- config = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
421
- _context5.prev = 1;
501
+ config = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
502
+ _context6.prev = 1;
422
503
  code = params.code;
423
504
  this.paymentModule.logInfo('[WalletPass] 开始搜索识别码', {
424
505
  code: code,
@@ -430,7 +511,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
430
511
  isWalletCode = code.length === 9 && code.startsWith('000'); // 测试环境先使用 WL
431
512
  // const isWalletCode = code.startsWith('WL');
432
513
  if (!isWalletCode) {
433
- _context5.next = 14;
514
+ _context6.next = 14;
434
515
  break;
435
516
  }
436
517
  // 钱包识别码直接调用专门接口,不缓存,直接返回
@@ -444,17 +525,17 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
444
525
  with_customer: walletDetailParams.with_customer,
445
526
  with: walletDetailParams.with
446
527
  });
447
- _context5.next = 10;
528
+ _context6.next = 10;
448
529
  return this.paymentModule.request.post('/wallet/detail/search', walletDetailParams);
449
530
  case 10:
450
- _response = _context5.sent;
531
+ _response = _context6.sent;
451
532
  _searchResults = (_response === null || _response === void 0 ? void 0 : _response.data) || [];
452
533
  this.paymentModule.logInfo('[WalletPass] 钱包识别码搜索完成', {
453
534
  code: code,
454
535
  results_count: _searchResults.length,
455
536
  type: 'walletCode'
456
537
  });
457
- return _context5.abrupt("return", {
538
+ return _context6.abrupt("return", {
458
539
  type: 'walletCode',
459
540
  data: _searchResults
460
541
  });
@@ -463,7 +544,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
463
544
  baseWalletParams = this.walletParams; // 构建完整的搜索参数,包含钱包扣款推荐的所有参数
464
545
  searchParams = {
465
546
  // 基础钱包参数
466
- sale_channel: params.sale_channel || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.sale_channel) || "pos",
547
+ sale_channel: params.sale_channel || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.sale_channel) || 'pos',
467
548
  customer_id: params.customer_id || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.customer_id),
468
549
  order_expect_amount: params.order_expect_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_expect_amount),
469
550
  order_product_amount: params.order_product_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_product_amount),
@@ -483,16 +564,16 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
483
564
  multiple: searchParams.multiple,
484
565
  payment_order_id: baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.payment_order_id
485
566
  });
486
- _context5.next = 19;
567
+ _context6.next = 19;
487
568
  return this.paymentModule.request.post('/machinecode/prepare/deduction/search', searchParams);
488
569
  case 19:
489
- response = _context5.sent;
570
+ response = _context6.sent;
490
571
  searchResults = (response === null || response === void 0 ? void 0 : response.data) || [];
491
572
  if (!config.noCache) {
492
- _context5.next = 23;
573
+ _context6.next = 23;
493
574
  break;
494
575
  }
495
- return _context5.abrupt("return", {
576
+ return _context6.abrupt("return", {
496
577
  type: 'normalCode',
497
578
  data: searchResults
498
579
  });
@@ -522,26 +603,26 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
522
603
  cached_results_count: this.searchResults.length,
523
604
  type: 'normalCode'
524
605
  });
525
- return _context5.abrupt("return", {
606
+ return _context6.abrupt("return", {
526
607
  type: 'normalCode',
527
608
  data: searchResults
528
609
  });
529
610
  case 29:
530
- _context5.prev = 29;
531
- _context5.t0 = _context5["catch"](1);
532
- this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context5.t0, {
611
+ _context6.prev = 29;
612
+ _context6.t0 = _context6["catch"](1);
613
+ this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context6.t0, {
533
614
  code: params.code,
534
615
  customer_id: params.customer_id,
535
616
  order_expect_amount: params.order_expect_amount
536
617
  });
537
- throw _context5.t0;
618
+ throw _context6.t0;
538
619
  case 33:
539
620
  case "end":
540
- return _context5.stop();
621
+ return _context6.stop();
541
622
  }
542
- }, _callee5, this, [[1, 29]]);
623
+ }, _callee6, this, [[1, 29]]);
543
624
  }));
544
- function searchIdentificationCodeAsync(_x5) {
625
+ function searchIdentificationCodeAsync(_x6) {
545
626
  return _searchIdentificationCodeAsync.apply(this, arguments);
546
627
  }
547
628
  return searchIdentificationCodeAsync;
@@ -549,22 +630,22 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
549
630
  }, {
550
631
  key: "processWalletPayment",
551
632
  value: function () {
552
- var _processWalletPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(amount, orderUuid, voucherId) {
633
+ var _processWalletPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(amount, orderUuid, voucherId) {
553
634
  var walletMethod, paymentItem;
554
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
555
- while (1) switch (_context6.prev = _context6.next) {
635
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
636
+ while (1) switch (_context7.prev = _context7.next) {
556
637
  case 0:
557
638
  this.paymentModule.logInfo('[WalletPass] 开始处理钱包支付', {
558
639
  amount: amount,
559
640
  orderUuid: orderUuid,
560
641
  voucherId: voucherId || 'none'
561
642
  });
562
- _context6.next = 3;
643
+ _context7.next = 3;
563
644
  return this.paymentModule.getWalletPaymentMethod();
564
645
  case 3:
565
- walletMethod = _context6.sent;
646
+ walletMethod = _context7.sent;
566
647
  if (walletMethod) {
567
- _context6.next = 7;
648
+ _context7.next = 7;
568
649
  break;
569
650
  }
570
651
  this.paymentModule.logError('[WalletPass] 钱包支付方式未找到', null, {
@@ -582,7 +663,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
582
663
  type: walletMethod.type,
583
664
  voucher_id: voucherId || ''
584
665
  };
585
- _context6.next = 10;
666
+ _context7.next = 10;
586
667
  return this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
587
668
  case 10:
588
669
  this.paymentModule.logInfo('[WalletPass] 钱包支付处理完成', {
@@ -593,11 +674,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
593
674
  });
594
675
  case 11:
595
676
  case "end":
596
- return _context6.stop();
677
+ return _context7.stop();
597
678
  }
598
- }, _callee6, this);
679
+ }, _callee7, this);
599
680
  }));
600
- function processWalletPayment(_x6, _x7, _x8) {
681
+ function processWalletPayment(_x7, _x8, _x9) {
601
682
  return _processWalletPayment.apply(this, arguments);
602
683
  }
603
684
  return processWalletPayment;
@@ -605,18 +686,18 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
605
686
  }, {
606
687
  key: "getWalletBalance",
607
688
  value: function () {
608
- var _getWalletBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(voucherId) {
609
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
610
- while (1) switch (_context7.prev = _context7.next) {
689
+ var _getWalletBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(voucherId) {
690
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
691
+ while (1) switch (_context8.prev = _context8.next) {
611
692
  case 0:
612
- return _context7.abrupt("return", 0);
693
+ return _context8.abrupt("return", 0);
613
694
  case 1:
614
695
  case "end":
615
- return _context7.stop();
696
+ return _context8.stop();
616
697
  }
617
- }, _callee7);
698
+ }, _callee8);
618
699
  }));
619
- function getWalletBalance(_x9) {
700
+ function getWalletBalance(_x10) {
620
701
  return _getWalletBalance.apply(this, arguments);
621
702
  }
622
703
  return getWalletBalance;
@@ -699,6 +780,25 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
699
780
  this.paymentModule.logInfo('[WalletPass] 搜索结果缓存已清除');
700
781
  }
701
782
 
783
+ /**
784
+ * 获取存储的钱包初始化数据
785
+ */
786
+ }, {
787
+ key: "getStoredWalletInitData",
788
+ value: function getStoredWalletInitData() {
789
+ return this.walletInitData;
790
+ }
791
+
792
+ /**
793
+ * 清除存储的钱包初始化数据
794
+ */
795
+ }, {
796
+ key: "clearStoredWalletInitData",
797
+ value: function clearStoredWalletInitData() {
798
+ this.walletInitData = null;
799
+ this.paymentModule.logInfo('[WalletPass] 钱包初始化数据已清除');
800
+ }
801
+
702
802
  /**
703
803
  * 清除所有缓存数据
704
804
  */
@@ -709,13 +809,14 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
709
809
  this.userIdentificationCodes = [];
710
810
  this.searchResults = [];
711
811
  this.walletParams = null;
812
+ this.walletInitData = null;
712
813
 
713
814
  // 发送所有缓存清除事件
714
815
  this.emitEvent(WalletPassHooks.OnWalletCacheCleared, {
715
816
  clearedTypes: ['all']
716
817
  });
717
818
  this.paymentModule.logInfo('[WalletPass] 所有缓存数据已清除', {
718
- cleared_types: ['walletRecommendList', 'userIdentificationCodes', 'searchResults', 'walletParams']
819
+ cleared_types: ['walletRecommendList', 'userIdentificationCodes', 'searchResults', 'walletParams', 'walletInitData']
719
820
  });
720
821
  }
721
822
  }]);
@@ -1,22 +1,26 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
3
  import { Rules, RulesModuleAPI, DiscountResult } from './types';
4
- import { Discount } from "../Discount/types";
4
+ import { Discount } from '../Discount/types';
5
5
  import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
6
+ import { WindowPlugin } from '../../plugins';
6
7
  export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
7
8
  protected defaultName: string;
8
9
  protected defaultVersion: string;
9
10
  private store;
11
+ window: WindowPlugin;
10
12
  private hooks;
11
13
  constructor(name?: string, version?: string);
12
14
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
13
15
  setRulesList(rulesList: Rules[]): Promise<void>;
14
16
  getRulesList(): Rules[];
17
+ getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
15
18
  private checkHolderMatch;
16
- isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders, isFormSubject, }: {
19
+ isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {
17
20
  oldDiscountList: Discount[];
18
21
  newDiscountList: Discount[];
19
22
  productList: any[];
23
+ orderTotalAmount: number;
20
24
  holders: {
21
25
  form_record_id: number;
22
26
  }[];
@@ -26,13 +30,14 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
26
30
  discountList: Discount[];
27
31
  productList: any[];
28
32
  };
29
- calcDiscount({ discountList, productList, holders, isFormSubject, }: {
33
+ calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
30
34
  discountList: Discount[];
31
35
  productList: any[];
32
36
  holders: {
33
37
  form_record_id: number;
34
38
  }[];
35
39
  isFormSubject: boolean;
40
+ orderTotalAmount: number;
36
41
  }, options?: {
37
42
  isSelected?: boolean;
38
43
  discountId?: number;