@pisell/pisellos 2.1.150 → 2.1.151
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/model/strategy/adapter/promotion/evaluator.js +99 -26
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +61 -8
- package/dist/model/strategy/adapter/walletPass/locales.js +12 -3
- package/dist/model/strategy/engine.d.ts +18 -5
- package/dist/model/strategy/engine.js +145 -45
- package/dist/model/strategy/type.d.ts +17 -0
- package/dist/model/strategy/type.js +4 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +56 -25
- package/dist/modules/Discount/index.d.ts +2 -6
- package/dist/modules/Discount/index.js +8 -14
- package/dist/modules/Discount/types.d.ts +19 -1
- package/dist/modules/Order/index.d.ts +1 -65
- package/dist/modules/Order/index.js +30 -901
- package/dist/modules/Order/types.d.ts +12 -174
- package/dist/modules/Order/types.js +0 -2
- package/dist/modules/Order/utils.d.ts +0 -118
- package/dist/modules/Order/utils.js +2 -586
- package/dist/modules/Payment/index.d.ts +2 -1
- package/dist/modules/Payment/index.js +10 -7
- package/dist/modules/Payment/utils.js +3 -0
- package/dist/modules/Payment/walletpass.d.ts +23 -0
- package/dist/modules/Payment/walletpass.js +191 -95
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +3 -4
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +677 -168
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +18 -11
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/types.d.ts +2 -0
- package/dist/modules/Summary/utils.d.ts +9 -3
- package/dist/modules/Summary/utils.js +52 -41
- package/dist/modules/index.d.ts +0 -4
- package/dist/modules/index.js +1 -5
- package/dist/plugins/window.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +3 -2
- package/dist/solution/BookingByStep/index.js +43 -46
- package/dist/solution/BookingByStep/types.d.ts +1 -3
- package/dist/solution/BookingByStep/types.js +1 -5
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/Checkout/index.js +2 -0
- package/dist/solution/ShopDiscount/index.d.ts +2 -2
- package/dist/solution/ShopDiscount/index.js +41 -37
- package/dist/solution/ShopDiscount/types.d.ts +1 -1
- package/dist/solution/ShopDiscount/types.js +2 -1
- package/dist/solution/ShopDiscount/utils.js +26 -12
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +34 -3
- package/lib/model/strategy/adapter/walletPass/locales.js +12 -3
- package/lib/model/strategy/engine.d.ts +18 -5
- package/lib/model/strategy/engine.js +85 -21
- package/lib/model/strategy/type.d.ts +17 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +39 -12
- package/lib/modules/Discount/index.d.ts +2 -6
- package/lib/modules/Discount/index.js +1 -3
- package/lib/modules/Discount/types.d.ts +19 -1
- package/lib/modules/Order/index.d.ts +1 -65
- package/lib/modules/Order/index.js +1 -513
- package/lib/modules/Order/types.d.ts +12 -174
- package/lib/modules/Order/utils.d.ts +0 -118
- package/lib/modules/Order/utils.js +2 -483
- package/lib/modules/Payment/index.d.ts +2 -1
- package/lib/modules/Payment/index.js +1 -0
- package/lib/modules/Payment/utils.js +3 -0
- package/lib/modules/Payment/walletpass.d.ts +23 -0
- package/lib/modules/Payment/walletpass.js +94 -17
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +3 -5
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +780 -288
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +11 -9
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/types.d.ts +2 -0
- package/lib/modules/Summary/utils.d.ts +9 -3
- package/lib/modules/Summary/utils.js +31 -22
- package/lib/modules/index.d.ts +0 -4
- package/lib/modules/index.js +1 -9
- package/lib/plugins/window.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +3 -2
- package/lib/solution/BookingByStep/index.js +4 -6
- package/lib/solution/BookingByStep/types.d.ts +1 -3
- package/lib/solution/BookingByStep/types.js +0 -10
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/Checkout/index.js +2 -0
- package/lib/solution/ShopDiscount/index.d.ts +2 -2
- package/lib/solution/ShopDiscount/index.js +24 -16
- package/lib/solution/ShopDiscount/types.d.ts +1 -1
- package/lib/solution/ShopDiscount/utils.js +10 -6
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/package.json +1 -1
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +0 -1
- package/dist/modules/OpenData/index.d.ts +0 -24
- package/dist/modules/OpenData/index.js +0 -173
- package/dist/modules/OpenData/types.d.ts +0 -73
- package/dist/modules/OpenData/types.js +0 -1
- package/dist/modules/OpenData/utils.d.ts +0 -2
- package/dist/modules/OpenData/utils.js +0 -75
- package/dist/modules/Quotation/index.d.ts +0 -48
- package/dist/modules/Quotation/index.js +0 -248
- package/dist/modules/Quotation/types.d.ts +0 -42
- package/dist/modules/Quotation/types.js +0 -1
- package/dist/modules/SalesSummary/index.d.ts +0 -63
- package/dist/modules/SalesSummary/index.js +0 -174
- package/dist/modules/SalesSummary/types.d.ts +0 -60
- package/dist/modules/SalesSummary/types.js +0 -1
- package/dist/modules/SalesSummary/utils.d.ts +0 -30
- package/dist/modules/SalesSummary/utils.js +0 -480
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -23
- package/dist/modules/ScanOrderLogger/index.js +0 -174
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +0 -221
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/grafana.js +0 -50
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
- package/dist/modules/ScanOrderLogger/types.js +0 -1
- package/dist/solution/ScanOrder/index.d.ts +0 -152
- package/dist/solution/ScanOrder/index.js +0 -3132
- package/dist/solution/ScanOrder/types.d.ts +0 -287
- package/dist/solution/ScanOrder/types.js +0 -35
- package/dist/solution/ScanOrder/utils.d.ts +0 -167
- package/dist/solution/ScanOrder/utils.js +0 -764
- package/dist/solution/VenueBooking/index.d.ts +0 -199
- package/dist/solution/VenueBooking/index.js +0 -3459
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/dist/solution/VenueBooking/types.d.ts +0 -154
- package/dist/solution/VenueBooking/types.js +0 -21
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/dist/solution/VenueBooking/utils/dateSummary.js +0 -104
- package/dist/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/dist/solution/VenueBooking/utils/resource.js +0 -131
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -38
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -239
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
- package/dist/solution/VenueBooking/utils/timeSlot.js +0 -453
- package/dist/solution/VenueBooking/utils.d.ts +0 -1
- package/dist/solution/VenueBooking/utils.js +0 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/modules/OpenData/index.d.ts +0 -24
- package/lib/modules/OpenData/index.js +0 -119
- package/lib/modules/OpenData/types.d.ts +0 -73
- package/lib/modules/OpenData/types.js +0 -17
- package/lib/modules/OpenData/utils.d.ts +0 -2
- package/lib/modules/OpenData/utils.js +0 -111
- package/lib/modules/Quotation/index.d.ts +0 -48
- package/lib/modules/Quotation/index.js +0 -152
- package/lib/modules/Quotation/types.d.ts +0 -42
- package/lib/modules/Quotation/types.js +0 -17
- package/lib/modules/SalesSummary/index.d.ts +0 -63
- package/lib/modules/SalesSummary/index.js +0 -105
- package/lib/modules/SalesSummary/types.d.ts +0 -60
- package/lib/modules/SalesSummary/types.js +0 -17
- package/lib/modules/SalesSummary/utils.d.ts +0 -30
- package/lib/modules/SalesSummary/utils.js +0 -420
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -23
- package/lib/modules/ScanOrderLogger/index.js +0 -147
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/feishu.js +0 -157
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/grafana.js +0 -52
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
- package/lib/modules/ScanOrderLogger/types.js +0 -17
- package/lib/solution/ScanOrder/index.d.ts +0 -152
- package/lib/solution/ScanOrder/index.js +0 -1901
- package/lib/solution/ScanOrder/types.d.ts +0 -287
- package/lib/solution/ScanOrder/types.js +0 -36
- package/lib/solution/ScanOrder/utils.d.ts +0 -167
- package/lib/solution/ScanOrder/utils.js +0 -635
- package/lib/solution/VenueBooking/index.d.ts +0 -199
- package/lib/solution/VenueBooking/index.js +0 -1926
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/lib/solution/VenueBooking/types.d.ts +0 -154
- package/lib/solution/VenueBooking/types.js +0 -44
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/lib/solution/VenueBooking/utils/dateSummary.js +0 -110
- package/lib/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/lib/solution/VenueBooking/utils/resource.js +0 -92
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -38
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -237
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
- package/lib/solution/VenueBooking/utils/timeSlot.js +0 -339
- package/lib/solution/VenueBooking/utils.d.ts +0 -1
- package/lib/solution/VenueBooking/utils.js +0 -69
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { OrderModuleAPI, CommitOrderParams,
|
|
3
|
+
import { OrderModuleAPI, CommitOrderParams, CheckoutOrderParams } from './types';
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
|
-
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
|
-
import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderSummary, ScanOrderTempOrder } from '../../solution/ScanOrder/types';
|
|
7
|
-
import type { Discount } from '../Discount/types';
|
|
8
|
-
import { UnavailableReason } from '../Rules/types';
|
|
9
5
|
export declare class OrderModule extends BaseModule implements Module, OrderModuleAPI {
|
|
10
6
|
protected defaultName: string;
|
|
11
7
|
protected defaultVersion: string;
|
|
12
8
|
private store;
|
|
13
9
|
private request;
|
|
14
10
|
private logger;
|
|
15
|
-
private window;
|
|
16
|
-
private cacheId;
|
|
17
|
-
private salesSummaryModuleName;
|
|
18
|
-
private rulesHooksOverride?;
|
|
19
|
-
/**
|
|
20
|
-
* Populate `savedAmount` on each discount based on product-level discount details.
|
|
21
|
-
* Only selected discounts get a non-zero value.
|
|
22
|
-
*/
|
|
23
|
-
static populateSavedAmounts(productList: Array<Record<string, any>>, discountList: Array<Record<string, any>>): void;
|
|
24
11
|
constructor(name?: string, version?: string);
|
|
25
12
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
26
13
|
/**
|
|
@@ -35,52 +22,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
35
22
|
* 记录错误日志
|
|
36
23
|
*/
|
|
37
24
|
private logError;
|
|
38
|
-
private registerDiscountModules;
|
|
39
|
-
private createDefaultRulesHooks;
|
|
40
|
-
loadDiscountConfig(params: {
|
|
41
|
-
customerId: number;
|
|
42
|
-
action?: 'create';
|
|
43
|
-
}): Promise<void>;
|
|
44
|
-
getDiscountList(): Discount[];
|
|
45
|
-
scanCode(code: string, customerId?: number): Promise<{
|
|
46
|
-
isAvailable: boolean;
|
|
47
|
-
discountList: Discount[];
|
|
48
|
-
type: 'server' | 'clientCalc';
|
|
49
|
-
unavailableReason?: UnavailableReason;
|
|
50
|
-
}>;
|
|
51
|
-
applyDiscount(): void;
|
|
52
|
-
initTempOrder(params: {
|
|
53
|
-
cacheId?: string;
|
|
54
|
-
salesSummaryModuleName?: string;
|
|
55
|
-
}): void;
|
|
56
|
-
private getTempOrderStorageKey;
|
|
57
|
-
private restoreTempOrderFromStorage;
|
|
58
|
-
persistTempOrder(): void;
|
|
59
|
-
private createDefaultTempOrderInstance;
|
|
60
|
-
ensureTempOrder(): ScanOrderTempOrder;
|
|
61
|
-
restoreOrder(): ScanOrderTempOrder;
|
|
62
|
-
getTempOrder(): ScanOrderTempOrder | null;
|
|
63
|
-
addNewOrder(): Promise<ScanOrderTempOrder>;
|
|
64
|
-
getOrderProducts(): ScanOrderOrderProduct[];
|
|
65
|
-
private getSalesSummary;
|
|
66
|
-
recalculateSummary(options?: {
|
|
67
|
-
createIfMissing?: boolean;
|
|
68
|
-
}): Promise<ScanOrderSummary | null>;
|
|
69
|
-
getScanOrderSummary(): Promise<ScanOrderSummary>;
|
|
70
|
-
updateTempOrderNote(note: string): string;
|
|
71
|
-
updateTempOrderBuzzer(buzzer: string): string;
|
|
72
|
-
updateTempOrderContactsInfo(contactsInfo: any[]): any[];
|
|
73
|
-
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
74
|
-
updateProductInOrder(params: UpdateProductInOrderParams): Promise<ScanOrderOrderProduct[]>;
|
|
75
|
-
removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
76
|
-
submitTempOrder<T = any>(params?: {
|
|
77
|
-
cacheId?: string;
|
|
78
|
-
platform?: string;
|
|
79
|
-
businessCode?: string;
|
|
80
|
-
channel?: string;
|
|
81
|
-
type?: string;
|
|
82
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
83
|
-
}): Promise<T>;
|
|
84
25
|
createOrder(params: CommitOrderParams['query']): {
|
|
85
26
|
type: "virtual" | "appointment_booking";
|
|
86
27
|
platform: string;
|
|
@@ -110,9 +51,4 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
110
51
|
* @returns 后端返回的订单数据(包含订单ID等)
|
|
111
52
|
*/
|
|
112
53
|
createOrderByCheckout(params: CheckoutOrderParams): Promise<any>;
|
|
113
|
-
submitScanOrder<T = any>(params: SubmitScanOrderParams): Promise<T>;
|
|
114
|
-
scanOrderMore<T = any>(params: ScanOrderMoreParams): Promise<T>;
|
|
115
|
-
getOrderInfoByRemote(order_id: number): Promise<any>;
|
|
116
|
-
getLastOrderInfo(): Record<string, any> | undefined;
|
|
117
54
|
}
|
|
118
|
-
export type { UpdateProductInOrderParams } from './types';
|