@pisell/pisellos 2.3.105 → 2.3.107

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 (78) hide show
  1. package/dist/modules/Discount/index.js +4 -1
  2. package/dist/modules/Discount/types.d.ts +10 -0
  3. package/dist/modules/OpenData/index.d.ts +15 -2
  4. package/dist/modules/OpenData/index.js +307 -19
  5. package/dist/modules/OpenData/types.d.ts +55 -0
  6. package/dist/modules/OpenData/types.js +7 -1
  7. package/dist/modules/OpenData/utils.d.ts +21 -1
  8. package/dist/modules/OpenData/utils.js +138 -0
  9. package/dist/modules/Order/index.d.ts +3 -1
  10. package/dist/modules/Order/index.js +89 -16
  11. package/dist/modules/Order/types.d.ts +13 -0
  12. package/dist/modules/Order/utils.d.ts +4 -1
  13. package/dist/modules/Order/utils.js +57 -3
  14. package/dist/modules/ResourcePlanner/planner.d.ts +2 -2
  15. package/dist/modules/ResourcePlanner/planner.js +172 -49
  16. package/dist/modules/ResourcePlanner/types.d.ts +19 -0
  17. package/dist/modules/Rules/index.js +1 -1
  18. package/dist/plugins/request.d.ts +2 -1
  19. package/dist/plugins/request.js +4 -2
  20. package/dist/server/index.d.ts +15 -0
  21. package/dist/server/index.js +1734 -1285
  22. package/dist/server/modules/order/types.d.ts +50 -0
  23. package/dist/server/modules/order/types.js +2 -0
  24. package/dist/server/utils/small-ticket.d.ts +4 -1
  25. package/dist/server/utils/small-ticket.js +461 -96
  26. package/dist/solution/BaseSales/index.d.ts +5 -1
  27. package/dist/solution/BaseSales/index.js +120 -45
  28. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  29. package/dist/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  30. package/dist/solution/BookingByStep/index.d.ts +1 -1
  31. package/dist/solution/BookingTicket/index.d.ts +8 -3
  32. package/dist/solution/BookingTicket/index.js +558 -443
  33. package/dist/solution/Sales/index.d.ts +16 -1
  34. package/dist/solution/Sales/index.js +338 -63
  35. package/dist/solution/Sales/types.d.ts +10 -0
  36. package/dist/solution/UnifiedBookingSales/index.d.ts +5 -4
  37. package/dist/solution/UnifiedBookingSales/index.js +614 -462
  38. package/dist/solution/UnifiedBookingSales/types.d.ts +7 -1
  39. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  40. package/lib/modules/Discount/index.js +4 -1
  41. package/lib/modules/Discount/types.d.ts +10 -0
  42. package/lib/modules/OpenData/index.d.ts +15 -2
  43. package/lib/modules/OpenData/index.js +230 -3
  44. package/lib/modules/OpenData/types.d.ts +55 -0
  45. package/lib/modules/OpenData/types.js +9 -1
  46. package/lib/modules/OpenData/utils.d.ts +21 -1
  47. package/lib/modules/OpenData/utils.js +126 -0
  48. package/lib/modules/Order/index.d.ts +3 -1
  49. package/lib/modules/Order/index.js +69 -1
  50. package/lib/modules/Order/types.d.ts +13 -0
  51. package/lib/modules/Order/utils.d.ts +4 -1
  52. package/lib/modules/Order/utils.js +58 -1
  53. package/lib/modules/ResourcePlanner/planner.d.ts +2 -2
  54. package/lib/modules/ResourcePlanner/planner.js +141 -35
  55. package/lib/modules/ResourcePlanner/types.d.ts +19 -0
  56. package/lib/modules/Rules/index.js +1 -1
  57. package/lib/plugins/request.d.ts +2 -1
  58. package/lib/plugins/request.js +3 -2
  59. package/lib/server/index.d.ts +15 -0
  60. package/lib/server/index.js +455 -105
  61. package/lib/server/modules/order/types.d.ts +50 -0
  62. package/lib/server/modules/order/types.js +1 -0
  63. package/lib/server/utils/small-ticket.d.ts +4 -1
  64. package/lib/server/utils/small-ticket.js +427 -72
  65. package/lib/solution/BaseSales/index.d.ts +5 -1
  66. package/lib/solution/BaseSales/index.js +84 -7
  67. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +2 -0
  68. package/lib/solution/BaseSales/utils/parseSalesResponse.js +1 -1
  69. package/lib/solution/BookingByStep/index.d.ts +1 -1
  70. package/lib/solution/BookingTicket/index.d.ts +8 -3
  71. package/lib/solution/BookingTicket/index.js +60 -15
  72. package/lib/solution/Sales/index.d.ts +16 -1
  73. package/lib/solution/Sales/index.js +168 -1
  74. package/lib/solution/Sales/types.d.ts +10 -0
  75. package/lib/solution/UnifiedBookingSales/index.d.ts +5 -4
  76. package/lib/solution/UnifiedBookingSales/index.js +128 -35
  77. package/lib/solution/UnifiedBookingSales/types.d.ts +7 -1
  78. package/package.json +1 -1
