@pisell/pisellos 2.1.59 → 2.1.60

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 (95) 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 +496 -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 +163 -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 +191 -95
  35. package/dist/modules/Rules/index.d.ts +8 -3
  36. package/dist/modules/Rules/index.js +152 -26
  37. package/dist/modules/Rules/types.d.ts +1 -0
  38. package/dist/modules/Summary/types.d.ts +2 -0
  39. package/dist/modules/Summary/utils.d.ts +6 -0
  40. package/dist/modules/Summary/utils.js +21 -0
  41. package/dist/plugins/window.d.ts +2 -0
  42. package/dist/solution/BookingByStep/index.d.ts +2 -1
  43. package/dist/solution/Checkout/index.js +2 -0
  44. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  45. package/dist/solution/ShopDiscount/index.js +11 -1
  46. package/dist/solution/ShopDiscount/types.d.ts +1 -0
  47. package/dist/solution/ShopDiscount/utils.js +26 -11
  48. package/lib/index.d.ts +1 -0
  49. package/lib/index.js +3 -1
  50. package/lib/model/index.d.ts +1 -0
  51. package/lib/model/index.js +23 -0
  52. package/lib/model/strategy/adapter/index.d.ts +3 -0
  53. package/lib/model/strategy/adapter/index.js +45 -0
  54. package/lib/model/strategy/adapter/type.d.ts +28 -0
  55. package/lib/model/strategy/adapter/type.js +17 -0
  56. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
  57. package/lib/model/strategy/adapter/walletPass/evaluator.js +420 -0
  58. package/lib/model/strategy/adapter/walletPass/example.d.ts +4 -0
  59. package/lib/model/strategy/adapter/walletPass/example.js +207 -0
  60. package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
  61. package/lib/model/strategy/adapter/walletPass/index.js +142 -0
  62. package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  63. package/lib/model/strategy/adapter/walletPass/locales.js +51 -0
  64. package/lib/model/strategy/adapter/walletPass/type.d.ts +163 -0
  65. package/lib/model/strategy/adapter/walletPass/type.js +17 -0
  66. package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  67. package/lib/model/strategy/adapter/walletPass/utils.js +660 -0
  68. package/lib/model/strategy/index.d.ts +94 -0
  69. package/lib/model/strategy/index.js +413 -0
  70. package/lib/model/strategy/strategy-example.d.ts +5 -0
  71. package/lib/model/strategy/strategy-example.js +318 -0
  72. package/lib/model/strategy/type.d.ts +228 -0
  73. package/lib/model/strategy/type.js +44 -0
  74. package/lib/modules/Cart/types.d.ts +2 -0
  75. package/lib/modules/Cart/utils/cartProduct.js +9 -0
  76. package/lib/modules/Discount/types.d.ts +15 -0
  77. package/lib/modules/Payment/index.d.ts +2 -1
  78. package/lib/modules/Payment/index.js +1 -0
  79. package/lib/modules/Payment/utils.js +3 -0
  80. package/lib/modules/Payment/walletpass.d.ts +23 -0
  81. package/lib/modules/Payment/walletpass.js +94 -17
  82. package/lib/modules/Rules/index.d.ts +8 -3
  83. package/lib/modules/Rules/index.js +370 -192
  84. package/lib/modules/Rules/types.d.ts +1 -0
  85. package/lib/modules/Summary/types.d.ts +2 -0
  86. package/lib/modules/Summary/utils.d.ts +6 -0
  87. package/lib/modules/Summary/utils.js +15 -0
  88. package/lib/plugins/window.d.ts +2 -0
  89. package/lib/solution/BookingByStep/index.d.ts +2 -1
  90. package/lib/solution/Checkout/index.js +2 -0
  91. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  92. package/lib/solution/ShopDiscount/index.js +6 -0
  93. package/lib/solution/ShopDiscount/types.d.ts +1 -0
  94. package/lib/solution/ShopDiscount/utils.js +10 -6
  95. 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
 
@@ -139,7 +144,10 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
139
144
  }
140
145
  return _context.abrupt("return", {
141
146
  walletRecommendList: [],
142
- userIdentificationCodes: []
147
+ userIdentificationCodes: [],
148
+ transformList: [],
149
+ noApplicableVoucher: [],
150
+ products: []
143
151
  });
144
152
  case 4:
145
153
  // 发送初始化开始事件
@@ -204,53 +212,121 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
204
212
  return initializeWalletDataFromBusinessAsync;
205
213
  }()
