@pisell/pisellos 2.3.39 → 2.3.41
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/core/index.d.ts +2 -0
- package/dist/core/index.js +7 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
- package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/dist/model/strategy/adapter/promotion/examples.js +99 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/dist/model/strategy/adapter/promotion/type.js +45 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -3
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -3
- 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.d.ts +2 -0
- package/dist/modules/OpenData/index.js +10 -2
- package/dist/modules/Order/index.d.ts +29 -12
- package/dist/modules/Order/index.js +750 -509
- package/dist/modules/Order/payment-utils.d.ts +26 -0
- package/dist/modules/Order/payment-utils.js +225 -0
- package/dist/modules/Order/types.d.ts +33 -10
- package/dist/modules/Order/utils/orderCollectionIdentity.js +7 -2
- package/dist/modules/Order/utils.d.ts +0 -10
- package/dist/modules/Order/utils.js +13 -41
- package/dist/modules/Payment/index.d.ts +2 -0
- package/dist/modules/Payment/index.js +79 -50
- package/dist/modules/Payment/types.d.ts +99 -28
- package/dist/modules/Payment/types.js +20 -3
- package/dist/modules/Payment/walletpass.d.ts +25 -1
- package/dist/modules/Payment/walletpass.js +707 -157
- 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.d.ts +1 -0
- package/dist/modules/Rules/index.js +89 -96
- package/dist/modules/SalesSummary/index.js +13 -12
- 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 +16 -14
- package/dist/server/index.js +1925 -1143
- package/dist/server/modules/order/index.d.ts +54 -4
- package/dist/server/modules/order/index.js +1600 -700
- package/dist/server/modules/order/types.d.ts +11 -3
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +109 -20
- package/dist/solution/BaseSales/index.js +1800 -480
- package/dist/solution/BaseSales/types.d.ts +52 -0
- package/dist/solution/BaseSales/types.js +2 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/dist/solution/BaseSales/utils/cartPromotion.js +90 -31
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
- package/dist/solution/BookingByStep/index.d.ts +2 -17
- 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 +7 -3
- package/dist/solution/BookingTicket/index.js +132 -49
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +172 -82
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.js +45 -0
- package/dist/solution/Sales/index.d.ts +1 -0
- package/dist/solution/Sales/index.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +14 -26
- package/dist/solution/ScanOrder/index.js +756 -1148
- 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 +860 -1176
- 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 +1 -1
- package/dist/utils/payment-number.d.ts +9 -0
- package/dist/utils/payment-number.js +69 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/lib/model/strategy/adapter/promotion/examples.js +91 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/lib/model/strategy/adapter/promotion/type.js +2 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -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.d.ts +2 -0
- package/lib/modules/OpenData/index.js +6 -1
- package/lib/modules/Order/index.d.ts +29 -12
- package/lib/modules/Order/index.js +196 -86
- package/lib/modules/Order/payment-utils.d.ts +26 -0
- package/lib/modules/Order/payment-utils.js +224 -0
- package/lib/modules/Order/types.d.ts +33 -10
- package/lib/modules/Order/utils/orderCollectionIdentity.js +3 -0
- package/lib/modules/Order/utils.d.ts +0 -10
- package/lib/modules/Order/utils.js +16 -40
- package/lib/modules/Payment/index.d.ts +2 -0
- package/lib/modules/Payment/index.js +34 -13
- package/lib/modules/Payment/types.d.ts +99 -28
- package/lib/modules/Payment/types.js +4 -3
- package/lib/modules/Payment/walletpass.d.ts +25 -1
- package/lib/modules/Payment/walletpass.js +470 -21
- 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.d.ts +1 -0
- package/lib/modules/Rules/index.js +47 -40
- package/lib/modules/SalesSummary/index.js +7 -6
- 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 +16 -14
- package/lib/server/index.js +675 -83
- package/lib/server/modules/order/index.d.ts +54 -4
- package/lib/server/modules/order/index.js +679 -66
- package/lib/server/modules/order/types.d.ts +11 -3
- package/lib/solution/BaseSales/index.d.ts +109 -20
- package/lib/solution/BaseSales/index.js +883 -70
- package/lib/solution/BaseSales/types.d.ts +52 -0
- package/lib/solution/BaseSales/types.js +2 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.js +63 -12
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -17
- 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 +7 -3
- package/lib/solution/BookingTicket/index.js +62 -9
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +36 -4
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +63 -0
- package/lib/solution/Sales/index.d.ts +1 -0
- package/lib/solution/Sales/index.js +5 -3
- package/lib/solution/ScanOrder/index.d.ts +14 -26
- package/lib/solution/ScanOrder/index.js +190 -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 +123 -328
- 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 +1 -1
- package/lib/utils/payment-number.d.ts +9 -0
- package/lib/utils/payment-number.js +64 -0
- 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 -1871
- 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 -1076
- package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/lib/solution/UnifiedBookingSales/types.js +0 -33
|
@@ -35,7 +35,6 @@ export interface ScanOrderOrderProductIdentity {
|
|
|
35
35
|
/** 参与合并/匹配;与 remove 通配语义见 isSkuOnlyDeleteIdentity */
|
|
36
36
|
product_sku?: ScanOrderProductSku;
|
|
37
37
|
product_bundle?: any[];
|
|
38
|
-
shop_id?: number | string;
|
|
39
38
|
}
|
|
40
39
|
export interface ScanOrderProductSku {
|
|
41
40
|
option: any[];
|
|
@@ -208,7 +207,7 @@ export interface ScanOrderSubmitPayload extends Omit<ScanOrderTempOrder, 'platfo
|
|
|
208
207
|
}>;
|
|
209
208
|
products: ScanOrderSubmitProduct[];
|
|
210
209
|
}
|
|
211
|
-
export type ScanOrderAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | '
|
|
210
|
+
export type ScanOrderAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | 'additional_order_with_code' | 'additional_order';
|
|
212
211
|
export interface ScanOrderTableFormRecord {
|
|
213
212
|
policy?: string | null;
|
|
214
213
|
partyroom_booking?: string | null;
|
|
@@ -251,10 +250,6 @@ export interface ScanOrderResourceOccupyDetail {
|
|
|
251
250
|
form_id?: number | string | null;
|
|
252
251
|
order_id?: number | string | null;
|
|
253
252
|
last_order_id?: number | string | null;
|
|
254
|
-
order_list?: Array<{
|
|
255
|
-
id?: number | string | null;
|
|
256
|
-
[key: string]: any;
|
|
257
|
-
}> | null;
|
|
258
253
|
resource_capacity?: ScanOrderResourceCapacity[] | null;
|
|
259
254
|
form_record?: ScanOrderTableFormRecord | null;
|
|
260
255
|
[key: string]: any;
|
|
@@ -268,21 +263,6 @@ export interface ScanOrderResourceOccupyDetailApiResponse {
|
|
|
268
263
|
} | null;
|
|
269
264
|
}
|
|
270
265
|
export type ScanOrderResourceSelectType = 'single' | 'multiple' | 'capacity';
|
|
271
|
-
export interface ScanOrderReservationResourceSelectInfo {
|
|
272
|
-
resourceSelectType?: ScanOrderResourceSelectType;
|
|
273
|
-
isSingleReservation: boolean;
|
|
274
|
-
isMultipleReservation: boolean;
|
|
275
|
-
isCapacityReservation: boolean;
|
|
276
|
-
}
|
|
277
|
-
export interface ScanOrderAllowAddItemsInfo {
|
|
278
|
-
enabled: boolean;
|
|
279
|
-
}
|
|
280
|
-
export type ScanOrderSyncAdditionalOrderReason = 'missing_resource_id' | 'no_order' | 'multiple_orders' | 'add_items_disabled' | 'invalid_order_id';
|
|
281
|
-
export interface ScanOrderSyncAdditionalOrderResult {
|
|
282
|
-
matched: boolean;
|
|
283
|
-
order_id?: string;
|
|
284
|
-
reason?: ScanOrderSyncAdditionalOrderReason;
|
|
285
|
-
}
|
|
286
266
|
export interface ScanOrderResourceState extends ScanOrderAvailabilityInfo {
|
|
287
267
|
relationId?: string;
|
|
288
268
|
tableFormId?: string;
|
|
@@ -2,7 +2,6 @@ import { ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderResource
|
|
|
2
2
|
import type { CartItemSummary, ItemRuleBusinessData, PaxInfo, QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
3
3
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
4
4
|
import type { ProductData } from '../../modules/Product/types';
|
|
5
|
-
import type { OrderSubmitProduct } from '../../modules/Order/types';
|
|
6
5
|
/**
|
|
7
6
|
* 构建金额全为 0 的空 summary。
|
|
8
7
|
* 作为尚未计算金额时的兜底默认值,避免下游因 undefined 报错。
|
|
@@ -43,8 +42,6 @@ export declare function toNonNegativeNumber(value: unknown): number;
|
|
|
43
42
|
export declare function toNonNegativeInt(value: unknown): number;
|
|
44
43
|
export declare function toPriceString(value: unknown, fallback?: string): string;
|
|
45
44
|
export declare function buildProductKey(productId: number, productVariantId: number): string;
|
|
46
|
-
/** 加餐接口只提交本次新增商品,过滤掉首单预约占位规则行。 */
|
|
47
|
-
export declare function filterProductsForScanOrderMore<T extends OrderSubmitProduct>(products?: T[]): T[];
|
|
48
45
|
export declare function getTopLevelProductId(product: Record<string, any>): number | null;
|
|
49
46
|
export declare function getTopLevelVariantId(product: Record<string, any>): number | null;
|
|
50
47
|
export declare function buildQuantityLimitIndex(limits: QuantityLimitResult[]): {
|
|
@@ -137,11 +134,6 @@ export declare function normalizeOrderProduct(product: Partial<ScanOrderOrderPro
|
|
|
137
134
|
* 从 reservation.enabled_reservation_rules 中收集 type=link 的商品 id。
|
|
138
135
|
*/
|
|
139
136
|
export declare function collectLinkProductIdsFromReservationRules(rules: unknown): number[];
|
|
140
|
-
/**
|
|
141
|
-
* 找到第一个归属指定桌台的预约规则商品。
|
|
142
|
-
* 归属判断基于商品资源中的 default_resource / optional_resource。
|
|
143
|
-
*/
|
|
144
|
-
export declare function findReservationRuleProductByResourceId(products: ProductData[], resourceId: string | number | null | undefined): ProductData | undefined;
|
|
145
137
|
/**
|
|
146
138
|
* 返回列表中第一个带有效 duration.value(分钟)的商品时长。
|
|
147
139
|
*/
|
|
@@ -39,8 +39,6 @@ __export(utils_exports, {
|
|
|
39
39
|
computeResourceIsFull: () => computeResourceIsFull,
|
|
40
40
|
createEmptySummary: () => createEmptySummary,
|
|
41
41
|
extractStrategyModelIdsFromTableConfig: () => extractStrategyModelIdsFromTableConfig,
|
|
42
|
-
filterProductsForScanOrderMore: () => filterProductsForScanOrderMore,
|
|
43
|
-
findReservationRuleProductByResourceId: () => findReservationRuleProductByResourceId,
|
|
44
42
|
getProductIdentityIndex: () => getProductIdentityIndex,
|
|
45
43
|
getSafeProductNum: () => getSafeProductNum,
|
|
46
44
|
getTopLevelProductId: () => getTopLevelProductId,
|
|
@@ -167,12 +165,6 @@ function toPriceString(value, fallback = "0.00") {
|
|
|
167
165
|
function buildProductKey(productId, productVariantId) {
|
|
168
166
|
return `${productId}_${productVariantId}`;
|
|
169
167
|
}
|
|
170
|
-
function filterProductsForScanOrderMore(products = []) {
|
|
171
|
-
return products.filter((product) => {
|
|
172
|
-
var _a;
|
|
173
|
-
return ((_a = product.metadata) == null ? void 0 : _a.is_rule) !== true;
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
168
|
function getTopLevelProductId(product) {
|
|
177
169
|
const rawProductId = product.product_id ?? product.id;
|
|
178
170
|
const productId = Number(rawProductId);
|
|
@@ -588,27 +580,6 @@ function collectLinkProductIdsFromReservationRules(rules) {
|
|
|
588
580
|
}
|
|
589
581
|
return [...new Set(ids)];
|
|
590
582
|
}
|
|
591
|
-
function findReservationRuleProductByResourceId(products, resourceId) {
|
|
592
|
-
var _a;
|
|
593
|
-
const numericResourceId = Number(resourceId);
|
|
594
|
-
if (!Number.isFinite(numericResourceId) || numericResourceId <= 0)
|
|
595
|
-
return void 0;
|
|
596
|
-
for (const product of products) {
|
|
597
|
-
const resources = (_a = product == null ? void 0 : product.product_resource) == null ? void 0 : _a.resources;
|
|
598
|
-
if (!Array.isArray(resources))
|
|
599
|
-
continue;
|
|
600
|
-
const hasMatchedResource = resources.some((resource) => {
|
|
601
|
-
const defaultResources = Array.isArray(resource == null ? void 0 : resource.default_resource) ? resource.default_resource : [];
|
|
602
|
-
const optionalResources = Array.isArray(resource == null ? void 0 : resource.optional_resource) ? resource.optional_resource : [];
|
|
603
|
-
return [...defaultResources, ...optionalResources].some(
|
|
604
|
-
(id) => Number(id) === numericResourceId
|
|
605
|
-
);
|
|
606
|
-
});
|
|
607
|
-
if (hasMatchedResource)
|
|
608
|
-
return product;
|
|
609
|
-
}
|
|
610
|
-
return void 0;
|
|
611
|
-
}
|
|
612
583
|
function pickFirstDurationMinutesFromProducts(products) {
|
|
613
584
|
var _a;
|
|
614
585
|
for (const product of products) {
|
|
@@ -712,8 +683,6 @@ function pickFirstCustomCapacityDimensionId(products) {
|
|
|
712
683
|
computeResourceIsFull,
|
|
713
684
|
createEmptySummary,
|
|
714
685
|
extractStrategyModelIdsFromTableConfig,
|
|
715
|
-
filterProductsForScanOrderMore,
|
|
716
|
-
findReservationRuleProductByResourceId,
|
|
717
686
|
getProductIdentityIndex,
|
|
718
687
|
getSafeProductNum,
|
|
719
688
|
getTopLevelProductId,
|
|
@@ -40,7 +40,6 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
40
40
|
discountList: Discount[];
|
|
41
41
|
};
|
|
42
42
|
setProductList(productList: Record<string, any>[]): void;
|
|
43
|
-
batchSearchByProductIds(productIds: number[]): Promise<Discount[]>;
|
|
44
43
|
scanCode(code: string, customerId?: number): Promise<{
|
|
45
44
|
isAvailable: boolean;
|
|
46
45
|
productList: Record<string, any>[];
|
|
@@ -270,20 +270,6 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
270
270
|
setProductList(productList) {
|
|
271
271
|
this.store.productList = productList;
|
|
272
272
|
}
|
|
273
|
-
async batchSearchByProductIds(productIds) {
|
|
274
|
-
var _a;
|
|
275
|
-
let resultDiscountList = await ((_a = this.store.discount) == null ? void 0 : _a.batchSearchByProductIds(productIds)) || [];
|
|
276
|
-
resultDiscountList = resultDiscountList.map((item) => {
|
|
277
|
-
return {
|
|
278
|
-
...item,
|
|
279
|
-
discount_rule_uncheck_flag: true
|
|
280
|
-
};
|
|
281
|
-
});
|
|
282
|
-
const currentDiscountList = this.getDiscountList() || [];
|
|
283
|
-
const newDiscountList = [...currentDiscountList, ...resultDiscountList];
|
|
284
|
-
this.setDiscountList(newDiscountList);
|
|
285
|
-
return newDiscountList;
|
|
286
|
-
}
|
|
287
273
|
// 扫码输入code
|
|
288
274
|
async scanCode(code, customerId) {
|
|
289
275
|
var _a, _b, _c;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
import { VenueBookingAddLogParams, VenueBookingSlotConfig,
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
|
|
4
4
|
import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
|
|
5
5
|
import type { UpdateOrderProductParams } from '../../modules/Order/types';
|
|
6
6
|
import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
|
|
7
|
-
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
8
7
|
import type { ProductData } from '../../modules/Product/types';
|
|
9
8
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
10
9
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
11
|
-
import type { IAppendFormRecordParams, IRefreshAllFormRecordsParams } from '../../modules/Holder/types';
|
|
12
10
|
export * from './types';
|
|
13
11
|
interface VenueBookingItemRuleRuntimeConfig {
|
|
14
12
|
strategyConfigs?: StrategyConfig[];
|
|
@@ -18,16 +16,16 @@ interface VenueBookingItemRuleRuntimeConfig {
|
|
|
18
16
|
submissionIndex?: number;
|
|
19
17
|
custom?: Record<string, any>;
|
|
20
18
|
}
|
|
21
|
-
export declare class VenueBookingImpl extends
|
|
19
|
+
export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
22
20
|
protected defaultName: string;
|
|
23
21
|
protected defaultVersion: string;
|
|
24
22
|
isSolution: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
window
|
|
30
|
-
request
|
|
23
|
+
private initializeOptions;
|
|
24
|
+
private store;
|
|
25
|
+
private otherParams;
|
|
26
|
+
private cacheId;
|
|
27
|
+
private window;
|
|
28
|
+
private request;
|
|
31
29
|
private baseSlotConfig;
|
|
32
30
|
private itemRuleEvaluator;
|
|
33
31
|
private itemRuleConfigs;
|
|
@@ -52,19 +50,8 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
52
50
|
private logMethodError;
|
|
53
51
|
addLog(params: VenueBookingAddLogParams): Promise<void>;
|
|
54
52
|
constructor(name?: string, version?: string);
|
|
55
|
-
protected getRegisteredModuleNames(): readonly string[];
|
|
56
|
-
protected createSubModule(moduleName: string): Module | null;
|
|
57
|
-
private attachProductOriginToTempOrder;
|
|
58
|
-
private readProductOriginFromTempOrder;
|
|
59
|
-
private normalizeVenueProductTitle;
|
|
60
53
|
private normalizeCustomerId;
|
|
61
54
|
private resolveCustomerIdFromLoginPayload;
|
|
62
|
-
private resolveHolderCustomerId;
|
|
63
|
-
/**
|
|
64
|
-
* 按商品 holder_config 预加载表单数据到 holderMap。
|
|
65
|
-
* appointment_booking 在加购时触发;venueBooking 在商品加载后预加载,避免 getHolderFormMap 为空。
|
|
66
|
-
*/
|
|
67
|
-
private preloadHolderForms;
|
|
68
55
|
private clearLoginEffectListeners;
|
|
69
56
|
private registerLoginEffect;
|
|
70
57
|
private registerCustomerLoginListeners;
|
|
@@ -157,10 +144,8 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
157
144
|
getScheduleListByIds(ids: number[]): import("../../server").ScheduleItem[];
|
|
158
145
|
getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
|
|
159
146
|
updateTempOrderNote(note: string): string;
|
|
160
|
-
updateTempOrderNote(note: string, sync: true): Promise<string>;
|
|
161
|
-
updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
|
|
162
147
|
updateTempOrderContactsInfo(contactsInfo: any[]): Record<string, any> | null;
|
|
163
|
-
private
|
|
148
|
+
private ensureTempOrder;
|
|
164
149
|
onCustomerLogin(params: {
|
|
165
150
|
customerId: number;
|
|
166
151
|
}): Promise<void>;
|
|
@@ -179,7 +164,7 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
179
164
|
setDiscountSelected(params: {
|
|
180
165
|
discountId: number;
|
|
181
166
|
isSelected: boolean;
|
|
182
|
-
}): Promise<
|
|
167
|
+
}): Promise<import("../../modules/Discount").Discount[]>;
|
|
183
168
|
addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
184
169
|
getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
|
|
185
170
|
getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
|
|
@@ -209,19 +194,6 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
209
194
|
setUIState(key: string, value: any): void;
|
|
210
195
|
getUIState<T = any>(key: string): T | undefined;
|
|
211
196
|
deleteUIState(key: string): void;
|
|
212
|
-
setBookingHolder(bookingUid: string, holder: any): void;
|
|
213
|
-
/**
|
|
214
|
-
* 获取 holder 表单 map
|
|
215
|
-
*/
|
|
216
|
-
getHolderFormMap(): import("../../modules/Holder").HolderFormMap;
|
|
217
|
-
/**
|
|
218
|
-
* UI 层触发:按当前 holderMap 批量刷新所有表单的 records
|
|
219
|
-
*/
|
|
220
|
-
refreshAllHolderFormRecords(params?: Pick<IRefreshAllFormRecordsParams, 'customer_id' | 'useCache' | 'recordsUrl' | 'num' | 'skip'>): Promise<import("../../modules/Holder").HolderFormMap>;
|
|
221
|
-
/**
|
|
222
|
-
* 添加表单记录
|
|
223
|
-
*/
|
|
224
|
-
appendFormRecord(params: IAppendFormRecordParams): import("../../modules/Holder").IFormRecord;
|
|
225
197
|
checkOpenDataAvailability(): Promise<OpenDataAvailabilityResult>;
|
|
226
198
|
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
227
199
|
cover?: boolean;
|