@pisell/pisellos 2.2.301 → 2.2.303

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 (152) hide show
  1. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +18 -2
  2. package/dist/model/strategy/adapter/dataVariant/evaluator.js +287 -101
  3. package/dist/model/strategy/adapter/dataVariant/type.d.ts +25 -0
  4. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  5. package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
  6. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  7. package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
  8. package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
  9. package/dist/model/strategy/adapter/itemRule/type.js +19 -1
  10. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +10 -7
  11. package/dist/modules/Discount/index.d.ts +2 -0
  12. package/dist/modules/Discount/index.js +41 -5
  13. package/dist/modules/Discount/types.d.ts +21 -0
  14. package/dist/modules/OpenData/index.d.ts +15 -2
  15. package/dist/modules/OpenData/index.js +307 -19
  16. package/dist/modules/OpenData/types.d.ts +55 -0
  17. package/dist/modules/OpenData/types.js +7 -1
  18. package/dist/modules/OpenData/utils.d.ts +21 -1
  19. package/dist/modules/OpenData/utils.js +138 -0
  20. package/dist/modules/Order/index.d.ts +50 -7
  21. package/dist/modules/Order/index.js +1690 -815
  22. package/dist/modules/Order/salesNotes.d.ts +31 -0
  23. package/dist/modules/Order/salesNotes.js +492 -0
  24. package/dist/modules/Order/types.d.ts +117 -10
  25. package/dist/modules/Order/types.js +6 -1
  26. package/dist/modules/Order/utils/virtualSettlement.d.ts +63 -0
  27. package/dist/modules/Order/utils/virtualSettlement.js +284 -0
  28. package/dist/modules/Order/utils.d.ts +5 -1
  29. package/dist/modules/Order/utils.js +138 -33
  30. package/dist/modules/Payment/walletpass.js +20 -21
  31. package/dist/modules/Product/types.d.ts +23 -0
  32. package/dist/modules/ProductList/index.d.ts +2 -1
  33. package/dist/modules/ProductList/index.js +100 -20
  34. package/dist/modules/ProductList/types.d.ts +10 -0
  35. package/dist/modules/Rules/index.d.ts +5 -0
  36. package/dist/modules/Rules/index.js +30 -14
  37. package/dist/modules/SalesSummary/index.d.ts +1 -0
  38. package/dist/modules/SalesSummary/index.js +4 -3
  39. package/dist/modules/SalesSummary/types.d.ts +1 -0
  40. package/dist/modules/SalesSummary/utils.d.ts +1 -0
  41. package/dist/modules/SalesSummary/utils.js +21 -1
  42. package/dist/plugins/request.d.ts +2 -1
  43. package/dist/plugins/request.js +4 -2
  44. package/dist/server/index.d.ts +21 -0
  45. package/dist/server/index.js +1774 -1285
  46. package/dist/server/modules/order/types.d.ts +50 -0
  47. package/dist/server/modules/order/types.js +2 -0
  48. package/dist/server/utils/small-ticket.d.ts +4 -1
  49. package/dist/server/utils/small-ticket.js +461 -96
  50. package/dist/solution/BaseSales/index.d.ts +26 -3
  51. package/dist/solution/BaseSales/index.js +1492 -873
  52. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  53. package/dist/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  54. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  55. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +72 -9
  56. package/dist/solution/BookingByStep/index.d.ts +1 -1
  57. package/dist/solution/BookingTicket/index.d.ts +8 -3
  58. package/dist/solution/BookingTicket/index.js +558 -443
  59. package/dist/solution/BookingTicket/utils/addProductDecision.js +2 -1
  60. package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
  61. package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
  62. package/dist/solution/RegisterAndLogin/config.js +95 -40
  63. package/dist/solution/RegisterAndLogin/index.js +4 -1
  64. package/dist/solution/Sales/index.d.ts +16 -1
  65. package/dist/solution/Sales/index.js +338 -63
  66. package/dist/solution/Sales/types.d.ts +10 -0
  67. package/dist/solution/ScanOrder/index.d.ts +1 -0
  68. package/dist/solution/ScanOrder/index.js +31 -27
  69. package/dist/solution/ScanOrder/utils.d.ts +1 -0
  70. package/dist/solution/ScanOrder/utils.js +2 -0
  71. package/dist/solution/UnifiedBookingSales/index.d.ts +20 -6
  72. package/dist/solution/UnifiedBookingSales/index.js +874 -527
  73. package/dist/solution/UnifiedBookingSales/types.d.ts +21 -2
  74. package/dist/solution/VenueBooking/index.d.ts +1 -0
  75. package/dist/solution/VenueBooking/index.js +8 -4
  76. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +18 -2
  77. package/lib/model/strategy/adapter/dataVariant/evaluator.js +137 -6
  78. package/lib/model/strategy/adapter/dataVariant/type.d.ts +25 -0
  79. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  80. package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
  81. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  82. package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
  83. package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
  84. package/lib/model/strategy/adapter/itemRule/type.js +19 -1
  85. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  86. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +4 -0
  87. package/lib/modules/Discount/index.d.ts +2 -0
  88. package/lib/modules/Discount/index.js +34 -2
  89. package/lib/modules/Discount/types.d.ts +21 -0
  90. package/lib/modules/OpenData/index.d.ts +15 -2
  91. package/lib/modules/OpenData/index.js +230 -3
  92. package/lib/modules/OpenData/types.d.ts +55 -0
  93. package/lib/modules/OpenData/types.js +9 -1
  94. package/lib/modules/OpenData/utils.d.ts +21 -1
  95. package/lib/modules/OpenData/utils.js +126 -0
  96. package/lib/modules/Order/index.d.ts +50 -7
  97. package/lib/modules/Order/index.js +704 -64
  98. package/lib/modules/Order/salesNotes.d.ts +31 -0
  99. package/lib/modules/Order/salesNotes.js +382 -0
  100. package/lib/modules/Order/types.d.ts +117 -10
  101. package/lib/modules/Order/types.js +5 -1
  102. package/lib/modules/Order/utils/virtualSettlement.d.ts +63 -0
  103. package/lib/modules/Order/utils/virtualSettlement.js +262 -0
  104. package/lib/modules/Order/utils.d.ts +5 -1
  105. package/lib/modules/Order/utils.js +127 -21
  106. package/lib/modules/Payment/walletpass.js +14 -11
  107. package/lib/modules/Product/types.d.ts +23 -0
  108. package/lib/modules/ProductList/index.d.ts +2 -1
  109. package/lib/modules/ProductList/index.js +47 -2
  110. package/lib/modules/ProductList/types.d.ts +10 -0
  111. package/lib/modules/Rules/index.d.ts +5 -0
  112. package/lib/modules/Rules/index.js +22 -12
  113. package/lib/modules/SalesSummary/index.d.ts +1 -0
  114. package/lib/modules/SalesSummary/index.js +4 -2
  115. package/lib/modules/SalesSummary/types.d.ts +1 -0
  116. package/lib/modules/SalesSummary/utils.d.ts +1 -0
  117. package/lib/modules/SalesSummary/utils.js +17 -1
  118. package/lib/plugins/request.d.ts +2 -1
  119. package/lib/plugins/request.js +3 -2
  120. package/lib/server/index.d.ts +21 -0
  121. package/lib/server/index.js +492 -108
  122. package/lib/server/modules/order/types.d.ts +50 -0
  123. package/lib/server/modules/order/types.js +1 -0
  124. package/lib/server/utils/small-ticket.d.ts +4 -1
  125. package/lib/server/utils/small-ticket.js +427 -72
  126. package/lib/solution/BaseSales/index.d.ts +26 -3
  127. package/lib/solution/BaseSales/index.js +439 -30
  128. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  129. package/lib/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  130. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
  131. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +38 -0
  132. package/lib/solution/BookingByStep/index.d.ts +1 -1
  133. package/lib/solution/BookingTicket/index.d.ts +8 -3
  134. package/lib/solution/BookingTicket/index.js +60 -15
  135. package/lib/solution/BookingTicket/utils/addProductDecision.js +1 -0
  136. package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
  137. package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
  138. package/lib/solution/RegisterAndLogin/config.js +49 -8
  139. package/lib/solution/RegisterAndLogin/index.js +4 -1
  140. package/lib/solution/Sales/index.d.ts +16 -1
  141. package/lib/solution/Sales/index.js +168 -1
  142. package/lib/solution/Sales/types.d.ts +10 -0
  143. package/lib/solution/ScanOrder/index.d.ts +1 -0
  144. package/lib/solution/ScanOrder/index.js +5 -1
  145. package/lib/solution/ScanOrder/utils.d.ts +1 -0
  146. package/lib/solution/ScanOrder/utils.js +1 -0
  147. package/lib/solution/UnifiedBookingSales/index.d.ts +20 -6
  148. package/lib/solution/UnifiedBookingSales/index.js +169 -16
  149. package/lib/solution/UnifiedBookingSales/types.d.ts +21 -2
  150. package/lib/solution/VenueBooking/index.d.ts +1 -0
  151. package/lib/solution/VenueBooking/index.js +5 -1
  152. package/package.json +1 -1