206
214
  /**
207
- * 初始化钱包数据
208
- * 先获取推荐列表,再获取用户识别码列表(顺序执行)
215
+ * 获取订单基础详情
209
216
  */
210
217
  )
211
218
  }, {
212
- key: "initializeWalletDataAsync",
219
+ key: "getOrderBasicDetailAsync",
213
220
  value: (function () {
214
- var _initializeWalletDataAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(baseParams) {
215
- var walletRecommendList, identificationParams, userIdentificationCodes;
221
+ var _getOrderBasicDetailAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderId) {
222
+ var response;
216
223
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
217
224
  while (1) switch (_context2.prev = _context2.next) {
218
225
  case 0:
219
226
  _context2.prev = 0;
220
227
  _context2.next = 3;
221
- return this.getWalletPassRecommendListAsync(baseParams);
228
+ return this.paymentModule.request.get("/order/order/".concat(orderId, "/basic-detail"));
222
229
  case 3:
223
- walletRecommendList = _context2.sent;
230
+ response = _context2.sent;
231
+ return _context2.abrupt("return", (response === null || response === void 0 ? void 0 : response.data) || {});
232
+ case 7:
233
+ _context2.prev = 7;
234
+ _context2.t0 = _context2["catch"](0);
235
+ throw _context2.t0;
236
+ case 10:
237
+ case "end":
238
+ return _context2.stop();
239
+ }
240
+ }, _callee2, this, [[0, 7]]);
241
+ }));
242
+ function getOrderBasicDetailAsync(_x2) {
243
+ return _getOrderBasicDetailAsync.apply(this, arguments);
244
+ }
245
+ return getOrderBasicDetailAsync;
246
+ }()
247
+ /**
248
+ * 初始化钱包数据
249
+ * 先获取推荐列表,再获取用户识别码列表(顺序执行)
250
+ */
251
+ )
252
+ }, {
253
+ key: "initializeWalletDataAsync",
254
+ value: (function () {
255
+ var _initializeWalletDataAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(baseParams) {
256
+ var _this$paymentModule$w, _this$paymentModule$w2, identificationParams, _yield$Promise$all, _yield$Promise$all2, allList, orderBasicDetail, walletPassEvaluator, products, res, recommended, transformList, noApplicableVoucher, recommendedAmount;
257
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
258
+ while (1) switch (_context3.prev = _context3.next) {
259
+ case 0:
260
+ _context3.prev = 0;
224
261
  // 格式化用户识别码列表参数
225
262
  identificationParams = _objectSpread(_objectSpread({}, baseParams), {}, {
226
263
  available: 2,
227
- prepare_payments: this.formatWalletPassList2PreparePayments(walletRecommendList),
264
+ prepare_payments: [],
228
265
  other_exact_codes: [],
229
266
  filter_prepare_wallet_pass: 1
230
- }); // 再获取用户识别码列表
231
- _context2.next = 7;
232
- return this.getUserIdentificationCodeListAsync(identificationParams);
233
- case 7:
234
- userIdentificationCodes = _context2.sent;
235
- return _context2.abrupt("return", {
236
- walletRecommendList: walletRecommendList,
237
- userIdentificationCodes: userIdentificationCodes
267
+ }); // 并行获取用户识别码列表和订单详情
268
+ _context3.next = 4;
269
+ return Promise.all([this.getUserIdentificationCodeListAsync(identificationParams), baseParams.payment_order_id ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)]);
270
+ case 4:
271
+ _yield$Promise$all = _context3.sent;
272
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
273
+ allList = _yield$Promise$all2[0];
274
+ orderBasicDetail = _yield$Promise$all2[1];
275
+ 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);
276
+ if (walletPassEvaluator) {
277
+ _context3.next = 11;
278
+ break;
279
+ }
280
+ return _context3.abrupt("return", {
281
+ walletRecommendList: [],
282
+ userIdentificationCodes: [],
283
+ transformList: [],
284
+ noApplicableVoucher: [],
285
+ products: []
238
286
  });
239
287
  case 11:
240
- _context2.prev = 11;
241
- _context2.t0 = _context2["catch"](0);
242
- this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context2.t0, {
288
+ products = (orderBasicDetail === null || orderBasicDetail === void 0 ? void 0 : orderBasicDetail.detail) || baseParams.products;
289
+ res = walletPassEvaluator === null || walletPassEvaluator === void 0 ? void 0 : walletPassEvaluator.getRecommendedVouchers({
290
+ orderTotalAmount: baseParams.order_wait_pay_amount,
291
+ products: products,
292
+ vouchers: allList
293
+ });
294
+ recommended = res.recommended, transformList = res.transformList, noApplicableVoucher = res.noApplicableVoucher, recommendedAmount = res.recommendedAmount;
295
+ console.log(res, 'resres12');
296
+ this.walletRecommendList = recommended;
297
+
298
+ // 存储初始化数据到内存中,供 useWalletPass 使用
299
+ this.walletInitData = {
300
+ transformList: transformList,
301
+ noApplicableVoucher: noApplicableVoucher,
302
+ products: products || []
303
+ };
304
+
305
+ // // 再获取用户识别码列表
306
+ // const userIdentificationCodes =
307
+ // await this.getUserIdentificationCodeListAsync(identificationParams);
308
+ return _context3.abrupt("return", {
309
+ walletRecommendList: recommended,
310
+ userIdentificationCodes: allList,
311
+ transformList: transformList,
312
+ noApplicableVoucher: noApplicableVoucher,
313
+ products: products || []
314
+ });
315
+ case 20:
316
+ _context3.prev = 20;
317
+ _context3.t0 = _context3["catch"](0);
318
+ this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context3.t0, {
243
319
  customer_id: baseParams.customer_id,
244
320
  order_expect_amount: baseParams.order_expect_amount
245
321
  });
246
- throw _context2.t0;
247
- case 15:
322
+ throw _context3.t0;
323
+ case 24:
248
324
  case "end":
249
- return _context2.stop();
325
+ return _context3.stop();
250
326
  }
251
- }, _callee2, this, [[0, 11]]);
327
+ }, _callee3, this, [[0, 20]]);
252
328
  }));
