@pisell/pisellos 0.10.88 → 0.10.91
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.
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +74 -7
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +13 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/dist/model/strategy/adapter/itemRule/type.js +10 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/dist/model/strategy/adapter/promotion/evaluator.js +103 -112
- package/dist/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
- package/dist/modules/BookingContext/utils/calendarBooking.js +207 -0
- package/dist/modules/BookingContext/utils/index.d.ts +1 -0
- package/dist/modules/BookingContext/utils/index.js +1 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +21 -0
- package/dist/modules/BookingContext/utils/productExtend.js +132 -33
- package/dist/modules/BookingContext/utils/resources.js +1 -1
- package/dist/modules/Cart/index.js +4 -3
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/dist/modules/Cart/utils/cartProduct.js +59 -32
- package/dist/modules/Date/index.d.ts +1 -1
- package/dist/modules/Date/index.js +60 -14
- package/dist/modules/Date/types.d.ts +5 -0
- package/dist/modules/OpenData/salesSettings.js +1 -1
- package/dist/modules/OpenData/types.d.ts +9 -0
- package/dist/modules/OpenData/utils.d.ts +1 -1
- package/dist/modules/OpenData/utils.js +3 -2
- package/dist/modules/Order/index.d.ts +22 -7
- package/dist/modules/Order/index.js +1565 -1161
- package/dist/modules/Order/localEftposState.d.ts +13 -0
- package/dist/modules/Order/localEftposState.js +39 -0
- package/dist/modules/Order/types.d.ts +33 -11
- package/dist/modules/Order/types.js +2 -2
- package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/dist/modules/Order/unpaidAmountGap.js +72 -0
- package/dist/modules/Order/utils.d.ts +4 -1
- package/dist/modules/Order/utils.js +185 -129
- package/dist/modules/Payment/walletpass.js +32 -6
- package/dist/modules/Product/types.d.ts +16 -0
- package/dist/modules/ProductList/index.js +1 -1
- package/dist/modules/ResourcePlanner/planner.d.ts +2 -0
- package/dist/modules/ResourcePlanner/planner.js +383 -24
- package/dist/modules/ResourcePlanner/types.d.ts +42 -0
- package/dist/modules/Rules/index.js +86 -54
- package/dist/modules/Schedule/index.d.ts +7 -1
- package/dist/modules/Schedule/index.js +155 -39
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/bookingReadValidation.d.ts +6 -0
- package/dist/modules/bookingReadValidation.js +72 -0
- package/dist/plugins/request.d.ts +2 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +1928 -1462
- package/dist/server/modules/form/index.d.ts +19 -0
- package/dist/server/modules/form/index.js +205 -0
- package/dist/server/modules/form/types.d.ts +13 -0
- package/dist/server/modules/form/types.js +3 -0
- package/dist/server/modules/index.d.ts +3 -0
- package/dist/server/modules/index.js +4 -0
- package/dist/server/modules/order/index.d.ts +21 -0
- package/dist/server/modules/order/index.js +1399 -831
- package/dist/server/modules/order/types.d.ts +3 -0
- package/dist/server/modules/order/utils/filterOrders.js +20 -0
- package/dist/server/modules/products/index.d.ts +28 -7
- package/dist/server/modules/products/index.js +1295 -769
- package/dist/server/modules/products/replication.d.ts +8 -0
- package/dist/server/modules/products/replication.js +69 -0
- package/dist/server/modules/products/types.d.ts +12 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/dist/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/dist/shared/receipt/small-ticket.d.ts +1 -0
- package/dist/shared/receipt/small-ticket.js +58 -26
- package/dist/shared/receipt/templateVisibility.d.ts +3 -0
- package/dist/shared/receipt/templateVisibility.js +6 -2
- package/dist/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/dist/solution/BaseSales/fulfillmentItemRules.js +750 -0
- package/dist/solution/BaseSales/index.d.ts +22 -6
- package/dist/solution/BaseSales/index.js +1881 -1347
- package/dist/solution/BaseSales/pickupTiming.d.ts +4 -0
- package/dist/solution/BaseSales/pickupTiming.js +35 -8
- package/dist/solution/BaseSales/types.d.ts +4 -0
- package/dist/solution/BaseSales/types.js +1 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
- package/dist/solution/BookingByStep/index.d.ts +19 -3
- package/dist/solution/BookingByStep/index.js +681 -361
- package/dist/solution/BookingByStep/utils/resources.d.ts +10 -0
- package/dist/solution/BookingByStep/utils/resources.js +117 -76
- package/dist/solution/BookingTicket/index.d.ts +6 -0
- package/dist/solution/BookingTicket/index.js +666 -593
- package/dist/solution/BookingTicket/types.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +35 -8
- package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +7 -7
- package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.js +188 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +58 -94
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +1 -3
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +33 -62
- package/dist/solution/OrderInvoicePreview/index.js +4 -3
- package/dist/solution/Sales/index.js +1 -1
- package/dist/solution/ScanOrder/index.d.ts +2 -0
- package/dist/solution/ScanOrder/index.js +230 -97
- package/dist/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/dist/solution/ScanOrder/menuAvailability.js +363 -0
- package/dist/solution/ScanOrder/types.d.ts +3 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +42 -10
- package/dist/solution/UnifiedBookingSales/index.js +2493 -1496
- package/dist/solution/UnifiedBookingSales/salesSettings.js +1 -1
- package/dist/solution/UnifiedBookingSales/types.d.ts +20 -5
- package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
- package/dist/utils/pos-receipt-auto-print.js +14 -0
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +54 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +9 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/lib/model/strategy/adapter/itemRule/type.js +10 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +22 -21
- package/lib/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
- package/lib/modules/BookingContext/utils/calendarBooking.js +156 -0
- package/lib/modules/BookingContext/utils/index.d.ts +1 -0
- package/lib/modules/BookingContext/utils/index.js +11 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +21 -0
- package/lib/modules/BookingContext/utils/productExtend.js +104 -5
- package/lib/modules/BookingContext/utils/resources.js +1 -1
- package/lib/modules/Cart/index.js +4 -2
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/lib/modules/Cart/utils/cartProduct.js +39 -20
- package/lib/modules/Date/index.d.ts +1 -1
- package/lib/modules/Date/index.js +28 -5
- package/lib/modules/Date/types.d.ts +5 -0
- package/lib/modules/OpenData/salesSettings.js +1 -1
- package/lib/modules/OpenData/types.d.ts +9 -0
- package/lib/modules/OpenData/utils.d.ts +1 -1
- package/lib/modules/OpenData/utils.js +3 -2
- package/lib/modules/Order/index.d.ts +22 -7
- package/lib/modules/Order/index.js +457 -174
- package/lib/modules/Order/localEftposState.d.ts +13 -0
- package/lib/modules/Order/localEftposState.js +44 -0
- package/lib/modules/Order/types.d.ts +33 -11
- package/lib/modules/Order/types.js +2 -2
- package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
- package/lib/modules/Order/unpaidAmountGap.js +60 -0
- package/lib/modules/Order/utils.d.ts +4 -1
- package/lib/modules/Order/utils.js +51 -3
- package/lib/modules/Payment/walletpass.js +23 -1
- package/lib/modules/Product/types.d.ts +16 -0
- package/lib/modules/ProductList/index.js +1 -1
- package/lib/modules/ResourcePlanner/planner.d.ts +2 -0
- package/lib/modules/ResourcePlanner/planner.js +299 -9
- package/lib/modules/ResourcePlanner/types.d.ts +42 -0
- package/lib/modules/Rules/index.js +32 -3
- package/lib/modules/Schedule/index.d.ts +7 -1
- package/lib/modules/Schedule/index.js +68 -4
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/bookingReadValidation.d.ts +6 -0
- package/lib/modules/bookingReadValidation.js +56 -0
- package/lib/plugins/request.d.ts +2 -0
- package/lib/server/index.d.ts +9 -0
- package/lib/server/index.js +279 -30
- package/lib/server/modules/form/index.d.ts +19 -0
- package/lib/server/modules/form/index.js +73 -0
- package/lib/server/modules/form/types.d.ts +13 -0
- package/lib/server/modules/form/types.js +9 -0
- package/lib/server/modules/index.d.ts +3 -0
- package/lib/server/modules/index.js +15 -1
- package/lib/server/modules/order/index.d.ts +21 -0
- package/lib/server/modules/order/index.js +344 -35
- package/lib/server/modules/order/types.d.ts +3 -0
- package/lib/server/modules/order/utils/filterOrders.js +18 -0
- package/lib/server/modules/products/index.d.ts +28 -7
- package/lib/server/modules/products/index.js +224 -62
- package/lib/server/modules/products/replication.d.ts +8 -0
- package/lib/server/modules/products/replication.js +30 -0
- package/lib/server/modules/products/types.d.ts +12 -1
- package/lib/server/modules/products/types.js +3 -0
- package/lib/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
- package/lib/shared/receipt/customerInvoiceLanguages.js +5 -3
- package/lib/shared/receipt/small-ticket.d.ts +1 -0
- package/lib/shared/receipt/small-ticket.js +53 -25
- package/lib/shared/receipt/templateVisibility.d.ts +3 -0
- package/lib/shared/receipt/templateVisibility.js +6 -2
- package/lib/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/lib/solution/BaseSales/fulfillmentItemRules.js +259 -0
- package/lib/solution/BaseSales/index.d.ts +22 -6
- package/lib/solution/BaseSales/index.js +347 -59
- package/lib/solution/BaseSales/pickupTiming.d.ts +4 -0
- package/lib/solution/BaseSales/pickupTiming.js +24 -3
- package/lib/solution/BaseSales/types.d.ts +4 -0
- package/lib/solution/BaseSales/types.js +1 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +19 -3
- package/lib/solution/BookingByStep/index.js +229 -17
- package/lib/solution/BookingByStep/utils/resources.d.ts +10 -0
- package/lib/solution/BookingByStep/utils/resources.js +25 -15
- package/lib/solution/BookingTicket/index.d.ts +6 -0
- package/lib/solution/BookingTicket/index.js +40 -5
- package/lib/solution/BookingTicket/types.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +34 -4
- package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +7 -7
- package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.js +136 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -14
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +1 -3
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +17 -34
- package/lib/solution/OrderInvoicePreview/index.js +1 -0
- package/lib/solution/Sales/index.js +1 -1
- package/lib/solution/ScanOrder/index.d.ts +2 -0
- package/lib/solution/ScanOrder/index.js +131 -22
- package/lib/solution/ScanOrder/menuAvailability.d.ts +24 -0
- package/lib/solution/ScanOrder/menuAvailability.js +203 -0
- package/lib/solution/ScanOrder/types.d.ts +3 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +42 -10
- package/lib/solution/UnifiedBookingSales/index.js +717 -144
- package/lib/solution/UnifiedBookingSales/salesSettings.js +1 -1
- package/lib/solution/UnifiedBookingSales/types.d.ts +20 -5
- package/lib/utils/pos-receipt-auto-print.d.ts +4 -0
- package/lib/utils/pos-receipt-auto-print.js +13 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["option"];
|
|
2
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
5
|
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); }
|
|
@@ -10,6 +11,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
11
|
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; }
|
|
11
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
13
|
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); }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
13
16
|
import Decimal from 'decimal.js';
|
|
14
17
|
import { isNormalProduct } from "../../Product/utils";
|
|
15
18
|
import { getDiscountAmount } from "../../../solution/ShopDiscount/utils";
|
|
@@ -117,7 +120,7 @@ export var formatProductToCartItem = function formatProductToCartItem(params) {
|
|
|
117
120
|
cartItem.bundle = formatBundle(bundle);
|
|
118
121
|
}
|
|
119
122
|
if (options !== null && options !== void 0 && options.length) {
|
|
120
|
-
cartItem.options = formatOptions(options);
|
|
123
|
+
cartItem.options = formatOptions(options, product);
|
|
121
124
|
}
|
|
122
125
|
// 拼装出 product_option_string
|
|
123
126
|
if (product_variant_id) {
|
|
@@ -167,7 +170,9 @@ export var formatProductToCartItemOrigin = function formatProductToCartItemOrigi
|
|
|
167
170
|
options = params.options,
|
|
168
171
|
product_variant_id = params.product_variant_id,
|
|
169
172
|
_params$quantity2 = params.quantity,
|
|
170
|
-
quantity = _params$quantity2 === void 0 ? 1 : _params$quantity2
|
|
173
|
+
quantity = _params$quantity2 === void 0 ? 1 : _params$quantity2,
|
|
174
|
+
_params$isLegacyOrder = params.isLegacyOrder,
|
|
175
|
+
isLegacyOrder = _params$isLegacyOrder === void 0 ? false : _params$isLegacyOrder;
|
|
171
176
|
var origin = cartItem._origin;
|
|
172
177
|
var product_discount_difference = (((_origin$product = origin.product) === null || _origin$product === void 0 ? void 0 : _origin$product.discount_list) || []).filter(function (item) {
|
|
173
178
|
var _item$metadata;
|
|
@@ -177,15 +182,23 @@ export var formatProductToCartItemOrigin = function formatProductToCartItemOrigi
|
|
|
177
182
|
return pre + ((cur === null || cur === void 0 || (_cur$metadata = cur.metadata) === null || _cur$metadata === void 0 ? void 0 : _cur$metadata.product_discount_difference) || 0);
|
|
178
183
|
}, 0);
|
|
179
184
|
if (product) {
|
|
180
|
-
var _origin$product2, _origin$product3, _product$duration, _product$duration2;
|
|
181
|
-
|
|
185
|
+
var _origin$product2, _origin$product3, _origin$product4, _origin$product5, _product$duration, _product$duration2;
|
|
186
|
+
var _ref = ((_origin$product2 = origin.product) === null || _origin$product2 === void 0 ? void 0 : _origin$product2.product_sku) || {},
|
|
187
|
+
_option = _ref.option,
|
|
188
|
+
legacyProductSku = _objectWithoutProperties(_ref, _excluded);
|
|
189
|
+
origin.product = _objectSpread(_objectSpread(_objectSpread({}, origin.product || {}), {}, {
|
|
182
190
|
num: quantity,
|
|
183
191
|
product_id: product.id,
|
|
184
192
|
product_variant_id: product_variant_id || 0,
|
|
185
|
-
product_bundle: ((_origin$
|
|
186
|
-
|
|
193
|
+
product_bundle: ((_origin$product3 = origin.product) === null || _origin$product3 === void 0 ? void 0 : _origin$product3.product_bundle) || []
|
|
194
|
+
}, isLegacyOrder ? {
|
|
195
|
+
product_sku: legacyProductSku,
|
|
196
|
+
product_option_item: ((_origin$product4 = origin.product) === null || _origin$product4 === void 0 ? void 0 : _origin$product4.product_option_item) || []
|
|
197
|
+
} : {
|
|
198
|
+
product_sku: ((_origin$product5 = origin.product) === null || _origin$product5 === void 0 ? void 0 : _origin$product5.product_sku) || {
|
|
187
199
|
option: []
|
|
188
|
-
}
|
|
200
|
+
}
|
|
201
|
+
}), {}, {
|
|
189
202
|
metadata: {
|
|
190
203
|
product_discount_difference: product_discount_difference
|
|
191
204
|
}
|
|
@@ -198,16 +211,21 @@ export var formatProductToCartItemOrigin = function formatProductToCartItemOrigi
|
|
|
198
211
|
origin.product.product_bundle = formatBundleToOrigin(bundle);
|
|
199
212
|
}
|
|
200
213
|
if (options !== null && options !== void 0 && options.length) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
214
|
+
var formattedOptions = formatOptionsToOrigin(options);
|
|
215
|
+
if (isLegacyOrder) {
|
|
216
|
+
origin.product.product_option_item = formattedOptions;
|
|
217
|
+
} else {
|
|
218
|
+
origin.product.product_sku = _objectSpread(_objectSpread({}, origin.product.product_sku || {}), {}, {
|
|
219
|
+
option: formattedOptions.map(function (option) {
|
|
220
|
+
var _option$add_price;
|
|
221
|
+
var next = _objectSpread(_objectSpread({}, option), {}, {
|
|
222
|
+
add_price: (_option$add_price = option.add_price) !== null && _option$add_price !== void 0 ? _option$add_price : option.price
|
|
223
|
+
});
|
|
224
|
+
delete next.price;
|
|
225
|
+
return next;
|
|
226
|
+
})
|
|
227
|
+
});
|
|
228
|
+
}
|
|
211
229
|
}
|
|
212
230
|
}
|
|
213
231
|
return origin;
|
|
@@ -230,10 +248,10 @@ export var getProductTotalPrice = function getProductTotalPrice(params) {
|
|
|
230
248
|
|
|
231
249
|
// option 行:unit 折后价在循环中与主商品使用同一套 getDiscountAmount(含 deductOptionPrice)
|
|
232
250
|
var optionRows = (_options$map = options === null || options === void 0 ? void 0 : options.map(function (currentValue) {
|
|
233
|
-
var
|
|
251
|
+
var _ref2, _currentValue$price, _ref3, _currentValue$num;
|
|
234
252
|
return {
|
|
235
|
-
unit: Number((
|
|
236
|
-
num: Number((
|
|
253
|
+
unit: Number((_ref2 = (_currentValue$price = currentValue.price) !== null && _currentValue$price !== void 0 ? _currentValue$price : currentValue.add_price) !== null && _ref2 !== void 0 ? _ref2 : 0),
|
|
254
|
+
num: Number((_ref3 = (_currentValue$num = currentValue.num) !== null && _currentValue$num !== void 0 ? _currentValue$num : currentValue.quantity) !== null && _ref3 !== void 0 ? _ref3 : 1)
|
|
237
255
|
};
|
|
238
256
|
})) !== null && _options$map !== void 0 ? _options$map : [];
|
|
239
257
|
|
|
@@ -317,12 +335,21 @@ export var getProductOriginTotalPrice = function getProductOriginTotalPrice(para
|
|
|
317
335
|
* @param options 套餐规格信息
|
|
318
336
|
* @returns 格式化后的套餐规格信息
|
|
319
337
|
*/
|
|
320
|
-
export var formatOptions = function formatOptions(options) {
|
|
338
|
+
export var formatOptions = function formatOptions(options, product) {
|
|
321
339
|
if (!(options !== null && options !== void 0 && options.length)) return [];
|
|
322
340
|
return options.map(function (item) {
|
|
341
|
+
var _ref4, _item$id, _product$option_group, _optionGroup$option_i, _ref5, _ref6, _item$name;
|
|
342
|
+
var optionGroupId = item === null || item === void 0 ? void 0 : item.option_group_id;
|
|
343
|
+
var optionItemId = (_ref4 = (_item$id = item === null || item === void 0 ? void 0 : item.id) !== null && _item$id !== void 0 ? _item$id : item === null || item === void 0 ? void 0 : item.option_group_item_id) !== null && _ref4 !== void 0 ? _ref4 : item === null || item === void 0 ? void 0 : item.product_option_item_id;
|
|
344
|
+
var optionGroup = product === null || product === void 0 || (_product$option_group = product.option_group) === null || _product$option_group === void 0 ? void 0 : _product$option_group.find(function (group) {
|
|
345
|
+
return String(group === null || group === void 0 ? void 0 : group.id) === String(optionGroupId);
|
|
346
|
+
});
|
|
347
|
+
var optionItem = optionGroup === null || optionGroup === void 0 || (_optionGroup$option_i = optionGroup.option_item) === null || _optionGroup$option_i === void 0 ? void 0 : _optionGroup$option_i.find(function (candidate) {
|
|
348
|
+
return String(candidate === null || candidate === void 0 ? void 0 : candidate.id) === String(optionItemId);
|
|
349
|
+
});
|
|
323
350
|
return {
|
|
324
|
-
id:
|
|
325
|
-
name: item === null || item === void 0 ? void 0 : item.name,
|
|
351
|
+
id: optionItemId,
|
|
352
|
+
name: (_ref5 = (_ref6 = (_item$name = item === null || item === void 0 ? void 0 : item.name) !== null && _item$name !== void 0 ? _item$name : item === null || item === void 0 ? void 0 : item.title) !== null && _ref6 !== void 0 ? _ref6 : optionItem === null || optionItem === void 0 ? void 0 : optionItem.name) !== null && _ref5 !== void 0 ? _ref5 : optionItem === null || optionItem === void 0 ? void 0 : optionItem.title,
|
|
326
353
|
num: item === null || item === void 0 ? void 0 : item.num,
|
|
327
354
|
price: item === null || item === void 0 ? void 0 : item.price,
|
|
328
355
|
total: item === null || item === void 0 ? void 0 : item.price,
|
|
@@ -337,7 +364,7 @@ export var formatOptionsToOrigin = function formatOptionsToOrigin(options) {
|
|
|
337
364
|
return options.map(function (d) {
|
|
338
365
|
return {
|
|
339
366
|
num: d.num,
|
|
340
|
-
option_group_item_id: d.option_group_item_id,
|
|
367
|
+
option_group_item_id: (d === null || d === void 0 ? void 0 : d.option_group_item_id) || (d === null || d === void 0 ? void 0 : d.product_option_item_id),
|
|
341
368
|
option_group_id: d.option_group_id
|
|
342
369
|
};
|
|
343
370
|
});
|
|
@@ -431,11 +458,11 @@ export var getProductDeposit = function getProductDeposit(params) {
|
|
|
431
458
|
// 判定商品是否有定金规则
|
|
432
459
|
if ((product === null || product === void 0 || (_product$custom_depos2 = product.custom_deposit_data) === null || _product$custom_depos2 === void 0 ? void 0 : _product$custom_depos2.has_deposit) == 1) {
|
|
433
460
|
var total = new Decimal(0);
|
|
434
|
-
var
|
|
435
|
-
deposit_fixed =
|
|
436
|
-
deposit_percentage =
|
|
437
|
-
deposit_policy_data =
|
|
438
|
-
self_deposit_policy_ids =
|
|
461
|
+
var _ref7 = (product === null || product === void 0 ? void 0 : product.custom_deposit_data) || {},
|
|
462
|
+
deposit_fixed = _ref7.deposit_fixed,
|
|
463
|
+
deposit_percentage = _ref7.deposit_percentage,
|
|
464
|
+
deposit_policy_data = _ref7.deposit_policy_data,
|
|
465
|
+
self_deposit_policy_ids = _ref7.self_deposit_policy_ids;
|
|
439
466
|
// 所有协议数据
|
|
440
467
|
var allProtocols = deposit_policy_data || [];
|
|
441
468
|
// 是否存在定金,主商品has_deposit为1,但是自身没有定金设置,需要判定子商品是否存在定金,如果不存在最终判定也是不存在定金
|
|
@@ -529,9 +556,9 @@ export var handleProductDeposit = function handleProductDeposit(params) {
|
|
|
529
556
|
depositTotal: new Decimal(0)
|
|
530
557
|
};
|
|
531
558
|
}
|
|
532
|
-
var
|
|
533
|
-
deposit_fixed =
|
|
534
|
-
deposit_percentage =
|
|
559
|
+
var _ref8 = depositData || {},
|
|
560
|
+
deposit_fixed = _ref8.deposit_fixed,
|
|
561
|
+
deposit_percentage = _ref8.deposit_percentage;
|
|
535
562
|
if (typeof deposit_fixed === 'string' && typeof deposit_percentage === 'string') {
|
|
536
563
|
var depositFixed = Decimal(deposit_fixed || 0);
|
|
537
564
|
var depositPercent = Decimal(deposit_percentage || 0);
|
|
@@ -15,7 +15,7 @@ export declare class DateModule extends BaseModule implements Module, DateModule
|
|
|
15
15
|
getDateRange(): ITime[];
|
|
16
16
|
getResourceDates(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
17
17
|
getDateList(): ITime[];
|
|
18
|
-
setDateList(dateList: ITime[]): void;
|
|
18
|
+
setDateList(dateList: ITime[], replaceDates?: boolean): void;
|
|
19
19
|
fetchResourceDates(params: IGetAvailableTimeListParams): Promise<any>;
|
|
20
20
|
/**
|
|
21
21
|
* 将时间向上取整到下一个10分钟整数
|
|
@@ -27,6 +27,7 @@ import dayjs from 'dayjs';
|
|
|
27
27
|
import { BaseModule } from "../BaseModule";
|
|
28
28
|
import { disableAllDates, generateMonthDates, handleAvailableDateByResource, handleAvailableDatesByRules } from "./utils";
|
|
29
29
|
import cloneDeep from 'lodash-es/cloneDeep';
|
|
30
|
+
import { isBookingResourceList } from "../bookingReadValidation";
|
|
30
31
|
export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
31
32
|
_inherits(DateModule, _BaseModule);
|
|
32
33
|
var _super = _createSuper(DateModule);
|
|
@@ -104,11 +105,12 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
104
105
|
key: "getResourceDates",
|
|
105
106
|
value: function () {
|
|
106
107
|
var _getResourceDates = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
107
|
-
var _params$
|
|
108
|
+
var _params$assertCurrent2;
|
|
109
|
+
var _params$query, currentDateList, currentDateListMap, resourceIds, hasResource, dates, _params$assertCurrent;
|
|
108
110
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
109
111
|
while (1) switch (_context2.prev = _context2.next) {
|
|
110
112
|
case 0:
|
|
111
|
-
if (!params.useCache) {
|
|
113
|
+
if (!(params.useCache && params.errorMode !== 'throw')) {
|
|
112
114
|
_context2.next = 7;
|
|
113
115
|
break;
|
|
114
116
|
}
|
|
@@ -131,17 +133,27 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
131
133
|
}
|
|
132
134
|
return _context2.abrupt("return", currentDateList);
|
|
133
135
|
case 7:
|
|
134
|
-
_context2.
|
|
136
|
+
_context2.prev = 7;
|
|
137
|
+
_context2.next = 10;
|
|
135
138
|
return this.getResourceAvailableTimeList(params);
|
|
136
|
-
case
|
|
139
|
+
case 10:
|
|
137
140
|
dates = _context2.sent;
|
|
138
|
-
|
|
141
|
+
_context2.next = 17;
|
|
142
|
+
break;
|
|
143
|
+
case 13:
|
|
144
|
+
_context2.prev = 13;
|
|
145
|
+
_context2.t0 = _context2["catch"](7);
|
|
146
|
+
(_params$assertCurrent = params.assertCurrent) === null || _params$assertCurrent === void 0 || _params$assertCurrent.call(params);
|
|
147
|
+
throw _context2.t0;
|
|
148
|
+
case 17:
|
|
149
|
+
(_params$assertCurrent2 = params.assertCurrent) === null || _params$assertCurrent2 === void 0 || _params$assertCurrent2.call(params);
|
|
150
|
+
this.setDateList(dates, params.errorMode === 'throw');
|
|
139
151
|
return _context2.abrupt("return", dates);
|
|
140
|
-
case
|
|
152
|
+
case 20:
|
|
141
153
|
case "end":
|
|
142
154
|
return _context2.stop();
|
|
143
155
|
}
|
|
144
|
-
}, _callee2, this);
|
|
156
|
+
}, _callee2, this, [[7, 13]]);
|
|
145
157
|
}));
|
|
146
158
|
function getResourceDates(_x3) {
|
|
147
159
|
return _getResourceDates.apply(this, arguments);
|
|
@@ -156,6 +168,16 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
156
168
|
}, {
|
|
157
169
|
key: "setDateList",
|
|
158
170
|
value: function setDateList(dateList) {
|
|
171
|
+
var replaceDates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
172
|
+
if (replaceDates) {
|
|
173
|
+
var incoming = new Map(dateList.map(function (date) {
|
|
174
|
+
return [date.date, date];
|
|
175
|
+
}));
|
|
176
|
+
this.store.dateList = [].concat(_toConsumableArray((this.store.dateList || []).filter(function (date) {
|
|
177
|
+
return !incoming.has(date.date);
|
|
178
|
+
})), _toConsumableArray(cloneDeep(dateList)));
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
159
181
|
// this.store.dateList = dateList;
|
|
160
182
|
// 并不能直接简单的进行复制
|
|
161
183
|
// 我们需要把每一天的资源都进行一个合并
|
|
@@ -210,25 +232,43 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
210
232
|
end_date: end_date,
|
|
211
233
|
resource_ids: resource_ids,
|
|
212
234
|
front_end_cache_id: useCache && this.cacheId
|
|
213
|
-
}, {
|
|
235
|
+
}, _objectSpread({
|
|
214
236
|
useCache: useCache
|
|
215
|
-
}
|
|
237
|
+
}, params.bookingRead ? {
|
|
238
|
+
bookingRead: true
|
|
239
|
+
} : {}));
|
|
216
240
|
case 6:
|
|
217
241
|
res = _context3.sent;
|
|
242
|
+
if (!(params.errorMode === 'throw')) {
|
|
243
|
+
_context3.next = 10;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
if (!(!res || res.code !== undefined && Number(res.code) !== 200 || res.status === false || res.success === false || typeof res.status === 'number' && res.status >= 400 || !isBookingResourceList(res.data))) {
|
|
247
|
+
_context3.next = 10;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
throw new Error((res === null || res === void 0 ? void 0 : res.message) || 'Invalid booking resource response');
|
|
251
|
+
case 10:
|
|
218
252
|
// 校正资源时间段数据
|
|
219
253
|
if (res !== null && res !== void 0 && res.data && Array.isArray(res.data)) {
|
|
220
254
|
res.data = this.correctResourceTimeSlots(res.data);
|
|
221
255
|
}
|
|
222
256
|
return _context3.abrupt("return", res);
|
|
223
|
-
case
|
|
224
|
-
_context3.prev =
|
|
257
|
+
case 14:
|
|
258
|
+
_context3.prev = 14;
|
|
225
259
|
_context3.t0 = _context3["catch"](3);
|
|
260
|
+
if (!(params.errorMode === 'throw')) {
|
|
261
|
+
_context3.next = 18;
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
throw _context3.t0;
|
|
265
|
+
case 18:
|
|
226
266
|
console.error(_context3.t0);
|
|
227
|
-
case
|
|
267
|
+
case 19:
|
|
228
268
|
case "end":
|
|
229
269
|
return _context3.stop();
|
|
230
270
|
}
|
|
231
|
-
}, _callee3, this, [[3,
|
|
271
|
+
}, _callee3, this, [[3, 14]]);
|
|
232
272
|
}));
|
|
233
273
|
function fetchResourceDates(_x4) {
|
|
234
274
|
return _fetchResourceDates.apply(this, arguments);
|
|
@@ -363,8 +403,14 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
363
403
|
case 18:
|
|
364
404
|
_context4.prev = 18;
|
|
365
405
|
_context4.t0 = _context4["catch"](7);
|
|
406
|
+
if (!(params.errorMode === 'throw')) {
|
|
407
|
+
_context4.next = 22;
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
throw _context4.t0;
|
|
411
|
+
case 22:
|
|
366
412
|
return _context4.abrupt("return", disableAllDates(dates));
|
|
367
|
-
case
|
|
413
|
+
case 23:
|
|
368
414
|
case "end":
|
|
369
415
|
return _context4.stop();
|
|
370
416
|
}
|
|
@@ -44,6 +44,11 @@ export interface DateModuleAPI {
|
|
|
44
44
|
getResourceDates: (params: IGetAvailableTimeListParams) => Promise<ITime[]>;
|
|
45
45
|
}
|
|
46
46
|
export interface IGetAvailableTimeListParams {
|
|
47
|
+
/** BookingByStep opts in; existing solutions retain unavailable-on-error behavior. */
|
|
48
|
+
errorMode?: 'unavailable' | 'throw';
|
|
49
|
+
bookingRead?: boolean;
|
|
50
|
+
/** Check the selection is still current before committing a response. */
|
|
51
|
+
assertCurrent?: () => void;
|
|
47
52
|
url?: string;
|
|
48
53
|
/** 是否使用缓存 */
|
|
49
54
|
useCache?: boolean;
|
|
@@ -73,7 +73,7 @@ export function normalizeSalesSettings(raw, platform) {
|
|
|
73
73
|
showDontRemindAgainToday: isPos && booleanOr(raw === null || raw === void 0 ? void 0 : raw['sale.show_option'], false)
|
|
74
74
|
},
|
|
75
75
|
reservation: {
|
|
76
|
-
multipleBookingScheduling: (raw === null || raw === void 0 ? void 0 : raw['reservation.multiple_booking_scheduling']) === '
|
|
76
|
+
multipleBookingScheduling: (raw === null || raw === void 0 ? void 0 : raw['reservation.multiple_booking_scheduling']) === 'one_after_another' ? 'one_after_another' : 'same_start_time',
|
|
77
77
|
resourceSettings: normalizeSalesResourceSettings(raw === null || raw === void 0 ? void 0 : raw['reservation.resource_setting'])
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ScheduleItem } from '../Schedule/types';
|
|
2
|
+
import type { PosReceiptAutoPrintPaymentStatus } from '../../utils/pos-receipt-auto-print';
|
|
3
|
+
export type { PosReceiptAutoPrintPaymentStatus } from '../../utils/pos-receipt-auto-print';
|
|
2
4
|
export interface MultiLangObject {
|
|
3
5
|
en?: string;
|
|
4
6
|
ja?: string;
|
|
@@ -95,6 +97,10 @@ export interface OpenDataConfig {
|
|
|
95
97
|
'sale.require_payment_on_submit'?: boolean | null;
|
|
96
98
|
'sale.enable_item_rules'?: boolean;
|
|
97
99
|
'sale.enable_short_number'?: boolean;
|
|
100
|
+
'sale.short_number_digits'?: number;
|
|
101
|
+
'sale.maximum_number'?: number | string | null;
|
|
102
|
+
'sale.pad_with_leading_zeros'?: boolean | null;
|
|
103
|
+
'sale.short_number_random'?: boolean;
|
|
98
104
|
'sale.short_number_daily_reset'?: boolean;
|
|
99
105
|
'sale.short_number_start_number'?: number;
|
|
100
106
|
'sale.short_number_prefix'?: string | null;
|
|
@@ -105,6 +111,8 @@ export interface OpenDataConfig {
|
|
|
105
111
|
'fulfillment.max_later_shift_minutes'?: number | string;
|
|
106
112
|
'fulfillment.enable_pickup'?: boolean;
|
|
107
113
|
'fulfillment.handover_mode'?: string[];
|
|
114
|
+
'fulfillment.takeaway_fees_rules'?: number[];
|
|
115
|
+
'fulfillment.dine_in_fees_rules'?: number[];
|
|
108
116
|
'fulfillment.pickup.timing_mode'?: 'asap_only' | 'scheduled_only' | 'asap_and_scheduled';
|
|
109
117
|
'fulfillment.pickup.schedule'?: number[];
|
|
110
118
|
'fulfillment.pickup.advance_days'?: number;
|
|
@@ -123,6 +131,7 @@ export interface OpenDataConfig {
|
|
|
123
131
|
}>;
|
|
124
132
|
'documents.invoice_template'?: string | number;
|
|
125
133
|
'documents.invoice_edit'?: RawInvoiceEditConfig;
|
|
134
|
+
'documents.pos_receipt_auto_print_payment_statuses'?: PosReceiptAutoPrintPaymentStatus[];
|
|
126
135
|
/** @deprecated 仅保留旧调用方的类型兼容,Invoice 读取逻辑不再消费该字段。 */
|
|
127
136
|
'documents.invoice'?: RawInvoiceLayoutConfig;
|
|
128
137
|
/** @deprecated Invoice 读取逻辑只消费扁平的 documents.invoice_* 字段。 */
|
|
@@ -3,7 +3,7 @@ export declare function getDefaultInvoiceLayoutConfig(): InvoiceLayoutConfig;
|
|
|
3
3
|
export declare function getDefaultInvoiceTemplateSettings(): InvoiceTemplateSettings;
|
|
4
4
|
/**
|
|
5
5
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
6
|
-
*
|
|
6
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
7
7
|
*/
|
|
8
8
|
export declare function resolveInvoiceReceiptLocales(settings?: InvoiceTemplateSettings | null): string[];
|
|
9
9
|
/**
|
|
@@ -51,12 +51,13 @@ var INVOICE_RECEIPT_LOCALE_MAPPING = {
|
|
|
51
51
|
zh_hk: ['zh_HK'],
|
|
52
52
|
ja: ['ja'],
|
|
53
53
|
pt: ['pt'],
|
|
54
|
-
cn_en: ['en', 'zh_CN']
|
|
54
|
+
cn_en: ['en', 'zh_CN'],
|
|
55
|
+
ja_en: ['ja', 'en']
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
|
|
59
|
-
*
|
|
60
|
+
* 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
|
|
60
61
|
*/
|
|
61
62
|
export function resolveInvoiceReceiptLocales(settings) {
|
|
62
63
|
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)) {
|
|
@@ -5,7 +5,7 @@ import { CartItem } from '../Cart/types';
|
|
|
5
5
|
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
6
|
import { type PickupTimingBooking, type PickupTimingBookingInput } from './pickupTiming';
|
|
7
7
|
import { type ProductVoucherGroup } from './utils/productVoucherGroups';
|
|
8
|
-
import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, ReplaceBookingProductWithRelatedRetailParams, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderHooksConfig, OrderCartIntentCommitContext, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
|
|
8
|
+
import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, ReplaceBookingProductWithRelatedRetailParams, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderHooksConfig, OrderCartIntentCommitContext, ReplaceTempOrderOptions, HydrateTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
|
|
9
9
|
import type { ICustomer } from '../AccountList/types';
|
|
10
10
|
import type { Discount } from '../Discount/types';
|
|
11
11
|
import { UnavailableReason } from '../Rules/types';
|
|
@@ -22,6 +22,10 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
22
22
|
private openCache;
|
|
23
23
|
private sessionStoragePersistEnabled;
|
|
24
24
|
private sessionStorageRestoreRecord;
|
|
25
|
+
private orderSessionId;
|
|
26
|
+
private orderSessionDestroyed;
|
|
27
|
+
private orderSessionAliases;
|
|
28
|
+
private orderReplacement;
|
|
25
29
|
/** 只允许当前订单最新的 prepare/config 请求回写客户资产态。 */
|
|
26
30
|
private customerWalletPrepareConfigEpoch;
|
|
27
31
|
/** Payment 可能早于 prepare/config 返回;先按实例 ID 暂存卡号等待 Snapshot。 */
|
|
@@ -205,6 +209,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
205
209
|
clearSessionStoragePersistedTempOrder(): void;
|
|
206
210
|
consumeSessionStorageRestore(): Record<string, any> | null;
|
|
207
211
|
notifyTempOrderChanged(): void;
|
|
212
|
+
private getOrderSessionAliases;
|
|
213
|
+
private publishOrderSession;
|
|
214
|
+
getOrderSessionId(): string | null;
|
|
215
|
+
isOrderSessionCurrent(sessionId: string): boolean;
|
|
216
|
+
private beginOrderReplacement;
|
|
217
|
+
private assertOrderReplacementCurrent;
|
|
218
|
+
private completeOrderReplacement;
|
|
219
|
+
private rollbackOrderReplacement;
|
|
208
220
|
private createDefaultTempOrderInstance;
|
|
209
221
|
private clearTempOrderCustomerWalletSnapshots;
|
|
210
222
|
private clearCustomerWalletState;
|
|
@@ -231,6 +243,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
231
243
|
private calculatePaymentTotal;
|
|
232
244
|
private calculateOrderPaidPaymentTotal;
|
|
233
245
|
private getDepositAmount;
|
|
246
|
+
private isDepositSelectionDisabled;
|
|
247
|
+
/** Cap only the active target; product rules, manual intent and saved snapshots stay raw. */
|
|
248
|
+
private applyEffectiveDepositSummary;
|
|
234
249
|
private normalizeDepositAmount;
|
|
235
250
|
private normalizeDepositFlag;
|
|
236
251
|
private getHistoricalDepositSnapshot;
|
|
@@ -536,7 +551,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
536
551
|
updateOrderProducts(paramsList: UpdateOrderProductParams[], options?: UpdateOrderProductsOptions): Promise<OrderProduct[]>;
|
|
537
552
|
private updateOrderProductsDraft;
|
|
538
553
|
private updateOrderProductsGuarded;
|
|
539
|
-
updateOrderProductQuantity(params: UpdateOrderProductQuantityParams
|
|
554
|
+
updateOrderProductQuantity(params: UpdateOrderProductQuantityParams, options?: {
|
|
555
|
+
isCurrentOrder?: () => boolean;
|
|
556
|
+
}): Promise<OrderProduct[]>;
|
|
540
557
|
private updateOrderProductQuantityDraft;
|
|
541
558
|
updateOrderBooking(params: UpdateOrderBookingParams): any[];
|
|
542
559
|
/**
|
|
@@ -557,7 +574,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
557
574
|
private removeProductsFromOrderDraft;
|
|
558
575
|
removeProductFromOrder(identity: OrderProductIdentity, options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
|
|
559
576
|
/**
|
|
560
|
-
*
|
|
577
|
+
* 清空购物车行(products / bookings)及整单折扣,不重置整单。
|
|
561
578
|
* 普通整单 note 保持不变;以商品行为主体的 Sales Notes 同步删除。
|
|
562
579
|
*/
|
|
563
580
|
clearOrderCartLines(): Promise<OrderTempOrder>;
|
|
@@ -672,10 +689,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
672
689
|
* 数据源应尽量返回 tempOrder 所需结构;这里仅做 SDK 运行必须字段兜底,
|
|
673
690
|
* 例如数组字段、商品行唯一值、价格 metadata、summary 派生状态和 _extend。
|
|
674
691
|
*/
|
|
675
|
-
hydrateTempOrderFromRecord(record: Record<string, any>, options?:
|
|
676
|
-
|
|
677
|
-
source?: 'salesDetail' | 'mergedSalesDetail' | 'sessionStorage';
|
|
678
|
-
}): Promise<OrderTempOrder>;
|
|
692
|
+
hydrateTempOrderFromRecord(record: Record<string, any>, options?: HydrateTempOrderOptions): Promise<OrderTempOrder>;
|
|
693
|
+
private prepareHydratedTempOrder;
|
|
679
694
|
/**
|
|
680
695
|
* 兼容后端详情将 holder 放在 metadata.holder 的历史形态,统一补到运行时展示路径。
|
|
681
696
|
*
|