@@ -1,15 +1,14 @@
1
1
  var _excluded = ["custom_product_bundle_map_id"],
2
2
  _excluded2 = ["unique_identification_number"],
3
3
  _excluded3 = ["num", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per", "production_code"],
4
- _excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id"],
5
- _excluded5 = ["collect_pax", "table_occupancy_duration"];
4
+ _excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "order_meta_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id", "payment_status", "notes"],
5
+ _excluded5 = ["collect_pax", "table_occupancy_duration", "cart_settlement_key", "cart_settlement_snapshot", "legal_currency_snapshot"];
6
6
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
7
7
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
8
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
9
  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."); }
10
10
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
11
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
- 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); }
13
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; }
14
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; }
15
14
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -18,11 +17,63 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
18
17
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
19
18
  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); }
20
19
  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; }
20
+ 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); }
21
21
  import dayjs from "dayjs";
22
22
  import Decimal from 'decimal.js';
23
23
  import { getProductHolderConfig } from "../Holder/utils";
24
24
  import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
25
25
  import { createUuidV4 } from "./utils/orderCollectionIdentity";
26
+ import { encodeSalesNotes } from "./salesNotes";
27
+ var POINT_CARD_SNAPSHOT_TAG = 'point_card';
28
+ function isPlainObject(value) {
29
+ return Boolean(value) && _typeof(value) === 'object' && !Array.isArray(value);
30
+ }
31
+ function normalizeSnapshotScalar(value) {
32
+ if (value === undefined || value === null) return undefined;
33
+ if (typeof value === 'string') return value.trim() ? value : undefined;
34
+ if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;
35
+ return undefined;
36
+ }
37
+ export function normalizePointCardSnapshotItem(value) {
38
+ var _value$product_name, _value$par_value, _value$used_par_value;
39
+ if (!isPlainObject(value)) return null;
40
+ var id = normalizeSnapshotScalar(value.id);
41
+ if (id === undefined) return null;
42
+ if (String(value.tag || '').trim().toLowerCase() !== POINT_CARD_SNAPSHOT_TAG) {
43
+ return null;
44
+ }
45
+ var snapshot = {
46
+ id: id,
47
+ tag: 'point_card',
48
+ product_name: String((_value$product_name = value.product_name) !== null && _value$product_name !== void 0 ? _value$product_name : ''),
49
+ par_value: String((_value$par_value = value.par_value) !== null && _value$par_value !== void 0 ? _value$par_value : ''),
50
+ used_par_value: String((_value$used_par_value = value.used_par_value) !== null && _value$used_par_value !== void 0 ? _value$used_par_value : '')
51
+ };
52
+ var productId = normalizeSnapshotScalar(value.product_id);
53
+ if (productId !== undefined) {
54
+ snapshot.product_id = productId;
55
+ }
56
+ return snapshot;
57
+ }
58
+ export function buildPointCardSnapshotFromWalletPassList(value) {
59
+ if (!Array.isArray(value)) return [];
60
+ return value.reduce(function (result, item) {
61
+ var normalized = normalizePointCardSnapshotItem(item);
62
+ if (normalized) result.push(normalized);
63
+ return result;
64
+ }, []);
65
+ }
66
+ export function normalizeOrderMetaList(value) {
67
+ if (value === undefined) return undefined;
68
+ if (!isPlainObject(value)) return undefined;
69
+ var normalized = {};
70
+ if (Object.prototype.hasOwnProperty.call(value, 'point_cards_snapshot')) {
71
+ normalized.point_cards_snapshot = buildPointCardSnapshotFromWalletPassList(value.point_cards_snapshot);
72
+ }
73
+ if (Object.keys(normalized).length > 0) return normalized;
74
+ return {};
75
+ }
76
+
26
77
  /**
27
78
  * 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
28
79
  *
@@ -822,6 +873,7 @@ function normalizeSubmitProductionCode(value) {
822
873
 
823
874
  // 后端 checkout 协议字段 option_group_item_id;tempOrder 内部也保持同一字段名。
824
875
  function formatSubmitOptionItems(options) {
876
+ var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
825
877
  if (!Array.isArray(options)) return [];
826
878
  return options.map(function (d) {
827
879
  var _d$add_price;
@@ -834,7 +886,11 @@ function formatSubmitOptionItems(options) {
834
886
  delete option.production_code;
835
887
  if (productionCode !== undefined) option.production_code = productionCode;
836
888
  var addPrice = (_d$add_price = d === null || d === void 0 ? void 0 : d.add_price) !== null && _d$add_price !== void 0 ? _d$add_price : d === null || d === void 0 ? void 0 : d.price;
837
- if (addPrice !== undefined) option.add_price = String(addPrice);
889
+ if (formatOptions.virtualSettlementMode) {
890
+ option.add_price = 0;
891
+ } else if (addPrice !== undefined) {
892
+ option.add_price = String(addPrice);
893
+ }
838
894
  delete option.price;
839
895
  return option;
840
896
  });
@@ -853,6 +909,7 @@ function toMoneyString(value) {
853
909
 
854
910
  // 出站补齐:只输出后端 checkout 协议字段,运行时/详情展示字段不进入 bundle payload。
855
911
  function formatSubmitBundleItems(bundle) {
912
+ var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
856
913
  if (!Array.isArray(bundle)) return [];
857
914
  return bundle.map(function (b) {
858
915
  var _ref25, _rawBundle$price, _rawBundle$surcharge_, _rawBundle$num, _rawBundle$is_charge_, _rawBundle$bundle_var, _rawBundle$quantity, _rawBundle$extension_, _rawBundle$extension_2, _ref26, _rawBundle$price_type, _ref27, _rawBundle$price_type2, _rawBundle$bundle_gro, _rawBundle$bundle_id, _rawBundle$bundle_pro;
@@ -863,10 +920,10 @@ function formatSubmitBundleItems(bundle) {
863
920
 
864
921
  // bundle_selling_price 出站存「正净额」:markdown 为 |price| − Σoptions(如 3.70),
865
922
  // markup/原价维持原值;与后端口径一致(price 仍为毛价)。
866
- var sellingPrice = getBundleSellingMagnitude(rawBundle).toFixed(2);
923
+ var sellingPrice = formatOptions.virtualSettlementMode ? '0.00' : getBundleSellingMagnitude(rawBundle).toFixed(2);
867
924
  // payment 价由整单折扣均摊层产出;缺省(无折扣)时与 selling 净额同义。
868
- var paymentPrice = rawBundle.bundle_payment_price !== undefined && rawBundle.bundle_payment_price !== null && rawBundle.bundle_payment_price !== '' ? toMoneyString(rawBundle.bundle_payment_price) : sellingPrice;
869
- var priceValue = (_ref25 = (_rawBundle$price = rawBundle.price) !== null && _rawBundle$price !== void 0 ? _rawBundle$price : rawBundle.custom_price) !== null && _ref25 !== void 0 ? _ref25 : rawBundle.bundle_selling_price;
925
+ var paymentPrice = formatOptions.virtualSettlementMode ? '0.00' : rawBundle.bundle_payment_price !== undefined && rawBundle.bundle_payment_price !== null && rawBundle.bundle_payment_price !== '' ? toMoneyString(rawBundle.bundle_payment_price) : sellingPrice;
926
+ var priceValue = formatOptions.virtualSettlementMode ? 0 : (_ref25 = (_rawBundle$price = rawBundle.price) !== null && _rawBundle$price !== void 0 ? _rawBundle$price : rawBundle.custom_price) !== null && _ref25 !== void 0 ? _ref25 : rawBundle.bundle_selling_price;
870
927
  var relationSurchargeIds = Array.isArray(rawBundle.relation_surcharge_ids) ? rawBundle.relation_surcharge_ids : Array.isArray(existedMetadata.relation_surcharge_ids) ? existedMetadata.relation_surcharge_ids : [];
871
928
  var surchargeFee = toMoneyString((_rawBundle$surcharge_ = rawBundle.surcharge_fee) !== null && _rawBundle$surcharge_ !== void 0 ? _rawBundle$surcharge_ : existedMetadata.surcharge_fee);
872
929
  var productDiscountDifference = toBundleNumber(existedMetadata.product_discount_difference, 0);
@@ -875,7 +932,7 @@ function formatSubmitBundleItems(bundle) {
875
932
  var hasSubmitBundleDiscounts = Array.isArray(rawBundle.discount_list) && rawBundle.discount_list.length > 0;
876
933
  var productionCode = normalizeSubmitProductionCode(rawBundle.production_code);
877
934
  return _objectSpread(_objectSpread({
878
- is_charge_tax: (_rawBundle$is_charge_ = rawBundle.is_charge_tax) !== null && _rawBundle$is_charge_ !== void 0 ? _rawBundle$is_charge_ : 0,
935
+ is_charge_tax: formatOptions.virtualSettlementMode ? 0 : (_rawBundle$is_charge_ = rawBundle.is_charge_tax) !== null && _rawBundle$is_charge_ !== void 0 ? _rawBundle$is_charge_ : 0,
879
936
  bundle_variant_id: (_rawBundle$bundle_var = rawBundle.bundle_variant_id) !== null && _rawBundle$bundle_var !== void 0 ? _rawBundle$bundle_var : 0
880
937
  }, productionCode !== undefined ? {
881
938
  production_code: productionCode
@@ -889,7 +946,7 @@ function formatSubmitBundleItems(bundle) {
889
946
  price_type_ext: (_ref27 = (_rawBundle$price_type2 = rawBundle.price_type_ext) !== null && _rawBundle$price_type2 !== void 0 ? _rawBundle$price_type2 : rawBundle.custom_price_type_ext) !== null && _ref27 !== void 0 ? _ref27 : '',
890
947
  bundle_selling_price: sellingPrice,
891
948
  bundle_payment_price: paymentPrice,
892
- option: formatSubmitOptionItems(rawBundle.option),
949
+ option: formatSubmitOptionItems(rawBundle.option, formatOptions),
893
950
  bundle_group_id: (_rawBundle$bundle_gro = rawBundle === null || rawBundle === void 0 ? void 0 : rawBundle.bundle_group_id) !== null && _rawBundle$bundle_gro !== void 0 ? _rawBundle$bundle_gro : rawBundle === null || rawBundle === void 0 ? void 0 : rawBundle.group_id,
894
951
  bundle_id: (_rawBundle$bundle_id = rawBundle === null || rawBundle === void 0 ? void 0 : rawBundle.bundle_id) !== null && _rawBundle$bundle_id !== void 0 ? _rawBundle$bundle_id : rawBundle === null || rawBundle === void 0 ? void 0 : rawBundle.id,
895
952
  bundle_product_id: (_rawBundle$bundle_pro = rawBundle === null || rawBundle === void 0 ? void 0 : rawBundle.bundle_product_id) !== null && _rawBundle$bundle_pro !== void 0 ? _rawBundle$bundle_pro : rawBundle === null || rawBundle === void 0 ? void 0 : rawBundle._bundle_product_id,
@@ -897,9 +954,9 @@ function formatSubmitBundleItems(bundle) {
897
954
  metadata: _objectSpread(_objectSpread(_objectSpread({}, submitMetadata), hasSubmitBundleDiscounts && bundleMapId !== undefined ? {
898
955
  custom_product_bundle_map_id: bundleMapId
899
956
  } : {}), {}, {
900
- surcharge_fee: surchargeFee,
901
- relation_surcharge_ids: relationSurchargeIds,
902
- product_discount_difference: productDiscountDifference
957
+ surcharge_fee: formatOptions.virtualSettlementMode ? '0.00' : surchargeFee,
958
+ relation_surcharge_ids: formatOptions.virtualSettlementMode ? [] : relationSurchargeIds,
959
+ product_discount_difference: formatOptions.virtualSettlementMode ? '' : productDiscountDifference
903
960
  })
904
961
  });
905
962
  });
@@ -919,10 +976,11 @@ function formatSubmitBundleItems(bundle) {
919
976
  * - `metadata.main_product_selling_price`:含 option、含主商品折扣。
920
977
  * - `metadata.price_schema_version`:schema 版本号(当前 = 2),用于跨端协商价格口径。
921
978
  *
922
- * 本函数不再改造价格字段形状,仅做字段/metadata 裁剪。
979
+ * 法币仅做字段/metadata 裁剪;虚拟币在出站前再次执行零加价与固定单价断言。
923
980
  */