253
- function initializeWalletDataAsync(_x2) {
329
+ function initializeWalletDataAsync(_x3) {
254
330
  return _initializeWalletDataAsync.apply(this, arguments);
255
331
  }
256
332
  return initializeWalletDataAsync;
@@ -258,23 +334,23 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
258
334
  }, {
259
335
  key: "getWalletPassRecommendListAsync",
260
336
  value: function () {
261
- var _getWalletPassRecommendListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
337
+ var _getWalletPassRecommendListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
262
338
  var _this$walletParams, response;
263
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
264
- while (1) switch (_context3.prev = _context3.next) {
339
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
340
+ while (1) switch (_context4.prev = _context4.next) {
265
341
  case 0:
266
- _context3.prev = 0;
342
+ _context4.prev = 0;
267
343
  this.paymentModule.logInfo('[WalletPass] 开始获取钱包推荐列表', {
268
344
  customer_id: params.customer_id,
269
345
  order_expect_amount: params.order_expect_amount,
270
346
  sale_channel: params.sale_channel,
271
347
  payment_order_id: (_this$walletParams = this.walletParams) === null || _this$walletParams === void 0 ? void 0 : _this$walletParams.payment_order_id
272
348
  });
273
- _context3.next = 4;
349
+ _context4.next = 4;
274
350
  return this.paymentModule.request.post('/machinecode/prepare/deduction/recommend', params // 将 params 作为请求体数据
275
351
  );
276
352
  case 4:
277
- response = _context3.sent;
353
+ response = _context4.sent;
278
354
  this.walletRecommendList = (response === null || response === void 0 ? void 0 : response.data) || [];
279
355
 
280
356
  // 发送钱包推荐列表更新事件(使用专用的WalletPassHooks)
@@ -292,24 +368,24 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
292
368
  };
293
369
  })
294
370
  });
295
- return _context3.abrupt("return", this.walletRecommendList);
371
+ return _context4.abrupt("return", this.walletRecommendList);
296
372
  case 11:
297
- _context3.prev = 11;
298
- _context3.t0 = _context3["catch"](0);
299
- this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context3.t0, {
373
+ _context4.prev = 11;
374
+ _context4.t0 = _context4["catch"](0);
375
+ this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context4.t0, {
300
376
  customer_id: params.customer_id,
301
377
  order_expect_amount: params.order_expect_amount,
302
378
  sale_channel: params.sale_channel
303
379
  });
304
380
  // throw error;
305
- return _context3.abrupt("return", []);
381
+ return _context4.abrupt("return", []);
306
382
  case 15:
307
383
  case "end":
308
- return _context3.stop();
384
+ return _context4.stop();
309
385
  }
310
- }, _callee3, this, [[0, 11]]);
386
+ }, _callee4, this, [[0, 11]]);
311
387
  }));
