@pisell/pisellos 2.2.241 → 2.2.242

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.
@@ -3911,7 +3911,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3911
3911
  value: function () {
3912
3912
  var _runSubmitTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
3913
3913
  var _params$cacheId2, _this$otherParams5, _ref70, _params$businessCode2, _this$otherParams6, _this$otherParams7;
3914
- var tempOrder, latestSummary, effectiveCacheId, hasPaymentOverride, hasPaymentStatusOverride, hasSmallTicketDataFlagOverride, enhancePayload, payload, result, _payload$payments, _result, _data, _payload$payments2, backendErrorResponse, submittedOrderId, resultRecord;
3914
+ var tempOrder, latestSummary, effectiveCacheId, hasPaymentOverride, hasPaymentStatusOverride, hasSmallTicketDataFlagOverride, enhancePayload, payload, result, _payload$payments, _payload$payments2, backendErrorResponse, submittedOrderId, resultRecord;
3915
3915
  return _regeneratorRuntime().wrap(function _callee27$(_context29) {
3916
3916
  while (1) switch (_context29.prev = _context29.next) {
3917
3917
  case 0:
@@ -3989,24 +3989,20 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3989
3989
  });
3990
3990
  case 25:
3991
3991
  result = _context29.sent;
3992
- // 如果成功需要把当前内存 tempOrder的一部分同步成 result 的
3993
- if ((_result = result) !== null && _result !== void 0 && _result.success) {
3994
- tempOrder.order_id = (_data = result.data) === null || _data === void 0 ? void 0 : _data.order_id;
3995
- }
3996
- _context29.next = 39;
3992
+ _context29.next = 38;
3997
3993
  break;
3998
- case 29:
3999
- _context29.prev = 29;
3994
+ case 28:
3995
+ _context29.prev = 28;
4000
3996
  _context29.t2 = _context29["catch"](21);
4001
3997
  backendErrorResponse = this.extractSubmitErrorResponse(_context29.t2);
4002
3998
  if (!backendErrorResponse) {
4003
- _context29.next = 36;
3999
+ _context29.next = 35;
4004
4000
  break;
4005
4001
  }
4006
4002
  this.store.syncState = 'failed';
4007
4003
  this.logSubmitBackendRejected(backendErrorResponse, payload);
4008
4004
  return _context29.abrupt("return", backendErrorResponse);
4009
- case 36:
4005
+ case 35:
4010
4006
  this.store.syncState = 'failed';
4011
4007
  this.logError('submitTempOrder failed', {
4012
4008
  error: _context29.t2 instanceof Error ? _context29.t2.message : String(_context29.t2),
@@ -4016,16 +4012,21 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
4016
4012
  paymentsCount: ((_payload$payments2 = payload.payments) === null || _payload$payments2 === void 0 ? void 0 : _payload$payments2.length) || 0
4017
4013
  });
4018
4014
  throw _context29.t2;
4019
- case 39:
4015
+ case 38:
4020
4016
  if (!this.isSubmitResponseRejected(result)) {
4021
- _context29.next = 43;
4017
+ _context29.next = 42;
4022
4018
  break;
4023
4019
  }
4024
4020
  this.store.syncState = 'failed';
4025
4021
  this.logSubmitBackendRejected(result, payload);
4026
4022
  return _context29.abrupt("return", result);
4027
- case 43:
4023
+ case 42:
4028
4024
  submittedOrderId = this.extractOrderIdFromSubmitResult(result);
4025
+ this.logInfo('runSubmitTempOrder: 提交成功', {
4026
+ submittedOrderId: submittedOrderId,
4027
+ result: result,
4028
+ tempOrder: tempOrder
4029
+ });
4029
4030
  if (!(submittedOrderId !== null && submittedOrderId !== undefined)) {
4030
4031
  _context29.next = 51;
4031
4032
  break;
@@ -4049,7 +4050,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
4049
4050
  case "end":
4050
4051
  return _context29.stop();
4051
4052
  }
4052
- }, _callee27, this, [[21, 29]]);
4053
+ }, _callee27, this, [[21, 28]]);
4053
4054
  }));
4054
4055
  function runSubmitTempOrder(_x31) {
4055
4056
  return _runSubmitTempOrder.apply(this, arguments);
@@ -1,49 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/model/strategy/adapter/promotion/index.ts
30
- var promotion_exports = {};
31
- __export(promotion_exports, {
32
- BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
33
- PromotionAdapter: () => import_adapter.PromotionAdapter,
34
- PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
35
- X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
36
- default: () => import_adapter2.default
37
- });
38
- module.exports = __toCommonJS(promotion_exports);
39
- var import_evaluator = require("./evaluator");
40
- var import_adapter = require("./adapter");
41
- var import_adapter2 = __toESM(require("./adapter"));
42
- var import_examples = require("./examples");
43
- // Annotate the CommonJS export names for ESM import in node:
44
- 0 && (module.exports = {
45
- BUY_X_GET_Y_FREE_STRATEGY,
46
- PromotionAdapter,
47
- PromotionEvaluator,
48
- X_ITEMS_FOR_Y_PRICE_STRATEGY
49
- });
@@ -2852,7 +2852,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
2852
2852
  });
2853
2853
  }
2854
2854
  async runSubmitTempOrder(params) {
2855
- var _a, _b, _c, _d, _e, _f;
2855
+ var _a, _b, _c, _d, _e;
2856
2856
  const tempOrder = this.ensureTempOrder();
2857
2857
  this.persistTempOrder();
2858
2858
  const latestSummary = await this.recalculateSummary({ createIfMissing: true }) || this.store.summary || (0, import_utils.createEmptySummary)();
@@ -2906,9 +2906,6 @@ var OrderModule = class extends import_BaseModule.BaseModule {
2906
2906
  result = await this.submitSalesOrder({
2907
2907
  query: payload
2908
2908
  });
2909
- if (result == null ? void 0 : result.success) {
2910
- tempOrder.order_id = (_e = result.data) == null ? void 0 : _e.order_id;
2911
- }
2912
2909
  } catch (error) {
2913
2910
  const backendErrorResponse = this.extractSubmitErrorResponse(error);
2914
2911
  if (backendErrorResponse) {
@@ -2922,7 +2919,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
2922
2919
  orderId: payload.order_id,
2923
2920
  externalSaleNumber: payload.external_sale_number,
2924
2921
  paymentStatus: payload.payment_status,
2925
- paymentsCount: ((_f = payload.payments) == null ? void 0 : _f.length) || 0
2922
+ paymentsCount: ((_e = payload.payments) == null ? void 0 : _e.length) || 0
2926
2923
  });
2927
2924
  throw error;
2928
2925
  }
@@ -2932,6 +2929,11 @@ var OrderModule = class extends import_BaseModule.BaseModule {
2932
2929
  return result;
2933
2930
  }
2934
2931
  const submittedOrderId = this.extractOrderIdFromSubmitResult(result);
2932
+ this.logInfo("runSubmitTempOrder: 提交成功", {
2933
+ submittedOrderId,
2934
+ result,
2935
+ tempOrder
2936
+ });
2935
2937
  if (submittedOrderId !== null && submittedOrderId !== void 0) {
2936
2938
  tempOrder.order_id = submittedOrderId;
2937
2939
  const resultRecord = result;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.241",
4
+ "version": "2.2.242",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",