@@ -1,6 +1,144 @@
1
+ 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; }
2
+ 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; }
3
+ 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; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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); }
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; }
1
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); }
2
13
  import dayjs from 'dayjs';
3
14
  import { getDateIsInSchedule } from "../Schedule/getDateIsInSchedule";
15
+ import { INVOICE_MODULE_KEYS } from "./types";
16
+ function isRecord(value) {
17
+ return !!value && _typeof(value) === 'object' && !Array.isArray(value);
18
+ }
19
+ function parseInvoiceRecord(value) {
20
+ var parsed = value;
21
+ if (typeof parsed === 'string') {
22
+ try {
23
+ parsed = JSON.parse(parsed);
24
+ } catch (_unused) {
25
+ return null;
26
+ }
27
+ }
28
+ return isRecord(parsed) ? parsed : null;
29
+ }
30
+ export function getDefaultInvoiceLayoutConfig() {
31
+ return {
32
+ module: INVOICE_MODULE_KEYS.map(function (key) {
33
+ return {
34
+ key: key,
35
+ is_show: 1
36
+ };
37
+ })
38
+ };
39
+ }
40
+ export function getDefaultInvoiceTemplateSettings() {
41
+ return {
42
+ template: 'DEFAULT',
43
+ language: {},
44
+ modules: []
45
+ };
46
+ }
47
+ var INVOICE_RECEIPT_LOCALE_ORDER = ['en', 'zh_CN', 'zh_HK', 'ja', 'pt'];
48
+ var INVOICE_RECEIPT_LOCALE_MAPPING = {
49
+ en: ['en'],
50
+ zh_cn: ['zh_CN'],
51
+ zh_hk: ['zh_HK'],
52
+ ja: ['ja'],
53
+ pt: ['pt'],
54
+ cn_en: ['en', 'zh_CN']
55
+ };
56
+
57
+ /**
58
+ * 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
59
+ * cn_en 是中英组合打印模式,因此展开为 en 与 zh_CN 两份数据。
60
+ */
61
+ export function resolveInvoiceReceiptLocales(settings) {
62
+ if (typeof (settings === null || settings === void 0 ? void 0 : settings.template) !== 'string' || settings.template.trim().length === 0 || settings.template.trim().toUpperCase() === 'DEFAULT' || !isRecord(settings.language)) {
63
+ return [];
64
+ }
65
+ var enabledLocales = new Set();
66
+ Object.entries(settings.language).forEach(function (_ref) {
67
+ var _INVOICE_RECEIPT_LOCA;
68
+ var _ref2 = _slicedToArray(_ref, 2),
69
+ rawKey = _ref2[0],
70
+ count = _ref2[1];
71
+ if (typeof count !== 'number' || !Number.isFinite(count) || count <= 0) {
72
+ return;
73
+ }
74
+ var key = rawKey.trim().toLowerCase().replace(/-/g, '_');
75
+ (_INVOICE_RECEIPT_LOCA = INVOICE_RECEIPT_LOCALE_MAPPING[key]) === null || _INVOICE_RECEIPT_LOCA === void 0 || _INVOICE_RECEIPT_LOCA.forEach(function (locale) {
76
+ enabledLocales.add(locale);
77
+ });
78
+ });
79
+ return INVOICE_RECEIPT_LOCALE_ORDER.filter(function (locale) {
80
+ return enabledLocales.has(locale);
81
+ });
82
+ }
83
+ function normalizeInvoiceTemplate(value) {
84
+ if (typeof value !== 'string' || value.trim().length === 0) return 'DEFAULT';
85
+ return value.trim().toUpperCase() === 'DEFAULT' ? 'DEFAULT' : value;
86
+ }
87
+ function normalizeInvoiceLanguage(value) {
88
+ if (!isRecord(value)) return {};
89
+ if (Object.values(value).some(function (item) {
90
+ return typeof item !== 'number';
91
+ })) return {};
92
+ return _objectSpread({}, value);
93
+ }
94
+ function normalizeInvoiceModules(value) {
95
+ if (!Array.isArray(value)) return [];
96
+ if (value.some(function (item) {
97
+ return !isRecord(item) || typeof item.key !== 'string';
98
+ })) {
99
+ return [];
100
+ }
101
+ return value.map(function (item) {
102
+ return _objectSpread({}, item);
103
+ });
104
+ }
105
+
106
+ /**
107
+ * 规范化已经提取出的公开 template_settings 值,供打印入口复用。
108
+ */
109
+ export function normalizeRawInvoiceTemplateSettings(value) {
110
+ var parsed = parseInvoiceRecord(value);
111
+ if (!parsed) return getDefaultInvoiceTemplateSettings();
112
+ return _objectSpread(_objectSpread({}, parsed), {}, {
113
+ template: normalizeInvoiceTemplate(parsed.template),
114
+ language: normalizeInvoiceLanguage(parsed.language),
115
+ modules: normalizeInvoiceModules(parsed.modules)
116
+ });
117
+ }
118
+
119
+ /**
120
+ * 从 OpenData Documents section 的两个扁平字段中构造 Native Invoice 配置。
121
+ */
122
+ export function normalizeInvoiceTemplateSettings(config) {
123
+ var parsedEdit = parseInvoiceRecord(config === null || config === void 0 ? void 0 : config['documents.invoice_edit']);
124
+ return normalizeRawInvoiceTemplateSettings(_objectSpread(_objectSpread({}, parsedEdit !== null && parsedEdit !== void 0 ? parsedEdit : {}), {}, {
125
+ template: normalizeInvoiceTemplate(config === null || config === void 0 ? void 0 : config['documents.invoice_template'])
126
+ }));
127
+ }
128
+ export function normalizeInvoiceLayoutFromTemplateSettings(settings) {
129
+ var modules = normalizeRawInvoiceTemplateSettings(settings).modules;
130
+ if (modules.length === 0) return getDefaultInvoiceLayoutConfig();
131
+ return {
132
+ module: modules
133
+ };
134
+ }
135
+
136
+ /**
137
+ * 将 invoice_edit.modules 原样投影为 Web Invoice 使用的 module 字段。
138
+ */
139
+ export function normalizeInvoiceLayoutConfig(config) {
140
+ return normalizeInvoiceLayoutFromTemplateSettings(normalizeInvoiceTemplateSettings(config));
141
+ }
4
142
  function toBoolean(value) {
5
143
  if (typeof value === 'boolean') return value;
6
144
  if (typeof value === 'string') return value === 'true' || value === '1';
@@ -176,6 +176,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
176
176
  consumeSessionStorageRestore(): Record<string, any> | null;
177
177
  notifyTempOrderChanged(): void;
178
178
  private createDefaultTempOrderInstance;
179
+ private clearTempOrderPointCardSnapshot;
180
+ private writePointCardSnapshotFromPrepareConfig;
179
181
  private createExternalSaleNumber;
180
182
  private ensureExternalSaleNumber;
181
183
  private ensureRequestUniqueIdempotencyToken;
@@ -632,4 +634,4 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
632
634
  getOrderInfo(order_id: number): Promise<any>;
633
635
  getVouchers(): any[];
634
636
  }