312
- function getWalletPassRecommendListAsync(_x3) {
388
+ function getWalletPassRecommendListAsync(_x4) {
313
389
  return _getWalletPassRecommendListAsync.apply(this, arguments);
314
390
  }
315
391
  return getWalletPassRecommendListAsync;
@@ -322,12 +398,12 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
322
398
  }, {
323
399
  key: "getUserIdentificationCodeListAsync",
324
400
  value: function () {
325
- var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
401
+ var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
326
402
  var _newParams$prepare_pa, _this$walletParams2, newParams, response, sortedData;
327
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
328
- while (1) switch (_context4.prev = _context4.next) {
403
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
404
+ while (1) switch (_context5.prev = _context5.next) {
329
405
  case 0:
330
- _context4.prev = 0;
406
+ _context5.prev = 0;
331
407
  newParams = _objectSpread(_objectSpread({}, this.walletParams), params);
332
408
  this.paymentModule.logInfo('[WalletPass] 开始获取用户识别码列表', {
333
409
  customer_id: newParams.customer_id,
@@ -336,10 +412,10 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
336
412
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
337
413
  payment_order_id: (_this$walletParams2 = this.walletParams) === null || _this$walletParams2 === void 0 ? void 0 : _this$walletParams2.payment_order_id
338
414
  });
339
- _context4.next = 5;
415
+ _context5.next = 5;
340
416
  return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
341
417
  case 5:
342
- response = _context4.sent;
418
+ response = _context5.sent;
343
419
  // 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
344
420
  sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
345
421
  this.userIdentificationCodes = sortedData;
@@ -358,22 +434,22 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
358
434
  };
359
435
  })
360
436
  });
361
- return _context4.abrupt("return", this.userIdentificationCodes);
437
+ return _context5.abrupt("return", this.userIdentificationCodes);
362
438
  case 13:
363
- _context4.prev = 13;
364
- _context4.t0 = _context4["catch"](0);
365
- this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context4.t0, {
439
+ _context5.prev = 13;
440
+ _context5.t0 = _context5["catch"](0);
441
+ this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context5.t0, {
366
442
  customer_id: params.customer_id,
367
443
  available: params.available
368
444
  });
369
- return _context4.abrupt("return", []);
445
+ return _context5.abrupt("return", []);
370
446
  case 17:
371
447
  case "end":
372
- return _context4.stop();
448
+ return _context5.stop();
373
449
  }
374
- }, _callee4, this, [[0, 13]]);
450
+ }, _callee5, this, [[0, 13]]);
375
451
  }));
