@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
|
*/
|
|
@@ -71,21 +71,6 @@ function bookingDateTimeString(datePart, timePart) {
|
|
|
71
71
|
}
|
|
72
72
|
return `${d} ${t}`.trim();
|
|
73
73
|
}
|
|
74
|
-
function resolveBookingTimeRange(booking) {
|
|
75
|
-
const start = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
76
|
-
if (!start)
|
|
77
|
-
return null;
|
|
78
|
-
const end = toTimestamp(
|
|
79
|
-
bookingDateTimeString(
|
|
80
|
-
booking.end_date || booking.start_date,
|
|
81
|
-
booking.end_time || booking.start_time
|
|
82
|
-
)
|
|
83
|
-
) || start;
|
|
84
|
-
return end >= start ? [start, end] : [end, start];
|
|
85
|
-
}
|
|
86
|
-
function isRangeOverlapping(left, right) {
|
|
87
|
-
return left[0] <= right[1] && left[1] >= right[0];
|
|
88
|
-
}
|
|
89
74
|
function parseDateRange(range) {
|
|
90
75
|
if (!Array.isArray(range) || range.length < 2)
|
|
91
76
|
return null;
|
|
@@ -183,13 +168,9 @@ function matchOrder(order, ctx) {
|
|
|
183
168
|
return true;
|
|
184
169
|
}
|
|
185
170
|
function matchBooking(booking, orderInfo, ctx) {
|
|
186
|
-
if (ctx.enableChildBookingFilter
|
|
187
|
-
const parentId = Number(
|
|
188
|
-
|
|
189
|
-
);
|
|
190
|
-
const itemType = String(
|
|
191
|
-
booking.item_type ?? ""
|
|
192
|
-
);
|
|
171
|
+
if (ctx.enableChildBookingFilter) {
|
|
172
|
+
const parentId = Number(booking.parent_id ?? 0);
|
|
173
|
+
const itemType = String(booking.item_type ?? "");
|
|
193
174
|
const isMatched = parentId !== 0 && itemType !== "recurring_booking" || parentId === 0 && itemType === "recurring_booking";
|
|
194
175
|
if (!isMatched)
|
|
195
176
|
return false;
|
|
@@ -197,8 +178,8 @@ function matchBooking(booking, orderInfo, ctx) {
|
|
|
197
178
|
if (ctx.appointmentStatusSet && !ctx.appointmentStatusSet.has(getBookingAppointmentStatus(booking)))
|
|
198
179
|
return false;
|
|
199
180
|
if (ctx.bookingTimeRange) {
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
181
|
+
const ts = toTimestamp(bookingDateTimeString(booking.start_date, booking.start_time));
|
|
182
|
+
if (ts < ctx.bookingTimeRange[0] || ts > ctx.bookingTimeRange[1])
|
|
202
183
|
return false;
|
|
203
184
|
}
|
|
204
185
|
if (ctx.afterExecutionTimeMs != null) {
|
|
@@ -33,13 +33,6 @@ __export(filterOrders_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(filterOrders_exports);
|
|
35
35
|
var import_dayjs = __toESM(require("dayjs"));
|
|
36
|
-
function getOrderPaymentCodes(order) {
|
|
37
|
-
const payments = order.payments;
|
|
38
|
-
if (!Array.isArray(payments) || payments.length === 0) {
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
41
|
-
return payments.map((item) => item == null ? void 0 : item.code).filter((code) => typeof code === "string" && code.length > 0);
|
|
42
|
-
}
|
|
43
36
|
function filterOrders(orders, filters) {
|
|
44
37
|
const safeFilters = filters || {};
|
|
45
38
|
if (!orders || !Array.isArray(orders)) {
|
|
@@ -140,27 +133,26 @@ function filterOrders(orders, filters) {
|
|
|
140
133
|
}
|
|
141
134
|
}
|
|
142
135
|
if (safeFilters.payment_methods && safeFilters.payment_methods.length > 0) {
|
|
143
|
-
|
|
144
|
-
if (orderPaymentCodes.length === 0) {
|
|
136
|
+
if (!order.payment_methods || !Array.isArray(order.payment_methods) || order.payment_methods.length === 0) {
|
|
145
137
|
rejected.push({
|
|
146
138
|
order_id: order.order_id,
|
|
147
139
|
order_number: order.order_number,
|
|
148
140
|
reason: {
|
|
149
141
|
field: "payment_methods",
|
|
150
|
-
actual: order.
|
|
142
|
+
actual: order.payment_methods,
|
|
151
143
|
expected: safeFilters.payment_methods
|
|
152
144
|
}
|
|
153
145
|
});
|
|
154
146
|
return false;
|
|
155
147
|
}
|
|
156
|
-
const hasMatch =
|
|
148
|
+
const hasMatch = order.payment_methods.some((pm) => safeFilters.payment_methods.includes(pm));
|
|
157
149
|
if (!hasMatch) {
|
|
158
150
|
rejected.push({
|
|
159
151
|
order_id: order.order_id,
|
|
160
152
|
order_number: order.order_number,
|
|
161
153
|
reason: {
|
|
162
154
|
field: "payment_methods",
|
|
163
|
-
actual:
|
|
155
|
+
actual: order.payment_methods,
|
|
164
156
|
expected: safeFilters.payment_methods
|
|
165
157
|
}
|
|
166
158
|
});
|
|
@@ -335,9 +327,8 @@ function filterOrders(orders, filters) {
|
|
|
335
327
|
}
|
|
336
328
|
}
|
|
337
329
|
if (safeFilters.start_time || safeFilters.end_time) {
|
|
338
|
-
const isCreatedIsUndefined = order.created_at === void 0;
|
|
339
330
|
const orderTime = order.created_at ? typeof order.created_at === "number" ? order.created_at : (0, import_dayjs.default)(String(order.created_at)).valueOf() : 0;
|
|
340
|
-
if (safeFilters.start_time
|
|
331
|
+
if (safeFilters.start_time) {
|
|
341
332
|
const startTs = (0, import_dayjs.default)(safeFilters.start_time).startOf("day").valueOf();
|
|
342
333
|
if (orderTime < startTs) {
|
|
343
334
|
rejected.push({
|
|
@@ -352,7 +343,7 @@ function filterOrders(orders, filters) {
|
|
|
352
343
|
return false;
|
|
353
344
|
}
|
|
354
345
|
}
|
|
355
|
-
if (safeFilters.end_time
|
|
346
|
+
if (safeFilters.end_time) {
|
|
356
347
|
const endTs = (0, import_dayjs.default)(safeFilters.end_time).endOf("day").valueOf();
|
|
357
348
|
if (orderTime > endTs) {
|
|
358
349
|
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
|
/**
|