@pisell/pisellos 2.1.170 → 2.1.172
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 -1
- package/dist/index.js +1 -3
- package/dist/model/strategy/adapter/index.d.ts +0 -4
- package/dist/model/strategy/adapter/index.js +1 -5
- package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- 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/Cart/utils/changePrice.js +9 -16
- package/dist/modules/Discount/index.d.ts +4 -13
- package/dist/modules/Discount/index.js +12 -124
- package/dist/modules/Discount/types.d.ts +18 -13
- package/dist/modules/Order/index.d.ts +1 -67
- package/dist/modules/Order/index.js +30 -918
- package/dist/modules/Order/types.d.ts +12 -176
- 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 +2 -4
- package/dist/modules/ProductList/index.js +12 -24
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +669 -173
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +18 -16
- 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 +57 -67
- 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 -3
- package/dist/solution/ShopDiscount/index.js +60 -62
- 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 -1
- package/lib/index.js +3 -4
- package/lib/model/strategy/adapter/index.d.ts +0 -4
- package/lib/model/strategy/adapter/index.js +2 -13
- package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
- 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/Cart/utils/changePrice.js +9 -13
- package/lib/modules/Discount/index.d.ts +4 -13
- package/lib/modules/Discount/index.js +5 -76
- package/lib/modules/Discount/types.d.ts +18 -13
- package/lib/modules/Order/index.d.ts +1 -67
- package/lib/modules/Order/index.js +1 -525
- package/lib/modules/Order/types.d.ts +12 -176
- 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 +2 -4
- package/lib/modules/ProductList/index.js +39 -46
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +776 -292
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +11 -13
- 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 +34 -45
- 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 -3
- package/lib/solution/ShopDiscount/index.js +27 -22
- 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 +2 -2
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +0 -1
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -867
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
- 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 -158
- package/dist/solution/ScanOrder/index.js +0 -3474
- package/dist/solution/ScanOrder/types.d.ts +0 -306
- package/dist/solution/ScanOrder/types.js +0 -35
- package/dist/solution/ScanOrder/utils.d.ts +0 -172
- package/dist/solution/ScanOrder/utils.js +0 -796
- package/dist/solution/VenueBooking/index.d.ts +0 -252
- package/dist/solution/VenueBooking/index.js +0 -3769
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/dist/solution/VenueBooking/types.d.ts +0 -156
- package/dist/solution/VenueBooking/types.js +0 -22
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/dist/solution/VenueBooking/utils/dateSummary.js +0 -91
- 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 -32
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -233
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -302
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/dist/solution/VenueBooking/utils/timeSlot.js +0 -458
- 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/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -666
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
- 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 -158
- package/lib/solution/ScanOrder/index.js +0 -2135
- package/lib/solution/ScanOrder/types.d.ts +0 -306
- package/lib/solution/ScanOrder/types.js +0 -36
- package/lib/solution/ScanOrder/utils.d.ts +0 -172
- package/lib/solution/ScanOrder/utils.js +0 -658
- package/lib/solution/VenueBooking/index.d.ts +0 -252
- package/lib/solution/VenueBooking/index.js +0 -2204
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/lib/solution/VenueBooking/types.d.ts +0 -156
- package/lib/solution/VenueBooking/types.js +0 -45
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/lib/solution/VenueBooking/utils/dateSummary.js +0 -105
- 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 -32
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -236
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -225
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/lib/solution/VenueBooking/utils/timeSlot.js +0 -343
- package/lib/solution/VenueBooking/utils.d.ts +0 -1
- package/lib/solution/VenueBooking/utils.js +0 -69
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"order_id": null,
|
|
3
|
-
"order_id__comment": "订单 ID;int/null;↕;创建时可为 null,更新时传已有订单 ID。",
|
|
4
|
-
"order_number": "A00123",
|
|
5
|
-
"order_number__comment": "系统订单号;string;←;服务端生成返回。",
|
|
6
|
-
"shop_order_number": "A00123",
|
|
7
|
-
"shop_order_number__comment": "商户订单号;string;←;服务端生成返回。",
|
|
8
|
-
"type": "appointment_booking",
|
|
9
|
-
"type__comment": "订单类型;string;↕;必填。示例:appointment_booking / ticket / virtual。",
|
|
10
|
-
"business_code": "appointment_booking",
|
|
11
|
-
"business_code__comment": "业务编码;string;↕;可选。",
|
|
12
|
-
"platform": "pos",
|
|
13
|
-
"platform__comment": "来源平台;string;↕;必填。示例:shop / pos / kiosk / h5 / app / mini-program。",
|
|
14
|
-
"sales_channel": "my_pisel",
|
|
15
|
-
"sales_channel__comment": "销售渠道;string;↕;必填。",
|
|
16
|
-
"order_sales_channel": "pos",
|
|
17
|
-
"order_sales_channel__comment": "订单销售渠道;string;↕;必填。",
|
|
18
|
-
"status": "normal",
|
|
19
|
-
"status__comment": "订单状态;string;←;服务端返回。文档说明示例:open / completed / cancelled。",
|
|
20
|
-
"payment_status": "payment_processing",
|
|
21
|
-
"payment_status__comment": "支付状态;string;↕;可选。具体枚举见服务端定义。",
|
|
22
|
-
"shipping_status": "unfulfilled",
|
|
23
|
-
"shipping_status__comment": "发货状态;string;←;服务端返回。",
|
|
24
|
-
|
|
25
|
-
"customer_id": 456,
|
|
26
|
-
"customer_id__comment": "客户 ID;int;↕;必填。设备端用该 ID 从本地客户基准数据取详情。",
|
|
27
|
-
"customer_name": "张三",
|
|
28
|
-
"customer_name__comment": "客户名称;string;↕;可选。",
|
|
29
|
-
"country_calling_code": "+86",
|
|
30
|
-
"country_calling_code__comment": "国家呼号;string;↕;可选。",
|
|
31
|
-
"phone": "13800138000",
|
|
32
|
-
"phone__comment": "手机号;string;↕;可选。",
|
|
33
|
-
"email": "zhang@example.com",
|
|
34
|
-
"email__comment": "邮箱;string;↕;可选。",
|
|
35
|
-
|
|
36
|
-
"is_price_include_tax": 1,
|
|
37
|
-
"is_price_include_tax__comment": "是否含税;int(0/1);↕;必填。",
|
|
38
|
-
"tax_title": "GST",
|
|
39
|
-
"tax_title__comment": "税种名称;string;↕;必填。",
|
|
40
|
-
"tax_country_code": "MY",
|
|
41
|
-
"tax_country_code__comment": "税种国家编码;string;↕;必填。",
|
|
42
|
-
"currency_code": "MYR",
|
|
43
|
-
"currency_code__comment": "货币编码;string;↕;必填。",
|
|
44
|
-
"currency_symbol": "RM",
|
|
45
|
-
"currency_symbol__comment": "货币符号;string;↕;必填。",
|
|
46
|
-
"currency_format": "symbol_first",
|
|
47
|
-
"currency_format__comment": "货币格式;string;↕;必填。",
|
|
48
|
-
|
|
49
|
-
"is_deposit": 0,
|
|
50
|
-
"is_deposit__comment": "是否收取定金;int(0/1);↕;必填。",
|
|
51
|
-
"deposit_amount": "0.00",
|
|
52
|
-
"deposit_amount__comment": "定金金额;string;↕;必填。",
|
|
53
|
-
"shop_discount": "0.00",
|
|
54
|
-
"shop_discount__comment": "整单优惠金额;string;↕;必填。",
|
|
55
|
-
"surcharge_fee": "10.00",
|
|
56
|
-
"surcharge_fee__comment": "附加费总额;string;↕;必填。",
|
|
57
|
-
"note": "客人要求安静包房",
|
|
58
|
-
"note__comment": "订单备注;string;↕;可选。",
|
|
59
|
-
"schedule_date": "2026-03-18 00:00:00",
|
|
60
|
-
"schedule_date__comment": "预约日期;datetime;↕;必填。",
|
|
61
|
-
"created_at": "2026-03-18 10:00:00",
|
|
62
|
-
"created_at__comment": "创建时间;datetime;↕;必填。",
|
|
63
|
-
|
|
64
|
-
"products": [
|
|
65
|
-
{
|
|
66
|
-
"order_detail_id": 789,
|
|
67
|
-
"order_detail_id__comment": "订单明细 ID;int/null;↕;创建时可为 null,更新时传。",
|
|
68
|
-
"product_id": 101,
|
|
69
|
-
"product_id__comment": "商品 ID;int/null;↕;null 表示自定义商品。",
|
|
70
|
-
"num": 2,
|
|
71
|
-
"num__comment": "数量;int;↕;必填。统一使用 num,不再使用 product_quantity。",
|
|
72
|
-
"product_variant_id": 0,
|
|
73
|
-
"product_variant_id__comment": "多规格 ID;int;↕;可选。",
|
|
74
|
-
"product_option_item": [],
|
|
75
|
-
"product_option_item__comment": "选项配置;array;↕;可选。",
|
|
76
|
-
"selling_price": "50.00",
|
|
77
|
-
"selling_price__comment": "销售单价(交易快照);string;←;服务端返回,不能依赖基准数据回填。",
|
|
78
|
-
"original_price": "60.00",
|
|
79
|
-
"original_price__comment": "原价(交易快照);string;←。",
|
|
80
|
-
"payment_price": "50.00",
|
|
81
|
-
"payment_price__comment": "实际支付单价(交易快照);string;←。",
|
|
82
|
-
"tax_fee": "5.00",
|
|
83
|
-
"tax_fee__comment": "商品税费;string;←。",
|
|
84
|
-
"is_charge_tax": 1,
|
|
85
|
-
"is_charge_tax__comment": "是否收税;int(0/1);←。",
|
|
86
|
-
"discount_list": [
|
|
87
|
-
{
|
|
88
|
-
"order_discount_id": 601,
|
|
89
|
-
"order_discount_id__comment": "折扣记录 ID;int/null;↕;更新时传。",
|
|
90
|
-
"type": "product",
|
|
91
|
-
"type__comment": "折扣类型;string;↕;示例:shop / product。",
|
|
92
|
-
"discount_id": 0,
|
|
93
|
-
"discount_id__comment": "关联折扣规则 ID;int;↕。",
|
|
94
|
-
"amount": "10.00",
|
|
95
|
-
"amount__comment": "折扣金额;string;↕。",
|
|
96
|
-
"discount": {},
|
|
97
|
-
"discount__comment": "折扣详情;object;↕。",
|
|
98
|
-
"metadata": {
|
|
99
|
-
"unique_identification_number": "local_disc_001"
|
|
100
|
-
},
|
|
101
|
-
"metadata__comment": "元数据;object;↕。"
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
"discount_list__comment": "商品折扣列表;array;↕;结构见当前数组示例。",
|
|
105
|
-
"product_bundle": [
|
|
106
|
-
{
|
|
107
|
-
"bundle_group_id": 1,
|
|
108
|
-
"bundle_group_id__comment": "套餐组 ID;int;↕。",
|
|
109
|
-
"bundle_id": 10,
|
|
110
|
-
"bundle_id__comment": "套餐商品 ID;int;↕。",
|
|
111
|
-
"bundle_variant_id": 0,
|
|
112
|
-
"bundle_variant_id__comment": "套餐商品规格 ID;int;↕。",
|
|
113
|
-
"num": 1,
|
|
114
|
-
"num__comment": "数量;number;↕。",
|
|
115
|
-
"extension_id": 0,
|
|
116
|
-
"extension_id__comment": "扩展 ID;int;↕。",
|
|
117
|
-
"extension_type": "",
|
|
118
|
-
"extension_type__comment": "扩展类型;string;↕。",
|
|
119
|
-
"option": [],
|
|
120
|
-
"option__comment": "选项;array;↕。"
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
"product_bundle__comment": "套餐子商品;array;↕;结构见当前数组示例。",
|
|
124
|
-
"metadata": {
|
|
125
|
-
"unique_identification_number": "local_prod_001"
|
|
126
|
-
},
|
|
127
|
-
"metadata__comment": "商品元数据;object;↕;通常包含 unique_identification_number。"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"products__comment": "订单级别商品数组;array;↕;非预约关联商品放这里。预约主商品在 bookings[].product 中。",
|
|
131
|
-
|
|
132
|
-
"bookings": [
|
|
133
|
-
{
|
|
134
|
-
"schedule_event_id": 301,
|
|
135
|
-
"schedule_event_id__comment": "子预约 ID;int/null;↕;更新时传。",
|
|
136
|
-
"booking_id": "B20260318001",
|
|
137
|
-
"booking_id__comment": "预约号;string;←;服务端生成。",
|
|
138
|
-
"appointment_status": "new",
|
|
139
|
-
"appointment_status__comment": "预约状态;string;←;示例:new / confirmed / arrived / started / completed / cancelled。",
|
|
140
|
-
|
|
141
|
-
"start_date": "2026-03-18",
|
|
142
|
-
"start_date__comment": "预定开始日期;string(Y-m-d);↕;必填。",
|
|
143
|
-
"start_time": "15:00",
|
|
144
|
-
"start_time__comment": "预定开始时间;string(H:i);↕;必填。",
|
|
145
|
-
"end_date": "2026-03-18",
|
|
146
|
-
"end_date__comment": "预定结束日期;string(Y-m-d);↕;必填。",
|
|
147
|
-
"end_time": "17:00",
|
|
148
|
-
"end_time__comment": "预定结束时间;string(H:i);↕;必填。",
|
|
149
|
-
"select_date": "2026-03-18",
|
|
150
|
-
"select_date__comment": "全天选择日期;string(Y-m-d);↕;必填。",
|
|
151
|
-
"duration": 120,
|
|
152
|
-
"duration__comment": "服务时长(分钟);int;↕;必填。",
|
|
153
|
-
"arrived_at": null,
|
|
154
|
-
"arrived_at__comment": "实际到店时间;datetime/null;←;新增字段。",
|
|
155
|
-
"completed_at": null,
|
|
156
|
-
"completed_at__comment": "实际结束时间;datetime/null;←;新增字段。",
|
|
157
|
-
|
|
158
|
-
"sub_type": "service",
|
|
159
|
-
"sub_type__comment": "子类型;string;↕;必填。",
|
|
160
|
-
"like_status": "common",
|
|
161
|
-
"like_status__comment": "特殊状态;string;↕;示例:common / like。",
|
|
162
|
-
"number": 1,
|
|
163
|
-
"number__comment": "预约人数/容量占用;int;↕;可选。",
|
|
164
|
-
|
|
165
|
-
"resources": [
|
|
166
|
-
{
|
|
167
|
-
"form_id": 10,
|
|
168
|
-
"form_id__comment": "表单 ID;int;↕;必填。",
|
|
169
|
-
"relation_type": "form",
|
|
170
|
-
"relation_type__comment": "关联类型;string;↕;必填。示例:form。",
|
|
171
|
-
"relation_id": 201,
|
|
172
|
-
"relation_id__comment": "关联资源 ID;int;↕;必填。设备端用该 ID 从本地基准数据取资源详情。",
|
|
173
|
-
"capacity": 1,
|
|
174
|
-
"capacity__comment": "占用容量;int;↕;必填。",
|
|
175
|
-
"like_status": "like",
|
|
176
|
-
"like_status__comment": "特殊状态;string;↕;可选。",
|
|
177
|
-
"metadata": null,
|
|
178
|
-
"metadata__comment": "资源元数据;object/null;↕;可选。",
|
|
179
|
-
"children": [
|
|
180
|
-
{
|
|
181
|
-
"form_id": 11,
|
|
182
|
-
"form_id__comment": "子资源表单 ID;int;↕。",
|
|
183
|
-
"relation_type": "form",
|
|
184
|
-
"relation_type__comment": "子资源关联类型;string;↕。",
|
|
185
|
-
"relation_id": 305,
|
|
186
|
-
"relation_id__comment": "子资源关联 ID;int;↕。",
|
|
187
|
-
"capacity": 1,
|
|
188
|
-
"capacity__comment": "子资源占用容量;int;↕。",
|
|
189
|
-
"metadata": null,
|
|
190
|
-
"metadata__comment": "子资源元数据;object/null;↕。"
|
|
191
|
-
}
|
|
192
|
-
],
|
|
193
|
-
"children__comment": "子资源数组;array;↕;组合资源场景使用,结构同父级。"
|
|
194
|
-
}
|
|
195
|
-
],
|
|
196
|
-
"resources__comment": "预约关联资源数组;array;↕;只返回 ID,不返回资源名称/头像/技能等详情。",
|
|
197
|
-
|
|
198
|
-
"product": {
|
|
199
|
-
"order_detail_id": null,
|
|
200
|
-
"order_detail_id__comment": "预约主商品对应的订单明细 ID;int/null;↕。",
|
|
201
|
-
"product_id": 101,
|
|
202
|
-
"product_id__comment": "预约主商品 ID;int/null;↕。",
|
|
203
|
-
"num": 1,
|
|
204
|
-
"num__comment": "预约主商品数量;int;↕。",
|
|
205
|
-
"discount_list": [],
|
|
206
|
-
"discount_list__comment": "预约主商品折扣列表;array;↕;结构同 products[].discount_list。",
|
|
207
|
-
"product_bundle": [],
|
|
208
|
-
"product_bundle__comment": "预约主商品套餐子项;array;↕;结构同 products[].product_bundle。",
|
|
209
|
-
"metadata": {
|
|
210
|
-
"unique_identification_number": "local_bk_prod_001"
|
|
211
|
-
},
|
|
212
|
-
"metadata__comment": "预约主商品元数据;object;↕。"
|
|
213
|
-
},
|
|
214
|
-
"product__comment": "预约主商品对象;object;↕;结构与 products 单项一致。",
|
|
215
|
-
|
|
216
|
-
"relation_products": [],
|
|
217
|
-
"relation_products__comment": "预约附属商品数组;array;↕;结构同 products。",
|
|
218
|
-
"relation_forms": [],
|
|
219
|
-
"relation_forms__comment": "预约关联表单;array;↕。",
|
|
220
|
-
"holder": null,
|
|
221
|
-
"holder__comment": "预约主体参数;object/null;↕。",
|
|
222
|
-
"metadata": {
|
|
223
|
-
"unique_identification_number": "local_booking_001"
|
|
224
|
-
},
|
|
225
|
-
"metadata__comment": "预约元数据;object;↕;通常包含 unique_identification_number。"
|
|
226
|
-
}
|
|
227
|
-
],
|
|
228
|
-
"bookings__comment": "预约数组;array;↕;每个 booking 对应一个子预约(schedule_event,parent_id != 0)。",
|
|
229
|
-
|
|
230
|
-
"payments": [
|
|
231
|
-
{
|
|
232
|
-
"order_payment_id": 501,
|
|
233
|
-
"order_payment_id__comment": "支付记录 ID;int/null;↕;存量数据传,新增时可为空。",
|
|
234
|
-
"custom_payment_id": 1,
|
|
235
|
-
"custom_payment_id__comment": "支付方式 ID;int;↕;设备端可用它从本地支付方式配置取详情。",
|
|
236
|
-
"code": "cash",
|
|
237
|
-
"code__comment": "支付方式编码;string;↕。",
|
|
238
|
-
"name": "现金",
|
|
239
|
-
"name__comment": "支付方式名称;string;↕。",
|
|
240
|
-
"type": "deposit",
|
|
241
|
-
"type__comment": "支付类型;string;↕;示例:deposit。",
|
|
242
|
-
"voucher_id": null,
|
|
243
|
-
"voucher_id__comment": "Wallet Pass ID;int/null;↕。",
|
|
244
|
-
"amount": "100.00",
|
|
245
|
-
"amount__comment": "支付金额;string;↕;必填。",
|
|
246
|
-
"origin_amount": "100.00",
|
|
247
|
-
"origin_amount__comment": "原始金额;string;←。",
|
|
248
|
-
"rounding_amount": "0.00",
|
|
249
|
-
"rounding_amount__comment": "Rounding 金额;string;←。",
|
|
250
|
-
"status": "paid",
|
|
251
|
-
"status__comment": "支付状态;string;↕;示例:paid / voided / payment_pending。",
|
|
252
|
-
"payment_time": "2026-03-18 15:00:00",
|
|
253
|
-
"payment_time__comment": "支付时间;datetime/null;←。",
|
|
254
|
-
"service_charge": null,
|
|
255
|
-
"service_charge__comment": "手续费配置;object/null;↕。",
|
|
256
|
-
"wallet_pass_usage_unit": null,
|
|
257
|
-
"wallet_pass_usage_unit__comment": "Wallet Pass 使用单位;array/null;↕。",
|
|
258
|
-
"wallet_pass_use_value": null,
|
|
259
|
-
"wallet_pass_use_value__comment": "Wallet Pass 使用值;number/null;↕。",
|
|
260
|
-
"metadata": {
|
|
261
|
-
"unique_payment_number": "local_pay_001"
|
|
262
|
-
},
|
|
263
|
-
"metadata__comment": "支付元数据;object;↕;通常包含 unique_payment_number。"
|
|
264
|
-
}
|
|
265
|
-
],
|
|
266
|
-
"payments__comment": "支付数组;array;↕。",
|
|
267
|
-
|
|
268
|
-
"surcharges": [
|
|
269
|
-
{
|
|
270
|
-
"order_surcharge_id": 701,
|
|
271
|
-
"order_surcharge_id__comment": "订单附加费记录 ID;int/null;←;服务端返回。",
|
|
272
|
-
"surcharge_id": 1,
|
|
273
|
-
"surcharge_id__comment": "附加费配置 ID;int;↕;必填。",
|
|
274
|
-
"type": "service_charge",
|
|
275
|
-
"type__comment": "附加费类型;string;↕;必填。",
|
|
276
|
-
"name": {
|
|
277
|
-
"en": "Service Charge"
|
|
278
|
-
},
|
|
279
|
-
"name__comment": "名称;object;↕;多语言 JSON。",
|
|
280
|
-
"description": {
|
|
281
|
-
"en": "10% service charge"
|
|
282
|
-
},
|
|
283
|
-
"description__comment": "描述;object;↕;多语言 JSON。",
|
|
284
|
-
"percentage": "0.10",
|
|
285
|
-
"percentage__comment": "百分比费率;string/null;↕。",
|
|
286
|
-
"fixed": null,
|
|
287
|
-
"fixed__comment": "固定金额;string/null;↕。",
|
|
288
|
-
"amount": "10.00",
|
|
289
|
-
"amount__comment": "附加费金额;string;↕;必填。"
|
|
290
|
-
}
|
|
291
|
-
],
|
|
292
|
-
"surcharges__comment": "附加费数组;array;↕。",
|
|
293
|
-
|
|
294
|
-
"discount_list": [],
|
|
295
|
-
"discount_list__comment": "顶层整单折扣列表;array;↕;文档样例中出现于顶层结构,但详细字段说明主要在商品折扣部分,可按商品折扣结构复用。",
|
|
296
|
-
"relation_forms": [],
|
|
297
|
-
"relation_forms__comment": "顶层关联表单;array;↕。",
|
|
298
|
-
"contacts": [],
|
|
299
|
-
"contacts__comment": "联系人数组;array;↕;顶层结构中出现,但文档第四部分未单独展开字段定义。",
|
|
300
|
-
"contacts_info": [],
|
|
301
|
-
"contacts_info__comment": "联系人信息数组;array;↕;顶层结构中出现,但文档第四部分未单独展开字段定义。",
|
|
302
|
-
"holder": null,
|
|
303
|
-
"holder__comment": "顶层持有人/主体参数;object/null;↕;顶层结构中出现,但文档第四部分未单独展开字段定义。",
|
|
304
|
-
|
|
305
|
-
"summary": {
|
|
306
|
-
"product_quantity": 3,
|
|
307
|
-
"product_quantity__comment": "商品总数量;int;←。",
|
|
308
|
-
"product_original_amount": "180.00",
|
|
309
|
-
"product_original_amount__comment": "商品原价总额;string;←。",
|
|
310
|
-
"product_amount": "150.00",
|
|
311
|
-
"product_amount__comment": "商品实际支付总额;string;←。",
|
|
312
|
-
"product_expect_amount": "150.00",
|
|
313
|
-
"product_expect_amount__comment": "商品预计支付总额;string;←。",
|
|
314
|
-
"product_tax_fee": "15.00",
|
|
315
|
-
"product_tax_fee__comment": "商品总税费;string;←。",
|
|
316
|
-
"shipping_fee": "0.00",
|
|
317
|
-
"shipping_fee__comment": "运费;string;←。",
|
|
318
|
-
"shipping_tax_fee": "0.00",
|
|
319
|
-
"shipping_tax_fee__comment": "运费税;string;←。",
|
|
320
|
-
"tax_fee": "15.00",
|
|
321
|
-
"tax_fee__comment": "订单总税费;string;←。",
|
|
322
|
-
"surcharge_fee": "10.00",
|
|
323
|
-
"surcharge_fee__comment": "附加费总额;string;←。",
|
|
324
|
-
"discount_amount": "30.00",
|
|
325
|
-
"discount_amount__comment": "优惠总额;string;←。",
|
|
326
|
-
"deposit_amount": "0.00",
|
|
327
|
-
"deposit_amount__comment": "定金金额;string;←。",
|
|
328
|
-
"expect_amount": "175.00",
|
|
329
|
-
"expect_amount__comment": "预计总金额(不含手续费);string;←。",
|
|
330
|
-
"total_amount": "175.00",
|
|
331
|
-
"total_amount__comment": "订单总金额(实际应付);string;←。",
|
|
332
|
-
"amount_gap": "0.00",
|
|
333
|
-
"amount_gap__comment": "差额;string;←。",
|
|
334
|
-
"rounding_amount": "0.00",
|
|
335
|
-
"rounding_amount__comment": "Rounding 金额;string;←。",
|
|
336
|
-
"pay_service_charge_amount": "0.00",
|
|
337
|
-
"pay_service_charge_amount__comment": "支付手续费;string;←。"
|
|
338
|
-
},
|
|
339
|
-
"summary__comment": "金额汇总;object;←;仅输出,由服务端计算生成。设备端离线场景可本地按同算法计算。",
|
|
340
|
-
|
|
341
|
-
"metadata": {},
|
|
342
|
-
"metadata__comment": "扩展元数据;object;↕;顶层附加信息。"
|
|
343
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { OrderModule, ProductList, SalesSummaryModule, ScanOrderLogInput, ScanOrderLoggerModule, ScanOrderLoggerProviderConfig, ScanOrderLoggerProviderType, DateModule, ScheduleModule, QuotationModule, OpenDataModule } from '../../modules';
|
|
2
|
-
import type { QuantityCheckResult, QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
3
|
-
export type { ScanOrderOrderProductIdentity, ScanOrderOrderProduct, ScanOrderSubmitProduct, ScanOrderSummary, ScanOrderTempOrder, ScanOrderSubmitPayload, } from '../ScanOrder/types';
|
|
4
|
-
export declare enum VenueBookingHooks {
|
|
5
|
-
onInited = "venueBooking:onInited",
|
|
6
|
-
onDestroy = "venueBooking:onDestroy",
|
|
7
|
-
onRetryInit = "venueBooking:onRetryInit",
|
|
8
|
-
onRefresh = "venueBooking:onRefresh",
|
|
9
|
-
onCartValidationChanged = "venueBooking:onCartValidationChanged",
|
|
10
|
-
/** 登录客户的智能定价、营销配置与订单汇总已完成刷新 */
|
|
11
|
-
onSmartPricingUpdated = "venueBooking:onSmartPricingUpdated"
|
|
12
|
-
}
|
|
13
|
-
export type VenueBookingStatus = 'idle' | 'initializing' | 'ready' | 'error';
|
|
14
|
-
export interface VenueBookingEntryContext {
|
|
15
|
-
biz: string;
|
|
16
|
-
venueId?: string;
|
|
17
|
-
sourceOrderId?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface VenueBookingConfig {
|
|
20
|
-
orderSource: 'local' | 'remote';
|
|
21
|
-
features: {
|
|
22
|
-
autoMerge: boolean;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export interface VenueBookingSlotConfig {
|
|
26
|
-
slotDurationMinutes: number;
|
|
27
|
-
businessStartTime: string;
|
|
28
|
-
businessEndTime: string;
|
|
29
|
-
fewLeftThreshold: number;
|
|
30
|
-
}
|
|
31
|
-
export declare const DEFAULT_SLOT_CONFIG: VenueBookingSlotConfig;
|
|
32
|
-
export interface VenueTimeSlot {
|
|
33
|
-
startTime: string;
|
|
34
|
-
endTime: string;
|
|
35
|
-
status: 'available' | 'occupied' | 'partially_occupied' | 'past' | 'unavailable';
|
|
36
|
-
price: string | null;
|
|
37
|
-
resourceId: number | string;
|
|
38
|
-
resourceFormId: number | string;
|
|
39
|
-
capacity: number | null;
|
|
40
|
-
remainingCapacity: number | null;
|
|
41
|
-
/** per-product sub-row slot 上带的 productId;外层合并 slot 不写 */
|
|
42
|
-
productId?: number;
|
|
43
|
-
}
|
|
44
|
-
export interface VenueResourceSubRow {
|
|
45
|
-
productId: number;
|
|
46
|
-
productTitle: string;
|
|
47
|
-
price: string;
|
|
48
|
-
slots: VenueTimeSlot[];
|
|
49
|
-
}
|
|
50
|
-
export interface VenueResourceCombinedInfo {
|
|
51
|
-
resourceIds: Array<number | string>;
|
|
52
|
-
}
|
|
53
|
-
export interface VenueResourceRow {
|
|
54
|
-
resourceId: number | string;
|
|
55
|
-
resourceFormId: number | string;
|
|
56
|
-
resourceName: string;
|
|
57
|
-
/** 单商品时取唯一 mapping.productId;多商品时取第一个 mapping(兼容字段) */
|
|
58
|
-
productId: number;
|
|
59
|
-
productTitle: string;
|
|
60
|
-
slots: VenueTimeSlot[];
|
|
61
|
-
/** 多商品共享同一场地时的子行;单商品不输出 */
|
|
62
|
-
products?: VenueResourceSubRow[];
|
|
63
|
-
hasMultipleProducts?: boolean;
|
|
64
|
-
/** 当前资源是 combined_resource.status===1 时输出 */
|
|
65
|
-
combinedResource?: VenueResourceCombinedInfo;
|
|
66
|
-
}
|
|
67
|
-
export interface VenueTimeSlotGrid {
|
|
68
|
-
date: string;
|
|
69
|
-
timeLabels: string[];
|
|
70
|
-
resources: VenueResourceRow[];
|
|
71
|
-
}
|
|
72
|
-
export interface VenueDateSummaryItem {
|
|
73
|
-
date: string;
|
|
74
|
-
status: 'available' | 'few_left' | 'sold_out' | 'unavailable';
|
|
75
|
-
startingPrice: string | null;
|
|
76
|
-
totalSlots: number;
|
|
77
|
-
availableSlots: number;
|
|
78
|
-
}
|
|
79
|
-
export interface VenueResourceCombinedRaw {
|
|
80
|
-
status: number;
|
|
81
|
-
resource_ids: Array<number | string>;
|
|
82
|
-
}
|
|
83
|
-
export interface VenueResourceRawData {
|
|
84
|
-
resourceId: number | string;
|
|
85
|
-
formId: number | string;
|
|
86
|
-
main_field?: string;
|
|
87
|
-
form_id?: number | string;
|
|
88
|
-
resource_form_id?: number | string;
|
|
89
|
-
capacity?: number;
|
|
90
|
-
times: Array<{
|
|
91
|
-
start_at: string;
|
|
92
|
-
end_at: string;
|
|
93
|
-
[key: string]: any;
|
|
94
|
-
}>;
|
|
95
|
-
combined_resource?: VenueResourceCombinedRaw;
|
|
96
|
-
[key: string]: any;
|
|
97
|
-
}
|
|
98
|
-
export interface ResourceProductMapping {
|
|
99
|
-
productId: number;
|
|
100
|
-
productTitle: string;
|
|
101
|
-
formName?: string;
|
|
102
|
-
resourceName: string;
|
|
103
|
-
formId: number | string;
|
|
104
|
-
price: string;
|
|
105
|
-
resourceType: 'single' | 'multiple' | 'capacity';
|
|
106
|
-
}
|
|
107
|
-
export interface VenueSlotSelection {
|
|
108
|
-
resourceId: number | string;
|
|
109
|
-
productId: number;
|
|
110
|
-
startTime: string;
|
|
111
|
-
endTime: string;
|
|
112
|
-
price: string;
|
|
113
|
-
}
|
|
114
|
-
export interface MergedSlotGroup {
|
|
115
|
-
startTime: string;
|
|
116
|
-
endTime: string;
|
|
117
|
-
totalPrice: string;
|
|
118
|
-
slotCount: number;
|
|
119
|
-
slots: VenueSlotSelection[];
|
|
120
|
-
}
|
|
121
|
-
export interface PriceBreakdownEntry {
|
|
122
|
-
start_time: string;
|
|
123
|
-
end_time: string;
|
|
124
|
-
unit_price: number;
|
|
125
|
-
quotation_shelf_id: number;
|
|
126
|
-
quantity: number;
|
|
127
|
-
}
|
|
128
|
-
export interface VenueBookingState {
|
|
129
|
-
entryContext: VenueBookingEntryContext | null;
|
|
130
|
-
status: VenueBookingStatus;
|
|
131
|
-
flow: Record<string, any>;
|
|
132
|
-
error: string | null;
|
|
133
|
-
products?: ProductList;
|
|
134
|
-
order?: OrderModule;
|
|
135
|
-
salesSummary?: SalesSummaryModule;
|
|
136
|
-
scanOrderLogger?: ScanOrderLoggerModule;
|
|
137
|
-
venueProducts?: ProductList;
|
|
138
|
-
addonProducts?: ProductList;
|
|
139
|
-
date?: DateModule;
|
|
140
|
-
schedule?: ScheduleModule;
|
|
141
|
-
quotation?: QuotationModule;
|
|
142
|
-
openData?: OpenDataModule;
|
|
143
|
-
rawResourceData: VenueResourceRawData[];
|
|
144
|
-
slotConfig: VenueBookingSlotConfig;
|
|
145
|
-
itemRuleQuantityLimits: QuantityLimitResult[];
|
|
146
|
-
cartValidation: {
|
|
147
|
-
passed: boolean | null;
|
|
148
|
-
failures: QuantityCheckResult[];
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
export interface VenueBookingLoggerRuntimeConfig {
|
|
152
|
-
provider?: ScanOrderLoggerProviderType;
|
|
153
|
-
providerConfig?: ScanOrderLoggerProviderConfig;
|
|
154
|
-
}
|
|
155
|
-
export interface VenueBookingAddLogParams extends ScanOrderLogInput {
|
|
156
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export var VenueBookingHooks = /*#__PURE__*/function (VenueBookingHooks) {
|
|
2
|
-
VenueBookingHooks["onInited"] = "venueBooking:onInited";
|
|
3
|
-
VenueBookingHooks["onDestroy"] = "venueBooking:onDestroy";
|
|
4
|
-
VenueBookingHooks["onRetryInit"] = "venueBooking:onRetryInit";
|
|
5
|
-
VenueBookingHooks["onRefresh"] = "venueBooking:onRefresh";
|
|
6
|
-
VenueBookingHooks["onCartValidationChanged"] = "venueBooking:onCartValidationChanged";
|
|
7
|
-
VenueBookingHooks["onSmartPricingUpdated"] = "venueBooking:onSmartPricingUpdated";
|
|
8
|
-
return VenueBookingHooks;
|
|
9
|
-
}({});
|
|
10
|
-
|
|
11
|
-
// ─── 场地预定核心类型 ───
|
|
12
|
-
|
|
13
|
-
export var DEFAULT_SLOT_CONFIG = {
|
|
14
|
-
slotDurationMinutes: 30,
|
|
15
|
-
businessStartTime: '09:00',
|
|
16
|
-
businessEndTime: '23:00',
|
|
17
|
-
fewLeftThreshold: 0.8
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// ─── 时段选择 & 合并 ───
|
|
21
|
-
|
|
22
|
-
// ─── Store 状态 ───
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { VenueBookingSlotConfig, VenueResourceRawData, VenueDateSummaryItem, ResourceProductMapping } from '../types';
|
|
2
|
-
export declare function buildDateRangeSummary(params: {
|
|
3
|
-
startDate: string;
|
|
4
|
-
endDate: string;
|
|
5
|
-
config: VenueBookingSlotConfig;
|
|
6
|
-
rawResources: VenueResourceRawData[];
|
|
7
|
-
resourceProductMap: Map<number | string, ResourceProductMapping[]>;
|
|
8
|
-
resolveConfig?: (date: string) => VenueBookingSlotConfig;
|
|
9
|
-
/** 按日期构建 slot 智能定价 Map */
|
|
10
|
-
buildSlotPriceMap?: (date: string, config: VenueBookingSlotConfig, productIds: number[]) => Map<string, string | null>;
|
|
11
|
-
}): VenueDateSummaryItem[];
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
-
import dayjs from 'dayjs';
|
|
9
|
-
import { buildTimeSlotGrid } from "./timeSlot";
|
|
10
|
-
export function buildDateRangeSummary(params) {
|
|
11
|
-
var startDate = params.startDate,
|
|
12
|
-
endDate = params.endDate,
|
|
13
|
-
config = params.config,
|
|
14
|
-
rawResources = params.rawResources,
|
|
15
|
-
resourceProductMap = params.resourceProductMap,
|
|
16
|
-
resolveConfig = params.resolveConfig,
|
|
17
|
-
buildSlotPriceMap = params.buildSlotPriceMap;
|
|
18
|
-
var result = [];
|
|
19
|
-
var productIds = buildSlotPriceMap ? _toConsumableArray(new Set(_toConsumableArray(resourceProductMap.values()).flat().map(function (m) {
|
|
20
|
-
return m.productId;
|
|
21
|
-
}))) : [];
|
|
22
|
-
var cursor = dayjs(startDate);
|
|
23
|
-
var end = dayjs(endDate);
|
|
24
|
-
while (!cursor.isAfter(end)) {
|
|
25
|
-
var _date = cursor.format('YYYY-MM-DD');
|
|
26
|
-
var effectiveConfig = (resolveConfig === null || resolveConfig === void 0 ? void 0 : resolveConfig(_date)) || config;
|
|
27
|
-
var slotPriceMap = buildSlotPriceMap && productIds.length ? buildSlotPriceMap(_date, effectiveConfig, productIds) : undefined;
|
|
28
|
-
var grid = buildTimeSlotGrid({
|
|
29
|
-
date: _date,
|
|
30
|
-
config: effectiveConfig,
|
|
31
|
-
rawResources: rawResources,
|
|
32
|
-
resourceProductMap: resourceProductMap,
|
|
33
|
-
slotPriceMap: slotPriceMap
|
|
34
|
-
});
|
|
35
|
-
var totalSlots = 0;
|
|
36
|
-
var availableSlots = 0;
|
|
37
|
-
var lowestPrice = null;
|
|
38
|
-
var _iterator = _createForOfIteratorHelper(grid.resources),
|
|
39
|
-
_step;
|
|
40
|
-
try {
|
|
41
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
42
|
-
var resource = _step.value;
|
|
43
|
-
var _iterator2 = _createForOfIteratorHelper(resource.slots),
|
|
44
|
-
_step2;
|
|
45
|
-
try {
|
|
46
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
47
|
-
var slot = _step2.value;
|
|
48
|
-
if (slot.status === 'past' || slot.status === 'unavailable') continue;
|
|
49
|
-
totalSlots++;
|
|
50
|
-
if (slot.status === 'available' || slot.status === 'partially_occupied') {
|
|
51
|
-
availableSlots++;
|
|
52
|
-
if (slot.price !== null) {
|
|
53
|
-
var priceNum = Number(slot.price);
|
|
54
|
-
if (Number.isFinite(priceNum) && (lowestPrice === null || priceNum < lowestPrice)) {
|
|
55
|
-
lowestPrice = priceNum;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
} catch (err) {
|
|
61
|
-
_iterator2.e(err);
|
|
62
|
-
} finally {
|
|
63
|
-
_iterator2.f();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
} catch (err) {
|
|
67
|
-
_iterator.e(err);
|
|
68
|
-
} finally {
|
|
69
|
-
_iterator.f();
|
|
70
|
-
}
|
|
71
|
-
var status = void 0;
|
|
72
|
-
if (totalSlots === 0) {
|
|
73
|
-
status = 'unavailable';
|
|
74
|
-
} else if (availableSlots === 0) {
|
|
75
|
-
status = 'sold_out';
|
|
76
|
-
} else if ((totalSlots - availableSlots) / totalSlots >= effectiveConfig.fewLeftThreshold) {
|
|
77
|
-
status = 'few_left';
|
|
78
|
-
} else {
|
|
79
|
-
status = 'available';
|
|
80
|
-
}
|
|
81
|
-
result.push({
|
|
82
|
-
date: _date,
|
|
83
|
-
status: status,
|
|
84
|
-
startingPrice: lowestPrice !== null ? lowestPrice.toFixed(2) : null,
|
|
85
|
-
totalSlots: totalSlots,
|
|
86
|
-
availableSlots: availableSlots
|
|
87
|
-
});
|
|
88
|
-
cursor = cursor.add(1, 'day');
|
|
89
|
-
}
|
|
90
|
-
return result;
|
|
91
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ProductData } from '../../../modules/Product/types';
|
|
2
|
-
import type { ResourceProductMapping } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* 从商品列表里抽取所有 resource_id:
|
|
5
|
-
* - 商品绑定的 default_resource / optional_resource
|
|
6
|
-
* - 以及这些资源上声明的 combined_resource.resource_ids(若可从 product_resource 读取)
|
|
7
|
-
* 用于一次性拉到子资源数据,判定组合资源的可用性。
|
|
8
|
-
*/
|
|
9
|
-
export declare function extractResourceIds(products: ProductData[]): number[];
|
|
10
|
-
/**
|
|
11
|
-
* 每个 resourceId 可以被多个商品共享(同一场地关联多种运动商品)。
|
|
12
|
-
* Map 的 value 改为 ResourceProductMapping[],按商品出现顺序保留。
|
|
13
|
-
*/
|
|
14
|
-
export declare function buildResourceProductMap(products: ProductData[]): Map<number | string, ResourceProductMapping[]>;
|