@pisell/pisellos 2.3.51 → 2.3.53
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/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +11 -40
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +7 -9
- package/dist/modules/Order/index.js +165 -140
- package/dist/modules/Order/types.d.ts +21 -12
- package/dist/modules/Order/types.js +11 -0
- package/dist/modules/Order/utils.d.ts +0 -10
- package/dist/modules/Order/utils.js +3 -35
- package/dist/modules/Product/types.d.ts +0 -1
- package/dist/modules/ProductList/index.js +14 -33
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/Rules/index.js +32 -56
- package/dist/modules/SalesSummary/index.js +13 -12
- package/dist/modules/SalesSummary/utils.js +7 -1
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/index.js +2 -15
- package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
- package/dist/modules/Schedule/index.d.ts +1 -3
- package/dist/modules/Schedule/index.js +16 -21
- package/dist/modules/Summary/utils.js +13 -38
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/window.d.ts +0 -1
- package/dist/server/index.d.ts +0 -14
- package/dist/server/index.js +793 -907
- package/dist/solution/BaseSales/index.d.ts +15 -12
- package/dist/solution/BaseSales/index.js +194 -178
- package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
- package/dist/solution/BookingByStep/index.d.ts +1 -16
- package/dist/solution/BookingByStep/index.js +215 -294
- package/dist/solution/BookingByStep/types.d.ts +1 -2
- package/dist/solution/BookingByStep/types.js +1 -3
- package/dist/solution/BookingByStep/utils/capacity.js +1 -17
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/BookingTicket/index.d.ts +2 -14
- package/dist/solution/BookingTicket/index.js +2 -2
- package/dist/solution/BookingTicket/types.d.ts +3 -0
- package/dist/solution/BookingTicket/utils/cartView.js +44 -32
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
- package/dist/solution/Sales/index.d.ts +1 -0
- package/dist/solution/Sales/index.js +16 -2
- package/dist/solution/ScanOrder/index.d.ts +14 -26
- package/dist/solution/ScanOrder/index.js +739 -1142
- package/dist/solution/ScanOrder/types.d.ts +1 -21
- package/dist/solution/ScanOrder/utils.d.ts +0 -8
- package/dist/solution/ScanOrder/utils.js +25 -66
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +87 -125
- package/dist/solution/VenueBooking/index.d.ts +11 -39
- package/dist/solution/VenueBooking/index.js +841 -1167
- package/dist/solution/VenueBooking/types.d.ts +0 -3
- package/dist/solution/VenueBooking/utils/resource.js +0 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
- package/dist/solution/index.d.ts +0 -1
- package/dist/solution/index.js +1 -2
- package/dist/types/index.d.ts +0 -1
- package/lib/model/strategy/adapter/promotion/index.js +0 -51
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +0 -9
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +7 -9
- package/lib/modules/Order/index.js +89 -38
- package/lib/modules/Order/types.d.ts +21 -12
- package/lib/modules/Order/utils.d.ts +0 -10
- package/lib/modules/Order/utils.js +5 -36
- package/lib/modules/Product/types.d.ts +0 -1
- package/lib/modules/ProductList/index.js +31 -40
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/Rules/index.js +32 -44
- package/lib/modules/SalesSummary/index.js +7 -6
- package/lib/modules/SalesSummary/utils.js +5 -1
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/index.js +1 -13
- package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
- package/lib/modules/Schedule/index.d.ts +1 -3
- package/lib/modules/Schedule/index.js +8 -10
- package/lib/modules/Summary/utils.js +1 -21
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/window.d.ts +0 -1
- package/lib/server/index.d.ts +0 -14
- package/lib/server/index.js +15 -72
- package/lib/solution/BaseSales/index.d.ts +15 -12
- package/lib/solution/BaseSales/index.js +52 -35
- package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -16
- package/lib/solution/BookingByStep/index.js +18 -60
- package/lib/solution/BookingByStep/types.d.ts +1 -2
- package/lib/solution/BookingByStep/types.js +0 -5
- package/lib/solution/BookingByStep/utils/capacity.js +1 -20
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/BookingTicket/index.d.ts +2 -14
- package/lib/solution/BookingTicket/index.js +2 -10
- package/lib/solution/BookingTicket/types.d.ts +3 -0
- package/lib/solution/BookingTicket/utils/cartView.js +43 -30
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/Sales/index.d.ts +1 -0
- package/lib/solution/Sales/index.js +15 -3
- package/lib/solution/ScanOrder/index.d.ts +14 -26
- package/lib/solution/ScanOrder/index.js +182 -449
- package/lib/solution/ScanOrder/types.d.ts +1 -21
- package/lib/solution/ScanOrder/utils.d.ts +0 -8
- package/lib/solution/ScanOrder/utils.js +0 -31
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +0 -14
- package/lib/solution/VenueBooking/index.d.ts +11 -39
- package/lib/solution/VenueBooking/index.js +110 -322
- package/lib/solution/VenueBooking/types.d.ts +0 -3
- package/lib/solution/VenueBooking/utils/resource.js +0 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
- package/lib/solution/index.d.ts +0 -1
- package/lib/solution/index.js +1 -3
- package/lib/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/modules/Holder/index.d.ts +0 -48
- package/dist/modules/Holder/index.js +0 -640
- package/dist/modules/Holder/types.d.ts +0 -123
- package/dist/modules/Holder/types.js +0 -1
- package/dist/modules/Holder/utils.d.ts +0 -13
- package/dist/modules/Holder/utils.js +0 -34
- package/dist/modules/ResourcePlanner/index.d.ts +0 -24
- package/dist/modules/ResourcePlanner/index.js +0 -181
- package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
- package/dist/modules/ResourcePlanner/planner.js +0 -1069
- package/dist/modules/ResourcePlanner/types.d.ts +0 -227
- package/dist/modules/ResourcePlanner/types.js +0 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/dist/solution/UnifiedBookingSales/index.js +0 -1891
- package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/dist/solution/UnifiedBookingSales/types.js +0 -11
- package/lib/modules/Holder/index.d.ts +0 -48
- package/lib/modules/Holder/index.js +0 -402
- package/lib/modules/Holder/types.d.ts +0 -123
- package/lib/modules/Holder/types.js +0 -17
- package/lib/modules/Holder/utils.d.ts +0 -13
- package/lib/modules/Holder/utils.js +0 -71
- package/lib/modules/ResourcePlanner/index.d.ts +0 -24
- package/lib/modules/ResourcePlanner/index.js +0 -148
- package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
- package/lib/modules/ResourcePlanner/planner.js +0 -933
- package/lib/modules/ResourcePlanner/types.d.ts +0 -227
- package/lib/modules/ResourcePlanner/types.js +0 -17
- package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/lib/solution/UnifiedBookingSales/index.js +0 -1084
- package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/lib/solution/UnifiedBookingSales/types.js +0 -33
|
@@ -134,9 +134,11 @@ function resolveMainProductPrice(product, fallback) {
|
|
|
134
134
|
}
|
|
135
135
|
function mapOrderBundleToOtherBundle(bundle) {
|
|
136
136
|
return bundle.map(function (item) {
|
|
137
|
-
var _ref7, _item$original_price;
|
|
137
|
+
var _ref7, _ref8, _item$original_price;
|
|
138
138
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
139
|
-
|
|
139
|
+
// 后端历史订单可能没有 original_price;此时 price 是折前毛价,
|
|
140
|
+
// bundle_selling_price 已包含折扣,不能把它当成编辑时的新原价。
|
|
141
|
+
original_price: (_ref7 = (_ref8 = (_item$original_price = item.original_price) !== null && _item$original_price !== void 0 ? _item$original_price : item.product_price) !== null && _ref8 !== void 0 ? _ref8 : item.price) !== null && _ref7 !== void 0 ? _ref7 : item.bundle_selling_price
|
|
140
142
|
});
|
|
141
143
|
});
|
|
142
144
|
}
|
|
@@ -167,10 +169,10 @@ function synthesizeProductResourceFromBooking(booking) {
|
|
|
167
169
|
});
|
|
168
170
|
if (relationIdsByForm.size === 0) return undefined;
|
|
169
171
|
return {
|
|
170
|
-
resources: Array.from(relationIdsByForm.entries()).map(function (
|
|
171
|
-
var
|
|
172
|
-
formId =
|
|
173
|
-
relationIds =
|
|
172
|
+
resources: Array.from(relationIdsByForm.entries()).map(function (_ref9) {
|
|
173
|
+
var _ref10 = _slicedToArray(_ref9, 2),
|
|
174
|
+
formId = _ref10[0],
|
|
175
|
+
relationIds = _ref10[1];
|
|
174
176
|
return {
|
|
175
177
|
id: formId,
|
|
176
178
|
status: 1,
|
|
@@ -190,7 +192,7 @@ function synthesizeProductResourceFromBooking(booking) {
|
|
|
190
192
|
* 调用方须传入与该行关联的 booking(通常 bookings[].product_uid === product.metadata.unique_identification_number)。
|
|
191
193
|
*/
|
|
192
194
|
export function buildCacheItemFromOrderLine(input) {
|
|
193
|
-
var _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$product_vari, _product$num,
|
|
195
|
+
var _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$product_vari, _product$num, _ref11, _product$note, _booking$detail2, _product$metadata, _product$metadata2, _ref12, _extension_type, _booking$product2, _booking$product3, _price, _product$product_sku, _product$order_detail, _ref13, _booking$id;
|
|
194
196
|
var product = input.product,
|
|
195
197
|
booking = input.booking,
|
|
196
198
|
sourceProduct = input.sourceProduct;
|
|
@@ -225,7 +227,7 @@ export function buildCacheItemFromOrderLine(input) {
|
|
|
225
227
|
quantity: (_product$num = product.num) !== null && _product$num !== void 0 ? _product$num : 1,
|
|
226
228
|
product_name: productTitle,
|
|
227
229
|
product_cover: productCover,
|
|
228
|
-
note: (
|
|
230
|
+
note: (_ref11 = (_product$note = product.note) !== null && _product$note !== void 0 ? _product$note : booking === null || booking === void 0 || (_booking$detail2 = booking.detail) === null || _booking$detail2 === void 0 ? void 0 : _booking$detail2.note) !== null && _ref11 !== void 0 ? _ref11 : '',
|
|
229
231
|
price: mainProductPrice,
|
|
230
232
|
total: selling,
|
|
231
233
|
origin_total: original,
|
|
@@ -260,7 +262,7 @@ export function buildCacheItemFromOrderLine(input) {
|
|
|
260
262
|
var base = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
|
|
261
263
|
id: resolvedId,
|
|
262
264
|
product_id: resolvedId,
|
|
263
|
-
extension_type: (
|
|
265
|
+
extension_type: (_ref12 = (_extension_type = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type) !== null && _extension_type !== void 0 ? _extension_type : booking === null || booking === void 0 || (_booking$product2 = booking.product) === null || _booking$product2 === void 0 ? void 0 : _booking$product2.extension_type) !== null && _ref12 !== void 0 ? _ref12 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type,
|
|
264
266
|
title: productTitle || (sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.title) || (booking === null || booking === void 0 || (_booking$product3 = booking.product) === null || _booking$product3 === void 0 ? void 0 : _booking$product3.title),
|
|
265
267
|
price: (_price = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _price !== void 0 ? _price : selling,
|
|
266
268
|
selling_price: product.selling_price,
|
|
@@ -274,7 +276,7 @@ export function buildCacheItemFromOrderLine(input) {
|
|
|
274
276
|
new: 0,
|
|
275
277
|
autoClose: false,
|
|
276
278
|
order_detail_id: (_product$order_detail = product.order_detail_id) !== null && _product$order_detail !== void 0 ? _product$order_detail : null,
|
|
277
|
-
booking_id: (
|
|
279
|
+
booking_id: (_ref13 = (_booking$id = booking.id) !== null && _booking$id !== void 0 ? _booking$id : booking.booking_id) !== null && _ref13 !== void 0 ? _ref13 : 0
|
|
278
280
|
});
|
|
279
281
|
if ((sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.capacity) !== undefined) {
|
|
280
282
|
base.capacity = sourceProduct.capacity;
|
|
@@ -32,7 +32,6 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
32
32
|
customerId?: number;
|
|
33
33
|
orderId?: number;
|
|
34
34
|
}): Promise<DiscountWithReason>;
|
|
35
|
-
batchSearchByProductIds(productIds: number[]): Promise<any>;
|
|
36
35
|
filterEnabledDiscountList(discountList: Discount[]): Discount[];
|
|
37
36
|
private checkUsageCreditsLimit;
|
|
38
37
|
filterEnabledDiscountListWithReason(discountList: Discount[]): DiscountWithReason;
|
|
@@ -244,35 +244,6 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
244
244
|
}
|
|
245
245
|
return batchSearch;
|
|
246
246
|
}()
|
|
247
|
-
}, {
|
|
248
|
-
key: "batchSearchByProductIds",
|
|
249
|
-
value: function () {
|
|
250
|
-
var _batchSearchByProductIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(productIds) {
|
|
251
|
-
var result;
|
|
252
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
253
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
254
|
-
case 0:
|
|
255
|
-
_context6.next = 2;
|
|
256
|
-
return this.request.get("/machinecode/batch-search", {
|
|
257
|
-
ids: productIds,
|
|
258
|
-
translate_flag: 1,
|
|
259
|
-
tags: ['good_pass', 'product_discount_card'],
|
|
260
|
-
relation_product: 1
|
|
261
|
-
});
|
|
262
|
-
case 2:
|
|
263
|
-
result = _context6.sent;
|
|
264
|
-
return _context6.abrupt("return", (result === null || result === void 0 ? void 0 : result.data) || []);
|
|
265
|
-
case 4:
|
|
266
|
-
case "end":
|
|
267
|
-
return _context6.stop();
|
|
268
|
-
}
|
|
269
|
-
}, _callee6, this);
|
|
270
|
-
}));
|
|
271
|
-
function batchSearchByProductIds(_x8) {
|
|
272
|
-
return _batchSearchByProductIds.apply(this, arguments);
|
|
273
|
-
}
|
|
274
|
-
return batchSearchByProductIds;
|
|
275
|
-
}()
|
|
276
247
|
}, {
|
|
277
248
|
key: "filterEnabledDiscountList",
|
|
278
249
|
value: function filterEnabledDiscountList(discountList) {
|
|
@@ -459,22 +430,22 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
459
430
|
}, {
|
|
460
431
|
key: "destroy",
|
|
461
432
|
value: function () {
|
|
462
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
463
|
-
return _regeneratorRuntime().wrap(function
|
|
464
|
-
while (1) switch (
|
|
433
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
434
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
435
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
465
436
|
case 0:
|
|
466
437
|
this.store.discountList = [];
|
|
467
438
|
this.core.effects.offByModuleDestroy(this.name);
|
|
468
|
-
|
|
439
|
+
_context6.next = 4;
|
|
469
440
|
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
470
441
|
case 4:
|
|
471
442
|
console.log('[Discount] 已销毁');
|
|
472
443
|
_get(_getPrototypeOf(DiscountModule.prototype), "destroy", this).call(this);
|
|
473
444
|
case 6:
|
|
474
445
|
case "end":
|
|
475
|
-
return
|
|
446
|
+
return _context6.stop();
|
|
476
447
|
}
|
|
477
|
-
},
|
|
448
|
+
}, _callee6, this);
|
|
478
449
|
}));
|
|
479
450
|
function destroy() {
|
|
480
451
|
return _destroy.apply(this, arguments);
|
|
@@ -484,18 +455,18 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
484
455
|
}, {
|
|
485
456
|
key: "clear",
|
|
486
457
|
value: function () {
|
|
487
|
-
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
488
|
-
return _regeneratorRuntime().wrap(function
|
|
489
|
-
while (1) switch (
|
|
458
|
+
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
459
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
460
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
490
461
|
case 0:
|
|
491
462
|
this.store.discountList = [];
|
|
492
463
|
this.store.originalDiscountList = [];
|
|
493
464
|
console.log('[Discount] clear');
|
|
494
465
|
case 3:
|
|
495
466
|
case "end":
|
|
496
|
-
return
|
|
467
|
+
return _context7.stop();
|
|
497
468
|
}
|
|
498
|
-
},
|
|
469
|
+
}, _callee7, this);
|
|
499
470
|
}));
|
|
500
471
|
function clear() {
|
|
501
472
|
return _clear.apply(this, arguments);
|
|
@@ -105,12 +105,12 @@ export var OpenDataModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
105
105
|
key: "fetchOpenData",
|
|
106
106
|
value: function () {
|
|
107
107
|
var _fetchOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
108
|
-
var _this$appPlugin, _this$appPlugin
|
|
108
|
+
var _this$appPlugin$getDa, _this$appPlugin;
|
|
109
109
|
var getData, shopId, tenantId, headers, response, data;
|
|
110
110
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
111
111
|
while (1) switch (_context2.prev = _context2.next) {
|
|
112
112
|
case 0:
|
|
113
|
-
getData = (_this$appPlugin =
|
|
113
|
+
getData = (_this$appPlugin$getDa = (_this$appPlugin = this.appPlugin).getData) === null || _this$appPlugin$getDa === void 0 ? void 0 : _this$appPlugin$getDa.call(_this$appPlugin);
|
|
114
114
|
shopId = getData === null || getData === void 0 ? void 0 : getData('shop_id');
|
|
115
115
|
if (shopId) {
|
|
116
116
|
_context2.next = 4;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CancelOrderParams, ChangeBookingStatusParams
|
|
3
|
+
import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CheckoutOrderParams, CancelOrderParams, ChangeBookingStatusParams } from './types';
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
|
-
import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from './types';
|
|
6
|
+
import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions } from './types';
|
|
7
7
|
import type { ICustomer } from '../AccountList/types';
|
|
8
8
|
import type { Discount } from '../Discount/types';
|
|
9
9
|
import { UnavailableReason } from '../Rules/types';
|
|
@@ -147,7 +147,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
147
147
|
isTempOrderPersistEnabled(): boolean;
|
|
148
148
|
/** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化;草稿保存请使用 IndexedDB saveDraft。 */
|
|
149
149
|
persistTempOrder(): void;
|
|
150
|
-
notifyTempOrderChanged(): void;
|
|
151
150
|
private createDefaultTempOrderInstance;
|
|
152
151
|
private createExternalSaleNumber;
|
|
153
152
|
private ensureExternalSaleNumber;
|
|
@@ -385,7 +384,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
385
384
|
* await order.addProductToOrder({ product_id: 1, num: 3 }, { start_time: '10:00' });
|
|
386
385
|
* // → tempOrder.products 新增 3 行,每行 num=1,bookings 3 条
|
|
387
386
|
*/
|
|
388
|
-
addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput): Promise<OrderProduct[]>;
|
|
387
|
+
addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<OrderProduct[]>;
|
|
389
388
|
/**
|
|
390
389
|
* 批量添加商品行,所有行追加完成后只触发一次促销、折扣、summary 重算与持久化。
|
|
391
390
|
*
|
|
@@ -423,8 +422,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
423
422
|
* @example
|
|
424
423
|
* await order.removeProductsFromOrder([identityA, identityB]);
|
|
425
424
|
*/
|
|
426
|
-
removeProductsFromOrder(identities: OrderProductIdentity[]): Promise<OrderProduct[]>;
|
|
427
|
-
removeProductFromOrder(identity: OrderProductIdentity): Promise<OrderProduct[]>;
|
|
425
|
+
removeProductsFromOrder(identities: OrderProductIdentity[], options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
|
|
426
|
+
removeProductFromOrder(identity: OrderProductIdentity, options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
|
|
428
427
|
/**
|
|
429
428
|
* 仅清空购物车行(products / bookings),不重置整单。
|
|
430
429
|
* 用于「仅清空商品」;客户、备注、支付等协议字段保持不变。
|
|
@@ -487,7 +486,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
487
486
|
generateIdempotencyToken(): string;
|
|
488
487
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
489
488
|
createOrder(params: CommitOrderParams['query']): {
|
|
490
|
-
type: "
|
|
489
|
+
type: "appointment_booking" | "virtual";
|
|
491
490
|
platform: string;
|
|
492
491
|
sales_channel: string;
|
|
493
492
|
order_sales_channel: string;
|
|
@@ -497,7 +496,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
497
496
|
is_deposit: number;
|
|
498
497
|
relation_products: any[];
|
|
499
498
|
relation_forms: any[];
|
|
500
|
-
business_code: string | undefined;
|
|
501
499
|
};
|
|
502
500
|
checkBeforeSubmitOrder(params: {
|
|
503
501
|
cartItems: CartItem[];
|
|
@@ -563,4 +561,4 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
563
561
|
getOrderInfo(order_id: number): Promise<any>;
|
|
564
562
|
getVouchers(): any[];
|
|
565
563
|
}
|
|
566
|
-
export type { UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';
|
|
564
|
+
export type { AddProductToOrderOptions, RemoveProductsFromOrderOptions, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';
|