376
- function getUserIdentificationCodeListAsync(_x4) {
452
+ function getUserIdentificationCodeListAsync(_x5) {
377
453
  return _getUserIdentificationCodeListAsync.apply(this, arguments);
378
454
  }
379
455
  return getUserIdentificationCodeListAsync;
@@ -387,7 +463,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
387
463
  }, {
388
464
  key: "searchIdentificationCodeAsync",
389
465
  value: (function () {
390
- var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
466
+ var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
391
467
  var config,
392
468
  code,
393
469
  isWalletCode,
@@ -401,12 +477,12 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
401
477
  _this$searchResults,
402
478
  existingCodes,
403
479
  newResults,
404
- _args5 = arguments;
405
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
406
- while (1) switch (_context5.prev = _context5.next) {
480
+ _args6 = arguments;
481
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
482
+ while (1) switch (_context6.prev = _context6.next) {
407
483
  case 0:
408
- config = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
409
- _context5.prev = 1;
484
+ config = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
485
+ _context6.prev = 1;
410
486
  code = params.code;
411
487
  this.paymentModule.logInfo('[WalletPass] 开始搜索识别码', {
412
488
  code: code,
@@ -418,7 +494,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
418
494
  isWalletCode = code.length === 9 && code.startsWith('000'); // 测试环境先使用 WL
419
495
  // const isWalletCode = code.startsWith('WL');
420
496
  if (!isWalletCode) {
421
- _context5.next = 14;
497
+ _context6.next = 14;
422
498
  break;
423
499
  }
424
500
  // 钱包识别码直接调用专门接口,不缓存,直接返回
@@ -432,17 +508,17 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
432
508
  with_customer: walletDetailParams.with_customer,
433
509
  with: walletDetailParams.with
434
510
  });
435
- _context5.next = 10;
511
+ _context6.next = 10;
436
512
  return this.paymentModule.request.post('/wallet/detail/search', walletDetailParams);
437
513
  case 10:
438
- _response = _context5.sent;
514
+ _response = _context6.sent;
439
515
  _searchResults = (_response === null || _response === void 0 ? void 0 : _response.data) || [];
440
516
  this.paymentModule.logInfo('[WalletPass] 钱包识别码搜索完成', {
441
517
  code: code,
442
518
  results_count: _searchResults.length,
443
519
  type: 'walletCode'
444
520
  });
445
- return _context5.abrupt("return", {
521
+ return _context6.abrupt("return", {
446
522
  type: 'walletCode',
447
523
  data: _searchResults
448
524
  });
@@ -451,7 +527,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
451
527
  baseWalletParams = this.walletParams; // 构建完整的搜索参数,包含钱包扣款推荐的所有参数
452
528
  searchParams = {
453
529
  // 基础钱包参数
454
- sale_channel: params.sale_channel || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.sale_channel) || "pos",
530
+ sale_channel: params.sale_channel || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.sale_channel) || 'pos',
455
531
  customer_id: params.customer_id || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.customer_id),
456
532
  order_expect_amount: params.order_expect_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_expect_amount),
457
533
  order_product_amount: params.order_product_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_product_amount),
@@ -471,16 +547,16 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
471
547
  multiple: searchParams.multiple,
472
548
  payment_order_id: baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.payment_order_id
473
549
  });
474
- _context5.next = 19;
550
+ _context6.next = 19;
475
551
  return this.paymentModule.request.post('/machinecode/prepare/deduction/search', searchParams);
476
552
  case 19:
477
- response = _context5.sent;
553
+ response = _context6.sent;
478
554
  searchResults = (response === null || response === void 0 ? void 0 : response.data) || [];
479
555
  if (!config.noCache) {
480
- _context5.next = 23;
556
+ _context6.next = 23;
481
557
  break;
482
558
  }
483
- return _context5.abrupt("return", {
559
+ return _context6.abrupt("return", {
484
560
  type: 'normalCode',
485
561
  data: searchResults
486
562
  });
@@ -510,26 +586,26 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
510
586
  cached_results_count: this.searchResults.length,
511
587
  type: 'normalCode'
512
588
  });
513
- return _context5.abrupt("return", {
589
+ return _context6.abrupt("return", {
514
590
  type: 'normalCode',
515
591
  data: searchResults
516
592
  });
517
593
  case 29:
518
- _context5.prev = 29;
519
- _context5.t0 = _context5["catch"](1);
520
- this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context5.t0, {
594
+ _context6.prev = 29;
595
+ _context6.t0 = _context6["catch"](1);
596
+ this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context6.t0, {
521
597
  code: params.code,
522
598
  customer_id: params.customer_id,
523
599
  order_expect_amount: params.order_expect_amount
524
600
  });
525
- throw _context5.t0;
601
+ throw _context6.t0;
526
602
  case 33:
527
603
  case "end":
528
- return _context5.stop();
604
+ return _context6.stop();
529
605
  }
530
- }, _callee5, this, [[1, 29]]);
606
+ }, _callee6, this, [[1, 29]]);
531
607
  }));
532
- function searchIdentificationCodeAsync(_x5) {
608
+ function searchIdentificationCodeAsync(_x6) {
533
609
  return _searchIdentificationCodeAsync.apply(this, arguments);
534
610
  }
535
611
  return searchIdentificationCodeAsync;
@@ -537,22 +613,22 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
537
613
  }, {
538
614
  key: "processWalletPayment",
539
615
  value: function () {
540
- var _processWalletPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(amount, orderUuid, voucherId) {
616
+ var _processWalletPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(amount, orderUuid, voucherId) {
541
617
  var walletMethod, paymentItem;
542
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
543
- while (1) switch (_context6.prev = _context6.next) {
618
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
619
+ while (1) switch (_context7.prev = _context7.next) {
544
620
  case 0:
545
621
  this.paymentModule.logInfo('[WalletPass] 开始处理钱包支付', {
546
622
  amount: amount,
547
623
  orderUuid: orderUuid,
548
624
  voucherId: voucherId || 'none'
549
625
  });
550
- _context6.next = 3;
626
+ _context7.next = 3;
551
627
  return this.paymentModule.getWalletPaymentMethod();
552
628
  case 3:
553
- walletMethod = _context6.sent;
629
+ walletMethod = _context7.sent;
554
630
  if (walletMethod) {
555
- _context6.next = 7;
631
+ _context7.next = 7;
556
632
  break;
557
633
  }
558
634
  this.paymentModule.logError('[WalletPass] 钱包支付方式未找到', null, {
@@ -570,7 +646,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
570
646
  type: walletMethod.type,
571
647
  voucher_id: voucherId || ''
572
648
  };
573
- _context6.next = 10;
649
+ _context7.next = 10;
574
650
  return this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
575
651
  case 10:
576
652
  this.paymentModule.logInfo('[WalletPass] 钱包支付处理完成', {
@@ -581,11 +657,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
581
657
  });
582
658
  case 11:
583
659
  case "end":
584
- return _context6.stop();
660
+ return _context7.stop();
585
661
  }
586
- }, _callee6, this);
662
+ }, _callee7, this);
587
663
  }));
