@pisell/pisellos 0.10.74 → 0.10.76
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/Product/index.d.ts +1 -1
- package/dist/server/index.js +14 -9
- package/dist/shared/receipt/small-ticket.d.ts +3 -0
- package/dist/shared/receipt/small-ticket.js +23 -2
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +13 -1
- package/dist/solution/OrderInvoicePreview/index.js +13 -8
- package/dist/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
- package/dist/solution/UnifiedBookingSales/catalogQueryBatch.js +202 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +8 -1
- package/dist/solution/UnifiedBookingSales/index.js +680 -557
- package/dist/solution/UnifiedBookingSales/types.d.ts +9 -0
- package/dist/solution/UnifiedBookingSales/types.js +2 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/server/index.js +5 -0
- package/lib/shared/receipt/small-ticket.d.ts +3 -0
- package/lib/shared/receipt/small-ticket.js +21 -0
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +13 -1
- package/lib/solution/OrderInvoicePreview/index.js +6 -1
- package/lib/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
- package/lib/solution/UnifiedBookingSales/catalogQueryBatch.js +109 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +8 -1
- package/lib/solution/UnifiedBookingSales/index.js +96 -1
- package/lib/solution/UnifiedBookingSales/types.d.ts +9 -0
- package/lib/solution/UnifiedBookingSales/types.js +1 -0
- package/package.json +1 -1
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/effects/index.d.ts +0 -19
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -173
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -70
- package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -224
- package/dist/model/strategy/adapter/promotion/type.d.ts +0 -535
- package/dist/model/strategy/adapter/type.d.ts +0 -28
- package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
- package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -192
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
- package/dist/model/strategy/engine.d.ts +0 -119
- package/dist/model/strategy/type.d.ts +0 -245
- package/dist/modules/Account/types.d.ts +0 -56
- package/dist/modules/BookingContext/types.d.ts +0 -104
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/dist/modules/Customer/constants.d.ts +0 -7
- package/dist/modules/Date/types.d.ts +0 -84
- package/dist/modules/Date/utils.d.ts +0 -36
- package/dist/modules/FulfillmentTiming/index.d.ts +0 -11
- package/dist/modules/FulfillmentTiming/types.d.ts +0 -67
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/pickupTiming.d.ts +0 -46
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
- package/dist/modules/Order/utils/weighedProduct.d.ts +0 -12
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/types.d.ts +0 -943
- package/dist/modules/Payment/utils.d.ts +0 -19
- package/dist/modules/Quotation/types.d.ts +0 -61
- package/dist/modules/Resource/types.d.ts +0 -50
- package/dist/modules/Resource/utils.d.ts +0 -23
- package/dist/modules/ResourcePlanner/localClock.d.ts +0 -33
- package/dist/modules/SalesSummary/types.d.ts +0 -69
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
- package/dist/modules/Schedule/type.d.ts +0 -157
- package/dist/modules/Schedule/types.d.ts +0 -201
- package/dist/modules/Schedule/utils.d.ts +0 -67
- package/dist/modules/Step/tyeps.d.ts +0 -20
- package/dist/modules/SurchargeList/types.d.ts +0 -15
- package/dist/plugins/app.d.ts +0 -10
- package/dist/plugins/shopStore.d.ts +0 -4
- package/dist/plugins/user.d.ts +0 -7
- package/dist/server/modules/floor-plan/types.d.ts +0 -43
- package/dist/server/modules/menu/types.d.ts +0 -68
- package/dist/server/modules/payment/types.d.ts +0 -9
- package/dist/server/modules/quotation/types.d.ts +0 -50
- package/dist/server/modules/resource/types.d.ts +0 -121
- package/dist/server/modules/schedule/types.d.ts +0 -1
- package/dist/server/modules/schedule/utils.d.ts +0 -32
- package/dist/server/types.d.ts +0 -66
- package/dist/server/utils/index.d.ts +0 -5
- package/dist/server/utils/schedule.d.ts +0 -14
- package/dist/server/utils/time.d.ts +0 -18
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
- package/dist/solution/PlaceOrder/index.d.ts +0 -0
- package/dist/solution/RegisterAndLogin/config.d.ts +0 -93
- package/dist/solution/RegisterAndLogin/types.d.ts +0 -445
- package/dist/solution/RegisterAndLogin/utils.d.ts +0 -103
- package/dist/store/createStore.d.ts +0 -3
- package/dist/types/index.d.ts +0 -132
- package/dist/utils/os-private-payload.d.ts +0 -5
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/task.d.ts +0 -40
- package/dist/utils/watch.d.ts +0 -102
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/effects/index.d.ts +0 -19
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -173
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -70
- package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -224
- package/lib/model/strategy/adapter/promotion/type.d.ts +0 -535
- package/lib/model/strategy/adapter/type.d.ts +0 -28
- package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
- package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -192
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
- package/lib/model/strategy/engine.d.ts +0 -119
- package/lib/model/strategy/type.d.ts +0 -245
- package/lib/modules/Account/types.d.ts +0 -56
- package/lib/modules/BookingContext/types.d.ts +0 -104
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/lib/modules/Customer/constants.d.ts +0 -7
- package/lib/modules/Date/types.d.ts +0 -84
- package/lib/modules/Date/utils.d.ts +0 -36
- package/lib/modules/FulfillmentTiming/index.d.ts +0 -11
- package/lib/modules/FulfillmentTiming/types.d.ts +0 -67
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/pickupTiming.d.ts +0 -46
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
- package/lib/modules/Order/utils/weighedProduct.d.ts +0 -12
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/types.d.ts +0 -943
- package/lib/modules/Payment/utils.d.ts +0 -19
- package/lib/modules/Quotation/types.d.ts +0 -61
- package/lib/modules/Resource/types.d.ts +0 -50
- package/lib/modules/Resource/utils.d.ts +0 -23
- package/lib/modules/ResourcePlanner/localClock.d.ts +0 -33
- package/lib/modules/SalesSummary/types.d.ts +0 -69
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
- package/lib/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
- package/lib/modules/Schedule/type.d.ts +0 -157
- package/lib/modules/Schedule/types.d.ts +0 -201
- package/lib/modules/Schedule/utils.d.ts +0 -67
- package/lib/modules/Step/tyeps.d.ts +0 -20
- package/lib/modules/SurchargeList/types.d.ts +0 -15
- package/lib/plugins/app.d.ts +0 -10
- package/lib/plugins/shopStore.d.ts +0 -4
- package/lib/plugins/user.d.ts +0 -7
- package/lib/server/modules/floor-plan/types.d.ts +0 -43
- package/lib/server/modules/menu/types.d.ts +0 -68
- package/lib/server/modules/payment/types.d.ts +0 -9
- package/lib/server/modules/quotation/types.d.ts +0 -50
- package/lib/server/modules/resource/types.d.ts +0 -121
- package/lib/server/modules/schedule/types.d.ts +0 -1
- package/lib/server/modules/schedule/utils.d.ts +0 -32
- package/lib/server/types.d.ts +0 -66
- package/lib/server/utils/index.d.ts +0 -5
- package/lib/server/utils/schedule.d.ts +0 -14
- package/lib/server/utils/time.d.ts +0 -18
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
- package/lib/solution/PlaceOrder/index.d.ts +0 -0
- package/lib/solution/RegisterAndLogin/config.d.ts +0 -93
- package/lib/solution/RegisterAndLogin/types.d.ts +0 -445
- package/lib/solution/RegisterAndLogin/utils.d.ts +0 -103
- package/lib/store/createStore.d.ts +0 -3
- package/lib/types/index.d.ts +0 -132
- package/lib/utils/os-private-payload.d.ts +0 -5
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/task.d.ts +0 -40
- package/lib/utils/watch.d.ts +0 -102
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export type PickupTimingSelectionMode = 'asap' | 'scheduled';
|
|
2
|
-
export type PickupTimingSource = 'asap' | 'schedule' | 'pos_manual';
|
|
3
|
-
export interface PickupTimingBookingInput {
|
|
4
|
-
mode: PickupTimingSelectionMode;
|
|
5
|
-
source: PickupTimingSource;
|
|
6
|
-
/** Store-local calendar date and minute; the caller validates availability. */
|
|
7
|
-
date: string;
|
|
8
|
-
time: string;
|
|
9
|
-
/** Absolute timestamp disambiguates a repeated local minute at a DST change. */
|
|
10
|
-
instant?: string;
|
|
11
|
-
timezone?: string;
|
|
12
|
-
frozen?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface PickupTimingBookingMetadata {
|
|
15
|
-
unique_identification_number: string;
|
|
16
|
-
is_fulfillment_timing: true;
|
|
17
|
-
fulfillment_timing: {
|
|
18
|
-
method: 'pick_up';
|
|
19
|
-
mode: PickupTimingSelectionMode;
|
|
20
|
-
source: PickupTimingSource;
|
|
21
|
-
instant?: string;
|
|
22
|
-
timezone?: string;
|
|
23
|
-
frozen?: boolean;
|
|
24
|
-
};
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
}
|
|
27
|
-
export interface PickupTimingBooking {
|
|
28
|
-
schedule_id: number | string;
|
|
29
|
-
start_date: string;
|
|
30
|
-
end_date: string;
|
|
31
|
-
start_time: string;
|
|
32
|
-
end_time: string;
|
|
33
|
-
select_date: string;
|
|
34
|
-
duration: 0;
|
|
35
|
-
is_all: 0;
|
|
36
|
-
sub_type: 'minutes';
|
|
37
|
-
like_status: string;
|
|
38
|
-
resources: [];
|
|
39
|
-
metadata: PickupTimingBookingMetadata;
|
|
40
|
-
schedule_event_id?: number | string;
|
|
41
|
-
[key: string]: any;
|
|
42
|
-
}
|
|
43
|
-
/** The explicit marker is the only authority; unlinked ordinary bookings remain ordinary. */
|
|
44
|
-
export declare function isFulfillmentTimingBooking(booking: unknown): boolean;
|
|
45
|
-
/** Update an independent pickup appointment without changing its persisted row identity. */
|
|
46
|
-
export declare function buildPickupTimingBooking(input: PickupTimingBookingInput, existing?: Record<string, any> | null): PickupTimingBooking;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/** 解析商品行数量(checkout 协议 product_num 语义 = 当前行 num) */
|
|
2
|
-
export declare function resolveSafeProductNum(num?: number | null): number;
|
|
3
|
-
/**
|
|
4
|
-
* 将 discount_list 中 type=product 项的 product_num 同步为当前商品数量。
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* syncManualProductDiscountProductNum(line.discount_list, line.num);
|
|
8
|
-
*/
|
|
9
|
-
export declare function syncManualProductDiscountProductNum(discountList: any[] | undefined | null, productNum?: number | null): any[];
|
|
10
|
-
/** 从多源解析改价前行总价(与 cacheItem._extend.origin_total 语义一致) */
|
|
11
|
-
export declare function resolveManualDiscountOriginTotal(sources: {
|
|
12
|
-
originTotal?: unknown;
|
|
13
|
-
extendOriginTotal?: unknown;
|
|
14
|
-
originExtendOriginTotal?: unknown;
|
|
15
|
-
sourceExtendOriginTotal?: unknown;
|
|
16
|
-
catalogUnitPrice?: unknown;
|
|
17
|
-
quantity?: number;
|
|
18
|
-
}): number;
|
|
19
|
-
/** 从 payload / extend / origin 解析手动折扣原因 */
|
|
20
|
-
export declare function resolveManualDiscountReasonFromSources(sources: {
|
|
21
|
-
discountReason?: unknown;
|
|
22
|
-
extendDiscountReason?: unknown;
|
|
23
|
-
originExtendDiscountReason?: unknown;
|
|
24
|
-
}): string;
|
|
25
|
-
/** 是否带手动改价标记(price_override / is_manual_discount) */
|
|
26
|
-
export declare function hasManualProductDiscountFlag(metadata?: Record<string, any> | null): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* normalize 兜底:手动改价但 discount_list 缺 type=product 时,按行级原价/折后价补写。
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ensureManualProductDiscountList({
|
|
32
|
-
* discountList: [],
|
|
33
|
-
* metadata: { price_override: '5', is_manual_discount: 1 },
|
|
34
|
-
* originalPrice: '11.00',
|
|
35
|
-
* sellingPrice: '5.00',
|
|
36
|
-
* quantity: 1,
|
|
37
|
-
* });
|
|
38
|
-
*/
|
|
39
|
-
export declare function ensureManualProductDiscountList(params: {
|
|
40
|
-
discountList?: any[] | null;
|
|
41
|
-
metadata?: Record<string, any> | null;
|
|
42
|
-
originalPrice: string | number;
|
|
43
|
-
sellingPrice: string | number;
|
|
44
|
-
quantity?: number;
|
|
45
|
-
}): any[];
|
|
46
|
-
/** 商品手动折扣 discount_list 项(checkout 协议,type = product) */
|
|
47
|
-
export interface ManualProductDiscountItem {
|
|
48
|
-
amount: number;
|
|
49
|
-
type: 'product';
|
|
50
|
-
discount: {
|
|
51
|
-
message: string;
|
|
52
|
-
discountway: string;
|
|
53
|
-
product_num: number;
|
|
54
|
-
discount_per: string;
|
|
55
|
-
discount_type: 'discount' | 'change_price';
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 从 discount_list 中取手动改价项(type = product)。
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* const manual = findManualProductDiscountItem(product.discount_list);
|
|
63
|
-
* manual?.discount.message; // 折扣原因
|
|
64
|
-
*/
|
|
65
|
-
export declare function findManualProductDiscountItem(discountList?: any[] | null): ManualProductDiscountItem | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* 解析折扣原因:优先 discount_list[type=product].discount.message。
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* resolveManualDiscountMessage(line.discount_list, line.metadata?.legacy_reason);
|
|
71
|
-
*/
|
|
72
|
-
export declare function resolveManualDiscountMessage(discountList?: any[] | null, fallback?: string): string;
|
|
73
|
-
/** 去掉 discount_list 中已有的手动改价项,避免重复叠加 */
|
|
74
|
-
export declare function stripManualProductDiscountItems(discountList?: any[] | null): any[];
|
|
75
|
-
/**
|
|
76
|
-
* 由改价前后行总价构建手动折扣项;amount = |originTotal - sellingTotal|(行级差额)。
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* buildManualProductDiscountItem({
|
|
80
|
-
* originTotal: 11,
|
|
81
|
-
* sellingTotal: 4,
|
|
82
|
-
* quantity: 1,
|
|
83
|
-
* message: 'VIP',
|
|
84
|
-
* });
|
|
85
|
-
*/
|
|
86
|
-
export declare function buildManualProductDiscountItem(params: {
|
|
87
|
-
originTotal: number;
|
|
88
|
-
sellingTotal: number;
|
|
89
|
-
quantity?: number;
|
|
90
|
-
message?: string;
|
|
91
|
-
discountway?: string;
|
|
92
|
-
discount_per?: string;
|
|
93
|
-
}): ManualProductDiscountItem;
|
|
94
|
-
/**
|
|
95
|
-
* 将手动改价项合并进 discount_list(替换已有 type=product 项)。
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* mergeManualProductDiscountIntoList(coupons, manualItem);
|
|
99
|
-
*/
|
|
100
|
-
export declare function mergeManualProductDiscountIntoList(discountList: any[] | undefined | null, manualItem: ManualProductDiscountItem | null | undefined): any[];
|
|
101
|
-
/** 是否应写入手动改价 discount_list 项 */
|
|
102
|
-
export declare function shouldBuildManualProductDiscount(params: {
|
|
103
|
-
hasPriceOverride?: boolean;
|
|
104
|
-
originTotal?: number;
|
|
105
|
-
sellingTotal?: number;
|
|
106
|
-
}): boolean;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export type OrderCollectionKind = 'product' | 'booking' | 'payment';
|
|
2
|
-
export interface OrderCollectionIdentityStats {
|
|
3
|
-
backfilledUidCount: number;
|
|
4
|
-
collapsedDuplicateCount: number;
|
|
5
|
-
uidConflictCount: number;
|
|
6
|
-
anonymousRowCount: number;
|
|
7
|
-
}
|
|
8
|
-
export interface OrderCollectionUidRemap {
|
|
9
|
-
kind: OrderCollectionKind;
|
|
10
|
-
from: string;
|
|
11
|
-
to: string;
|
|
12
|
-
persistentId: string | null;
|
|
13
|
-
/** 默认全局迁移;UID 冲突时只能迁移能由另一侧 UID 明确定位的引用。 */
|
|
14
|
-
scope?: 'global' | 'linked-owner';
|
|
15
|
-
referenceOwnerUid?: string | null;
|
|
16
|
-
}
|
|
17
|
-
export interface NormalizeOrderCollectionResult<T> {
|
|
18
|
-
items: T[];
|
|
19
|
-
stats: OrderCollectionIdentityStats;
|
|
20
|
-
uidRemaps: OrderCollectionUidRemap[];
|
|
21
|
-
}
|
|
22
|
-
export interface NormalizeOrderCollectionsResult<T> {
|
|
23
|
-
order: T;
|
|
24
|
-
stats: Record<OrderCollectionKind, OrderCollectionIdentityStats>;
|
|
25
|
-
uidRemaps: OrderCollectionUidRemap[];
|
|
26
|
-
}
|
|
27
|
-
export interface ProductLineIdentityRepair {
|
|
28
|
-
index: number;
|
|
29
|
-
from: string;
|
|
30
|
-
to: string;
|
|
31
|
-
}
|
|
32
|
-
export interface RepairDuplicateProductLineIdentitiesResult<T> {
|
|
33
|
-
products: T[];
|
|
34
|
-
productsByUid?: Record<string, Record<string, any>>;
|
|
35
|
-
repairs: ProductLineIdentityRepair[];
|
|
36
|
-
}
|
|
37
|
-
export declare function createUuidV4(): string;
|
|
38
|
-
export declare function isBlankOrderCollectionIdentity(value: unknown): boolean;
|
|
39
|
-
export declare function getOrderCollectionPersistentId(kind: OrderCollectionKind, item: unknown): string | null;
|
|
40
|
-
export declare function getOrderCollectionUid(kind: OrderCollectionKind, item: unknown): string | null;
|
|
41
|
-
export declare function buildOrderCollectionFallbackUid(kind: OrderCollectionKind, persistentId: string | number): string;
|
|
42
|
-
export declare function getOrderCollectionReferenceUid(kind: OrderCollectionKind, item: unknown): string | null;
|
|
43
|
-
export declare function setOrderCollectionUid<T>(kind: OrderCollectionKind, item: T, uid: string): T;
|
|
44
|
-
/**
|
|
45
|
-
* Rules 会把同一商品按商品券拆成多条真实订单行。拆行结果会继承原商品 UID,
|
|
46
|
-
* 因此必须在通用 collection normalization 之前为后续行派生稳定身份,避免被折叠。
|
|
47
|
-
*/
|
|
48
|
-
export declare function repairDuplicateProductLineIdentities<T extends Record<string, any>>(products: T[] | null | undefined, productsByUid?: Record<string, Record<string, any>> | null): RepairDuplicateProductLineIdentitiesResult<T>;
|
|
49
|
-
/**
|
|
50
|
-
* 持久化行 ID 是服务端事实主键;只有至少一侧尚未持久化时,才允许用 runtime UID 对齐。
|
|
51
|
-
*/
|
|
52
|
-
export declare function isSameOrderCollectionItem(kind: OrderCollectionKind, left: unknown, right: unknown): boolean;
|
|
53
|
-
export declare function mergeOrderCollectionItems<T>(kind: OrderCollectionKind, currentItem: T, incomingItem: T, options?: {
|
|
54
|
-
ensureUid?: boolean;
|
|
55
|
-
createAnonymousUid?: () => string;
|
|
56
|
-
}): T;
|
|
57
|
-
/**
|
|
58
|
-
* 规范化单一数组:强身份重复时保留首次位置、用最后一条业务字段覆盖,并统一补 UID。
|
|
59
|
-
*/
|
|
60
|
-
export declare function normalizeOrderCollection<T>(kind: OrderCollectionKind, items: T[] | null | undefined, options?: {
|
|
61
|
-
ensureUid?: boolean;
|
|
62
|
-
createAnonymousUid?: () => string;
|
|
63
|
-
}): NormalizeOrderCollectionResult<T>;
|
|
64
|
-
export declare function applyOrderCollectionUidRemaps<T extends Record<string, any>>(sourceOrder: T, uidRemaps: OrderCollectionUidRemap[]): T;
|
|
65
|
-
export declare function normalizeOrderCollections<T extends Record<string, any>>(sourceOrder: T, options?: {
|
|
66
|
-
ensureUid?: boolean;
|
|
67
|
-
createAnonymousUid?: () => string;
|
|
68
|
-
}): NormalizeOrderCollectionsResult<T>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Only pricing/measurement fields participate; display and option data do not. */
|
|
2
|
-
export declare function getWeighedProductPriceFingerprint(sku?: Record<string, any>): string;
|
|
3
|
-
/**
|
|
4
|
-
* A weighed line's source is the amount for its net weight, never its catalog unit price.
|
|
5
|
-
* Persisted SKU measurements and the full catalog snapshot take priority over runtime
|
|
6
|
-
* _extend.weighing, which can survive repricing with an obsolete total_amount.
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolveWeighedSourcePrice(sku?: Record<string, any>, weighing?: Record<string, any>): string | undefined;
|
|
9
|
-
/** Original bundle totals must use the nested options before manual distribution. */
|
|
10
|
-
export declare function withOriginalBundleOptionPrices(bundles?: Array<Record<string, any>>): {
|
|
11
|
-
option: any;
|
|
12
|
-
}[] | undefined;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 现金支付推荐算法
|
|
3
|
-
*
|
|
4
|
-
* 核心原理:
|
|
5
|
-
* 1. 第一项始终是精确应付金额
|
|
6
|
-
* 2. 其余推荐只能是严格大于应付金额的真实币种面额
|
|
7
|
-
* 3. 最多推荐三个更高面额
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* 常见国家货币面额配置
|
|
11
|
-
*/
|
|
12
|
-
export declare const CURRENCY_DENOMINATIONS: Record<string, number[]>;
|
|
13
|
-
/**
|
|
14
|
-
* 最优支付金额推荐算法
|
|
15
|
-
* 返回精确应付金额,以及最多三个更高的真实币种面额
|
|
16
|
-
*
|
|
17
|
-
* @param targetAmount 目标金额
|
|
18
|
-
* @param denominations 币种面值数组
|
|
19
|
-
* @returns 推荐支付金额数组
|
|
20
|
-
*/
|
|
21
|
-
export declare function recommendOptimalPayments(targetAmount: number, denominations: number[]): number[];
|
|
File without changes
|