@pisell/pisellos 2.2.292 → 2.2.293
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 +7 -0
- package/dist/core/index.js +108 -65
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/dist/model/strategy/adapter/itemRule/type.js +19 -1
- package/dist/modules/BookingContext/index.d.ts +3 -0
- package/dist/modules/BookingContext/index.js +42 -13
- package/dist/modules/BookingContext/types.d.ts +4 -4
- package/dist/modules/BookingContext/types.js +3 -3
- package/dist/modules/OpenData/types.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +19 -4
- package/dist/modules/Order/index.js +885 -485
- package/dist/modules/Order/salesNotes.d.ts +31 -0
- package/dist/modules/Order/salesNotes.js +492 -0
- package/dist/modules/Order/types.d.ts +93 -5
- package/dist/modules/Order/types.js +5 -0
- package/dist/modules/Order/utils.d.ts +12 -0
- package/dist/modules/Order/utils.js +96 -31
- package/dist/modules/Product/types.d.ts +2 -0
- package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/dist/modules/ProductList/clientDataVariants.js +216 -0
- package/dist/modules/ProductList/index.d.ts +18 -3
- package/dist/modules/ProductList/index.js +220 -38
- package/dist/modules/ProductList/types.d.ts +10 -0
- package/dist/modules/Quotation/index.d.ts +22 -0
- package/dist/modules/Quotation/index.js +293 -28
- package/dist/modules/ResourcePlanner/index.d.ts +0 -22
- package/dist/modules/ResourcePlanner/index.js +1 -180
- package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/dist/modules/ResourcePlanner/localClock.js +183 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
- package/dist/modules/ResourcePlanner/planner.js +2111 -958
- package/dist/modules/ResourcePlanner/types.d.ts +359 -187
- package/dist/modules/ResourcePlanner/types.js +33 -1
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +17 -2
- package/dist/server/index.js +1134 -932
- package/dist/server/modules/floor-plan/index.d.ts +4 -0
- package/dist/server/modules/floor-plan/index.js +240 -98
- package/dist/server/modules/menu/index.js +48 -23
- package/dist/server/modules/order/index.d.ts +17 -7
- package/dist/server/modules/order/index.js +419 -207
- package/dist/server/modules/products/index.d.ts +10 -4
- package/dist/server/modules/products/index.js +177 -84
- package/dist/server/modules/resource/index.js +21 -13
- package/dist/server/utils/product.d.ts +1 -1
- package/dist/server/utils/product.js +186 -22
- package/dist/server/utils/small-ticket.d.ts +9 -1
- package/dist/server/utils/small-ticket.js +136 -41
- package/dist/solution/BaseSales/index.d.ts +26 -3
- package/dist/solution/BaseSales/index.js +1384 -905
- package/dist/solution/BaseSales/types.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
- package/dist/solution/BaseSales/utils.js +6 -3
- package/dist/solution/BookingByStep/index.d.ts +4 -4
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +4 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
- package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
- package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
- package/dist/solution/RegisterAndLogin/config.js +95 -40
- package/dist/solution/RegisterAndLogin/index.js +4 -1
- package/dist/solution/ScanOrder/index.d.ts +1 -0
- package/dist/solution/ScanOrder/index.js +31 -27
- package/dist/solution/ScanOrder/types.d.ts +2 -0
- package/dist/solution/ScanOrder/utils.d.ts +1 -0
- package/dist/solution/ScanOrder/utils.js +8 -3
- package/dist/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/dist/solution/UnifiedBookingSales/index.js +3877 -963
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/dist/solution/UnifiedBookingSales/types.js +4 -9
- package/dist/solution/VenueBooking/index.d.ts +3 -0
- package/dist/solution/VenueBooking/index.js +549 -497
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/dist/utils/platform.d.ts +8 -0
- package/dist/utils/platform.js +15 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.js +20 -2
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
- package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/lib/model/strategy/adapter/itemRule/type.js +19 -1
- package/lib/modules/BookingContext/index.d.ts +3 -0
- package/lib/modules/BookingContext/index.js +35 -8
- package/lib/modules/BookingContext/types.d.ts +4 -4
- package/lib/modules/BookingContext/types.js +3 -3
- package/lib/modules/OpenData/types.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +19 -4
- package/lib/modules/Order/index.js +325 -28
- package/lib/modules/Order/salesNotes.d.ts +31 -0
- package/lib/modules/Order/salesNotes.js +382 -0
- package/lib/modules/Order/types.d.ts +93 -5
- package/lib/modules/Order/types.js +4 -0
- package/lib/modules/Order/utils.d.ts +12 -0
- package/lib/modules/Order/utils.js +85 -16
- package/lib/modules/Product/types.d.ts +2 -0
- package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/lib/modules/ProductList/clientDataVariants.js +204 -0
- package/lib/modules/ProductList/index.d.ts +18 -3
- package/lib/modules/ProductList/index.js +137 -8
- package/lib/modules/ProductList/types.d.ts +10 -0
- package/lib/modules/Quotation/index.d.ts +22 -0
- package/lib/modules/Quotation/index.js +158 -11
- package/lib/modules/ResourcePlanner/index.d.ts +0 -22
- package/lib/modules/ResourcePlanner/index.js +9 -129
- package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/lib/modules/ResourcePlanner/localClock.js +205 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
- package/lib/modules/ResourcePlanner/planner.js +1807 -783
- package/lib/modules/ResourcePlanner/types.d.ts +359 -187
- package/lib/modules/ResourcePlanner/types.js +13 -1
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +17 -2
- package/lib/server/index.js +149 -21
- package/lib/server/modules/floor-plan/index.d.ts +4 -0
- package/lib/server/modules/floor-plan/index.js +60 -7
- package/lib/server/modules/menu/index.js +26 -4
- package/lib/server/modules/order/index.d.ts +17 -7
- package/lib/server/modules/order/index.js +194 -57
- package/lib/server/modules/products/index.d.ts +10 -4
- package/lib/server/modules/products/index.js +93 -23
- package/lib/server/modules/resource/index.js +12 -2
- package/lib/server/utils/product.d.ts +1 -1
- package/lib/server/utils/product.js +163 -3
- package/lib/server/utils/small-ticket.d.ts +9 -1
- package/lib/server/utils/small-ticket.js +126 -33
- package/lib/solution/BaseSales/index.d.ts +26 -3
- package/lib/solution/BaseSales/index.js +396 -70
- package/lib/solution/BaseSales/types.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
- package/lib/solution/BaseSales/utils.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +4 -4
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
- package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
- package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
- package/lib/solution/RegisterAndLogin/config.js +49 -8
- package/lib/solution/RegisterAndLogin/index.js +4 -1
- package/lib/solution/ScanOrder/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.js +5 -1
- package/lib/solution/ScanOrder/types.d.ts +2 -0
- package/lib/solution/ScanOrder/utils.d.ts +1 -0
- package/lib/solution/ScanOrder/utils.js +4 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/lib/solution/UnifiedBookingSales/index.js +2592 -424
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/lib/solution/UnifiedBookingSales/types.js +4 -6
- package/lib/solution/VenueBooking/index.d.ts +3 -0
- package/lib/solution/VenueBooking/index.js +33 -9
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/lib/utils/platform.d.ts +8 -0
- package/lib/utils/platform.js +22 -0
- package/package.json +1 -1
|
@@ -8,6 +8,13 @@ import type { PaymentItem } from '../Payment/types';
|
|
|
8
8
|
import type { ICustomer } from '../AccountList/types';
|
|
9
9
|
import type { OrderProductDiscountItem } from '../../server/modules/order/types';
|
|
10
10
|
export type { OrderProductDiscountItem } from '../../server/modules/order/types';
|
|
11
|
+
export type PickupReferenceMode = 'counter_pickup' | 'table_service';
|
|
12
|
+
export type ShopServiceType = 'dine_in' | 'takeaway';
|
|
13
|
+
export interface ShopServiceData {
|
|
14
|
+
pickup_reference_mode?: PickupReferenceMode;
|
|
15
|
+
service_type?: ShopServiceType | '';
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
11
18
|
export declare enum OrderHooks {
|
|
12
19
|
OnOrderCreate = "order:onOrderCreate",
|
|
13
20
|
OnOrderUpdate = "order:onOrderUpdate",
|
|
@@ -191,6 +198,8 @@ export interface OrderLocalizedText {
|
|
|
191
198
|
export interface OrderProduct extends OrderProductIdentity {
|
|
192
199
|
order_detail_id: number | null;
|
|
193
200
|
num: number;
|
|
201
|
+
/** Product 或当前 Variant 的生产编码 */
|
|
202
|
+
production_code?: string;
|
|
194
203
|
bundle_edit?: number;
|
|
195
204
|
product_sku: OrderProductSku;
|
|
196
205
|
gift_card?: number;
|
|
@@ -236,6 +245,72 @@ export interface OrderSummary {
|
|
|
236
245
|
tax_title?: string;
|
|
237
246
|
tax_rate?: number;
|
|
238
247
|
}
|
|
248
|
+
export type SalesNoteRelationType = 'about' | 'related_to';
|
|
249
|
+
export type SalesNoteTargetType = 'order' | 'order_detail';
|
|
250
|
+
export type SalesNoteLocalizedText = string | Record<string, string>;
|
|
251
|
+
export interface SalesNoteLocalizedSelection {
|
|
252
|
+
id: string;
|
|
253
|
+
label: SalesNoteLocalizedText;
|
|
254
|
+
}
|
|
255
|
+
export type SalesNoteTextInput = {
|
|
256
|
+
kind: 'localizedSelections';
|
|
257
|
+
selections: SalesNoteLocalizedSelection[];
|
|
258
|
+
locale: string;
|
|
259
|
+
input?: string;
|
|
260
|
+
} | {
|
|
261
|
+
kind: 'plain';
|
|
262
|
+
input: string;
|
|
263
|
+
} | {
|
|
264
|
+
kind: 'resolved';
|
|
265
|
+
text: Record<string, string>;
|
|
266
|
+
};
|
|
267
|
+
export interface SalesNoteRelation {
|
|
268
|
+
uuid: string;
|
|
269
|
+
relation_type: SalesNoteRelationType;
|
|
270
|
+
target_type: SalesNoteTargetType;
|
|
271
|
+
target_uuid: string;
|
|
272
|
+
is_primary: 0 | 1;
|
|
273
|
+
}
|
|
274
|
+
export interface SalesNote {
|
|
275
|
+
uuid: string;
|
|
276
|
+
note_type: string;
|
|
277
|
+
content: {
|
|
278
|
+
text: Record<string, string>;
|
|
279
|
+
};
|
|
280
|
+
importance: string;
|
|
281
|
+
note_relations: SalesNoteRelation[];
|
|
282
|
+
}
|
|
283
|
+
export interface SalesNoteTarget {
|
|
284
|
+
target_type: 'order_detail';
|
|
285
|
+
target_uuid: string;
|
|
286
|
+
}
|
|
287
|
+
export interface SetSalesNoteInput {
|
|
288
|
+
note_type: string;
|
|
289
|
+
target: SalesNoteTarget;
|
|
290
|
+
text: SalesNoteTextInput;
|
|
291
|
+
}
|
|
292
|
+
export interface SalesNoteDraftInput {
|
|
293
|
+
note_type: string;
|
|
294
|
+
text: SalesNoteTextInput;
|
|
295
|
+
}
|
|
296
|
+
export interface SalesNotesRuntimeState {
|
|
297
|
+
loaded: boolean;
|
|
298
|
+
dirty: boolean;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Sales Notes 乐观写入前的可恢复快照。
|
|
302
|
+
* 该对象应视为 opaque token,只用于原样传回 restoreSalesNotesMutationSnapshot。
|
|
303
|
+
*/
|
|
304
|
+
export interface SalesNotesMutationSnapshot {
|
|
305
|
+
orderIdentity: {
|
|
306
|
+
orderId: number | string | null;
|
|
307
|
+
externalSaleNumber: string;
|
|
308
|
+
};
|
|
309
|
+
notes: SalesNote[];
|
|
310
|
+
state: SalesNotesRuntimeState;
|
|
311
|
+
}
|
|
312
|
+
export type SalesNoteProtocolRelation = SalesNoteRelation;
|
|
313
|
+
export type SalesNoteProtocol = SalesNote;
|
|
239
314
|
export interface OrderTempOrder {
|
|
240
315
|
order_id: number | null;
|
|
241
316
|
external_sale_number: string;
|
|
@@ -275,6 +350,7 @@ export interface OrderTempOrder {
|
|
|
275
350
|
created_at: string | undefined;
|
|
276
351
|
request_unique_idempotency_token?: string;
|
|
277
352
|
products: OrderProduct[];
|
|
353
|
+
notes: SalesNote[];
|
|
278
354
|
bookings: any[];
|
|
279
355
|
payments: any[];
|
|
280
356
|
surcharges: any[];
|
|
@@ -287,6 +363,7 @@ export interface OrderTempOrder {
|
|
|
287
363
|
summary?: OrderSummary;
|
|
288
364
|
_extend?: {
|
|
289
365
|
productsByUid?: Record<string, Record<string, any>>;
|
|
366
|
+
salesNotesState?: SalesNotesRuntimeState;
|
|
290
367
|
[key: string]: any;
|
|
291
368
|
};
|
|
292
369
|
}
|
|
@@ -295,7 +372,7 @@ export interface OrderSubmitProduct extends Omit<OrderProduct, 'unique_identific
|
|
|
295
372
|
payment_price: string;
|
|
296
373
|
product_sku: OrderProductSku;
|
|
297
374
|
}
|
|
298
|
-
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer' | 'discount_list' | 'created_at'> {
|
|
375
|
+
export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | 'notes' | '_extend' | 'customer' | 'discount_list' | 'created_at'> {
|
|
299
376
|
platform: string;
|
|
300
377
|
created_at?: string | undefined;
|
|
301
378
|
request_unique_idempotency_token?: string;
|
|
@@ -304,6 +381,7 @@ export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'p
|
|
|
304
381
|
form_record_id: number | string;
|
|
305
382
|
}>;
|
|
306
383
|
products: OrderSubmitProduct[];
|
|
384
|
+
notes?: SalesNoteProtocol[];
|
|
307
385
|
summary?: OrderSummary;
|
|
308
386
|
small_ticket_data_flag?: number;
|
|
309
387
|
}
|
|
@@ -332,6 +410,8 @@ export interface AddProductToOrderOptions {
|
|
|
332
410
|
insertAfterProductUid?: string;
|
|
333
411
|
/** 跳过同商品/规格匹配,始终新增购物车行。 */
|
|
334
412
|
disableMerge?: boolean;
|
|
413
|
+
/** 商品行 UID 落定后,由 OrderModule 原子绑定到该行的 Sales Notes 草稿。 */
|
|
414
|
+
salesNotes?: SalesNoteDraftInput[];
|
|
335
415
|
}
|
|
336
416
|
/**
|
|
337
417
|
* 删除商品后的可选位置保持策略。
|
|
@@ -747,9 +827,17 @@ export interface OrderModuleAPI {
|
|
|
747
827
|
updateTempOrderShopDiscount: (amount: string | number) => string;
|
|
748
828
|
updateTempOrderDepositAmount: (amount: string | number) => OrderSummary;
|
|
749
829
|
updateTempOrderCustomer: (customer: UpdateTempOrderCustomerInput) => OrderSnapshot['customer'];
|
|
830
|
+
updateTempOrderPickupReferenceMode: (mode: PickupReferenceMode) => ShopServiceData;
|
|
831
|
+
updateTempOrderServiceType: (serviceType: ShopServiceType) => ShopServiceData;
|
|
750
832
|
updateTempOrderBuzzer: (buzzer: string) => string;
|
|
751
833
|
updateTempOrderContactsInfo: (contactsInfo: Record<string, any> | null) => Record<string, any> | null;
|
|
752
834
|
addProductToOrder: (product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions) => Promise<OrderProduct[]>;
|
|
835
|
+
getSalesNotes: () => SalesNote[];
|
|
836
|
+
createSalesNotesMutationSnapshot: () => SalesNotesMutationSnapshot;
|
|
837
|
+
restoreSalesNotesMutationSnapshot: (snapshot: SalesNotesMutationSnapshot) => void;
|
|
838
|
+
setSalesNote: (input: SetSalesNoteInput) => Promise<SalesNote>;
|
|
839
|
+
removeSalesNote: (uuid: string) => Promise<void>;
|
|
840
|
+
clearSalesNotes: () => Promise<void>;
|
|
753
841
|
updateOrderProduct: (params: UpdateOrderProductParams) => Promise<OrderProduct[]>;
|
|
754
842
|
/** 批量更新购物车行,末尾仅触发一次促销重算与 summary 刷新 */
|
|
755
843
|
updateOrderProducts: (paramsList: UpdateOrderProductParams[]) => Promise<OrderProduct[]>;
|
|
@@ -897,10 +985,10 @@ export interface OrderModuleAPI {
|
|
|
897
985
|
/** 读取上次 applyPromotion 产出的赠品操作 diff(toAdd / toReduce / toRemove) */
|
|
898
986
|
getLastGiftActions: () => OrderLastGiftActions | null;
|
|
899
987
|
/**
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
988
|
+
* 取消订单
|
|
989
|
+
* @param params 取消订单参数
|
|
990
|
+
* @returns 后端返回结果
|
|
991
|
+
*/
|
|
904
992
|
cancelOrder: (params: CancelOrderParams) => Promise<any>;
|
|
905
993
|
/**
|
|
906
994
|
* 变更预约状态
|
|
@@ -64,6 +64,11 @@ export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
|
|
|
64
64
|
* 清空时整个 payload 为 null。
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Sales Notes 乐观写入前的可恢复快照。
|
|
69
|
+
* 该对象应视为 opaque token,只用于原样传回 restoreSalesNotesMutationSnapshot。
|
|
70
|
+
*/
|
|
71
|
+
|
|
67
72
|
/**
|
|
68
73
|
* 添加商品行时的顺序控制。
|
|
69
74
|
* 默认追加到 products 尾部;预约数量同步可插入到既有预约组的最新行之后,
|
|
@@ -210,6 +210,18 @@ export interface SubmitPayloadEnhancerContext {
|
|
|
210
210
|
now: Date;
|
|
211
211
|
}
|
|
212
212
|
export type SubmitPayloadEnhancer = (payload: OrderSubmitPayload, ctx: SubmitPayloadEnhancerContext) => OrderSubmitPayload;
|
|
213
|
+
/**
|
|
214
|
+
* 解析 checkout 的订单类型。
|
|
215
|
+
* dine_in 普通落库单在新增桌台资源后,即使原类型仍是 virtual,也必须按 table-order 提交。
|
|
216
|
+
*/
|
|
217
|
+
export declare function resolveSubmitOrderType(params: {
|
|
218
|
+
requestedType?: string;
|
|
219
|
+
tempOrderType?: string;
|
|
220
|
+
orderId?: unknown;
|
|
221
|
+
businessCode?: string;
|
|
222
|
+
tempOrderBusinessCode?: string;
|
|
223
|
+
bookings?: unknown;
|
|
224
|
+
}): string;
|
|
213
225
|
export declare function buildSubmitPayload(params: {
|
|
214
226
|
tempOrder: OrderTempOrder;
|
|
215
227
|
cacheId?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["custom_product_bundle_map_id"],
|
|
2
2
|
_excluded2 = ["unique_identification_number"],
|
|
3
|
-
_excluded3 = ["num", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per"],
|
|
4
|
-
_excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id"],
|
|
3
|
+
_excluded3 = ["num", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per", "production_code"],
|
|
4
|
+
_excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id", "notes"],
|
|
5
5
|
_excluded5 = ["collect_pax", "table_occupancy_duration"];
|
|
6
6
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -23,6 +23,7 @@ import Decimal from 'decimal.js';
|
|
|
23
23
|
import { getProductHolderConfig } from "../Holder/utils";
|
|
24
24
|
import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
|
|
25
25
|
import { createUuidV4 } from "./utils/orderCollectionIdentity";
|
|
26
|
+
import { encodeSalesNotes } from "./salesNotes";
|
|
26
27
|
/**
|
|
27
28
|
* 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
|
|
28
29
|
*
|
|
@@ -814,6 +815,11 @@ function normalizeSubmitPlatform(platform) {
|
|
|
814
815
|
if (lower === 'h5') return 'H5';
|
|
815
816
|
return value;
|
|
816
817
|
}
|
|
818
|
+
function normalizeSubmitProductionCode(value) {
|
|
819
|
+
if (value === undefined || value === null) return undefined;
|
|
820
|
+
var productionCode = String(value).trim();
|
|
821
|
+
return productionCode || undefined;
|
|
822
|
+
}
|
|
817
823
|
|
|
818
824
|
// 后端 checkout 协议字段 option_group_item_id;tempOrder 内部也保持同一字段名。
|
|
819
825
|
function formatSubmitOptionItems(options) {
|
|
@@ -825,6 +831,9 @@ function formatSubmitOptionItems(options) {
|
|
|
825
831
|
option_group_item_id: d === null || d === void 0 ? void 0 : d.option_group_item_id,
|
|
826
832
|
option_group_id: d === null || d === void 0 ? void 0 : d.option_group_id
|
|
827
833
|
});
|
|
834
|
+
var productionCode = normalizeSubmitProductionCode(d === null || d === void 0 ? void 0 : d.production_code);
|
|
835
|
+
delete option.production_code;
|
|
836
|
+
if (productionCode !== undefined) option.production_code = productionCode;
|
|
828
837
|
var addPrice = (_d$add_price = d === null || d === void 0 ? void 0 : d.add_price) !== null && _d$add_price !== void 0 ? _d$add_price : d === null || d === void 0 ? void 0 : d.price;
|
|
829
838
|
if (addPrice !== undefined) option.add_price = String(addPrice);
|
|
830
839
|
delete option.price;
|
|
@@ -865,9 +874,13 @@ function formatSubmitBundleItems(bundle) {
|
|
|
865
874
|
var num = toBundleNumber((_rawBundle$num = rawBundle.num) !== null && _rawBundle$num !== void 0 ? _rawBundle$num : rawBundle.quantity, 1);
|
|
866
875
|
var bundleMapId = resolveSubmitBundleMapId(rawBundle);
|
|
867
876
|
var hasSubmitBundleDiscounts = Array.isArray(rawBundle.discount_list) && rawBundle.discount_list.length > 0;
|
|
868
|
-
|
|
877
|
+
var productionCode = normalizeSubmitProductionCode(rawBundle.production_code);
|
|
878
|
+
return _objectSpread(_objectSpread({
|
|
869
879
|
is_charge_tax: (_rawBundle$is_charge_ = rawBundle.is_charge_tax) !== null && _rawBundle$is_charge_ !== void 0 ? _rawBundle$is_charge_ : 0,
|
|
870
|
-
bundle_variant_id: (_rawBundle$bundle_var = rawBundle.bundle_variant_id) !== null && _rawBundle$bundle_var !== void 0 ? _rawBundle$bundle_var : 0
|
|
880
|
+
bundle_variant_id: (_rawBundle$bundle_var = rawBundle.bundle_variant_id) !== null && _rawBundle$bundle_var !== void 0 ? _rawBundle$bundle_var : 0
|
|
881
|
+
}, productionCode !== undefined ? {
|
|
882
|
+
production_code: productionCode
|
|
883
|
+
} : {}), {}, {
|
|
871
884
|
num: num,
|
|
872
885
|
quantity: toBundleNumber((_rawBundle$quantity = rawBundle.quantity) !== null && _rawBundle$quantity !== void 0 ? _rawBundle$quantity : rawBundle.num, num),
|
|
873
886
|
extension_id: (_rawBundle$extension_ = rawBundle.extension_id) !== null && _rawBundle$extension_ !== void 0 ? _rawBundle$extension_ : 0,
|
|
@@ -889,7 +902,7 @@ function formatSubmitBundleItems(bundle) {
|
|
|
889
902
|
relation_surcharge_ids: relationSurchargeIds,
|
|
890
903
|
product_discount_difference: productDiscountDifference
|
|
891
904
|
})
|
|
892
|
-
};
|
|
905
|
+
});
|
|
893
906
|
});
|
|
894
907
|
}
|
|
895
908
|
|
|
@@ -921,7 +934,9 @@ function normalizeSubmitProduct(product) {
|
|
|
921
934
|
_deprecatedDiscountway = submitProduct.discountway,
|
|
922
935
|
_deprecatedProductDiscountReason = submitProduct.product_discount_reason,
|
|
923
936
|
_deprecatedDiscountPer = submitProduct.discount_per,
|
|
937
|
+
rawProductionCode = submitProduct.production_code,
|
|
924
938
|
productRest = _objectWithoutProperties(submitProduct, _excluded3);
|
|
939
|
+
var productionCode = normalizeSubmitProductionCode(rawProductionCode);
|
|
925
940
|
delete productRest["product_".concat('option', "_item")];
|
|
926
941
|
var rawMetadata = submitProduct.metadata || {};
|
|
927
942
|
var bookingUid = rawMetadata.booking_uid;
|
|
@@ -953,7 +968,9 @@ function normalizeSubmitProduct(product) {
|
|
|
953
968
|
var productSku = _objectSpread(_objectSpread({}, submitProduct.product_sku && _typeof(submitProduct.product_sku) === 'object' ? submitProduct.product_sku : {}), {}, {
|
|
954
969
|
option: formatSubmitOptionItems((_submitProduct$produc = submitProduct.product_sku) === null || _submitProduct$produc === void 0 ? void 0 : _submitProduct$produc.option)
|
|
955
970
|
});
|
|
956
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest),
|
|
971
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest), productionCode !== undefined ? {
|
|
972
|
+
production_code: productionCode
|
|
973
|
+
} : {}), bookingUid ? {
|
|
957
974
|
booking_uid: bookingUid
|
|
958
975
|
} : {}), bundleEdit !== undefined ? {
|
|
959
976
|
bundle_edit: bundleEdit
|
|
@@ -1072,6 +1089,7 @@ export function createDefaultTempOrder(params) {
|
|
|
1072
1089
|
request_unique_idempotency_token: '',
|
|
1073
1090
|
vouchers: [],
|
|
1074
1091
|
products: [],
|
|
1092
|
+
notes: [],
|
|
1075
1093
|
bookings: [],
|
|
1076
1094
|
payments: [],
|
|
1077
1095
|
surcharges: [],
|
|
@@ -1081,12 +1099,59 @@ export function createDefaultTempOrder(params) {
|
|
|
1081
1099
|
holder: null,
|
|
1082
1100
|
metadata: {},
|
|
1083
1101
|
_extend: {
|
|
1084
|
-
productsByUid: {}
|
|
1102
|
+
productsByUid: {},
|
|
1103
|
+
salesNotesState: {
|
|
1104
|
+
loaded: true,
|
|
1105
|
+
dirty: false
|
|
1106
|
+
}
|
|
1085
1107
|
}
|
|
1086
1108
|
};
|
|
1087
1109
|
}
|
|
1110
|
+
function hasBoundBookingResource(bookings) {
|
|
1111
|
+
if (!Array.isArray(bookings)) return false;
|
|
1112
|
+
return bookings.some(function (booking) {
|
|
1113
|
+
if (!booking || _typeof(booking) !== 'object') return false;
|
|
1114
|
+
if (Number(booking.parent_id) === 0) return false;
|
|
1115
|
+
var resources = booking.resources;
|
|
1116
|
+
if (!Array.isArray(resources)) return false;
|
|
1117
|
+
return resources.some(function (resource) {
|
|
1118
|
+
var _relation_id;
|
|
1119
|
+
if (!resource || _typeof(resource) !== 'object') return false;
|
|
1120
|
+
var relationId = String((_relation_id = resource.relation_id) !== null && _relation_id !== void 0 ? _relation_id : '').trim();
|
|
1121
|
+
return relationId !== '' && relationId !== '0';
|
|
1122
|
+
});
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
function isPersistedSubmitOrderId(orderId) {
|
|
1126
|
+
if (orderId === undefined || orderId === null || orderId === '') return false;
|
|
1127
|
+
var normalizedOrderId = Number(orderId);
|
|
1128
|
+
return Number.isFinite(normalizedOrderId) && normalizedOrderId > 0;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* 解析 checkout 的订单类型。
|
|
1133
|
+
* dine_in 普通落库单在新增桌台资源后,即使原类型仍是 virtual,也必须按 table-order 提交。
|
|
1134
|
+
*/
|
|
1135
|
+
export function resolveSubmitOrderType(params) {
|
|
1136
|
+
var requestedType = params.requestedType,
|
|
1137
|
+
tempOrderType = params.tempOrderType,
|
|
1138
|
+
orderId = params.orderId,
|
|
1139
|
+
businessCode = params.businessCode,
|
|
1140
|
+
tempOrderBusinessCode = params.tempOrderBusinessCode,
|
|
1141
|
+
bookings = params.bookings;
|
|
1142
|
+
var currentType = requestedType !== null && requestedType !== void 0 ? requestedType : tempOrderType;
|
|
1143
|
+
var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrderBusinessCode;
|
|
1144
|
+
if (isPersistedSubmitOrderId(orderId) && resolvedBusinessCode === 'dine_in' && currentType === 'virtual' && hasBoundBookingResource(bookings)) {
|
|
1145
|
+
return 'table-order';
|
|
1146
|
+
}
|
|
1147
|
+
if (currentType) return currentType;
|
|
1148
|
+
if (Array.isArray(bookings) && bookings.length > 0) {
|
|
1149
|
+
return businessCode === 'dine_in' ? 'table-order' : 'appointment_booking';
|
|
1150
|
+
}
|
|
1151
|
+
return 'virtual';
|
|
1152
|
+
}
|
|
1088
1153
|
export function buildSubmitPayload(params) {
|
|
1089
|
-
var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _enhancedPayload$summ;
|
|
1154
|
+
var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _tempOrder$_extend, _enhancedPayload$summ;
|
|
1090
1155
|
var tempOrder = params.tempOrder,
|
|
1091
1156
|
cacheId = params.cacheId,
|
|
1092
1157
|
_params$now = params.now,
|
|
@@ -1118,23 +1183,18 @@ export function buildSubmitPayload(params) {
|
|
|
1118
1183
|
_totalRefundAmount = _ref30.total_refund_amount,
|
|
1119
1184
|
_createDate = _ref30.create_date,
|
|
1120
1185
|
_holderId = _ref30.holder_id,
|
|
1186
|
+
_notes = _ref30.notes,
|
|
1121
1187
|
tempOrderRest = _objectWithoutProperties(_ref30, _excluded4);
|
|
1122
|
-
var
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1133
|
-
} else {
|
|
1134
|
-
submitType = 'virtual';
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
var payload = _objectSpread(_objectSpread({}, tempOrderRest), {}, {
|
|
1188
|
+
var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code;
|
|
1189
|
+
var submitType = resolveSubmitOrderType({
|
|
1190
|
+
requestedType: type,
|
|
1191
|
+
tempOrderType: tempOrder.type,
|
|
1192
|
+
orderId: tempOrder.order_id,
|
|
1193
|
+
businessCode: businessCode,
|
|
1194
|
+
tempOrderBusinessCode: tempOrder.business_code,
|
|
1195
|
+
bookings: tempOrder.bookings
|
|
1196
|
+
});
|
|
1197
|
+
var payload = _objectSpread(_objectSpread(_objectSpread({}, tempOrderRest), {}, {
|
|
1138
1198
|
customer_id: (_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : 1,
|
|
1139
1199
|
customer_name: tempOrder.customer_name || 'Walk-In',
|
|
1140
1200
|
country_calling_code: String((_tempOrder$country_ca = tempOrder.country_calling_code) !== null && _tempOrder$country_ca !== void 0 ? _tempOrder$country_ca : ''),
|
|
@@ -1146,7 +1206,7 @@ export function buildSubmitPayload(params) {
|
|
|
1146
1206
|
platform: normalizeSubmitPlatform(platform),
|
|
1147
1207
|
request_unique_idempotency_token: (params === null || params === void 0 ? void 0 : params.request_unique_idempotency_token) || tempOrder.request_unique_idempotency_token || "".concat(tempOrder.external_sale_number, "_").concat(now.getTime()),
|
|
1148
1208
|
type: submitType,
|
|
1149
|
-
business_code:
|
|
1209
|
+
business_code: resolvedBusinessCode,
|
|
1150
1210
|
sales_channel: tempOrder.sales_channel || 'my_pisel',
|
|
1151
1211
|
order_sales_channel: (_ref31 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref31 !== void 0 ? _ref31 : 'online_store',
|
|
1152
1212
|
status: tempOrder.status || 'normal',
|
|
@@ -1179,7 +1239,12 @@ export function buildSubmitPayload(params) {
|
|
|
1179
1239
|
_tableOccupancyDuration = _ref32.table_occupancy_duration,
|
|
1180
1240
|
rest = _objectWithoutProperties(_ref32, _excluded5);
|
|
1181
1241
|
return _objectSpread({}, rest);
|
|
1182
|
-
}()
|
|
1242
|
+
}()
|
|
1243
|
+
}, (_tempOrder$_extend = tempOrder._extend) !== null && _tempOrder$_extend !== void 0 && (_tempOrder$_extend = _tempOrder$_extend.salesNotesState) !== null && _tempOrder$_extend !== void 0 && _tempOrder$_extend.dirty ? {
|
|
1244
|
+
notes: encodeSalesNotes(tempOrder.notes || [], {
|
|
1245
|
+
allowUnresolvedOrderTarget: true
|
|
1246
|
+
})
|
|
1247
|
+
} : {}), {}, {
|
|
1183
1248
|
products: (tempOrder.products || []).map(function (product) {
|
|
1184
1249
|
return normalizeSubmitProduct(product);
|
|
1185
1250
|
})
|
|
@@ -1307,7 +1372,7 @@ export function hasAssignedHolderId(value) {
|
|
|
1307
1372
|
* clearTempOrderHolderAssignments(tempOrder);
|
|
1308
1373
|
*/
|
|
1309
1374
|
export function clearTempOrderHolderAssignments(tempOrder) {
|
|
1310
|
-
var _tempOrder$
|
|
1375
|
+
var _tempOrder$_extend2;
|
|
1311
1376
|
var changed = false;
|
|
1312
1377
|
var resetHolderField = function resetHolderField(target) {
|
|
1313
1378
|
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'holder_id';
|
|
@@ -1348,7 +1413,7 @@ export function clearTempOrderHolderAssignments(tempOrder) {
|
|
|
1348
1413
|
} finally {
|
|
1349
1414
|
_iterator9.f();
|
|
1350
1415
|
}
|
|
1351
|
-
var productsByUid = (_tempOrder$
|
|
1416
|
+
var productsByUid = (_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2.productsByUid;
|
|
1352
1417
|
if (productsByUid && _typeof(productsByUid) === 'object') {
|
|
1353
1418
|
for (var _i4 = 0, _Object$values = Object.values(productsByUid); _i4 < _Object$values.length; _i4++) {
|
|
1354
1419
|
var entry = _Object$values[_i4];
|
|
@@ -1379,9 +1444,9 @@ export function getOrderProductLineUid(product) {
|
|
|
1379
1444
|
return String(uid);
|
|
1380
1445
|
}
|
|
1381
1446
|
export function getRuntimeProductOrigin(tempOrder, product) {
|
|
1382
|
-
var _tempOrder$
|
|
1447
|
+
var _tempOrder$_extend3, _tempOrder$_extend4;
|
|
1383
1448
|
var uid = getOrderProductLineUid(product);
|
|
1384
|
-
if (uid && tempOrder !== null && tempOrder !== void 0 && (_tempOrder$
|
|
1449
|
+
if (uid && tempOrder !== null && tempOrder !== void 0 && (_tempOrder$_extend3 = tempOrder._extend) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3[uid]) !== null && _tempOrder$_extend3 !== void 0 && _tempOrder$_extend3.origin) {
|
|
1385
1450
|
return tempOrder._extend.productsByUid[uid].origin;
|
|
1386
1451
|
}
|
|
1387
1452
|
var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
|
|
@@ -1389,7 +1454,7 @@ export function getRuntimeProductOrigin(tempOrder, product) {
|
|
|
1389
1454
|
return item === product || getOrderProductLineUid(item) === uid || String((_ref33 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref33 !== void 0 ? _ref33 : '') === String((_ref34 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref34 !== void 0 ? _ref34 : '');
|
|
1390
1455
|
});
|
|
1391
1456
|
var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
|
|
1392
|
-
return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$
|
|
1457
|
+
return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[matchedUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin) || null : null;
|
|
1393
1458
|
}
|
|
1394
1459
|
export function isHolderConfigRequired(holderConfig) {
|
|
1395
1460
|
if (!holderConfig || _typeof(holderConfig) !== 'object') return false;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PisellCore } from '../../types';
|
|
2
|
+
import type { RequestPlugin } from '../../plugins';
|
|
3
|
+
import type { ProductData } from '../Product/types';
|
|
4
|
+
export declare const PRODUCT_QUERY_DATA_VARIANT_RELATIONS: readonly ["category", "collection", "resourceRelation", "bundleGroup.bundleItem", "optionGroup.optionItem", "variantGroup.variantItem", "dataVariants"];
|
|
5
|
+
/**
|
|
6
|
+
* 判断当前商品查询是否会被本地 OS Server 接管。
|
|
7
|
+
*
|
|
8
|
+
* H5 RequestPlugin 即使收到 osServer=true 仍会直接请求远端接口,因此必须按
|
|
9
|
+
* RequestPlugin 实际 baseUrl 对应的已注册路由判断,不能只看请求选项。
|
|
10
|
+
*/
|
|
11
|
+
export declare function isProductQueryHandledByOsServer(core: PisellCore | undefined, request: RequestPlugin | undefined): boolean;
|
|
12
|
+
export interface ResolveClientDataVariantsParams {
|
|
13
|
+
core: PisellCore | undefined;
|
|
14
|
+
otherParams?: Record<string, any>;
|
|
15
|
+
products: ProductData[];
|
|
16
|
+
queryPayload: Record<string, any>;
|
|
17
|
+
handledByOsServer: boolean;
|
|
18
|
+
scheduleList?: unknown;
|
|
19
|
+
menuList?: unknown;
|
|
20
|
+
/** Quote fast paths require hydrated relations; legacy list resolution does not. */
|
|
21
|
+
requireCompleteDataVariantRelations?: boolean;
|
|
22
|
+
/** Quote fast paths require every referenced rule; legacy list resolution is best-effort. */
|
|
23
|
+
requireEvaluatorReady?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type ResolveClientDataVariantsResult = {
|
|
26
|
+
status: 'handled-by-os-server' | 'empty' | 'data-variants-unavailable' | 'evaluator-unavailable' | 'evaluator-not-ready';
|
|
27
|
+
products: ProductData[];
|
|
28
|
+
} | {
|
|
29
|
+
status: 'resolved';
|
|
30
|
+
products: ProductData[];
|
|
31
|
+
} | {
|
|
32
|
+
status: 'error';
|
|
33
|
+
products: ProductData[];
|
|
34
|
+
error: unknown;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Strict client-side Data Variant resolution for quote fast paths.
|
|
38
|
+
*
|
|
39
|
+
* Unlike resolveClientDataVariants, callers can distinguish a complete local
|
|
40
|
+
* result from a capability/readiness/error fallback and decide to query the
|
|
41
|
+
* remote product endpoint instead.
|
|
42
|
+
*/
|
|
43
|
+
export declare function tryResolveClientDataVariants({ core, otherParams, products, queryPayload, handledByOsServer, scheduleList: explicitScheduleList, menuList: explicitMenuList, requireCompleteDataVariantRelations, requireEvaluatorReady, }: ResolveClientDataVariantsParams): ResolveClientDataVariantsResult;
|
|
44
|
+
/**
|
|
45
|
+
* 未启用商品 OS 路由时,在客户端补做 Data Variant 解析。
|
|
46
|
+
*
|
|
47
|
+
* 商品列表和预约报价必须共用这个边界,避免 H5 的弹窗报价绕过客户端智能定价。
|
|
48
|
+
* OS Server 已接管时直接信任服务端结果,确保同一批商品只评估一次。
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveClientDataVariants({ core, otherParams, products, queryPayload, handledByOsServer, scheduleList: explicitScheduleList, menuList: explicitMenuList, }: ResolveClientDataVariantsParams): ProductData[];
|