635
- export type { AddProductToOrderOptions, RemoveProductsFromOrderOptions, SalesNote, SalesNoteDraftInput, SalesNoteLocalizedSelection, SalesNoteLocalizedText, SalesNoteRelation, SalesNoteTextInput, SetSalesNoteInput, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';
637
+ export type { AddProductToOrderOptions, OrderMetaList, PointCardSnapshotItem, RemoveProductsFromOrderOptions, SalesNote, SalesNoteDraftInput, SalesNoteLocalizedSelection, SalesNoteLocalizedText, SalesNoteRelation, SalesNoteTextInput, SetSalesNoteInput, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';
@@ -32,7 +32,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
32
32
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
33
33
  import { BaseModule } from "../BaseModule";
34
34
  import { OrderHooks } from "./types";
35
- import { composeLinePrice, generateDuration, getAllDiscountList, mergeRelationForms, ensureCartItemOriginHolder, buildSubmitPayload, createDefaultTempOrder, createDefaultOrderRulesHooks, createEmptySummary, createUuidV4, formatDateTime, isTempOrder, normalizeBookingIsAll, normalizeBookingSubType, mapPaymentItemsToOrderPayments, normalizeOrderProductDiscountList, resolveEffectivePerUnitDiscount, ensureProductSku, getProductSkuOptions, normalizeProductSkuOptions, sumOptionUnitPrice, clearTempOrderHolderAssignments, getOrderProductLineUid, indexOrderProductsByUid, calculateOrderProductsDeposit, mergeOrderProductDisplayFields, resolveIsFormSubject } from "./utils";
35
+ import { composeLinePrice, generateDuration, getAllDiscountList, mergeRelationForms, ensureCartItemOriginHolder, buildSubmitPayload, createDefaultTempOrder, createDefaultOrderRulesHooks, createEmptySummary, createUuidV4, formatDateTime, isTempOrder, normalizeOrderMetaList, normalizeBookingIsAll, normalizeBookingSubType, mapPaymentItemsToOrderPayments, normalizeOrderProductDiscountList, resolveEffectivePerUnitDiscount, ensureProductSku, getProductSkuOptions, normalizeProductSkuOptions, sumOptionUnitPrice, clearTempOrderHolderAssignments, getOrderProductLineUid, indexOrderProductsByUid, calculateOrderProductsDeposit, buildPointCardSnapshotFromWalletPassList, mergeOrderProductDisplayFields, resolveIsFormSubject, isMarkdownBundle } from "./utils";
36
36
  import { isNormalProduct } from "../Product/utils";
37
37
  import dayjs from 'dayjs';
38
38
  import { buildSalesNoteText, decodeSalesNotesSnapshot, getSalesNotePolicy } from "./salesNotes";
@@ -107,6 +107,13 @@ function getVoucherPaymentLifecycleKey(payment) {
107
107
  if (!isVoucherPaymentRecord(payment)) return null;
108
108
  return "".concat(String(payment.voucher_id), "::").concat(String(payment.status || ''));
109
109
  }
110
+ function hasPersistedOrderId(orderId) {
111
+ if (orderId === undefined || orderId === null || orderId === '') return false;
112
+ if (typeof orderId === 'string' && orderId.startsWith('LOCAL_')) return false;
113
+ var normalizedOrderId = Number(orderId);
114
+ if (Number.isFinite(normalizedOrderId)) return normalizedOrderId > 0;
115
+ return String(orderId).trim() !== '';
116
+ }
110
117
  export var OrderModule = /*#__PURE__*/function (_BaseModule) {
111
118
  _inherits(OrderModule, _BaseModule);
112
119
  var _super = _createSuper(OrderModule);
@@ -586,8 +593,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
586
593
  discountList = prepareConfigResult === null || prepareConfigResult === void 0 ? void 0 : prepareConfigResult.discountList;
587
594
  this.store.availableWalletIds = (prepareConfigResult === null || prepareConfigResult === void 0 ? void 0 : prepareConfigResult.availableWalletIds) || [];
588
595
  this.store.virtualCurrencyList = (prepareConfigResult === null || prepareConfigResult === void 0 ? void 0 : prepareConfigResult.virtualCurrencyList) || [];
596
+ if (prepareConfigResult) {
597
+ this.writePointCardSnapshotFromPrepareConfig({
598
+ orderId: orderId,
599
+ customerId: params.customerId,
600
+ availableWalletPassList: prepareConfigResult.availableWalletPassList || []
601
+ });
602
+ }
589
603
  if (!discountList) {
590
- _context3.next = 19;
604
+ _context3.next = 20;
591
605
  break;
592
606
  }
593
607
  currentDiscountList = ((_this$store$discount2 = this.store.discount) === null || _this$store$discount2 === void 0 ? void 0 : _this$store$discount2.getDiscountList()) || [];
@@ -608,17 +622,17 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
608
622
  return true;
609
623
  });
610
624
  mergedDiscountList = [].concat(_toConsumableArray(currentEditDiscounts), _toConsumableArray(currentScanDiscounts), _toConsumableArray(runtimeDiscounts));
611
- _context3.next = 17;
625
+ _context3.next = 18;
612
626
  return (_this$store$discount3 = this.store.discount) === null || _this$store$discount3 === void 0 ? void 0 : _this$store$discount3.setOriginalDiscountList(mergedDiscountList);
613
- case 17:
614
- _context3.next = 19;
627
+ case 18:
628
+ _context3.next = 20;
615
629
  return (_this$store$discount4 = this.store.discount) === null || _this$store$discount4 === void 0 ? void 0 : _this$store$discount4.setDiscountList(mergedDiscountList);
616
- case 19:
630
+ case 20:
617
631
  if (params.apply !== false && (_this$store$tempOrder2 = this.store.tempOrder) !== null && _this$store$tempOrder2 !== void 0 && (_this$store$tempOrder2 = _this$store$tempOrder2.products) !== null && _this$store$tempOrder2 !== void 0 && _this$store$tempOrder2.length) {
618
632
  this.applyDiscount();
619
633
  }
620
634
  return _context3.abrupt("return", this.getDiscountList());
621
- case 21:
635
+ case 22:
622
636
  case "end":
623
637
  return _context3.stop();
624
638
  }