924
981
  function normalizeSubmitProduct(product) {
925
- var _ref29, _submitProduct$bundle, _rawMetadata$product_, _submitProduct$produc, _submitProduct$paymen;
982
+ var _ref29, _submitProduct$bundle, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
983
+ var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
926
984
  var _ref28 = product,
927
985
  _runtimeUid = _ref28.unique_identification_number,
928
986
  submitProduct = _objectWithoutProperties(_ref28, _excluded2);
@@ -947,7 +1005,7 @@ function normalizeSubmitProduct(product) {
947
1005
  if (rawMetadata.unique_identification_number) {
948
1006
  cleanMetadata.unique_identification_number = rawMetadata.unique_identification_number;
949
1007
  }
950
- var priceMetaKeys = ['main_product_original_price', 'main_product_selling_price', 'main_product_attached_bundle_selling_price', 'main_product_attached_bundle_payment_price', 'average_discount_amount_rate', 'source_product_price', 'main_product_attached_bundle_surcharge_fee', 'main_product_attached_bundle_tax_fee', 'surcharge_rounding_remainder', 'tax_fee_rounding_remainder', 'relation_surcharge_ids', 'discountable_flag', 'parent_unique_identification_number', 'product_add_schedule_time'];
1008
+ var priceMetaKeys = ['main_product_original_price', 'main_product_selling_price', 'main_product_attached_bundle_selling_price', 'main_product_attached_bundle_payment_price', 'average_discount_amount_rate', 'source_product_price', 'main_product_attached_bundle_surcharge_fee', 'main_product_attached_bundle_tax_fee', 'surcharge_rounding_remainder', 'tax_fee_rounding_remainder', 'relation_surcharge_ids', 'discountable_flag', 'price_schema_version', 'parent_unique_identification_number', 'product_add_schedule_time', 'data_variant_ids'];
951
1009
  for (var _i = 0, _priceMetaKeys = priceMetaKeys; _i < _priceMetaKeys.length; _i++) {
952
1010
  var key = _priceMetaKeys[_i];
953
1011
  if (rawMetadata[key] !== undefined) {
@@ -964,10 +1022,33 @@ function normalizeSubmitProduct(product) {
964
1022
  if (rawMetadata.holder_config !== undefined) {
965
1023
  cleanMetadata.holder_config = rawMetadata.holder_config;
966
1024
  }
1025
+ var virtualPrice = toMoneyString((_rawMetadata$selected = (_rawMetadata$selected2 = rawMetadata.selected_settlement_snapshot) === null || _rawMetadata$selected2 === void 0 ? void 0 : _rawMetadata$selected2.price) !== null && _rawMetadata$selected !== void 0 ? _rawMetadata$selected : submitProduct.selling_price);
1026
+ if (formatOptions.virtualSettlementMode) {
1027
+ Object.assign(cleanMetadata, {
1028
+ source_product_price: virtualPrice,
1029
+ main_product_original_price: virtualPrice,
1030
+ main_product_selling_price: virtualPrice,
1031
+ main_product_attached_bundle_selling_price: virtualPrice,
1032
+ main_product_attached_bundle_payment_price: virtualPrice,
1033
+ main_product_attached_bundle_surcharge_fee: '0.00',
1034
+ main_product_attached_bundle_tax_fee: '0.00',
1035
+ surcharge_rounding_remainder: '0.00',
1036
+ tax_fee_rounding_remainder: '0.00',
1037
+ relation_surcharge_ids: [],
1038
+ average_discount_amount_rate: '1',
1039
+ product_discount_difference: '',
1040
+ discountable_flag: 0,
1041
+ price_schema_version: 2
1042
+ });
1043
+ }
967
1044
  var productSku = _objectSpread(_objectSpread({}, submitProduct.product_sku && _typeof(submitProduct.product_sku) === 'object' ? submitProduct.product_sku : {}), {}, {
968
- option: formatSubmitOptionItems((_submitProduct$produc = submitProduct.product_sku) === null || _submitProduct$produc === void 0 ? void 0 : _submitProduct$produc.option)
1045
+ option: formatSubmitOptionItems((_submitProduct$produc = submitProduct.product_sku) === null || _submitProduct$produc === void 0 ? void 0 : _submitProduct$produc.option, formatOptions)
969
1046
  });
970
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest), productionCode !== undefined ? {
1047
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest), formatOptions.virtualSettlementMode ? {
1048
+ selling_price: virtualPrice,
1049
+ original_price: virtualPrice,
1050
+ is_charge_tax: 0
1051
+ } : {}), productionCode !== undefined ? {
971
1052
  production_code: productionCode
972
1053
  } : {}), bookingUid ? {
973
1054
  booking_uid: bookingUid
@@ -976,12 +1057,12 @@ function normalizeSubmitProduct(product) {
976
1057
  } : {}), {}, {
977
1058
  product_quantity: toBundleNumber(num !== null && num !== void 0 ? num : submitProduct.product_quantity, 1),
978
1059
  product_sku: productSku,
979
- discount_list: collectSubmitProductDiscountList(submitProduct),
980
- product_bundle: formatSubmitBundleItems(submitProduct.product_bundle),
1060
+ discount_list: formatOptions.virtualSettlementMode ? [] : collectSubmitProductDiscountList(submitProduct),
1061
+ product_bundle: formatSubmitBundleItems(submitProduct.product_bundle, formatOptions),
981
1062
  metadata: cleanMetadata,
982
1063
  // 出站兼容:后端消费 payment_price 字段(行 composite 已减整单折扣均摊)。
983
1064
  // 由整单折扣均摊层产出;缺省(无折扣)时与 selling_price 同义。
984
- payment_price: (_submitProduct$paymen = submitProduct.payment_price) !== null && _submitProduct$paymen !== void 0 ? _submitProduct$paymen : submitProduct.selling_price
1065
+ payment_price: formatOptions.virtualSettlementMode ? virtualPrice : (_submitProduct$paymen = submitProduct.payment_price) !== null && _submitProduct$paymen !== void 0 ? _submitProduct$paymen : submitProduct.selling_price
985
1066
  });
986
1067
  }