588
- function processWalletPayment(_x6, _x7, _x8) {
664
+ function processWalletPayment(_x7, _x8, _x9) {
589
665
  return _processWalletPayment.apply(this, arguments);
590
666
  }
591
667
  return processWalletPayment;
@@ -593,18 +669,18 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
593
669
  }, {
594
670
  key: "getWalletBalance",
595
671
  value: function () {
596
- var _getWalletBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(voucherId) {
597
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
598
- while (1) switch (_context7.prev = _context7.next) {
672
+ var _getWalletBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(voucherId) {
673
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
674
+ while (1) switch (_context8.prev = _context8.next) {
599
675
  case 0:
600
- return _context7.abrupt("return", 0);
676
+ return _context8.abrupt("return", 0);
601
677
  case 1:
602
678
  case "end":
603
- return _context7.stop();
679
+ return _context8.stop();
604
680
  }
605
- }, _callee7);
681
+ }, _callee8);
606
682
  }));
607
- function getWalletBalance(_x9) {
683
+ function getWalletBalance(_x10) {
608
684
  return _getWalletBalance.apply(this, arguments);
609
685
  }
610
686
  return getWalletBalance;
@@ -687,6 +763,25 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
687
763
  this.paymentModule.logInfo('[WalletPass] 搜索结果缓存已清除');
688
764
  }
689
765
 
766
+ /**
767
+ * 获取存储的钱包初始化数据
768
+ */
769
+ }, {
770
+ key: "getStoredWalletInitData",
771
+ value: function getStoredWalletInitData() {
772
+ return this.walletInitData;
773
+ }
774
+
775
+ /**
776
+ * 清除存储的钱包初始化数据
777
+ */
778
+ }, {
779
+ key: "clearStoredWalletInitData",
780
+ value: function clearStoredWalletInitData() {
781
+ this.walletInitData = null;
782
+ this.paymentModule.logInfo('[WalletPass] 钱包初始化数据已清除');
783
+ }
784
+
690
785
  /**
691
786
  * 清除所有缓存数据
692
787
  */
@@ -697,13 +792,14 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
697
792
  this.userIdentificationCodes = [];
698
793
  this.searchResults = [];
699
794
  this.walletParams = null;
795
+ this.walletInitData = null;
700
796
 
701
797
  // 发送所有缓存清除事件
702
798
  this.emitEvent(WalletPassHooks.OnWalletCacheCleared, {
703
799
  clearedTypes: ['all']
704
800
  });
705
801
  this.paymentModule.logInfo('[WalletPass] 所有缓存数据已清除', {
706
- cleared_types: ['walletRecommendList', 'userIdentificationCodes', 'searchResults', 'walletParams']
802
+ cleared_types: ['walletRecommendList', 'userIdentificationCodes', 'searchResults', 'walletParams', 'walletInitData']
707
803
  });
708
804
  }
709
805
  }]);
@@ -1,37 +1,42 @@
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, holders, orderTotalAmount, isFormSubject, }: {
17
20
  oldDiscountList: Discount[];
18
21
  newDiscountList: Discount[];
19
22
  productList: any[];
20
23
  holders: {
21
24
  form_record_id: number;
22
25
  }[];
26
+ orderTotalAmount: number;
23
27
  isFormSubject: boolean;
24
28
  }): {
25
29
  isAvailable: boolean;
26
30
  discountList: Discount[];
27
31
  productList: any[];
28
32
  };
29
- calcDiscount({ discountList, productList, holders, isFormSubject, }: {
33
+ calcDiscount({ discountList, productList, holders, orderTotalAmount, isFormSubject, }: {
30
34
  discountList: Discount[];
31
35
  productList: any[];
32
36
  holders: {
33
37
  form_record_id: number;
34
38
  }[];
39
+ orderTotalAmount: number;
35
40
  isFormSubject: boolean;
36
41
  }, options?: {
37
42
  isSelected?: boolean;