@pisell/pisellos 2.3.37 → 2.3.39
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/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 +11 -28
- package/dist/modules/Order/index.js +513 -747
- package/dist/modules/Order/types.d.ts +10 -33
- package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +40 -11
- package/dist/modules/Payment/index.d.ts +0 -2
- package/dist/modules/Payment/index.js +49 -78
- package/dist/modules/Payment/types.d.ts +24 -26
- package/dist/modules/Payment/types.js +0 -2
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -14
- 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 +48 -15
- 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 +14 -16
- package/dist/server/index.js +1162 -1943
- package/dist/server/modules/order/index.d.ts +4 -49
- package/dist/server/modules/order/index.js +695 -1574
- package/dist/server/modules/order/types.d.ts +3 -11
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +10 -33
- package/dist/solution/BaseSales/index.js +385 -676
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- 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.js +1 -2
- package/dist/solution/Sales/index.d.ts +0 -1
- package/dist/solution/Sales/index.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1140 -737
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +66 -25
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1177 -850
- 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/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 +11 -28
- package/lib/modules/Order/index.js +83 -187
- package/lib/modules/Order/types.d.ts +10 -33
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +39 -10
- package/lib/modules/Payment/index.d.ts +0 -2
- package/lib/modules/Payment/index.js +12 -33
- package/lib/modules/Payment/types.d.ts +24 -26
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +40 -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 +34 -18
- 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 +14 -16
- package/lib/server/index.js +88 -678
- package/lib/server/modules/order/index.d.ts +4 -49
- package/lib/server/modules/order/index.js +66 -657
- package/lib/server/modules/order/types.d.ts +3 -11
- package/lib/solution/BaseSales/index.d.ts +10 -33
- package/lib/solution/BaseSales/index.js +33 -201
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- 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.js +1 -2
- package/lib/solution/Sales/index.d.ts +0 -1
- package/lib/solution/Sales/index.js +3 -5
- 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 +31 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1076 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +328 -115
- 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 +2 -2
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/payment-utils.js +0 -225
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/payment-number.js +0 -69
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/payment-utils.js +0 -224
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/payment-number.js +0 -64
|
@@ -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,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/modules/Holder/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -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,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/Holder/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
createEmptyFormItemData: () => createEmptyFormItemData,
|
|
23
|
+
getFormIdFromHolderConfig: () => getFormIdFromHolderConfig,
|
|
24
|
+
getProductHolderConfig: () => getProductHolderConfig,
|
|
25
|
+
normalizeFormId: () => normalizeFormId,
|
|
26
|
+
resolveFormMetaFromHolderItem: () => resolveFormMetaFromHolderItem
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(utils_exports);
|
|
29
|
+
function getProductHolderConfig(product) {
|
|
30
|
+
var _a;
|
|
31
|
+
if (!product)
|
|
32
|
+
return null;
|
|
33
|
+
const config = (product == null ? void 0 : product.holder_config) ?? ((_a = product == null ? void 0 : product.origin) == null ? void 0 : _a.holder_config);
|
|
34
|
+
if ((config == null ? void 0 : config.status) && (config == null ? void 0 : config.status) !== "enable")
|
|
35
|
+
return null;
|
|
36
|
+
if (!(config == null ? void 0 : config.resource_id))
|
|
37
|
+
return null;
|
|
38
|
+
return config;
|
|
39
|
+
}
|
|
40
|
+
function getFormIdFromHolderConfig(config) {
|
|
41
|
+
return Number(config == null ? void 0 : config.resource_id);
|
|
42
|
+
}
|
|
43
|
+
function normalizeFormId(formId) {
|
|
44
|
+
return Number(formId);
|
|
45
|
+
}
|
|
46
|
+
function createEmptyFormItemData() {
|
|
47
|
+
return {
|
|
48
|
+
records: [],
|
|
49
|
+
form: {}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function resolveFormMetaFromHolderItem(mapKey, item) {
|
|
53
|
+
const formInfo = item.form || {};
|
|
54
|
+
const nestedForm = formInfo.form || {};
|
|
55
|
+
const form_id = normalizeFormId(
|
|
56
|
+
nestedForm.id ?? formInfo.form_id ?? formInfo.id ?? mapKey
|
|
57
|
+
);
|
|
58
|
+
const shop_id = nestedForm.shop_id ?? formInfo.shop_id;
|
|
59
|
+
if (shop_id === void 0 || shop_id === null || shop_id === "") {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return { form_id, shop_id };
|
|
63
|
+
}
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
createEmptyFormItemData,
|
|
67
|
+
getFormIdFromHolderConfig,
|
|
68
|
+
getProductHolderConfig,
|
|
69
|
+
normalizeFormId,
|
|
70
|
+
resolveFormMetaFromHolderItem
|
|
71
|
+
});
|
|
@@ -73,7 +73,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
|
|
|
73
73
|
}
|
|
74
74
|
async fetchOpenData(params) {
|
|
75
75
|
var _a, _b;
|
|
76
|
-
const getData = (_b = (_a = this.appPlugin).getData) == null ? void 0 : _b.call(_a);
|
|
76
|
+
const getData = (_b = (_a = this.appPlugin) == null ? void 0 : _a.getData) == null ? void 0 : _b.call(_a);
|
|
77
77
|
const shopId = getData == null ? void 0 : getData("shop_id");
|
|
78
78
|
if (!shopId)
|
|
79
79
|
throw new Error("[OpenDataModule] 无法获取 shop_id");
|
|
@@ -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,
|
|
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
|
-
import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData,
|
|
6
|
+
import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } 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';
|
|
@@ -14,7 +14,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
14
14
|
private request;
|
|
15
15
|
private logger;
|
|
16
16
|
private window;
|
|
17
|
-
private appPlugin;
|
|
18
17
|
private cacheId;
|
|
19
18
|
private salesSummaryModuleName;
|
|
20
19
|
private rulesHooksOverride?;
|
|
@@ -146,6 +145,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
146
145
|
isTempOrderPersistEnabled(): boolean;
|
|
147
146
|
/** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化;草稿保存请使用 IndexedDB saveDraft。 */
|
|
148
147
|
persistTempOrder(): void;
|
|
148
|
+
notifyTempOrderChanged(): void;
|
|
149
149
|
private createDefaultTempOrderInstance;
|
|
150
150
|
private createExternalSaleNumber;
|
|
151
151
|
private ensureExternalSaleNumber;
|
|
@@ -177,9 +177,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
177
177
|
};
|
|
178
178
|
private calculateDepositPaidAmount;
|
|
179
179
|
private resolveNextOrderPaymentType;
|
|
180
|
-
private getPaymentNumberAppData;
|
|
181
|
-
private getPaymentNumberDevicePrefixSync;
|
|
182
|
-
private getPaymentNumberDevicePrefixAsync;
|
|
183
180
|
private normalizePaymentSource;
|
|
184
181
|
private updateTempOrderPaymentStatus;
|
|
185
182
|
private shouldKeepPaymentStatusAfterAmountRecalc;
|
|
@@ -311,20 +308,19 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
311
308
|
* 用一组支付来源覆盖当前订单支付项。
|
|
312
309
|
*
|
|
313
310
|
* 入参允许来自 PaymentModule 的 PaymentItem,内部统一映射为 Sales 协议:
|
|
314
|
-
*
|
|
311
|
+
* uuid -> metadata.unique_payment_number,id -> custom_payment_id,
|
|
315
312
|
* isSynced 等运行态字段不会进入 tempOrder.payments。
|
|
316
313
|
*/
|
|
317
314
|
setOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
|
|
318
|
-
/**
|
|
315
|
+
/** 追加单个支付项,并立即持久化当前 tempOrder。 */
|
|
319
316
|
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
320
|
-
/** 异步入口:创建支付项时读取最新 IoT 设备短号。 */
|
|
321
|
-
addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
|
|
322
|
-
private addOrderPaymentWithDevicePrefix;
|
|
323
317
|
/**
|
|
324
|
-
*
|
|
325
|
-
*
|
|
318
|
+
* 按支付唯一号、后端支付 ID、自定义支付方式 ID 或旧 uuid 更新支付项。
|
|
319
|
+
*
|
|
320
|
+
* 该方法服务 PaymentModal 的 void / 编辑场景;更新 metadata 时会做浅合并,
|
|
321
|
+
* 避免覆盖 unique_payment_number、现金实付/找零等已有元数据。
|
|
326
322
|
*/
|
|
327
|
-
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any
|
|
323
|
+
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
|
|
328
324
|
/** 从当前订单支付项中移除指定支付项。 */
|
|
329
325
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
330
326
|
private confirmPendingVoucherPaymentsInList;
|
|
@@ -347,11 +343,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
347
343
|
*/
|
|
348
344
|
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
349
345
|
status?: 'paid' | 'payment_pending';
|
|
350
|
-
devicePrefix?: string;
|
|
351
346
|
}): OrderPaymentData[];
|
|
352
|
-
updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
|
|
353
|
-
status?: 'paid' | 'payment_pending';
|
|
354
|
-
}): Promise<OrderPaymentData[]>;
|
|
355
347
|
private shouldMergeProductToOrder;
|
|
356
348
|
private hasOrderProductLineNote;
|
|
357
349
|
/**
|
|
@@ -436,14 +428,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
436
428
|
type?: string;
|
|
437
429
|
}): import("./types").OrderSubmitPayload;
|
|
438
430
|
applyLocalPrintOrderNumbers(order?: Record<string, any> | null): Promise<OrderTempOrder>;
|
|
439
|
-
saveTempOrderAsDraft<T = any>(params?: {
|
|
440
|
-
cacheId?: string;
|
|
441
|
-
platform?: string;
|
|
442
|
-
businessCode?: string;
|
|
443
|
-
channel?: string;
|
|
444
|
-
type?: string;
|
|
445
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
446
|
-
}): Promise<T>;
|
|
447
431
|
/**
|
|
448
432
|
* 提交当前 Sales tempOrder。
|
|
449
433
|
*
|
|
@@ -495,6 +479,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
495
479
|
is_deposit: number;
|
|
496
480
|
relation_products: any[];
|
|
497
481
|
relation_forms: any[];
|
|
482
|
+
business_code: string | undefined;
|
|
498
483
|
};
|
|
499
484
|
checkBeforeSubmitOrder(params: {
|
|
500
485
|
cartItems: CartItem[];
|
|
@@ -548,8 +533,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
548
533
|
*/
|
|
549
534
|
private seedAnonymousBookingUidsFromProducts;
|
|
550
535
|
private normalizeTempOrderForRuntime;
|
|
551
|
-
private isSyntheticDraftOrderIdForRuntime;
|
|
552
|
-
private withoutSyntheticDraftOrderIdForRuntime;
|
|
553
536
|
private hydrateLinkedBookingIdentity;
|
|
554
537
|
private pickHydratedDisplayText;
|
|
555
538
|
private formatHydratedNamePair;
|