@pisell/pisellos 0.10.57 → 0.10.59
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/inventory/index.d.ts +92 -0
- package/dist/inventory/index.js +500 -0
- package/dist/modules/Order/index.d.ts +20 -3
- package/dist/modules/Order/index.js +1369 -1021
- package/dist/modules/Order/types.d.ts +5 -0
- package/dist/modules/Order/utils.d.ts +5 -3
- package/dist/modules/Order/utils.js +32 -11
- package/dist/modules/ProductList/index.js +40 -17
- package/dist/solution/BaseSales/index.d.ts +8 -0
- package/dist/solution/BaseSales/index.js +1382 -1207
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.js +58 -38
- package/lib/index.d.ts +1 -0
- package/lib/index.js +12 -0
- package/lib/inventory/index.d.ts +92 -0
- package/lib/inventory/index.js +280 -0
- package/lib/modules/Order/index.d.ts +20 -3
- package/lib/modules/Order/index.js +111 -19
- package/lib/modules/Order/types.d.ts +5 -0
- package/lib/modules/Order/utils.d.ts +5 -3
- package/lib/modules/Order/utils.js +29 -10
- package/lib/modules/ProductList/index.js +21 -4
- package/lib/solution/BaseSales/index.d.ts +8 -0
- package/lib/solution/BaseSales/index.js +82 -7
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.js +11 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrde
|
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
6
|
import { type PickupTimingBooking, type PickupTimingBookingInput } from './pickupTiming';
|
|
7
|
-
import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderCartIntentCommitContext, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
|
|
7
|
+
import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderHooksConfig, OrderCartIntentCommitContext, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
|
|
8
8
|
import type { ICustomer } from '../AccountList/types';
|
|
9
9
|
import type { Discount } from '../Discount/types';
|
|
10
10
|
import { UnavailableReason } from '../Rules/types';
|
|
@@ -29,6 +29,12 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
29
29
|
private rulesHooksOverride?;
|
|
30
30
|
private moduleHooksOverride?;
|
|
31
31
|
private orderHooks?;
|
|
32
|
+
private cartCommandQueue;
|
|
33
|
+
private queueCartCommand;
|
|
34
|
+
/** Use the exact Order normalizers/merge rules on a private draft, not a second projection. */
|
|
35
|
+
private beginCartMutation;
|
|
36
|
+
/** Serializes checkout preparation with local cart commands; hydration remains outside this guard. */
|
|
37
|
+
prepareCheckout<T>(prepare: (items: OrderProduct[]) => Promise<T>): Promise<T>;
|
|
32
38
|
private otherParams?;
|
|
33
39
|
/** 评估器引用;由 SalesSdkProvider 注入,未注入时 applyPromotion 静默跳过 */
|
|
34
40
|
private promotionEvaluator;
|
|
@@ -66,7 +72,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
66
72
|
* @example
|
|
67
73
|
* orderModule.updateOtherParams({ cacheId: 'cache-2', channel: 'pos' });
|
|
68
74
|
*/
|
|
69
|
-
updateOtherParams(params: Record<string, any
|
|
75
|
+
updateOtherParams(params: Record<string, any>, options?: {
|
|
76
|
+
hooks?: OrderHooksConfig;
|
|
77
|
+
changedParams?: Record<string, any>;
|
|
78
|
+
cover?: boolean;
|
|
79
|
+
}): void;
|
|
70
80
|
/** Internal intent boundary shared with asynchronous scanner/detail flows. */
|
|
71
81
|
createCartIntentCommitGuard(action: OrderCartIntentCommitContext['action'], tempOrder?: OrderTempOrder | null): () => void;
|
|
72
82
|
/** PC/H5 属于在线店铺;其它或缺失平台统一沿用 POS 行为。 */
|
|
@@ -481,6 +491,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
481
491
|
* // → tempOrder.products 新增 3 行,每行 num=1,bookings 3 条
|
|
482
492
|
*/
|
|
483
493
|
addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<OrderProduct[]>;
|
|
494
|
+
private addProductToOrderDraft;
|
|
484
495
|
/**
|
|
485
496
|
* 批量添加商品行,所有行追加完成后只触发一次促销、折扣、summary 重算与持久化。
|
|
486
497
|
*
|
|
@@ -496,6 +507,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
496
507
|
}>, options?: {
|
|
497
508
|
skipEditDiscountConfigRefresh?: boolean;
|
|
498
509
|
}): Promise<OrderProduct[]>;
|
|
510
|
+
private addProductsToOrderDraft;
|
|
499
511
|
private getFullCoveragePassDiscounts;
|
|
500
512
|
private hasEntitlementPassDiscount;
|
|
501
513
|
private hasGoodPassDiscount;
|
|
@@ -507,8 +519,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
507
519
|
private isRestrictedCartProductUpdate;
|
|
508
520
|
private applyOrderProductUpdateToTempOrder;
|
|
509
521
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<OrderProduct[]>;
|
|
522
|
+
private updateOrderProductDraft;
|
|
510
523
|
updateOrderProducts(paramsList: UpdateOrderProductParams[]): Promise<OrderProduct[]>;
|
|
524
|
+
private updateOrderProductsDraft;
|
|
511
525
|
updateOrderProductQuantity(params: UpdateOrderProductQuantityParams): Promise<OrderProduct[]>;
|
|
526
|
+
private updateOrderProductQuantityDraft;
|
|
512
527
|
updateOrderBooking(params: UpdateOrderBookingParams): any[];
|
|
513
528
|
/**
|
|
514
529
|
* 商品行写路径收尾:促销 → 折扣 → 清洗 → summary → 持久化。
|
|
@@ -525,12 +540,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
525
540
|
* await order.removeProductsFromOrder([identityA, identityB]);
|
|
526
541
|
*/
|
|
527
542
|
removeProductsFromOrder(identities: OrderProductIdentity[], options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
|
|
543
|
+
private removeProductsFromOrderDraft;
|
|
528
544
|
removeProductFromOrder(identity: OrderProductIdentity, options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
|
|
529
545
|
/**
|
|
530
546
|
* 仅清空购物车行(products / bookings),不重置整单。
|
|
531
547
|
* 普通整单 note 保持不变;以商品行为主体的 Sales Notes 同步删除。
|
|
532
548
|
*/
|
|
533
549
|
clearOrderCartLines(): Promise<OrderTempOrder>;
|
|
550
|
+
private clearOrderCartLinesDraft;
|
|
534
551
|
/**
|
|
535
552
|
* 切换购物车结算单位时清理所有会影响新币种的订单状态,但保留当前客户。
|
|
536
553
|
*/
|
|
@@ -592,7 +609,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
592
609
|
generateIdempotencyToken(): string;
|
|
593
610
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
594
611
|
createOrder(params: CommitOrderParams['query']): {
|
|
595
|
-
type: "
|
|
612
|
+
type: "appointment_booking" | "virtual";
|
|
596
613
|
platform: string;
|
|
597
614
|
sales_channel: string;
|
|
598
615
|
order_sales_channel: string;
|