987
1068
  var SUBMIT_BOOKING_METADATA_WHITELIST = ['unique_identification_number', 'collect_pax', 'capacity', 'holder_id', 'resource_select_type', 'holder'];
@@ -1088,6 +1169,7 @@ export function createDefaultTempOrder(params) {
1088
1169
  request_unique_idempotency_token: '',
1089
1170
  vouchers: [],
1090
1171
  products: [],
1172
+ notes: [],
1091
1173
  bookings: [],
1092
1174
  payments: [],
1093
1175
  surcharges: [],
@@ -1097,7 +1179,11 @@ export function createDefaultTempOrder(params) {
1097
1179
  holder: null,
1098
1180
  metadata: {},
1099
1181
  _extend: {
1100
- productsByUid: {}
1182
+ productsByUid: {},
1183
+ salesNotesState: {
1184
+ loaded: true,
1185
+ dirty: false
1186
+ }
1101
1187
  }
1102
1188
  };
1103
1189
  }
@@ -1145,7 +1231,7 @@ export function resolveSubmitOrderType(params) {
1145
1231
  return 'virtual';
1146
1232
  }
1147
1233
  export function buildSubmitPayload(params) {
1148
- var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _enhancedPayload$summ;
1234
+ var _tempOrder$metadata2, _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _tempOrder$_extend, _enhancedPayload$summ;
1149
1235
  var tempOrder = params.tempOrder,
1150
1236
  cacheId = params.cacheId,
1151
1237
  _params$now = params.now,
@@ -1158,6 +1244,7 @@ export function buildSubmitPayload(params) {
1158
1244
  enhance = params.enhance;
1159
1245
  var scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
1160
1246
  var bookingUuid = createUuidV4();
1247
+ var virtualSettlementMode = ((_tempOrder$metadata2 = tempOrder.metadata) === null || _tempOrder$metadata2 === void 0 || (_tempOrder$metadata2 = _tempOrder$metadata2.currency_settlement_config) === null || _tempOrder$metadata2 === void 0 ? void 0 : _tempOrder$metadata2.settlement_type) === 'virtual_currency';
1161
1248
  var _ref30 = tempOrder,
1162
1249
  _extend = _ref30._extend,
1163
1250
  _relationId = _ref30.relation_id,
@@ -1172,13 +1259,17 @@ export function buildSubmitPayload(params) {
1172
1259
  _startTime = _ref30.start_time,
1173
1260
  _customer = _ref30.customer,
1174
1261
  _discountList = _ref30.discount_list,
1262
+ _orderMetaList = _ref30.order_meta_list,
1175
1263
  _rootTaxFee = _ref30.tax_fee,
1176
1264
  _totalAmount = _ref30.total_amount,
1177
1265
  _totalRefundAmount = _ref30.total_refund_amount,
1178
1266
  _createDate = _ref30.create_date,
1179
1267
  _holderId = _ref30.holder_id,
1268
+ _paymentStatus = _ref30.payment_status,
1269
+ _notes = _ref30.notes,
1180
1270
  tempOrderRest = _objectWithoutProperties(_ref30, _excluded4);
1181
1271
  var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code;
1272
+ var normalizedOrderMetaList = normalizeOrderMetaList(tempOrder.order_meta_list);
1182
1273
  var submitType = resolveSubmitOrderType({
1183
1274
  requestedType: type,
1184
1275
  tempOrderType: tempOrder.type,
@@ -1187,7 +1278,7 @@ export function buildSubmitPayload(params) {
1187
1278
  tempOrderBusinessCode: tempOrder.business_code,
1188
1279
  bookings: tempOrder.bookings
1189
1280
  });
1190
- var payload = _objectSpread(_objectSpread({}, tempOrderRest), {}, {
1281
+ var payload = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, tempOrderRest), {}, {
1191
1282
  customer_id: (_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : 1,
1192
1283
  customer_name: tempOrder.customer_name || 'Walk-In',
1193
1284
  country_calling_code: String((_tempOrder$country_ca = tempOrder.country_calling_code) !== null && _tempOrder$country_ca !== void 0 ? _tempOrder$country_ca : ''),
@@ -1202,8 +1293,10 @@ export function buildSubmitPayload(params) {
1202
1293
  business_code: resolvedBusinessCode,
1203
1294
  sales_channel: tempOrder.sales_channel || 'my_pisel',
1204
1295
  order_sales_channel: (_ref31 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref31 !== void 0 ? _ref31 : 'online_store',
1205
- status: tempOrder.status || 'normal',
1206
- payment_status: tempOrder.payment_status || 'payment_processing',
1296
+ status: tempOrder.status || 'normal'
1297
+ }, params.includePaymentStatus !== false ? {
1298
+ payment_status: tempOrder.payment_status || 'payment_processing'
1299
+ } : {}), {}, {
1207
1300
  // shipping_status: tempOrder.shipping_status || 'unfulfilled',
1208
1301
  is_price_include_tax: (_tempOrder$is_price_i = tempOrder.is_price_include_tax) !== null && _tempOrder$is_price_i !== void 0 ? _tempOrder$is_price_i : 1,
1209
1302
  currency_format: tempOrder.currency_format || 'symbol_first',
@@ -1230,13 +1323,25 @@ export function buildSubmitPayload(params) {
1230
1323
  var _ref32 = tempOrder.metadata || {},
1231
1324
  _collectPax = _ref32.collect_pax,
1232
1325
  _tableOccupancyDuration = _ref32.table_occupancy_duration,
1326
+ _cartSettlementKey = _ref32.cart_settlement_key,
1327
+ _cartSettlementSnapshot = _ref32.cart_settlement_snapshot,
1328
+ _legalCurrencySnapshot = _ref32.legal_currency_snapshot,
1233
1329
  rest = _objectWithoutProperties(_ref32, _excluded5);
1234
1330
  return _objectSpread({}, rest);
1235
- }(),
1331
+ }()
1332
+ }, (_tempOrder$_extend = tempOrder._extend) !== null && _tempOrder$_extend !== void 0 && (_tempOrder$_extend = _tempOrder$_extend.salesNotesState) !== null && _tempOrder$_extend !== void 0 && _tempOrder$_extend.dirty ? {
1333
+ notes: encodeSalesNotes(tempOrder.notes || [], {
1334
+ allowUnresolvedOrderTarget: true
1335
+ })
1336
+ } : {}), {}, {
1236
1337
  products: (tempOrder.products || []).map(function (product) {
1237
- return normalizeSubmitProduct(product);
1338
+ return normalizeSubmitProduct(product, {
1339
+ virtualSettlementMode: virtualSettlementMode
1340
+ });
1238
1341
  })
1239
- });
1342
+ }, normalizedOrderMetaList !== undefined ? {
1343
+ order_meta_list: normalizedOrderMetaList
1344
+ } : {});
1240
1345
  if (!enhance) return payload;
1241
1346
  var enhancedPayload = enhance(payload, {
1242
1347
  tempOrder: tempOrder,
@@ -1360,7 +1465,7 @@ export function hasAssignedHolderId(value) {
1360
1465
  * clearTempOrderHolderAssignments(tempOrder);
1361
1466
  */
1362
1467
  export function clearTempOrderHolderAssignments(tempOrder) {
1363
- var _tempOrder$_extend;
1468
+ var _tempOrder$_extend2;
1364
1469
  var changed = false;
1365
1470
  var resetHolderField = function resetHolderField(target) {
1366
1471
  var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'holder_id';
@@ -1401,7 +1506,7 @@ export function clearTempOrderHolderAssignments(tempOrder) {
1401
1506
  } finally {
1402
1507
  _iterator9.f();
1403
1508
  }
1404
- var productsByUid = (_tempOrder$_extend = tempOrder._extend) === null || _tempOrder$_extend === void 0 ? void 0 : _tempOrder$_extend.productsByUid;
1509
+ var productsByUid = (_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2.productsByUid;
1405
1510
  if (productsByUid && _typeof(productsByUid) === 'object') {
1406
1511
  for (var _i4 = 0, _Object$values = Object.values(productsByUid); _i4 < _Object$values.length; _i4++) {
1407
1512
  var entry = _Object$values[_i4];
@@ -1432,9 +1537,9 @@ export function getOrderProductLineUid(product) {
1432
1537
  return String(uid);
1433
1538
  }
1434
1539
  export function getRuntimeProductOrigin(tempOrder, product) {
1435
- var _tempOrder$_extend2, _tempOrder$_extend3;
1540
+ var _tempOrder$_extend3, _tempOrder$_extend4;
1436
1541
  var uid = getOrderProductLineUid(product);
1437
- if (uid && tempOrder !== null && tempOrder !== void 0 && (_tempOrder$_extend2 = tempOrder._extend) !== null && _tempOrder$_extend2 !== void 0 && (_tempOrder$_extend2 = _tempOrder$_extend2.productsByUid) !== null && _tempOrder$_extend2 !== void 0 && (_tempOrder$_extend2 = _tempOrder$_extend2[uid]) !== null && _tempOrder$_extend2 !== void 0 && _tempOrder$_extend2.origin) {
1542
+ if (uid && tempOrder !== null && tempOrder !== void 0 && (_tempOrder$_extend3 = tempOrder._extend) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3[uid]) !== null && _tempOrder$_extend3 !== void 0 && _tempOrder$_extend3.origin) {
1438
1543
  return tempOrder._extend.productsByUid[uid].origin;
1439
1544
  }
1440
1545
  var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
@@ -1442,7 +1547,7 @@ export function getRuntimeProductOrigin(tempOrder, product) {
1442
1547
  return item === product || getOrderProductLineUid(item) === uid || String((_ref33 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref33 !== void 0 ? _ref33 : '') === String((_ref34 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref34 !== void 0 ? _ref34 : '');
1443
1548
  });
1444
1549
  var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
1445
- return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[matchedUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin) || null : null;
1550
+ return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[matchedUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin) || null : null;
1446
1551
  }
1447
1552
  export function isHolderConfigRequired(holderConfig) {
1448
1553
  if (!holderConfig || _typeof(holderConfig) !== 'object') return false;
@@ -851,7 +851,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
851
851
  key: "getUserIdentificationCodeListAsync",
852
852
  value: function () {
853
853
  var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
854
- var _newParams$products, _newParams$prepare_pa, _this$walletParams4, newParams, platform, response, sortedData;
854
+ var _newParams$products, _newParams$prepare_pa, _this$walletParams4, newParams, response, sortedData;
855
855
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
856
856
  while (1) switch (_context6.prev = _context6.next) {
857
857
  case 0:
@@ -864,20 +864,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
864
864
  this.paymentModule.logInfo('[WalletPass] 商品列表为空,跳过获取用户识别码列表');
865
865
  return _context6.abrupt("return", []);
866
866
  case 5:
867
- platform = this.paymentModule.getPlatform();
868
- if (!(platform === 'pc' || platform === 'h5')) {
869
- _context6.next = 11;
870
- break;
871
- }
872
- this.userIdentificationCodes = [];
873
- this.emitEvent(WalletPassHooks.OnUserIdentificationCodesUpdated, {
874
- userIdentificationCodes: []
875
- });
876
- this.paymentModule.logInfo('[WalletPass] 用户端平台跳过获取用户识别码列表', {
877
- platform: platform
878
- });
879
- return _context6.abrupt("return", []);
880
- case 11:
867
+ // const platform = this.paymentModule.getPlatform();
868
+ // if (platform === 'pc' || platform === 'h5') {
869
+ // this.userIdentificationCodes = [];
870
+ // this.emitEvent(WalletPassHooks.OnUserIdentificationCodesUpdated, {
871
+ // userIdentificationCodes: [],
872
+ // } as OnUserIdentificationCodesUpdatedEventData);
873
+ // this.paymentModule.logInfo(
874
+ // '[WalletPass] 用户端平台跳过获取用户识别码列表',
875
+ // { platform },
876
+ // );
877
+ // return [];
878
+ // }
879
+
881
880
  if (typeof newParams.payment_order_id === 'string' && newParams.payment_order_id.startsWith('LOCAL_')) {
882
881
  newParams.payment_order_id = undefined;
883
882
  }
@@ -888,9 +887,9 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
888
887
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
889
888
  payment_order_id: (_this$walletParams4 = this.walletParams) === null || _this$walletParams4 === void 0 ? void 0 : _this$walletParams4.payment_order_id
890
889
  });
891
- _context6.next = 15;
890
+ _context6.next = 9;
892
891
  return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
893
- case 15:
892
+ case 9:
894
893
  response = _context6.sent;
895
894
  // 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
896
895
  sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
@@ -911,19 +910,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
911
910
  })
912
911
  });
913
912
  return _context6.abrupt("return", this.userIdentificationCodes);
914
- case 23:
915
- _context6.prev = 23;
913
+ case 17:
914
+ _context6.prev = 17;
916
915
  _context6.t0 = _context6["catch"](0);
917
916
  this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context6.t0, {
918
917
  customer_id: params.customer_id,
919
918
  available: params.available
920
919
  });
921
920
  return _context6.abrupt("return", []);
922
- case 27:
921
+ case 21:
923
922
  case "end":
924
923
  return _context6.stop();
925
924
  }
926
- }, _callee6, this, [[0, 23]]);
925
+ }, _callee6, this, [[0, 17]]);
927
926
  }));