@@ -1503,6 +1517,34 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
1503
1517
  now: formatDateTime(new Date())
1504
1518
  });
1505
1519
  }
1520
+ }, {
1521
+ key: "clearTempOrderPointCardSnapshot",
1522
+ value: function clearTempOrderPointCardSnapshot(tempOrder) {
1523
+ var orderMetaList = normalizeOrderMetaList(tempOrder.order_meta_list);
1524
+ if (!orderMetaList) return;
1525
+ var nextOrderMetaList = _objectSpread({}, orderMetaList);
1526
+ delete nextOrderMetaList.point_cards_snapshot;
1527
+ if (Object.keys(nextOrderMetaList).length === 0) {
1528
+ delete tempOrder.order_meta_list;
1529
+ return;
1530
+ }
1531
+ tempOrder.order_meta_list = nextOrderMetaList;
1532
+ }
1533
+ }, {
1534
+ key: "writePointCardSnapshotFromPrepareConfig",
1535
+ value: function writePointCardSnapshotFromPrepareConfig(params) {
1536
+ var _tempOrder$customer_i, _params$orderId;
1537
+ var tempOrder = this.store.tempOrder;
1538
+ if (!tempOrder) return;
1539
+ if (String((_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : '') !== String(params.customerId)) return;
1540
+ var effectiveOrderId = (_params$orderId = params.orderId) !== null && _params$orderId !== void 0 ? _params$orderId : tempOrder.order_id;
1541
+ if (hasPersistedOrderId(effectiveOrderId)) return;
1542
+ tempOrder.order_meta_list = _objectSpread(_objectSpread({}, normalizeOrderMetaList(tempOrder.order_meta_list) || {}), {}, {
1543
+ point_cards_snapshot: buildPointCardSnapshotFromWalletPassList(params.availableWalletPassList)
1544
+ });
1545
+ this.persistTempOrder();
1546
+ this.saveDraftInBackground();
1547
+ }
1506
1548
  }, {
1507
1549
  key: "createExternalSaleNumber",
1508
1550
  value: function createExternalSaleNumber() {
@@ -2718,7 +2760,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
2718
2760
  }, {
2719
2761
  key: "getOrderSnapshot",
2720
2762
  value: function getOrderSnapshot() {
2721
- var _tempOrder$customer_i, _tempOrder$products;
2763
+ var _tempOrder$customer_i2, _tempOrder$products;
2722
2764
  var tempOrder = this.store.tempOrder;
2723
2765
  if (!tempOrder) return null;
2724
2766
  var identity = this.getOrderIdentity();
@@ -2733,7 +2775,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
2733
2775
  shippingStatus: tempOrder.shipping_status || '',
2734
2776
  note: tempOrder.note || '',
2735
2777
  customer: {
2736
- customerId: (_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : null,
2778
+ customerId: (_tempOrder$customer_i2 = tempOrder.customer_id) !== null && _tempOrder$customer_i2 !== void 0 ? _tempOrder$customer_i2 : null,
2737
2779
  customerName: tempOrder.customer_name || '',
2738
2780
  phone: tempOrder.phone || '',
2739
2781
  email: tempOrder.email || ''
@@ -3810,9 +3852,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3810
3852
  }, {
3811
3853
  key: "updateTempOrderCustomer",
3812
3854
  value: function updateTempOrderCustomer(customer) {
3813
- var _tempOrder$customer_i2, _ref54, _ref55, _customer$customer_id, _ref56, _ref57, _ref58, _customer$customer_na, _ref59, _customer$country_cal, _tempOrder$customer_i3;
3855
+ var _tempOrder$customer_i3, _ref54, _ref55, _customer$customer_id, _ref56, _ref57, _ref58, _customer$customer_na, _ref59, _customer$country_cal, _tempOrder$customer_i4;
3814
3856
  var tempOrder = this.ensureTempOrder();
3815
- var previousCustomerId = (_tempOrder$customer_i2 = tempOrder.customer_id) !== null && _tempOrder$customer_i2 !== void 0 ? _tempOrder$customer_i2 : null;
3857
+ var previousCustomerId = (_tempOrder$customer_i3 = tempOrder.customer_id) !== null && _tempOrder$customer_i3 !== void 0 ? _tempOrder$customer_i3 : null;
3816
3858
  var customerId = (_ref54 = (_ref55 = (_customer$customer_id = customer.customer_id) !== null && _customer$customer_id !== void 0 ? _customer$customer_id : customer.customerId) !== null && _ref55 !== void 0 ? _ref55 : customer.id) !== null && _ref54 !== void 0 ? _ref54 : null;
3817
3859
  var customerName = (_ref56 = (_ref57 = (_ref58 = (_customer$customer_na = customer.customer_name) !== null && _customer$customer_na !== void 0 ? _customer$customer_na : customer.customerName) !== null && _ref58 !== void 0 ? _ref58 : customer.display_name) !== null && _ref57 !== void 0 ? _ref57 : customer.name) !== null && _ref56 !== void 0 ? _ref56 : '';
3818
3860
  tempOrder.customer_id = customerId === null || customerId === undefined || customerId === '' ? null : Number(customerId);
@@ -3828,7 +3870,11 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3828
3870
  phone: tempOrder.phone,
3829
3871
  email: tempOrder.email
3830
3872
  });
3831
- var nextCustomerId = (_tempOrder$customer_i3 = tempOrder.customer_id) !== null && _tempOrder$customer_i3 !== void 0 ? _tempOrder$customer_i3 : null;
3873
+ var nextCustomerId = (_tempOrder$customer_i4 = tempOrder.customer_id) !== null && _tempOrder$customer_i4 !== void 0 ? _tempOrder$customer_i4 : null;
3874
+ if (String(previousCustomerId !== null && previousCustomerId !== void 0 ? previousCustomerId : '') !== String(nextCustomerId !== null && nextCustomerId !== void 0 ? nextCustomerId : '') && !hasPersistedOrderId(tempOrder.order_id)) {
3875
+ this.store.availableWalletIds = [];
3876
+ this.clearTempOrderPointCardSnapshot(tempOrder);
3877
+ }
3832
3878
  this.persistTempOrder();
3833
3879
  return {
3834
3880
  customerId: tempOrder.customer_id,
@@ -3840,13 +3886,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3840
3886
  }, {
3841
3887
  key: "setOrderCustomer",
3842
3888
  value: function setOrderCustomer(patch, snapshot) {
3843
- var _tempOrder$customer_i4, _tempOrder$customer_i5;
3889
+ var _tempOrder$customer_i5, _tempOrder$customer_i6;
3844
3890
  if (!patch) {
3845
3891
  this.clearOrderCustomer();
3846
3892
  return;
3847
3893
  }
3848
3894
  var tempOrder = this.ensureTempOrder();
3849
- var previousCustomerId = (_tempOrder$customer_i4 = tempOrder.customer_id) !== null && _tempOrder$customer_i4 !== void 0 ? _tempOrder$customer_i4 : null;
3895
+ var previousCustomerId = (_tempOrder$customer_i5 = tempOrder.customer_id) !== null && _tempOrder$customer_i5 !== void 0 ? _tempOrder$customer_i5 : null;
3850
3896
  tempOrder.customer_id = patch.customer_id || patch.id || null;
3851
3897
  tempOrder.customer_name = String(patch.customer_name || '');
3852
3898
  tempOrder.country_calling_code = String(patch.country_calling_code || '');
@@ -3864,10 +3910,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3864
3910
  var extend = this.ensureExtend(tempOrder);
3865
3911
  if (snapshot === null) delete extend.customerSnapshot;else extend.customerSnapshot = cloneDeep(snapshot);
3866
3912
  }
3867
- var nextCustomerId = (_tempOrder$customer_i5 = tempOrder.customer_id) !== null && _tempOrder$customer_i5 !== void 0 ? _tempOrder$customer_i5 : null;
3913
+ var nextCustomerId = (_tempOrder$customer_i6 = tempOrder.customer_id) !== null && _tempOrder$customer_i6 !== void 0 ? _tempOrder$customer_i6 : null;
3868
3914
  if (String(previousCustomerId !== null && previousCustomerId !== void 0 ? previousCustomerId : '') !== String(nextCustomerId !== null && nextCustomerId !== void 0 ? nextCustomerId : '')) {
3869
3915
  this.store.availableWalletIds = [];
3870
3916
  this.store.virtualCurrencyList = [];
3917
+ if (!hasPersistedOrderId(tempOrder.order_id)) {
3918
+ this.clearTempOrderPointCardSnapshot(tempOrder);
3919
+ }
3871
3920
  clearTempOrderHolderAssignments(tempOrder);
3872
3921
  this.clearCustomerBoundDiscounts(tempOrder);
3873
3922
  this.applyDiscount();
@@ -3914,6 +3963,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3914
3963
  if (tempOrder._extend) delete tempOrder._extend.customerSnapshot;
3915
3964
  this.store.availableWalletIds = [];
3916
3965
  this.store.virtualCurrencyList = [];
3966
+ if (!hasPersistedOrderId(tempOrder.order_id)) {
3967
+ this.clearTempOrderPointCardSnapshot(tempOrder);
3968
+ }
3917
3969
  this.clearCustomerBoundDiscounts(tempOrder);
3918
3970
  this.applyDiscount();
3919
3971
  this.persistTempOrder();
@@ -6788,7 +6840,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6788
6840
  }
6789
6841
  _context49.next = 6;
6790
6842
  return this.request.get("/order/sales/".concat(encodeURIComponent(lookup)), _objectSpread({
6791
- with: ['products', 'bookings', 'payments', 'customer', 'summary', 'contacts_info', 'refunds', 'notes']
6843
+ with: ['products', 'bookings', 'payments', 'customer', 'summary', 'contacts_info', 'order_meta_list', 'refunds', 'notes']
6792
6844
  }, params.forceRemote ? {
6793
6845
  forceRemote: true
6794
6846
  } : {}), {
@@ -7154,6 +7206,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
7154
7206
  return _objectSpread({}, c || {});
7155
7207
  }) : [];
7156
7208
  nextTempOrder.contacts_info = raw.contacts_info && _typeof(raw.contacts_info) === 'object' && !Array.isArray(raw.contacts_info) ? _objectSpread({}, raw.contacts_info) : null;
7209
+ nextTempOrder.order_meta_list = normalizeOrderMetaList(raw.order_meta_list);
7157
7210
  nextTempOrder._extend = raw._extend && _typeof(raw._extend) === 'object' ? _objectSpread(_objectSpread({}, raw._extend), {}, {
7158
7211
  productsByUid: raw._extend.productsByUid || {}
7159
7212
  }) : {
@@ -7347,6 +7400,26 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
7347
7400
  row.metadata.booking_uid = row.booking_uid;
7348
7401
  }
7349
7402
  row = restoreHydratedBundleDiscounts(row, normalizeOrderProductDiscountList);
7403
+ var rawOriginalPrice = Number(row.original_price);
7404
+ var rawSellingPrice = Number(row.selling_price);
7405
+ var hasProductDiscounts = Array.isArray(row.discount_list) && row.discount_list.length > 0;
7406
+ var hasBundleDiscounts = row.product_bundle.some(function (bundle) {
7407
+ return Array.isArray(bundle === null || bundle === void 0 ? void 0 : bundle.discount_list) && bundle.discount_list.length > 0;
7408
+ });
7409
+ var isUndiscountedV2Line = String(row.metadata.price_schema_version) === '2' && Number.isFinite(rawOriginalPrice) && Number.isFinite(rawSellingPrice) && new Decimal(rawOriginalPrice).eq(rawSellingPrice) && !hasProductDiscounts && !hasBundleDiscounts;
7410
+ if (isUndiscountedV2Line) {
7411
+ var hasPriceValue = function hasPriceValue(value) {
7412
+ return value !== undefined && value !== null && value !== '';
7413
+ };
7414
+ row.product_bundle = row.product_bundle.map(function (bundle) {
7415
+ if (!bundle || isMarkdownBundle(bundle) || hasPriceValue(bundle.original_price) || hasPriceValue(bundle.product_price) || !hasPriceValue(bundle.bundle_selling_price)) {
7416
+ return bundle;
7417
+ }
7418
+ return _objectSpread(_objectSpread({}, bundle), {}, {
7419
+ original_price: bundle.bundle_selling_price
7420
+ });
7421
+ });
7422
+ }
7350
7423
  var existingIdentity = row.metadata.unique_identification_number || row.unique_identification_number;
7351
7424
  if (!existingIdentity) {
7352
7425
  row.metadata.unique_identification_number = createUuidV4();
@@ -195,6 +195,17 @@ export interface OrderProductSku {
195
195
  export interface OrderLocalizedText {
196
196
  [locale: string]: string | null;
197
197
  }
198
+ export interface PointCardSnapshotItem {
199
+ id: number | string;
200
+ tag: 'point_card';
201
+ product_id?: number | string;
202
+ product_name: string;
203
+ par_value: string;
204
+ used_par_value: string;
205
+ }
206
+ export interface OrderMetaList {
207
+ point_cards_snapshot?: PointCardSnapshotItem[];
208
+ }
198
209
  export interface OrderProduct extends OrderProductIdentity {
199
210
  order_detail_id: number | null;
200
211
  num: number;
@@ -361,6 +372,7 @@ export interface OrderTempOrder {
361
372
  contacts: any[];
362
373
  contacts_info: Record<string, any> | null;
363
374
  holder: Record<string, any> | null;
375
+ order_meta_list?: OrderMetaList;
364
376
  metadata: Record<string, any>;
365
377
  summary?: OrderSummary;
366
378
  _extend?: {
@@ -566,6 +578,7 @@ export interface SubmitSalesOrderParams {
566
578
  contacts: any[];
567
579
  contacts_info: Record<string, any> | null;
568
580
  holder: Record<string, any> | null;
581
+ order_meta_list?: OrderMetaList;
569
582
  metadata: Record<string, any>;
570
583
  summary?: OrderSummary;
571
584
  small_ticket_data_flag?: number;
@@ -1,6 +1,6 @@
1
1
  import Decimal from 'decimal.js';
2
2
  import type { CartItem } from "../Cart";
3
- import type { OrderProductDiscountItem, OrderProduct, OrderSubmitPayload, OrderSubmitProduct, OrderSummary, OrderTempOrder } from './types';
3
+ import type { OrderProductDiscountItem, OrderMetaList, OrderProduct, OrderSubmitPayload, OrderSubmitProduct, OrderSummary, OrderTempOrder, PointCardSnapshotItem } from './types';
4
4
  import type { RulesParamsHooks } from '../Rules/types';
5
5
  import type { MapOrderPaymentsOptions, OrderPaymentData, OrderPaymentSource } from './types';
6
6
  import { createUuidV4 } from './utils/orderCollectionIdentity';
@@ -16,6 +16,9 @@ export interface OrderProductsDepositSummary {
16
16
  hasDeposit: boolean;
17
17
  }
18
18
  import type { WindowPlugin } from '../../plugins';
19
+ export declare function normalizePointCardSnapshotItem(value: unknown): PointCardSnapshotItem | null;
20
+ export declare function buildPointCardSnapshotFromWalletPassList(value: unknown): PointCardSnapshotItem[];
21
+ export declare function normalizeOrderMetaList(value: unknown): OrderMetaList | undefined;
19
22
  /**
20
23
  * 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
21
24
  *
@@ -1,7 +1,7 @@
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", "payment_status", "notes"],
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
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; }
@@ -9,7 +9,6 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
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,12 +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
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
+
27
77
  /**
28
78
  * 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
29
79
  *
@@ -1209,6 +1259,7 @@ export function buildSubmitPayload(params) {
1209
1259
  _startTime = _ref30.start_time,
1210
1260
  _customer = _ref30.customer,
1211
1261
  _discountList = _ref30.discount_list,
1262
+ _orderMetaList = _ref30.order_meta_list,
1212
1263
  _rootTaxFee = _ref30.tax_fee,
1213
1264
  _totalAmount = _ref30.total_amount,
1214
1265
  _totalRefundAmount = _ref30.total_refund_amount,
@@ -1218,6 +1269,7 @@ export function buildSubmitPayload(params) {
1218
1269
  _notes = _ref30.notes,
1219
1270
  tempOrderRest = _objectWithoutProperties(_ref30, _excluded4);
1220
1271
  var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code;
1272
+ var normalizedOrderMetaList = normalizeOrderMetaList(tempOrder.order_meta_list);
1221
1273
  var submitType = resolveSubmitOrderType({
1222
1274
  requestedType: type,
1223
1275
  tempOrderType: tempOrder.type,
@@ -1287,7 +1339,9 @@ export function buildSubmitPayload(params) {
1287
1339
  virtualSettlementMode: virtualSettlementMode
1288
1340
  });
1289
1341
  })
1290
- });
1342
+ }, normalizedOrderMetaList !== undefined ? {
1343
+ order_meta_list: normalizedOrderMetaList
1344
+ } : {});
1291
1345
  if (!enhance) return payload;
1292
1346
  var enhancedPayload = enhance(payload, {
1293
1347
  tempOrder: tempOrder,
@@ -1,5 +1,5 @@
1
1
  import type { AvailabilityProjection, AvailabilityProjectionInput, AvailabilityQuery, AvailabilityQueryResult, AvailabilitySelectionValidationParams, AvailabilitySelectionValidationResult, GetProductTimeRangesRequest, GetProductTimeRangesRuntimeOptions, ProductTimeRangeGroup } from './types';
2
2
  export declare function createAvailabilityProjection(input: AvailabilityProjectionInput): AvailabilityProjection;
3
3
  export declare function getProductTimeRanges(projection: AvailabilityProjection, request?: GetProductTimeRangesRequest, runtimeOptions?: GetProductTimeRangesRuntimeOptions): ProductTimeRangeGroup[];
4
- export declare function queryAvailabilityProjection(projection: AvailabilityProjection, request: AvailabilityQuery): AvailabilityQueryResult;
5
- export declare function validateAvailabilitySelection(projection: AvailabilityProjection, params: AvailabilitySelectionValidationParams): AvailabilitySelectionValidationResult;
4
+ export declare function queryAvailabilityProjection(projection: AvailabilityProjection, request: AvailabilityQuery, runtimeOptions?: GetProductTimeRangesRuntimeOptions): AvailabilityQueryResult;
5
+ export declare function validateAvailabilitySelection(projection: AvailabilityProjection, params: AvailabilitySelectionValidationParams, runtimeOptions?: GetProductTimeRangesRuntimeOptions): AvailabilitySelectionValidationResult;