@pisell/pisellos 2.2.278 → 2.2.280
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/BaseModule.d.ts +1 -0
- package/dist/modules/BaseModule.js +24 -28
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +7 -3
- package/dist/modules/BookingContext/utils/productExtend.js +5 -9
- package/dist/modules/BookingContext/utils/timeSlices.js +24 -3
- package/dist/modules/Customer/index.d.ts +4 -0
- package/dist/modules/Customer/index.js +91 -59
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +32 -4
- package/dist/modules/Order/index.js +868 -675
- package/dist/modules/Order/types.d.ts +22 -1
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +227 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +71 -34
- package/dist/modules/Payment/index.d.ts +4 -0
- package/dist/modules/Payment/index.js +14 -4
- package/dist/modules/Payment/walletpass.js +21 -7
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -13
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.js +153 -56
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +20 -0
- package/dist/server/index.js +1101 -909
- package/dist/server/modules/order/index.d.ts +2 -0
- package/dist/server/modules/order/index.js +261 -96
- package/dist/server/modules/order/types.d.ts +1 -1
- package/dist/solution/BaseSales/index.d.ts +20 -1
- package/dist/solution/BaseSales/index.js +989 -881
- package/dist/solution/BaseSales/utils/cartPromotion.js +19 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
- package/dist/solution/BaseSales/utils.js +31 -20
- package/dist/solution/BookingByStep/index.d.ts +17 -2
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.d.ts +21 -3
- package/dist/solution/BookingTicket/index.js +312 -226
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1142 -739
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +97 -45
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +204 -0
- package/dist/solution/UnifiedBookingSales/index.js +2211 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +150 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1167 -841
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -51
- package/lib/modules/BaseModule.d.ts +1 -0
- package/lib/modules/BaseModule.js +24 -37
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -0
- package/lib/modules/BookingContext/utils/productExtend.js +4 -3
- package/lib/modules/BookingContext/utils/timeSlices.js +18 -3
- package/lib/modules/Customer/index.d.ts +4 -0
- package/lib/modules/Customer/index.js +11 -0
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +32 -4
- package/lib/modules/Order/index.js +372 -156
- package/lib/modules/Order/types.d.ts +22 -1
- package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +170 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +39 -6
- package/lib/modules/Payment/index.d.ts +4 -0
- package/lib/modules/Payment/index.js +7 -0
- package/lib/modules/Payment/walletpass.js +12 -0
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +49 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.js +117 -25
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +20 -0
- package/lib/server/index.js +124 -19
- package/lib/server/modules/order/index.d.ts +2 -0
- package/lib/server/modules/order/index.js +75 -5
- package/lib/server/modules/order/types.d.ts +1 -1
- package/lib/solution/BaseSales/index.d.ts +20 -1
- package/lib/solution/BaseSales/index.js +105 -31
- package/lib/solution/BaseSales/utils/cartPromotion.js +18 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -0
- package/lib/solution/BaseSales/utils.js +29 -18
- package/lib/solution/BookingByStep/index.d.ts +17 -2
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.d.ts +21 -3
- package/lib/solution/BookingTicket/index.js +75 -16
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -182
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +60 -18
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +204 -0
- package/lib/solution/UnifiedBookingSales/index.js +1273 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +150 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +322 -110
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ProductData } from '../Product/types';
|
|
2
|
+
/**
|
|
3
|
+
* 商品 holder 配置
|
|
4
|
+
*/
|
|
5
|
+
export interface IHolderConfig {
|
|
6
|
+
required?: number;
|
|
7
|
+
resource_id: number;
|
|
8
|
+
status?: string;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 表单记录
|
|
13
|
+
*/
|
|
14
|
+
export interface IFormRecord {
|
|
15
|
+
form_id: number;
|
|
16
|
+
form_record_id: number;
|
|
17
|
+
main_field: string;
|
|
18
|
+
customer_cover?: string;
|
|
19
|
+
created_at?: string;
|
|
20
|
+
customer_id?: number;
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 表单配置/定义
|
|
25
|
+
*/
|
|
26
|
+
export interface IFormInfo {
|
|
27
|
+
form_id: number;
|
|
28
|
+
name: string;
|
|
29
|
+
fields?: Record<string, any>[];
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 单个 form_id 下的数据结构
|
|
34
|
+
*/
|
|
35
|
+
export interface IFormItemData {
|
|
36
|
+
records: IFormRecord[];
|
|
37
|
+
form: IFormInfo | Record<string, any>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* form_id 为 key 的 map 结构,如 948: { records: [], form: {} }
|
|
41
|
+
*/
|
|
42
|
+
export type HolderFormMap = Record<string, IFormItemData>;
|
|
43
|
+
/**
|
|
44
|
+
* Holder 模块 reactive store,仅 holderMap 会触发 changed 事件
|
|
45
|
+
*/
|
|
46
|
+
export interface HolderState {
|
|
47
|
+
holderMap: HolderFormMap;
|
|
48
|
+
}
|
|
49
|
+
export interface IFetchFormInfoParams {
|
|
50
|
+
url?: string;
|
|
51
|
+
query: {
|
|
52
|
+
form_id: string | number;
|
|
53
|
+
};
|
|
54
|
+
useCache?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface IFetchFormRecordsParams {
|
|
57
|
+
url?: string;
|
|
58
|
+
query: {
|
|
59
|
+
customer_id?: number;
|
|
60
|
+
form_id: string | number;
|
|
61
|
+
shop_id: string | number;
|
|
62
|
+
num?: number;
|
|
63
|
+
skip?: number;
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
};
|
|
66
|
+
useCache?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface IAddFormRecordParams {
|
|
69
|
+
url?: string;
|
|
70
|
+
body: {
|
|
71
|
+
form_id: number;
|
|
72
|
+
shop_id: number | string;
|
|
73
|
+
customer_id?: number;
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* UI 层自行调用添加接口后,将返回记录写入 holderMap
|
|
79
|
+
*/
|
|
80
|
+
export interface IAppendFormRecordParams {
|
|
81
|
+
/** 接口返回的 data,或完整响应 { data: {...} } */
|
|
82
|
+
record: IFormRecord | Record<string, any>;
|
|
83
|
+
/** 可选,未传则从 record.form_id 读取 */
|
|
84
|
+
form_id?: number | string;
|
|
85
|
+
}
|
|
86
|
+
export interface IEnsureFormDataParams {
|
|
87
|
+
form_id: number | string;
|
|
88
|
+
shop_id: number | string;
|
|
89
|
+
customer_id?: number;
|
|
90
|
+
useCache?: boolean;
|
|
91
|
+
forceRefresh?: boolean;
|
|
92
|
+
formInfoUrl?: string;
|
|
93
|
+
recordsUrl?: string;
|
|
94
|
+
skip?: number;
|
|
95
|
+
num?: number;
|
|
96
|
+
}
|
|
97
|
+
export interface IEnsureFormByProductParams {
|
|
98
|
+
product: ProductData | Record<string, any>;
|
|
99
|
+
customer_id?: number;
|
|
100
|
+
shop_id?: number | string;
|
|
101
|
+
useCache?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface IRefreshAllFormRecordsParams {
|
|
104
|
+
customer_id?: number;
|
|
105
|
+
useCache?: boolean;
|
|
106
|
+
recordsUrl?: string;
|
|
107
|
+
num?: number;
|
|
108
|
+
skip?: number;
|
|
109
|
+
}
|
|
110
|
+
export interface HolderModuleAPI {
|
|
111
|
+
getHolderFormMap: () => HolderFormMap;
|
|
112
|
+
getHolderFormData: (formId: number | string) => IFormItemData | undefined;
|
|
113
|
+
setFormData: (formId: number | string, data: Partial<IFormItemData>) => void;
|
|
114
|
+
fetchFormInfo: (params: IFetchFormInfoParams) => Promise<IFormInfo | IFormInfo[]>;
|
|
115
|
+
fetchRecords: (params: IFetchFormRecordsParams) => Promise<IFormRecord[]>;
|
|
116
|
+
ensureFormData: (params: IEnsureFormDataParams) => Promise<IFormItemData>;
|
|
117
|
+
ensureFormByProduct: (params: IEnsureFormByProductParams) => Promise<IFormItemData | null>;
|
|
118
|
+
addFormRecord: (params: IAddFormRecordParams) => Promise<IFormRecord>;
|
|
119
|
+
appendFormRecord: (params: IAppendFormRecordParams) => IFormRecord;
|
|
120
|
+
removeFormRecord: (formId: number | string, formRecordId: number) => void;
|
|
121
|
+
clearFormData: (formId?: number | string) => void;
|
|
122
|
+
refreshAllFormRecords: (params?: IRefreshAllFormRecordsParams) => Promise<HolderFormMap>;
|
|
123
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ProductData } from '../Product/types';
|
|
2
|
+
import { IFormItemData, IHolderConfig } from './types';
|
|
3
|
+
export declare function getProductHolderConfig(product?: ProductData | Record<string, any> | null): IHolderConfig | null;
|
|
4
|
+
export declare function getFormIdFromHolderConfig(config: IHolderConfig): number;
|
|
5
|
+
export declare function normalizeFormId(formId: number | string): number;
|
|
6
|
+
export declare function createEmptyFormItemData(): {
|
|
7
|
+
records: any[];
|
|
8
|
+
form: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
export declare function resolveFormMetaFromHolderItem(mapKey: string, item: IFormItemData): {
|
|
11
|
+
form_id: string | number;
|
|
12
|
+
shop_id: number | string;
|
|
13
|
+
} | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function getProductHolderConfig(product) {
|
|
2
|
+
var _product$holder_confi, _product$origin;
|
|
3
|
+
if (!product) return null;
|
|
4
|
+
var config = (_product$holder_confi = product === null || product === void 0 ? void 0 : product.holder_config) !== null && _product$holder_confi !== void 0 ? _product$holder_confi : product === null || product === void 0 || (_product$origin = product.origin) === null || _product$origin === void 0 ? void 0 : _product$origin.holder_config;
|
|
5
|
+
if (config !== null && config !== void 0 && config.status && (config === null || config === void 0 ? void 0 : config.status) !== 'enable') return null;
|
|
6
|
+
if (!(config !== null && config !== void 0 && config.resource_id)) return null;
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
export function getFormIdFromHolderConfig(config) {
|
|
10
|
+
return Number(config === null || config === void 0 ? void 0 : config.resource_id);
|
|
11
|
+
}
|
|
12
|
+
export function normalizeFormId(formId) {
|
|
13
|
+
return Number(formId);
|
|
14
|
+
}
|
|
15
|
+
export function createEmptyFormItemData() {
|
|
16
|
+
return {
|
|
17
|
+
records: [],
|
|
18
|
+
form: {}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function resolveFormMetaFromHolderItem(mapKey, item) {
|
|
22
|
+
var _ref, _ref2, _nestedForm$id, _nestedForm$shop_id;
|
|
23
|
+
var formInfo = item.form || {};
|
|
24
|
+
var nestedForm = formInfo.form || {};
|
|
25
|
+
var form_id = normalizeFormId((_ref = (_ref2 = (_nestedForm$id = nestedForm.id) !== null && _nestedForm$id !== void 0 ? _nestedForm$id : formInfo.form_id) !== null && _ref2 !== void 0 ? _ref2 : formInfo.id) !== null && _ref !== void 0 ? _ref : mapKey);
|
|
26
|
+
var shop_id = (_nestedForm$shop_id = nestedForm.shop_id) !== null && _nestedForm$shop_id !== void 0 ? _nestedForm$shop_id : formInfo.shop_id;
|
|
27
|
+
if (shop_id === undefined || shop_id === null || shop_id === '') {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
form_id: form_id,
|
|
32
|
+
shop_id: shop_id
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -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
|
|
108
|
+
var _this$appPlugin, _this$appPlugin$getDa;
|
|
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 = this.appPlugin) === null || _this$appPlugin === void 0 || (_this$appPlugin$getDa = _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,6 +1,6 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams,
|
|
3
|
+
import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CancelOrderParams, ChangeBookingStatusParams, CheckoutOrderParams } from './types';
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
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';
|
|
@@ -16,6 +16,10 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
16
16
|
private window;
|
|
17
17
|
private appPlugin;
|
|
18
18
|
private cacheId;
|
|
19
|
+
private fatherModule;
|
|
20
|
+
private openCache;
|
|
21
|
+
private sessionStoragePersistEnabled;
|
|
22
|
+
private sessionStorageRestoreRecord;
|
|
19
23
|
private salesSummaryModuleName;
|
|
20
24
|
private rulesHooksOverride?;
|
|
21
25
|
private moduleHooksOverride?;
|
|
@@ -46,6 +50,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
46
50
|
static populateSavedAmounts(productList: Array<Record<string, any>>, discountList: Array<Record<string, any>>): void;
|
|
47
51
|
private applyProductDiscountPrices;
|
|
48
52
|
constructor(name?: string, version?: string);
|
|
53
|
+
private syncSessionStorageOptions;
|
|
49
54
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
50
55
|
destroy(): Promise<void>;
|
|
51
56
|
/**
|
|
@@ -137,7 +142,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
137
142
|
}): void;
|
|
138
143
|
/**
|
|
139
144
|
* 控制 IndexedDB 草稿(saveDraft)是否写入。
|
|
140
|
-
*
|
|
145
|
+
* 此开关仅影响 saveDraft;可选 sessionStorage 会话恢复由
|
|
146
|
+
* enableSessionStoragePersist 独立控制。
|
|
141
147
|
*
|
|
142
148
|
* @example
|
|
143
149
|
* order.setEnableTempOrderPersist(false); // BigSale 弹窗:跳过 ~1s 的 dbUpdate
|
|
@@ -145,8 +151,20 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
145
151
|
setEnableTempOrderPersist(enabled: boolean): void;
|
|
146
152
|
/** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
|
|
147
153
|
isTempOrderPersistEnabled(): boolean;
|
|
148
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* 在 UnifiedBookingSales 显式开启会话恢复时,将完整 tempOrder 写入
|
|
156
|
+
* sessionStorage 的 cacheId 分桶。写入失败由 BaseModule 静默降级。
|
|
157
|
+
*/
|
|
149
158
|
persistTempOrder(): void;
|
|
159
|
+
/**
|
|
160
|
+
* 终止当前模块实例的 sessionStorage 订单恢复会话。
|
|
161
|
+
*
|
|
162
|
+
* 支付跳转等终态场景需要同时删除当前 cacheId 的 tempOrder 快照,并关闭
|
|
163
|
+
* 本实例后续异步任务的再次写入;新模块实例初始化时会按 otherParams 重新启用。
|
|
164
|
+
*/
|
|
165
|
+
clearSessionStoragePersistedTempOrder(): void;
|
|
166
|
+
consumeSessionStorageRestore(): Record<string, any> | null;
|
|
167
|
+
notifyTempOrderChanged(): void;
|
|
150
168
|
private createDefaultTempOrderInstance;
|
|
151
169
|
private createExternalSaleNumber;
|
|
152
170
|
private ensureExternalSaleNumber;
|
|
@@ -177,6 +195,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
177
195
|
orderExpectedAmount: string;
|
|
178
196
|
};
|
|
179
197
|
private calculateDepositPaidAmount;
|
|
198
|
+
private hasPaidNormalPayment;
|
|
180
199
|
private resolveNextOrderPaymentType;
|
|
181
200
|
private getPaymentNumberAppData;
|
|
182
201
|
private getPaymentNumberDevicePrefixSync;
|
|
@@ -226,6 +245,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
226
245
|
private sanitizeOrderProductForTempOrder;
|
|
227
246
|
private sanitizeTempOrderProducts;
|
|
228
247
|
private ensureExtend;
|
|
248
|
+
private repairDuplicateProductLineIdentities;
|
|
229
249
|
private captureProductRuntime;
|
|
230
250
|
private createLinkedProductAndBooking;
|
|
231
251
|
/**
|
|
@@ -353,6 +373,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
353
373
|
updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
|
|
354
374
|
status?: 'paid' | 'payment_pending';
|
|
355
375
|
}): Promise<OrderPaymentData[]>;
|
|
376
|
+
private normalizeShouldMergeProductResult;
|
|
356
377
|
private shouldMergeProductToOrder;
|
|
357
378
|
private hasOrderProductLineNote;
|
|
358
379
|
/**
|
|
@@ -374,7 +395,12 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
374
395
|
* 带 booking 且 num>1 时由 `addProductToOrder` 拆成多次本方法调用(每次 num=1)。
|
|
375
396
|
*
|
|
376
397
|
* @example
|
|
377
|
-
*
|
|
398
|
+
* const pending = this.appendProductLineToTempOrder(
|
|
399
|
+
* tempOrder,
|
|
400
|
+
* { product_id: 1, num: 1 },
|
|
401
|
+
* booking,
|
|
402
|
+
* );
|
|
403
|
+
* if (pending) await pending;
|
|
378
404
|
*/
|
|
379
405
|
private appendProductLineToTempOrder;
|
|
380
406
|
/**
|
|
@@ -496,6 +522,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
496
522
|
is_deposit: number;
|
|
497
523
|
relation_products: any[];
|
|
498
524
|
relation_forms: any[];
|
|
525
|
+
business_code: string | undefined;
|
|
499
526
|
};
|
|
500
527
|
checkBeforeSubmitOrder(params: {
|
|
501
528
|
cartItems: CartItem[];
|
|
@@ -535,6 +562,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
535
562
|
*/
|
|
536
563
|
hydrateTempOrderFromRecord(record: Record<string, any>, options?: {
|
|
537
564
|
recalcOnHydrate?: boolean;
|
|
565
|
+
source?: 'salesDetail' | 'sessionStorage';
|
|
538
566
|
}): Promise<OrderTempOrder>;
|
|
539
567
|
/**
|
|
540
568
|
* 兼容后端详情将 holder 放在 metadata.holder 的历史形态,统一补到运行时展示路径。
|