928
927
  function getUserIdentificationCodeListAsync(_x7) {
929
928
  return _getUserIdentificationCodeListAsync.apply(this, arguments);
@@ -23,12 +23,25 @@ export interface ProductDataVariant {
23
23
  module_data_id: number;
24
24
  /** 关联 data_variant_rule.id */
25
25
  data_variant_rule_id: number;
26
+ /** 多货币结算等业务类型 */
27
+ business_type?: 'multi_currency_settlement' | string;
28
+ /** 数据状态;多货币结算仅处理 enable 记录 */
29
+ status?: 'enable' | 'disable' | string;
26
30
  /** 命中策略后覆盖到商品上的字段 */
27
31
  data: Record<string, any>;
28
32
  created_at: string | null;
29
33
  updated_at: string | null;
30
34
  deleted_at: string | null;
31
35
  }
36
+ export interface ProductSettlementOption extends Record<string, any> {
37
+ settlement_type: 'legal_currency' | 'virtual_currency' | string;
38
+ currency_product_id?: number;
39
+ price: string;
40
+ data_variant_id?: number;
41
+ data_variant_rule_id: number | string;
42
+ available: boolean;
43
+ disabled_reason?: string;
44
+ }
32
45
  /**
33
46
  * 商品基本信息接口
34
47
  */
@@ -61,6 +74,8 @@ export interface ProductData {
61
74
  sum_stock: number;
62
75
  /** 商品价格 */
63
76
  price: string;
77
+ /** 当前上下文解析出的可选结算货币 */
78
+ available_settlement_options?: ProductSettlementOption[];
64
79
  /** 商品原价 */
65
80
  original_price: string;
66
81
  /** 商品成本价 */
@@ -239,6 +254,14 @@ export interface ProductData {
239
254
  option_group_count: number;
240
255
  /** 智能定价变体列表,/product/query with dataVariants 返回 */
241
256
  data_variants?: ProductDataVariant[];
257
+ /**
258
+ * 商品接口规则计算结果;data_variant_ids 按优先级从高到低排列。
259
+ * 空数组表示规则已经计算完成但没有命中 Data Variant。
260
+ */
261
+ metadata?: {
262
+ data_variant_ids?: Array<number | string>;
263
+ [key: string]: any;
264
+ };
242
265
  /** 服务时长 */
243
266
  service_times?: any;
244
267
  }
@@ -1,6 +1,6 @@
1
1
  import { Module, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { ProductListLoadProductsParams } from './types';
3
+ import { ProductListLoadProductsParams, ProductListStoreQueryParams } from './types';
4
4
  import { ProductData } from '../Product/types';
5
5
  export * from './types';
6
6
  export declare class ProductList extends BaseModule implements Module {
@@ -52,6 +52,7 @@ export declare class ProductList extends BaseModule implements Module {
52
52
  getRawProductPriceSources(ids: number[]): Map<number, ProductData>;
53
53
  getProducts(): Promise<ProductData[]>;
54
54
  getProduct(id: number): Promise<ProductData | undefined>;
55
+ queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
55
56
  getProductByIds(ids: number[]): Promise<ProductData[] | undefined>;
56
57
  addProduct(products: ProductData[]): Promise<void>;
57
58
  selectProducts(products: ProductData[]): Promise<void>;