@pisell/pisellos 0.0.513 → 0.0.516
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/Discount/types.d.ts +1 -1
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Rules/index.js +9 -9
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/VenueBooking/index.js +83 -27
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/Discount/types.d.ts +1 -1
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Rules/index.js +6 -6
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/VenueBooking/index.js +31 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ interface PackageSubItemUsageRules {
|
|
|
19
19
|
type: 'universal_discount' | 'package_exclusive' | 'single_item_promo' | 'custom_usage_rules';
|
|
20
20
|
rules: ("original_price" | "markup_price")[];
|
|
21
21
|
package_scope?: {
|
|
22
|
-
type: 'all_packages' | 'specific_packages';
|
|
22
|
+
type: 'all_packages' | 'specific_packages' | 'product_all' | 'products';
|
|
23
23
|
exclude_bundle_product_ids: number[];
|
|
24
24
|
include_bundle_product_ids: number[];
|
|
25
25
|
filter: 0 | 1;
|
|
@@ -82,7 +82,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
82
82
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
83
83
|
}): Promise<T>;
|
|
84
84
|
createOrder(params: CommitOrderParams['query']): {
|
|
85
|
-
type: "
|
|
85
|
+
type: "virtual" | "appointment_booking";
|
|
86
86
|
platform: string;
|
|
87
87
|
sales_channel: string;
|
|
88
88
|
order_sales_channel: string;
|
|
@@ -2368,12 +2368,12 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2368
2368
|
return true; // 单独购买时可用
|
|
2369
2369
|
}
|
|
2370
2370
|
if (isBundleItem) {
|
|
2371
|
-
var _flatItem$bundleItem9, _flatItem$bundleItem10, _flatItem$originProdu, _flatItem$
|
|
2371
|
+
var _flatItem$bundleItem9, _flatItem$bundleItem10, _flatItem$originProdu, _flatItem$parentProdu11;
|
|
2372
2372
|
// 套餐中购买时,判断是否为原价
|
|
2373
2373
|
var priceType = (_flatItem$bundleItem9 = flatItem.bundleItem) === null || _flatItem$bundleItem9 === void 0 ? void 0 : _flatItem$bundleItem9.price_type;
|
|
2374
2374
|
var priceTypeExt = (_flatItem$bundleItem10 = flatItem.bundleItem) === null || _flatItem$bundleItem10 === void 0 ? void 0 : _flatItem$bundleItem10.price_type_ext;
|
|
2375
2375
|
// 主商品id
|
|
2376
|
-
var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.
|
|
2376
|
+
var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 || (_flatItem$originProdu = _flatItem$originProdu._productOrigin) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.id) || (flatItem === null || flatItem === void 0 || (_flatItem$parentProdu11 = flatItem.parentProduct) === null || _flatItem$parentProdu11 === void 0 ? void 0 : _flatItem$parentProdu11.id) || 0;
|
|
2377
2377
|
// original_price 对应:
|
|
2378
2378
|
// 1. price_type: "markup" && price_type_ext: "product_price"
|
|
2379
2379
|
// markup_price 对应:
|
|
@@ -2392,8 +2392,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2392
2392
|
// 套餐适用范围校验
|
|
2393
2393
|
var isScopeValid = false;
|
|
2394
2394
|
|
|
2395
|
-
//
|
|
2396
|
-
if (scopeType === 'all_packages') {
|
|
2395
|
+
// 排除套餐判断, product_all值兼容旧数据
|
|
2396
|
+
if (scopeType === 'all_packages' || scopeType === 'product_all') {
|
|
2397
2397
|
// 所有套餐可用
|
|
2398
2398
|
if (!filter) {
|
|
2399
2399
|
isScopeValid = true;
|
|
@@ -2402,8 +2402,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2402
2402
|
}
|
|
2403
2403
|
}
|
|
2404
2404
|
|
|
2405
|
-
//
|
|
2406
|
-
if (scopeType === 'specific_packages') {
|
|
2405
|
+
// 包含套餐判断, products值兼容旧数据
|
|
2406
|
+
if (scopeType === 'specific_packages' || scopeType === 'products') {
|
|
2407
2407
|
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
2408
2408
|
}
|
|
2409
2409
|
|
|
@@ -2438,10 +2438,10 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2438
2438
|
return false; // 单独购买时不可用
|
|
2439
2439
|
}
|
|
2440
2440
|
if (isBundleItem) {
|
|
2441
|
-
var _flatItem$
|
|
2441
|
+
var _flatItem$bundleItem11, _flatItem$bundleItem12;
|
|
2442
2442
|
// 套餐中购买时,判断是否为原价
|
|
2443
|
-
var _priceType = (_flatItem$
|
|
2444
|
-
var _priceTypeExt = (_flatItem$
|
|
2443
|
+
var _priceType = (_flatItem$bundleItem11 = flatItem.bundleItem) === null || _flatItem$bundleItem11 === void 0 ? void 0 : _flatItem$bundleItem11.price_type;
|
|
2444
|
+
var _priceTypeExt = (_flatItem$bundleItem12 = flatItem.bundleItem) === null || _flatItem$bundleItem12 === void 0 ? void 0 : _flatItem$bundleItem12.price_type_ext;
|
|
2445
2445
|
|
|
2446
2446
|
// original_price 对应:
|
|
2447
2447
|
// 1. price_type: "markup" && price_type_ext: "product_price"
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 5 | 3 | 2 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -131,7 +131,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
131
131
|
* 获取当前的客户搜索条件
|
|
132
132
|
* @returns 当前搜索条件
|
|
133
133
|
*/
|
|
134
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
134
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
135
135
|
/**
|
|
136
136
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
137
137
|
* @returns 客户状态
|
|
@@ -2455,7 +2455,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2455
2455
|
key: "removeProductFromOrder",
|
|
2456
2456
|
value: function () {
|
|
2457
2457
|
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(identity) {
|
|
2458
|
-
var products;
|
|
2458
|
+
var _this$store$order$get3, _this$store$order6, _this$store$order$ens, _this$store$order7, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator15, _step15, _product$metadata6, _product$metadata7, product, beforeBookingCount, _this$store$order$per, _this$store$order8;
|
|
2459
2459
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2460
2460
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2461
2461
|
case 0:
|
|
@@ -2470,30 +2470,86 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
throw new Error('order 模块未初始化');
|
|
2472
2472
|
case 4:
|
|
2473
|
-
|
|
2473
|
+
tempOrder = ((_this$store$order$get3 = (_this$store$order6 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order6)) || ((_this$store$order$ens = (_this$store$order7 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order7));
|
|
2474
|
+
_context27.next = 7;
|
|
2474
2475
|
return this.store.order.removeProductFromOrder(identity);
|
|
2475
|
-
case
|
|
2476
|
+
case 7:
|
|
2476
2477
|
products = _context27.sent;
|
|
2477
|
-
|
|
2478
|
+
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
|
|
2479
|
+
_context27.next = 33;
|
|
2480
|
+
break;
|
|
2481
|
+
}
|
|
2482
|
+
venueProductUids = new Set();
|
|
2483
|
+
venueBookingUids = new Set();
|
|
2484
|
+
_iterator15 = _createForOfIteratorHelper(tempOrder.products || []);
|
|
2485
|
+
_context27.prev = 12;
|
|
2486
|
+
_iterator15.s();
|
|
2487
|
+
case 14:
|
|
2488
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
2489
|
+
_context27.next = 22;
|
|
2490
|
+
break;
|
|
2491
|
+
}
|
|
2492
|
+
product = _step15.value;
|
|
2493
|
+
if (product !== null && product !== void 0 && (_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) {
|
|
2494
|
+
_context27.next = 18;
|
|
2495
|
+
break;
|
|
2496
|
+
}
|
|
2497
|
+
return _context27.abrupt("continue", 20);
|
|
2498
|
+
case 18:
|
|
2499
|
+
if (product.identity_key) venueProductUids.add(String(product.identity_key));
|
|
2500
|
+
if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
|
|
2501
|
+
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
2502
|
+
}
|
|
2503
|
+
case 20:
|
|
2504
|
+
_context27.next = 14;
|
|
2505
|
+
break;
|
|
2506
|
+
case 22:
|
|
2507
|
+
_context27.next = 27;
|
|
2508
|
+
break;
|
|
2509
|
+
case 24:
|
|
2510
|
+
_context27.prev = 24;
|
|
2511
|
+
_context27.t0 = _context27["catch"](12);
|
|
2512
|
+
_iterator15.e(_context27.t0);
|
|
2513
|
+
case 27:
|
|
2514
|
+
_context27.prev = 27;
|
|
2515
|
+
_iterator15.f();
|
|
2516
|
+
return _context27.finish(27);
|
|
2517
|
+
case 30:
|
|
2518
|
+
beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
|
|
2519
|
+
tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
|
|
2520
|
+
var _booking$metadata, _booking$metadata2;
|
|
2521
|
+
if (!(booking !== null && booking !== void 0 && (_booking$metadata = booking.metadata) !== null && _booking$metadata !== void 0 && _booking$metadata.venue_booking)) return true;
|
|
2522
|
+
if (booking.product_uid) {
|
|
2523
|
+
return venueProductUids.has(String(booking.product_uid));
|
|
2524
|
+
}
|
|
2525
|
+
var bookingUid = (_booking$metadata2 = booking.metadata) === null || _booking$metadata2 === void 0 ? void 0 : _booking$metadata2.unique_identification_number;
|
|
2526
|
+
if (bookingUid) return venueBookingUids.has(String(bookingUid));
|
|
2527
|
+
return true;
|
|
2528
|
+
});
|
|
2529
|
+
if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
|
|
2530
|
+
(_this$store$order$per = (_this$store$order8 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order8);
|
|
2531
|
+
}
|
|
2532
|
+
case 33:
|
|
2533
|
+
_context27.next = 35;
|
|
2478
2534
|
return this.refreshItemRuleQuantityLimits();
|
|
2479
|
-
case
|
|
2480
|
-
_context27.next =
|
|
2535
|
+
case 35:
|
|
2536
|
+
_context27.next = 37;
|
|
2481
2537
|
return this.refreshCartValidationPassed();
|
|
2482
|
-
case
|
|
2538
|
+
case 37:
|
|
2483
2539
|
this.logMethodSuccess('removeProductFromOrder', {
|
|
2484
2540
|
productCount: products.length
|
|
2485
2541
|
});
|
|
2486
2542
|
return _context27.abrupt("return", products);
|
|
2487
|
-
case
|
|
2488
|
-
_context27.prev =
|
|
2489
|
-
_context27.
|
|
2490
|
-
this.logMethodError('removeProductFromOrder', _context27.
|
|
2491
|
-
throw _context27.
|
|
2492
|
-
case
|
|
2543
|
+
case 41:
|
|
2544
|
+
_context27.prev = 41;
|
|
2545
|
+
_context27.t1 = _context27["catch"](1);
|
|
2546
|
+
this.logMethodError('removeProductFromOrder', _context27.t1);
|
|
2547
|
+
throw _context27.t1;
|
|
2548
|
+
case 45:
|
|
2493
2549
|
case "end":
|
|
2494
2550
|
return _context27.stop();
|
|
2495
2551
|
}
|
|
2496
|
-
}, _callee27, this, [[1,
|
|
2552
|
+
}, _callee27, this, [[1, 41], [12, 24, 27, 30]]);
|
|
2497
2553
|
}));
|
|
2498
2554
|
function removeProductFromOrder(_x18) {
|
|
2499
2555
|
return _removeProductFromOrder.apply(this, arguments);
|
|
@@ -2697,17 +2753,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2697
2753
|
if (visited.has(value)) return;
|
|
2698
2754
|
visited.add(value);
|
|
2699
2755
|
if (Array.isArray(value)) {
|
|
2700
|
-
var
|
|
2701
|
-
|
|
2756
|
+
var _iterator16 = _createForOfIteratorHelper(value),
|
|
2757
|
+
_step16;
|
|
2702
2758
|
try {
|
|
2703
|
-
for (
|
|
2704
|
-
var item =
|
|
2759
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
2760
|
+
var item = _step16.value;
|
|
2705
2761
|
collectFromValue(item);
|
|
2706
2762
|
}
|
|
2707
2763
|
} catch (err) {
|
|
2708
|
-
|
|
2764
|
+
_iterator16.e(err);
|
|
2709
2765
|
} finally {
|
|
2710
|
-
|
|
2766
|
+
_iterator16.f();
|
|
2711
2767
|
}
|
|
2712
2768
|
return;
|
|
2713
2769
|
}
|
|
@@ -2862,7 +2918,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2862
2918
|
key: "applyPrefillByItemRule",
|
|
2863
2919
|
value: function () {
|
|
2864
2920
|
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
2865
|
-
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges,
|
|
2921
|
+
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator17, _step17, _prefillItem$product_, _targetProduct$_origi, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, sellingPrice, targetProduct, existedQuantity, delta, nextProduct;
|
|
2866
2922
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
2867
2923
|
while (1) switch (_context36.prev = _context36.next) {
|
|
2868
2924
|
case 0:
|
|
@@ -2907,15 +2963,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2907
2963
|
productSourceMap = _context36.sent;
|
|
2908
2964
|
tempOrder = this.ensureTempOrder();
|
|
2909
2965
|
hasChanges = false;
|
|
2910
|
-
|
|
2966
|
+
_iterator17 = _createForOfIteratorHelper(prefillItems);
|
|
2911
2967
|
_context36.prev = 20;
|
|
2912
|
-
|
|
2968
|
+
_iterator17.s();
|
|
2913
2969
|
case 22:
|
|
2914
|
-
if ((
|
|
2970
|
+
if ((_step17 = _iterator17.n()).done) {
|
|
2915
2971
|
_context36.next = 45;
|
|
2916
2972
|
break;
|
|
2917
2973
|
}
|
|
2918
|
-
prefillItem =
|
|
2974
|
+
prefillItem = _step17.value;
|
|
2919
2975
|
productId = Number(prefillItem.product_id);
|
|
2920
2976
|
productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
|
|
2921
2977
|
targetQuantity = toNonNegativeInt(prefillItem.quantity);
|
|
@@ -2984,10 +3040,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2984
3040
|
case 47:
|
|
2985
3041
|
_context36.prev = 47;
|
|
2986
3042
|
_context36.t0 = _context36["catch"](20);
|
|
2987
|
-
|
|
3043
|
+
_iterator17.e(_context36.t0);
|
|
2988
3044
|
case 50:
|
|
2989
3045
|
_context36.prev = 50;
|
|
2990
|
-
|
|
3046
|
+
_iterator17.f();
|
|
2991
3047
|
return _context36.finish(50);
|
|
2992
3048
|
case 53:
|
|
2993
3049
|
if (!hasChanges) {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
+
var promotion_exports = {};
|
|
31
|
+
__export(promotion_exports, {
|
|
32
|
+
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
34
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
35
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
36
|
+
default: () => import_adapter2.default
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
39
|
+
var import_evaluator = require("./evaluator");
|
|
40
|
+
var import_adapter = require("./adapter");
|
|
41
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
42
|
+
var import_examples = require("./examples");
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
46
|
+
PromotionAdapter,
|
|
47
|
+
PromotionEvaluator,
|
|
48
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
49
|
+
});
|
|
@@ -19,7 +19,7 @@ interface PackageSubItemUsageRules {
|
|
|
19
19
|
type: 'universal_discount' | 'package_exclusive' | 'single_item_promo' | 'custom_usage_rules';
|
|
20
20
|
rules: ("original_price" | "markup_price")[];
|
|
21
21
|
package_scope?: {
|
|
22
|
-
type: 'all_packages' | 'specific_packages';
|
|
22
|
+
type: 'all_packages' | 'specific_packages' | 'product_all' | 'products';
|
|
23
23
|
exclude_bundle_product_ids: number[];
|
|
24
24
|
include_bundle_product_ids: number[];
|
|
25
25
|
filter: 0 | 1;
|
|
@@ -82,7 +82,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
82
82
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
83
83
|
}): Promise<T>;
|
|
84
84
|
createOrder(params: CommitOrderParams['query']): {
|
|
85
|
-
type: "
|
|
85
|
+
type: "virtual" | "appointment_booking";
|
|
86
86
|
platform: string;
|
|
87
87
|
sales_channel: string;
|
|
88
88
|
order_sales_channel: string;
|
|
@@ -1892,7 +1892,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1892
1892
|
* @returns 是否可用
|
|
1893
1893
|
*/
|
|
1894
1894
|
checkPackageSubItemUsageRules(discount, flatItem) {
|
|
1895
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1895
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1896
1896
|
const limitedData = discount.limited_relation_product_data;
|
|
1897
1897
|
const usageRules = limitedData == null ? void 0 : limitedData.package_sub_item_usage_rules;
|
|
1898
1898
|
const rules = ["original_price", ...(usageRules == null ? void 0 : usageRules.rules) || []];
|
|
@@ -1914,7 +1914,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1914
1914
|
if (isBundleItem) {
|
|
1915
1915
|
const priceType = (_a = flatItem.bundleItem) == null ? void 0 : _a.price_type;
|
|
1916
1916
|
const priceTypeExt = (_b = flatItem.bundleItem) == null ? void 0 : _b.price_type_ext;
|
|
1917
|
-
const mainProductId = ((_c = flatItem == null ? void 0 : flatItem.originProduct) == null ? void 0 : _c.
|
|
1917
|
+
const mainProductId = ((_d = (_c = flatItem == null ? void 0 : flatItem.originProduct) == null ? void 0 : _c._productOrigin) == null ? void 0 : _d.id) || ((_e = flatItem == null ? void 0 : flatItem.parentProduct) == null ? void 0 : _e.id) || 0;
|
|
1918
1918
|
const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
|
|
1919
1919
|
const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
|
|
1920
1920
|
if (rules.length > 0) {
|
|
@@ -1922,14 +1922,14 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1922
1922
|
const _isMarkupPrice = isMarkupPrice && rules.includes("markup_price");
|
|
1923
1923
|
const isPriceValid = _isOriginalPrice || _isMarkupPrice;
|
|
1924
1924
|
let isScopeValid = false;
|
|
1925
|
-
if (scopeType === "all_packages") {
|
|
1925
|
+
if (scopeType === "all_packages" || scopeType === "product_all") {
|
|
1926
1926
|
if (!filter) {
|
|
1927
1927
|
isScopeValid = true;
|
|
1928
1928
|
} else {
|
|
1929
1929
|
isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
|
-
if (scopeType === "specific_packages") {
|
|
1932
|
+
if (scopeType === "specific_packages" || scopeType === "products") {
|
|
1933
1933
|
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
1934
1934
|
}
|
|
1935
1935
|
if (isPriceValid && isScopeValid) {
|
|
@@ -1946,8 +1946,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1946
1946
|
return false;
|
|
1947
1947
|
}
|
|
1948
1948
|
if (isBundleItem) {
|
|
1949
|
-
const priceType = (
|
|
1950
|
-
const priceTypeExt = (
|
|
1949
|
+
const priceType = (_f = flatItem.bundleItem) == null ? void 0 : _f.price_type;
|
|
1950
|
+
const priceTypeExt = (_g = flatItem.bundleItem) == null ? void 0 : _g.price_type_ext;
|
|
1951
1951
|
const isOriginalPrice = priceType === "markup" && priceTypeExt === "product_price";
|
|
1952
1952
|
const isMarkupPrice = priceType === "markup" && (priceTypeExt === "" || !priceTypeExt);
|
|
1953
1953
|
if (rules.length > 0) {
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 5 | 3 | 2 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -131,7 +131,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
131
131
|
* 获取当前的客户搜索条件
|
|
132
132
|
* @returns 当前搜索条件
|
|
133
133
|
*/
|
|
134
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
134
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
135
135
|
/**
|
|
136
136
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
137
137
|
* @returns 客户状态
|
|
@@ -1455,6 +1455,7 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
}
|
|
1457
1457
|
async removeProductFromOrder(identity) {
|
|
1458
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
1458
1459
|
this.logMethodStart("removeProductFromOrder", {
|
|
1459
1460
|
product_id: identity.product_id,
|
|
1460
1461
|
product_variant_id: identity.product_variant_id
|
|
@@ -1462,7 +1463,37 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1462
1463
|
try {
|
|
1463
1464
|
if (!this.store.order)
|
|
1464
1465
|
throw new Error("order 模块未初始化");
|
|
1466
|
+
const tempOrder = ((_b = (_a = this.store.order).getTempOrder) == null ? void 0 : _b.call(_a)) || ((_d = (_c = this.store.order).ensureTempOrder) == null ? void 0 : _d.call(_c));
|
|
1465
1467
|
const products = await this.store.order.removeProductFromOrder(identity);
|
|
1468
|
+
if ((_e = tempOrder == null ? void 0 : tempOrder.bookings) == null ? void 0 : _e.length) {
|
|
1469
|
+
const venueProductUids = /* @__PURE__ */ new Set();
|
|
1470
|
+
const venueBookingUids = /* @__PURE__ */ new Set();
|
|
1471
|
+
for (const product of tempOrder.products || []) {
|
|
1472
|
+
if (!((_f = product == null ? void 0 : product.metadata) == null ? void 0 : _f.venue_booking))
|
|
1473
|
+
continue;
|
|
1474
|
+
if (product.identity_key)
|
|
1475
|
+
venueProductUids.add(String(product.identity_key));
|
|
1476
|
+
if ((_g = product.metadata) == null ? void 0 : _g.booking_uid) {
|
|
1477
|
+
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
const beforeBookingCount = ((_h = tempOrder.bookings) == null ? void 0 : _h.length) || 0;
|
|
1481
|
+
tempOrder.bookings = (tempOrder.bookings || []).filter((booking) => {
|
|
1482
|
+
var _a2, _b2;
|
|
1483
|
+
if (!((_a2 = booking == null ? void 0 : booking.metadata) == null ? void 0 : _a2.venue_booking))
|
|
1484
|
+
return true;
|
|
1485
|
+
if (booking.product_uid) {
|
|
1486
|
+
return venueProductUids.has(String(booking.product_uid));
|
|
1487
|
+
}
|
|
1488
|
+
const bookingUid = (_b2 = booking.metadata) == null ? void 0 : _b2.unique_identification_number;
|
|
1489
|
+
if (bookingUid)
|
|
1490
|
+
return venueBookingUids.has(String(bookingUid));
|
|
1491
|
+
return true;
|
|
1492
|
+
});
|
|
1493
|
+
if ((((_i = tempOrder.bookings) == null ? void 0 : _i.length) || 0) !== beforeBookingCount) {
|
|
1494
|
+
(_k = (_j = this.store.order).persistTempOrder) == null ? void 0 : _k.call(_j);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1466
1497
|
await this.refreshItemRuleQuantityLimits();
|
|
1467
1498
|
await this.refreshCartValidationPassed();
|
|
1468
1499
|
this.logMethodSuccess("removeProductFromOrder", {
|