@pisell/pisellos 2.2.243 → 2.2.244
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/model/strategy/adapter/promotion/evaluator.js +2 -3
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +4 -7
- package/dist/modules/Cart/utils/cartProduct.js +3 -24
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +0 -20
- package/dist/modules/Customer/index.js +83 -172
- package/dist/modules/Customer/types.d.ts +0 -2
- package/dist/modules/Discount/index.js +3 -4
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.d.ts +0 -8
- package/dist/modules/OpenData/index.js +17 -37
- package/dist/modules/Order/index.d.ts +18 -268
- package/dist/modules/Order/index.js +757 -3306
- package/dist/modules/Order/types.d.ts +31 -279
- package/dist/modules/Order/types.js +0 -38
- package/dist/modules/Order/utils.d.ts +5 -147
- package/dist/modules/Order/utils.js +103 -746
- package/dist/modules/Payment/index.d.ts +13 -10
- package/dist/modules/Payment/index.js +837 -467
- package/dist/modules/Payment/types.d.ts +0 -2
- package/dist/modules/Payment/utils.js +1 -2
- package/dist/modules/Payment/walletpass.js +7 -14
- package/dist/modules/ProductList/index.d.ts +12 -16
- package/dist/modules/ProductList/index.js +59 -133
- package/dist/modules/ProductList/types.d.ts +0 -14
- package/dist/modules/Quotation/index.d.ts +1 -0
- package/dist/modules/Quotation/index.js +22 -25
- package/dist/modules/Rules/index.d.ts +0 -4
- package/dist/modules/Rules/index.js +69 -93
- package/dist/modules/Rules/types.d.ts +0 -1
- package/dist/modules/SalesSummary/index.d.ts +25 -8
- package/dist/modules/SalesSummary/index.js +35 -86
- package/dist/modules/SalesSummary/types.d.ts +1 -4
- package/dist/modules/SalesSummary/utils.d.ts +25 -2
- package/dist/modules/SalesSummary/utils.js +162 -794
- package/dist/modules/Schedule/index.d.ts +0 -7
- package/dist/modules/Schedule/index.js +2 -24
- package/dist/modules/Summary/index.js +3 -4
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/request.d.ts +0 -1
- package/dist/server/index.d.ts +1 -204
- package/dist/server/index.js +928 -3658
- package/dist/server/modules/index.d.ts +0 -2
- package/dist/server/modules/index.js +0 -2
- package/dist/server/modules/order/index.d.ts +4 -120
- package/dist/server/modules/order/index.js +483 -1779
- package/dist/server/modules/order/types.d.ts +3 -32
- package/dist/server/modules/order/types.js +0 -8
- package/dist/server/modules/order/utils/filterBookings.js +3 -26
- package/dist/server/modules/order/utils/filterOrders.js +8 -23
- package/dist/server/modules/products/index.d.ts +7 -34
- package/dist/server/modules/products/index.js +317 -631
- package/dist/server/modules/resource/index.d.ts +0 -2
- package/dist/server/modules/resource/index.js +3 -29
- package/dist/server/modules/schedule/index.d.ts +4 -4
- package/dist/server/modules/schedule/index.js +88 -111
- package/dist/solution/BaseSales/index.d.ts +9 -131
- package/dist/solution/BaseSales/index.js +447 -1944
- package/dist/solution/BaseSales/types.d.ts +6 -76
- package/dist/solution/BaseSales/types.js +4 -5
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -105
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +21 -62
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +10 -270
- package/dist/solution/BookingTicket/index.js +237 -1772
- package/dist/solution/BookingTicket/types.d.ts +1 -118
- package/dist/solution/BookingTicket/types.js +2 -41
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/dist/solution/BookingTicket/utils/bookingStatus.js +0 -70
- package/dist/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/dist/solution/BookingTicket/utils/cartView.js +7 -94
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/dist/solution/BookingTicket/utils/scan/index.js +8 -20
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +0 -1
- package/dist/solution/Checkout/index.js +9 -10
- package/dist/solution/RegisterAndLogin/config.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +3 -9
- package/dist/solution/ScanOrder/index.js +134 -241
- package/dist/solution/ScanOrder/types.d.ts +5 -9
- package/dist/solution/ScanOrder/types.js +3 -2
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +22 -84
- package/dist/solution/VenueBooking/index.d.ts +2 -5
- package/dist/solution/VenueBooking/index.js +59 -110
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/dist/types/index.d.ts +0 -10
- package/lib/model/strategy/adapter/promotion/evaluator.js +1 -2
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/model/strategy/adapter/walletPass/utils.js +2 -3
- package/lib/modules/Cart/utils/cartProduct.js +3 -20
- package/lib/modules/Cart/utils/changePrice.js +20 -12
- package/lib/modules/Customer/index.d.ts +0 -20
- package/lib/modules/Customer/index.js +11 -64
- package/lib/modules/Customer/types.d.ts +0 -2
- package/lib/modules/Discount/index.js +1 -5
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.d.ts +0 -8
- package/lib/modules/OpenData/index.js +5 -19
- package/lib/modules/Order/index.d.ts +18 -268
- package/lib/modules/Order/index.js +344 -2149
- package/lib/modules/Order/types.d.ts +31 -279
- package/lib/modules/Order/types.js +0 -1
- package/lib/modules/Order/utils.d.ts +5 -147
- package/lib/modules/Order/utils.js +46 -614
- package/lib/modules/Payment/index.d.ts +13 -10
- package/lib/modules/Payment/index.js +150 -18
- package/lib/modules/Payment/types.d.ts +0 -2
- package/lib/modules/Payment/utils.js +1 -2
- package/lib/modules/Payment/walletpass.js +3 -7
- package/lib/modules/ProductList/index.d.ts +12 -16
- package/lib/modules/ProductList/index.js +4 -41
- package/lib/modules/ProductList/types.d.ts +0 -14
- package/lib/modules/Quotation/index.d.ts +1 -0
- package/lib/modules/Quotation/index.js +16 -19
- package/lib/modules/Rules/index.d.ts +0 -4
- package/lib/modules/Rules/index.js +120 -136
- package/lib/modules/Rules/types.d.ts +0 -1
- package/lib/modules/SalesSummary/index.d.ts +25 -8
- package/lib/modules/SalesSummary/index.js +4 -30
- package/lib/modules/SalesSummary/types.d.ts +1 -4
- package/lib/modules/SalesSummary/utils.d.ts +25 -2
- package/lib/modules/SalesSummary/utils.js +91 -645
- package/lib/modules/Schedule/index.d.ts +0 -7
- package/lib/modules/Schedule/index.js +1 -17
- package/lib/modules/Summary/index.js +4 -5
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/request.d.ts +0 -1
- package/lib/server/index.d.ts +1 -204
- package/lib/server/index.js +57 -1888
- package/lib/server/modules/index.d.ts +0 -2
- package/lib/server/modules/index.js +0 -3
- package/lib/server/modules/order/index.d.ts +4 -120
- package/lib/server/modules/order/index.js +142 -919
- package/lib/server/modules/order/types.d.ts +3 -32
- package/lib/server/modules/order/utils/filterBookings.js +5 -24
- package/lib/server/modules/order/utils/filterOrders.js +6 -15
- package/lib/server/modules/products/index.d.ts +7 -34
- package/lib/server/modules/products/index.js +54 -189
- package/lib/server/modules/resource/index.d.ts +0 -2
- package/lib/server/modules/resource/index.js +3 -27
- package/lib/server/modules/schedule/index.d.ts +4 -4
- package/lib/server/modules/schedule/index.js +40 -47
- package/lib/solution/BaseSales/index.d.ts +9 -131
- package/lib/solution/BaseSales/index.js +63 -1106
- package/lib/solution/BaseSales/types.d.ts +6 -76
- package/lib/solution/BaseSales/types.js +1 -3
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +18 -106
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +10 -54
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +10 -270
- package/lib/solution/BookingTicket/index.js +29 -922
- package/lib/solution/BookingTicket/types.d.ts +1 -118
- package/lib/solution/BookingTicket/types.js +0 -11
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/lib/solution/BookingTicket/utils/bookingStatus.js +2 -44
- package/lib/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/lib/solution/BookingTicket/utils/cartView.js +6 -61
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/lib/solution/BookingTicket/utils/scan/index.js +3 -17
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +0 -1
- package/lib/solution/Checkout/index.js +2 -1
- package/lib/solution/RegisterAndLogin/config.js +10 -2
- package/lib/solution/ScanOrder/index.d.ts +3 -9
- package/lib/solution/ScanOrder/index.js +70 -153
- package/lib/solution/ScanOrder/types.d.ts +5 -9
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +17 -83
- package/lib/solution/VenueBooking/index.d.ts +2 -5
- package/lib/solution/VenueBooking/index.js +17 -54
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/lib/types/index.d.ts +0 -10
- package/package.json +1 -1
- package/dist/modules/BookingContext/index.d.ts +0 -48
- package/dist/modules/BookingContext/index.js +0 -566
- package/dist/modules/BookingContext/types.d.ts +0 -102
- package/dist/modules/BookingContext/types.js +0 -51
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -284
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -145
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -218
- package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/dist/modules/BookingContext/utils/flexible.js +0 -56
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
- package/dist/modules/BookingContext/utils/index.d.ts +0 -11
- package/dist/modules/BookingContext/utils/index.js +0 -11
- package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/dist/modules/BookingContext/utils/noResource.js +0 -77
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +0 -36
- package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/dist/modules/BookingContext/utils/productExtend.js +0 -339
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
- package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
- package/dist/modules/BookingContext/utils/resources.js +0 -486
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/dist/modules/Order/utils/manualProductDiscount.js +0 -210
- package/dist/modules/SurchargeList/index.d.ts +0 -16
- package/dist/modules/SurchargeList/index.js +0 -162
- package/dist/modules/SurchargeList/types.d.ts +0 -11
- package/dist/modules/SurchargeList/types.js +0 -1
- package/dist/server/modules/payment/index.d.ts +0 -28
- package/dist/server/modules/payment/index.js +0 -305
- package/dist/server/modules/payment/types.d.ts +0 -9
- package/dist/server/modules/payment/types.js +0 -1
- package/dist/server/test.json +0 -713
- package/dist/server/utils/small-ticket.d.ts +0 -71
- package/dist/server/utils/small-ticket.js +0 -830
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/dist/solution/BaseSales/utils/cartPromotion.js +0 -1438
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +0 -95
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/dist/solution/BookingTicket/utils/exampleData.js +0 -183
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -438
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -399
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -56
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +0 -150
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +0 -78
- package/lib/modules/BookingContext/index.d.ts +0 -48
- package/lib/modules/BookingContext/index.js +0 -368
- package/lib/modules/BookingContext/types.d.ts +0 -102
- package/lib/modules/BookingContext/types.js +0 -34
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -276
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -151
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -201
- package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/lib/modules/BookingContext/utils/flexible.js +0 -80
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
- package/lib/modules/BookingContext/utils/index.d.ts +0 -11
- package/lib/modules/BookingContext/utils/index.js +0 -43
- package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/lib/modules/BookingContext/utils/noResource.js +0 -90
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +0 -56
- package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/lib/modules/BookingContext/utils/productExtend.js +0 -283
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
- package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
- package/lib/modules/BookingContext/utils/resources.js +0 -377
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/lib/modules/Order/utils/manualProductDiscount.js +0 -206
- package/lib/modules/SurchargeList/index.d.ts +0 -16
- package/lib/modules/SurchargeList/index.js +0 -89
- package/lib/modules/SurchargeList/types.d.ts +0 -11
- package/lib/modules/SurchargeList/types.js +0 -17
- package/lib/server/modules/payment/index.d.ts +0 -28
- package/lib/server/modules/payment/index.js +0 -192
- package/lib/server/modules/payment/types.d.ts +0 -9
- package/lib/server/modules/payment/types.js +0 -17
- package/lib/server/test.json +0 -713
- package/lib/server/utils/small-ticket.d.ts +0 -71
- package/lib/server/utils/small-ticket.js +0 -781
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/lib/solution/BaseSales/utils/cartPromotion.js +0 -992
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +0 -125
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -254
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -168
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -51
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +0 -127
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +0 -85
|
@@ -80,16 +80,6 @@ export interface OrderProductMetadata {
|
|
|
80
80
|
unique_identification_number?: string;
|
|
81
81
|
[key: string]: unknown;
|
|
82
82
|
}
|
|
83
|
-
export interface OrderProductTitleSnapshot {
|
|
84
|
-
en: string | null;
|
|
85
|
-
ja: string | null;
|
|
86
|
-
pt: string | null;
|
|
87
|
-
auto: string | null;
|
|
88
|
-
'zh-CN': string | null;
|
|
89
|
-
'zh-HK': string | null;
|
|
90
|
-
kitchen: string | null;
|
|
91
|
-
original: string | null;
|
|
92
|
-
}
|
|
93
83
|
/**
|
|
94
84
|
* 订单级商品行(3.3 products)。
|
|
95
85
|
* 订单级别的非预约关联商品;预约关联商品在 bookings 内。
|
|
@@ -102,10 +92,10 @@ export interface OrderProductLineItem {
|
|
|
102
92
|
product_id?: number | null;
|
|
103
93
|
/** 数量。创建/更新时必填。来源:Detail.product_quantity */
|
|
104
94
|
num: number;
|
|
105
|
-
/** 商品标题快照;本地待同步订单会补齐为多语言对象。 */
|
|
106
|
-
product_title?: OrderProductTitleSnapshot | string | null;
|
|
107
95
|
/** 多规格 ID。来源:Detail.product_variant_id */
|
|
108
96
|
product_variant_id?: number;
|
|
97
|
+
/** 选项配置 */
|
|
98
|
+
product_option_item?: unknown[];
|
|
109
99
|
/**
|
|
110
100
|
* 销售单价(交易快照,仅输出)。
|
|
111
101
|
* 来源:Detail.selling_price
|
|
@@ -239,10 +229,8 @@ export interface OrderPaymentItem {
|
|
|
239
229
|
rounding_amount?: OrderMoneyString;
|
|
240
230
|
/** 支付状态:paid / voided / payment_pending 等 */
|
|
241
231
|
status?: OrderPaymentRecordStatus;
|
|
242
|
-
/**
|
|
232
|
+
/** 支付时间(仅输出)。来源:OrderPayment.payment_time */
|
|
243
233
|
payment_time?: string | null;
|
|
244
|
-
/** 支付创建时间(输入/输出均保留)。来源:OrderPayment.created_at */
|
|
245
|
-
created_at?: string | null;
|
|
246
234
|
/** 手续费配置。来源:OrderPayment.service_charge */
|
|
247
235
|
service_charge?: Record<string, unknown> | null;
|
|
248
236
|
/** Wallet Pass 使用单位 */
|
|
@@ -407,8 +395,6 @@ export interface OrderData {
|
|
|
407
395
|
/** 本地辅助字段 */
|
|
408
396
|
shop_id?: number;
|
|
409
397
|
create_date?: string;
|
|
410
|
-
/** 本地待同步标记:1 表示需要后续同步到云端 */
|
|
411
|
-
need_sync?: 0 | 1 | number;
|
|
412
398
|
/** 兼容:部分场景仍使用顶层 total_amount */
|
|
413
399
|
total_amount?: OrderMoneyString | number;
|
|
414
400
|
/** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
|
|
@@ -538,21 +524,6 @@ export interface OrderAblyEventPayload {
|
|
|
538
524
|
order_id?: OrderId;
|
|
539
525
|
timestamp: number;
|
|
540
526
|
}
|
|
541
|
-
/**
|
|
542
|
-
* 订单变更广播载荷。
|
|
543
|
-
* 用于保留原有全量列表通知能力,同时让订阅方可按 changedOrders 做增量处理。
|
|
544
|
-
*
|
|
545
|
-
* @example
|
|
546
|
-
* const changedOrders = payload.changedOrders
|
|
547
|
-
*/
|
|
548
|
-
export interface OrderChangedPayload {
|
|
549
|
-
/** 当前订单 store 全量列表,兼容既有重算列表订阅 */
|
|
550
|
-
list: OrderData[];
|
|
551
|
-
/** 本次明确发生变更的订单;全量刷新等无法确定 delta 的场景可为空 */
|
|
552
|
-
changedOrders: OrderData[];
|
|
553
|
-
/** 触发来源,便于订阅者区分 pubsub / 远端覆盖 / 清空等场景 */
|
|
554
|
-
source?: string;
|
|
555
|
-
}
|
|
556
527
|
/**
|
|
557
528
|
* OrderSyncMessage - pubsub 同步消息结构
|
|
558
529
|
*/
|
|
@@ -54,29 +54,6 @@ function bookingDateTimeString(datePart, timePart) {
|
|
|
54
54
|
}
|
|
55
55
|
return "".concat(d, " ").concat(t).trim();
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 解析预约自身的起止时间区间,供 `sales_time_between` 做区间重叠匹配。
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* const span = resolveBookingTimeRange({ start_date: '2026-06-09', start_time: '10:00', end_date: '2026-06-15', end_time: '10:00' })
|
|
63
|
-
*/
|
|
64
|
-
function resolveBookingTimeRange(booking) {
|
|
65
|
-
var start = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
66
|
-
if (!start) return null;
|
|
67
|
-
var end = toTimestamp(bookingDateTimeString(booking.end_date || booking.start_date, booking.end_time || booking.start_time)) || start;
|
|
68
|
-
return end >= start ? [start, end] : [end, start];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 判断两个闭区间是否有交集。
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* isRangeOverlapping([1, 10], [5, 6]) // true
|
|
76
|
-
*/
|
|
77
|
-
function isRangeOverlapping(left, right) {
|
|
78
|
-
return left[0] <= right[1] && left[1] >= right[0];
|
|
79
|
-
}
|
|
80
57
|
function parseDateRange(range) {
|
|
81
58
|
if (!Array.isArray(range) || range.length < 2) return null;
|
|
82
59
|
var start = toRangeBoundary(range[0], false);
|
|
@@ -174,7 +151,7 @@ function matchOrder(order, ctx) {
|
|
|
174
151
|
// ─────────────────────────────────────────────────────────────────
|
|
175
152
|
|
|
176
153
|
function matchBooking(booking, orderInfo, ctx) {
|
|
177
|
-
if (ctx.enableChildBookingFilter
|
|
154
|
+
if (ctx.enableChildBookingFilter) {
|
|
178
155
|
var _parent_id, _item_type;
|
|
179
156
|
var parentId = Number((_parent_id = booking.parent_id) !== null && _parent_id !== void 0 ? _parent_id : 0);
|
|
180
157
|
var itemType = String((_item_type = booking.item_type) !== null && _item_type !== void 0 ? _item_type : '');
|
|
@@ -183,8 +160,8 @@ function matchBooking(booking, orderInfo, ctx) {
|
|
|
183
160
|
}
|
|
184
161
|
if (ctx.appointmentStatusSet && !ctx.appointmentStatusSet.has(getBookingAppointmentStatus(booking))) return false;
|
|
185
162
|
if (ctx.bookingTimeRange) {
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
163
|
+
var ts = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
164
|
+
if (ts < ctx.bookingTimeRange[0] || ts > ctx.bookingTimeRange[1]) return false;
|
|
188
165
|
}
|
|
189
166
|
if (ctx.afterExecutionTimeMs != null) {
|
|
190
167
|
var bookingStartMs = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
-
/** 从订单 payments 提取支付方式 code,与 UI 筛选选项及 filterBookings 一致 */
|
|
3
|
-
function getOrderPaymentCodes(order) {
|
|
4
|
-
var payments = order.payments;
|
|
5
|
-
if (!Array.isArray(payments) || payments.length === 0) {
|
|
6
|
-
return [];
|
|
7
|
-
}
|
|
8
|
-
return payments.map(function (item) {
|
|
9
|
-
return item === null || item === void 0 ? void 0 : item.code;
|
|
10
|
-
}).filter(function (code) {
|
|
11
|
-
return typeof code === 'string' && code.length > 0;
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
2
|
/**
|
|
16
3
|
* 订单过滤函数
|
|
17
4
|
* @param orders 原始订单列表
|
|
@@ -139,23 +126,22 @@ export function filterOrders(orders, filters) {
|
|
|
139
126
|
}
|
|
140
127
|
}
|
|
141
128
|
|
|
142
|
-
// payment_methods -
|
|
129
|
+
// payment_methods - 支付方式
|
|
143
130
|
if (safeFilters.payment_methods && safeFilters.payment_methods.length > 0) {
|
|
144
|
-
|
|
145
|
-
if (orderPaymentCodes.length === 0) {
|
|
131
|
+
if (!order.payment_methods || !Array.isArray(order.payment_methods) || order.payment_methods.length === 0) {
|
|
146
132
|
rejected.push({
|
|
147
133
|
order_id: order.order_id,
|
|
148
134
|
order_number: order.order_number,
|
|
149
135
|
reason: {
|
|
150
136
|
field: 'payment_methods',
|
|
151
|
-
actual: order.
|
|
137
|
+
actual: order.payment_methods,
|
|
152
138
|
expected: safeFilters.payment_methods
|
|
153
139
|
}
|
|
154
140
|
});
|
|
155
141
|
return false;
|
|
156
142
|
}
|
|
157
|
-
var hasMatch =
|
|
158
|
-
return safeFilters.payment_methods.includes(
|
|
143
|
+
var hasMatch = order.payment_methods.some(function (pm) {
|
|
144
|
+
return safeFilters.payment_methods.includes(pm);
|
|
159
145
|
});
|
|
160
146
|
if (!hasMatch) {
|
|
161
147
|
rejected.push({
|
|
@@ -163,7 +149,7 @@ export function filterOrders(orders, filters) {
|
|
|
163
149
|
order_number: order.order_number,
|
|
164
150
|
reason: {
|
|
165
151
|
field: 'payment_methods',
|
|
166
|
-
actual:
|
|
152
|
+
actual: order.payment_methods,
|
|
167
153
|
expected: safeFilters.payment_methods
|
|
168
154
|
}
|
|
169
155
|
});
|
|
@@ -362,11 +348,10 @@ export function filterOrders(orders, filters) {
|
|
|
362
348
|
|
|
363
349
|
// start_time / end_time - 创建时间范围
|
|
364
350
|
if (safeFilters.start_time || safeFilters.end_time) {
|
|
365
|
-
var isCreatedIsUndefined = order.created_at === undefined;
|
|
366
351
|
// 统一用 dayjs 按本地时区解析,避免 new Date("YYYY-MM-DD") 被当作 UTC 0 点
|
|
367
352
|
// 与含时分的本地时间字符串比较时产生时区错位
|
|
368
353
|
var orderTime = order.created_at ? typeof order.created_at === 'number' ? order.created_at : dayjs(String(order.created_at)).valueOf() : 0;
|
|
369
|
-
if (safeFilters.start_time
|
|
354
|
+
if (safeFilters.start_time) {
|
|
370
355
|
var startTs = dayjs(safeFilters.start_time).startOf('day').valueOf();
|
|
371
356
|
if (orderTime < startTs) {
|
|
372
357
|
rejected.push({
|
|
@@ -381,7 +366,7 @@ export function filterOrders(orders, filters) {
|
|
|
381
366
|
return false;
|
|
382
367
|
}
|
|
383
368
|
}
|
|
384
|
-
if (safeFilters.end_time
|
|
369
|
+
if (safeFilters.end_time) {
|
|
385
370
|
var endTs = dayjs(safeFilters.end_time).endOf('day').valueOf();
|
|
386
371
|
if (orderTime > endTs) {
|
|
387
372
|
rejected.push({
|
|
@@ -21,18 +21,12 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
21
21
|
private isPriceFormatterRegistered;
|
|
22
22
|
private quotationPriceBridge?;
|
|
23
23
|
private quotationBridgeChannel?;
|
|
24
|
-
private
|
|
24
|
+
private quotationBridgeCustomerId?;
|
|
25
25
|
private quotationBridgeRefreshPromise?;
|
|
26
26
|
private quotationBridgeRefreshKey?;
|
|
27
27
|
private productDataSource;
|
|
28
28
|
private pendingSyncMessages;
|
|
29
29
|
private syncTimer?;
|
|
30
|
-
/** 最近一次 SSE 全量拉取完成时间 */
|
|
31
|
-
private lastServerFullFetchAtMs;
|
|
32
|
-
/** 最近一次 preload 完成时间(含 IndexDB 命中) */
|
|
33
|
-
private lastPreloadCompletedAtMs;
|
|
34
|
-
/** IndexDB 写入串行队列,避免快照与 patch 并发交错 */
|
|
35
|
-
private productIndexDBSaveQueue;
|
|
36
30
|
constructor(name?: string, version?: string);
|
|
37
31
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
38
32
|
/**
|
|
@@ -215,28 +209,10 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
215
209
|
*/
|
|
216
210
|
private loadProductsFromIndexDB;
|
|
217
211
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* @example
|
|
221
|
-
* await this.runInProductIndexDBSaveQueue(async () => {
|
|
222
|
-
* await this.dbManager.bulkUpdate(INDEXDB_STORE_NAME, products)
|
|
223
|
-
* })
|
|
224
|
-
*/
|
|
225
|
-
private runInProductIndexDBSaveQueue;
|
|
226
|
-
/**
|
|
227
|
-
* 全量快照写入 IndexDB:clear + bulkUpdate,仅用于 SSE/HTTP 全量拉取。
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* await this.replaceProductsSnapshotInIndexDB(list, 'loadProductsByServer')
|
|
231
|
-
*/
|
|
232
|
-
private replaceProductsSnapshotInIndexDB;
|
|
233
|
-
/**
|
|
234
|
-
* 增量 upsert 商品到 IndexDB,不清空表;用于 pubsub 批次合并后的变更商品。
|
|
235
|
-
*
|
|
236
|
-
* @example
|
|
237
|
-
* await this.patchProductsInIndexDB(changedProducts, 'pubsub.processProductSyncMessages', mergeActions)
|
|
212
|
+
* 保存商品数据到 IndexDB(平铺存储)
|
|
213
|
+
* @private
|
|
238
214
|
*/
|
|
239
|
-
private
|
|
215
|
+
private saveProductsToIndexDB;
|
|
240
216
|
/**
|
|
241
217
|
* 同步更新商品 Map 缓存
|
|
242
218
|
* 将 list 中的商品同步到 map,以 id 为 key
|
|
@@ -286,17 +262,14 @@ export declare class ProductsModule extends BaseModule implements Module {
|
|
|
286
262
|
/**
|
|
287
263
|
* 将 body 完整数据直接覆盖到本地 store(不调用报价单接口)
|
|
288
264
|
* 已存在的 → 直接替换;不存在的 → 追加
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
* await this.applyBodyUpdatesToStore(bodyUpdates, { skipIndexDB: true })
|
|
265
|
+
* 同时更新 Map 缓存、IndexDB,触发 onProductsChanged
|
|
266
|
+
* 价格缓存由 processProductSyncMessages 末尾统一清除
|
|
292
267
|
*/
|
|
293
268
|
private applyBodyUpdatesToStore;
|
|
294
269
|
/**
|
|
295
270
|
* 将增量拉取的商品合并到 store
|
|
296
271
|
* 已存在的 → 替换;新的 → 追加
|
|
297
|
-
*
|
|
298
|
-
* @example
|
|
299
|
-
* await this.mergeProductsToStore(freshProducts, { skipIndexDB: true })
|
|
272
|
+
* 同时更新 store.map、IndexDB,触发 onProductsChanged
|
|
300
273
|
*/
|
|
301
274
|
private mergeProductsToStore;
|
|
302
275
|
/**
|