@pisell/pisellos 2.1.150 → 2.1.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +61 -8
- package/dist/model/strategy/adapter/walletPass/locales.js +12 -3
- package/dist/model/strategy/engine.d.ts +18 -5
- package/dist/model/strategy/engine.js +145 -45
- package/dist/model/strategy/type.d.ts +17 -0
- package/dist/model/strategy/type.js +4 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +56 -25
- package/dist/modules/Discount/index.d.ts +2 -6
- package/dist/modules/Discount/index.js +8 -14
- package/dist/modules/Discount/types.d.ts +19 -1
- package/dist/modules/Order/index.d.ts +1 -65
- package/dist/modules/Order/index.js +30 -901
- package/dist/modules/Order/types.d.ts +12 -174
- package/dist/modules/Order/types.js +0 -2
- package/dist/modules/Order/utils.d.ts +0 -118
- package/dist/modules/Order/utils.js +2 -586
- package/dist/modules/Payment/index.d.ts +2 -1
- package/dist/modules/Payment/index.js +10 -7
- package/dist/modules/Payment/utils.js +3 -0
- package/dist/modules/Payment/walletpass.d.ts +23 -0
- package/dist/modules/Payment/walletpass.js +191 -95
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +3 -4
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +677 -168
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +18 -11
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/types.d.ts +2 -0
- package/dist/modules/Summary/utils.d.ts +9 -3
- package/dist/modules/Summary/utils.js +52 -41
- package/dist/modules/index.d.ts +0 -4
- package/dist/modules/index.js +1 -5
- package/dist/plugins/window.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +3 -2
- package/dist/solution/BookingByStep/index.js +43 -46
- package/dist/solution/BookingByStep/types.d.ts +1 -3
- package/dist/solution/BookingByStep/types.js +1 -5
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/Checkout/index.js +2 -0
- package/dist/solution/ShopDiscount/index.d.ts +2 -2
- package/dist/solution/ShopDiscount/index.js +41 -37
- package/dist/solution/ShopDiscount/types.d.ts +1 -1
- package/dist/solution/ShopDiscount/types.js +2 -1
- package/dist/solution/ShopDiscount/utils.js +26 -12
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +34 -3
- package/lib/model/strategy/adapter/walletPass/locales.js +12 -3
- package/lib/model/strategy/engine.d.ts +18 -5
- package/lib/model/strategy/engine.js +85 -21
- package/lib/model/strategy/type.d.ts +17 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +39 -12
- package/lib/modules/Discount/index.d.ts +2 -6
- package/lib/modules/Discount/index.js +1 -3
- package/lib/modules/Discount/types.d.ts +19 -1
- package/lib/modules/Order/index.d.ts +1 -65
- package/lib/modules/Order/index.js +1 -513
- package/lib/modules/Order/types.d.ts +12 -174
- package/lib/modules/Order/utils.d.ts +0 -118
- package/lib/modules/Order/utils.js +2 -483
- package/lib/modules/Payment/index.d.ts +2 -1
- package/lib/modules/Payment/index.js +1 -0
- package/lib/modules/Payment/utils.js +3 -0
- package/lib/modules/Payment/walletpass.d.ts +23 -0
- package/lib/modules/Payment/walletpass.js +94 -17
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +3 -5
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +780 -288
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +11 -9
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/types.d.ts +2 -0
- package/lib/modules/Summary/utils.d.ts +9 -3
- package/lib/modules/Summary/utils.js +31 -22
- package/lib/modules/index.d.ts +0 -4
- package/lib/modules/index.js +1 -9
- package/lib/plugins/window.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +3 -2
- package/lib/solution/BookingByStep/index.js +4 -6
- package/lib/solution/BookingByStep/types.d.ts +1 -3
- package/lib/solution/BookingByStep/types.js +0 -10
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/Checkout/index.js +2 -0
- package/lib/solution/ShopDiscount/index.d.ts +2 -2
- package/lib/solution/ShopDiscount/index.js +24 -16
- package/lib/solution/ShopDiscount/types.d.ts +1 -1
- package/lib/solution/ShopDiscount/utils.js +10 -6
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/package.json +1 -1
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +0 -1
- package/dist/modules/OpenData/index.d.ts +0 -24
- package/dist/modules/OpenData/index.js +0 -173
- package/dist/modules/OpenData/types.d.ts +0 -73
- package/dist/modules/OpenData/types.js +0 -1
- package/dist/modules/OpenData/utils.d.ts +0 -2
- package/dist/modules/OpenData/utils.js +0 -75
- package/dist/modules/Quotation/index.d.ts +0 -48
- package/dist/modules/Quotation/index.js +0 -248
- package/dist/modules/Quotation/types.d.ts +0 -42
- package/dist/modules/Quotation/types.js +0 -1
- package/dist/modules/SalesSummary/index.d.ts +0 -63
- package/dist/modules/SalesSummary/index.js +0 -174
- package/dist/modules/SalesSummary/types.d.ts +0 -60
- package/dist/modules/SalesSummary/types.js +0 -1
- package/dist/modules/SalesSummary/utils.d.ts +0 -30
- package/dist/modules/SalesSummary/utils.js +0 -480
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -23
- package/dist/modules/ScanOrderLogger/index.js +0 -174
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +0 -221
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/grafana.js +0 -50
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
- package/dist/modules/ScanOrderLogger/types.js +0 -1
- package/dist/solution/ScanOrder/index.d.ts +0 -152
- package/dist/solution/ScanOrder/index.js +0 -3132
- package/dist/solution/ScanOrder/types.d.ts +0 -287
- package/dist/solution/ScanOrder/types.js +0 -35
- package/dist/solution/ScanOrder/utils.d.ts +0 -167
- package/dist/solution/ScanOrder/utils.js +0 -764
- package/dist/solution/VenueBooking/index.d.ts +0 -199
- package/dist/solution/VenueBooking/index.js +0 -3459
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/dist/solution/VenueBooking/types.d.ts +0 -154
- package/dist/solution/VenueBooking/types.js +0 -21
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/dist/solution/VenueBooking/utils/dateSummary.js +0 -104
- package/dist/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/dist/solution/VenueBooking/utils/resource.js +0 -131
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -38
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -239
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
- package/dist/solution/VenueBooking/utils/timeSlot.js +0 -453
- package/dist/solution/VenueBooking/utils.d.ts +0 -1
- package/dist/solution/VenueBooking/utils.js +0 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/modules/OpenData/index.d.ts +0 -24
- package/lib/modules/OpenData/index.js +0 -119
- package/lib/modules/OpenData/types.d.ts +0 -73
- package/lib/modules/OpenData/types.js +0 -17
- package/lib/modules/OpenData/utils.d.ts +0 -2
- package/lib/modules/OpenData/utils.js +0 -111
- package/lib/modules/Quotation/index.d.ts +0 -48
- package/lib/modules/Quotation/index.js +0 -152
- package/lib/modules/Quotation/types.d.ts +0 -42
- package/lib/modules/Quotation/types.js +0 -17
- package/lib/modules/SalesSummary/index.d.ts +0 -63
- package/lib/modules/SalesSummary/index.js +0 -105
- package/lib/modules/SalesSummary/types.d.ts +0 -60
- package/lib/modules/SalesSummary/types.js +0 -17
- package/lib/modules/SalesSummary/utils.d.ts +0 -30
- package/lib/modules/SalesSummary/utils.js +0 -420
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -23
- package/lib/modules/ScanOrderLogger/index.js +0 -147
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/feishu.js +0 -157
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/grafana.js +0 -52
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
- package/lib/modules/ScanOrderLogger/types.js +0 -17
- package/lib/solution/ScanOrder/index.d.ts +0 -152
- package/lib/solution/ScanOrder/index.js +0 -1901
- package/lib/solution/ScanOrder/types.d.ts +0 -287
- package/lib/solution/ScanOrder/types.js +0 -36
- package/lib/solution/ScanOrder/utils.d.ts +0 -167
- package/lib/solution/ScanOrder/utils.js +0 -635
- package/lib/solution/VenueBooking/index.d.ts +0 -199
- package/lib/solution/VenueBooking/index.js +0 -1926
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/lib/solution/VenueBooking/types.d.ts +0 -154
- package/lib/solution/VenueBooking/types.js +0 -44
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/lib/solution/VenueBooking/utils/dateSummary.js +0 -110
- package/lib/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/lib/solution/VenueBooking/utils/resource.js +0 -92
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -38
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -237
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
- package/lib/solution/VenueBooking/utils/timeSlot.js +0 -339
- package/lib/solution/VenueBooking/utils.d.ts +0 -1
- package/lib/solution/VenueBooking/utils.js +0 -69
|
@@ -1,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,154 +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
|
-
export type VenueBookingStatus = 'idle' | 'initializing' | 'ready' | 'error';
|
|
12
|
-
export interface VenueBookingEntryContext {
|
|
13
|
-
biz: string;
|
|
14
|
-
venueId?: string;
|
|
15
|
-
sourceOrderId?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface VenueBookingConfig {
|
|
18
|
-
orderSource: 'local' | 'remote';
|
|
19
|
-
features: {
|
|
20
|
-
autoMerge: boolean;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface VenueBookingSlotConfig {
|
|
24
|
-
slotDurationMinutes: number;
|
|
25
|
-
businessStartTime: string;
|
|
26
|
-
businessEndTime: string;
|
|
27
|
-
fewLeftThreshold: number;
|
|
28
|
-
}
|
|
29
|
-
export declare const DEFAULT_SLOT_CONFIG: VenueBookingSlotConfig;
|
|
30
|
-
export interface VenueTimeSlot {
|
|
31
|
-
startTime: string;
|
|
32
|
-
endTime: string;
|
|
33
|
-
status: 'available' | 'occupied' | 'partially_occupied' | 'past' | 'unavailable';
|
|
34
|
-
price: string | null;
|
|
35
|
-
resourceId: number | string;
|
|
36
|
-
resourceFormId: number | string;
|
|
37
|
-
capacity: number | null;
|
|
38
|
-
remainingCapacity: number | null;
|
|
39
|
-
/** per-product sub-row slot 上带的 productId;外层合并 slot 不写 */
|
|
40
|
-
productId?: number;
|
|
41
|
-
}
|
|
42
|
-
export interface VenueResourceSubRow {
|
|
43
|
-
productId: number;
|
|
44
|
-
productTitle: string;
|
|
45
|
-
price: string;
|
|
46
|
-
slots: VenueTimeSlot[];
|
|
47
|
-
}
|
|
48
|
-
export interface VenueResourceCombinedInfo {
|
|
49
|
-
resourceIds: Array<number | string>;
|
|
50
|
-
}
|
|
51
|
-
export interface VenueResourceRow {
|
|
52
|
-
resourceId: number | string;
|
|
53
|
-
resourceFormId: number | string;
|
|
54
|
-
resourceName: string;
|
|
55
|
-
/** 单商品时取唯一 mapping.productId;多商品时取第一个 mapping(兼容字段) */
|
|
56
|
-
productId: number;
|
|
57
|
-
productTitle: string;
|
|
58
|
-
slots: VenueTimeSlot[];
|
|
59
|
-
/** 多商品共享同一场地时的子行;单商品不输出 */
|
|
60
|
-
products?: VenueResourceSubRow[];
|
|
61
|
-
hasMultipleProducts?: boolean;
|
|
62
|
-
/** 当前资源是 combined_resource.status===1 时输出 */
|
|
63
|
-
combinedResource?: VenueResourceCombinedInfo;
|
|
64
|
-
}
|
|
65
|
-
export interface VenueTimeSlotGrid {
|
|
66
|
-
date: string;
|
|
67
|
-
timeLabels: string[];
|
|
68
|
-
resources: VenueResourceRow[];
|
|
69
|
-
}
|
|
70
|
-
export interface VenueDateSummaryItem {
|
|
71
|
-
date: string;
|
|
72
|
-
status: 'available' | 'few_left' | 'sold_out' | 'unavailable';
|
|
73
|
-
startingPrice: string | null;
|
|
74
|
-
totalSlots: number;
|
|
75
|
-
availableSlots: number;
|
|
76
|
-
}
|
|
77
|
-
export interface VenueResourceCombinedRaw {
|
|
78
|
-
status: number;
|
|
79
|
-
resource_ids: Array<number | string>;
|
|
80
|
-
}
|
|
81
|
-
export interface VenueResourceRawData {
|
|
82
|
-
resourceId: number | string;
|
|
83
|
-
formId: number | string;
|
|
84
|
-
main_field?: string;
|
|
85
|
-
form_id?: number | string;
|
|
86
|
-
resource_form_id?: number | string;
|
|
87
|
-
capacity?: number;
|
|
88
|
-
times: Array<{
|
|
89
|
-
start_at: string;
|
|
90
|
-
end_at: string;
|
|
91
|
-
[key: string]: any;
|
|
92
|
-
}>;
|
|
93
|
-
combined_resource?: VenueResourceCombinedRaw;
|
|
94
|
-
[key: string]: any;
|
|
95
|
-
}
|
|
96
|
-
export interface ResourceProductMapping {
|
|
97
|
-
productId: number;
|
|
98
|
-
productTitle: string;
|
|
99
|
-
formName?: string;
|
|
100
|
-
resourceName: string;
|
|
101
|
-
formId: number | string;
|
|
102
|
-
price: string;
|
|
103
|
-
resourceType: 'single' | 'multiple' | 'capacity';
|
|
104
|
-
}
|
|
105
|
-
export interface VenueSlotSelection {
|
|
106
|
-
resourceId: number | string;
|
|
107
|
-
productId: number;
|
|
108
|
-
startTime: string;
|
|
109
|
-
endTime: string;
|
|
110
|
-
price: string;
|
|
111
|
-
}
|
|
112
|
-
export interface MergedSlotGroup {
|
|
113
|
-
startTime: string;
|
|
114
|
-
endTime: string;
|
|
115
|
-
totalPrice: string;
|
|
116
|
-
slotCount: number;
|
|
117
|
-
slots: VenueSlotSelection[];
|
|
118
|
-
}
|
|
119
|
-
export interface PriceBreakdownEntry {
|
|
120
|
-
start_time: string;
|
|
121
|
-
end_time: string;
|
|
122
|
-
unit_price: number;
|
|
123
|
-
quotation_shelf_id: number;
|
|
124
|
-
quantity: number;
|
|
125
|
-
}
|
|
126
|
-
export interface VenueBookingState {
|
|
127
|
-
entryContext: VenueBookingEntryContext | null;
|
|
128
|
-
status: VenueBookingStatus;
|
|
129
|
-
flow: Record<string, any>;
|
|
130
|
-
error: string | null;
|
|
131
|
-
products?: ProductList;
|
|
132
|
-
order?: OrderModule;
|
|
133
|
-
salesSummary?: SalesSummaryModule;
|
|
134
|
-
scanOrderLogger?: ScanOrderLoggerModule;
|
|
135
|
-
venueProducts?: ProductList;
|
|
136
|
-
addonProducts?: ProductList;
|
|
137
|
-
date?: DateModule;
|
|
138
|
-
schedule?: ScheduleModule;
|
|
139
|
-
quotation?: QuotationModule;
|
|
140
|
-
openData?: OpenDataModule;
|
|
141
|
-
rawResourceData: VenueResourceRawData[];
|
|
142
|
-
slotConfig: VenueBookingSlotConfig;
|
|
143
|
-
itemRuleQuantityLimits: QuantityLimitResult[];
|
|
144
|
-
cartValidation: {
|
|
145
|
-
passed: boolean | null;
|
|
146
|
-
failures: QuantityCheckResult[];
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
export interface VenueBookingLoggerRuntimeConfig {
|
|
150
|
-
provider?: ScanOrderLoggerProviderType;
|
|
151
|
-
providerConfig?: ScanOrderLoggerProviderConfig;
|
|
152
|
-
}
|
|
153
|
-
export interface VenueBookingAddLogParams extends ScanOrderLogInput {
|
|
154
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/solution/VenueBooking/types.ts
|
|
20
|
-
var types_exports = {};
|
|
21
|
-
__export(types_exports, {
|
|
22
|
-
DEFAULT_SLOT_CONFIG: () => DEFAULT_SLOT_CONFIG,
|
|
23
|
-
VenueBookingHooks: () => VenueBookingHooks
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(types_exports);
|
|
26
|
-
var VenueBookingHooks = /* @__PURE__ */ ((VenueBookingHooks2) => {
|
|
27
|
-
VenueBookingHooks2["onInited"] = "venueBooking:onInited";
|
|
28
|
-
VenueBookingHooks2["onDestroy"] = "venueBooking:onDestroy";
|
|
29
|
-
VenueBookingHooks2["onRetryInit"] = "venueBooking:onRetryInit";
|
|
30
|
-
VenueBookingHooks2["onRefresh"] = "venueBooking:onRefresh";
|
|
31
|
-
VenueBookingHooks2["onCartValidationChanged"] = "venueBooking:onCartValidationChanged";
|
|
32
|
-
return VenueBookingHooks2;
|
|
33
|
-
})(VenueBookingHooks || {});
|
|
34
|
-
var DEFAULT_SLOT_CONFIG = {
|
|
35
|
-
slotDurationMinutes: 30,
|
|
36
|
-
businessStartTime: "09:00",
|
|
37
|
-
businessEndTime: "23:00",
|
|
38
|
-
fewLeftThreshold: 0.8
|
|
39
|
-
};
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
DEFAULT_SLOT_CONFIG,
|
|
43
|
-
VenueBookingHooks
|
|
44
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { VenueBookingSlotConfig, VenueResourceRawData, VenueDateSummaryItem, ResourceProductMapping } from '../types';
|
|
2
|
-
import type { QuotationModule } from '../../../modules/Quotation';
|
|
3
|
-
export declare function buildDateRangeSummary(params: {
|
|
4
|
-
startDate: string;
|
|
5
|
-
endDate: string;
|
|
6
|
-
config: VenueBookingSlotConfig;
|
|
7
|
-
rawResources: VenueResourceRawData[];
|
|
8
|
-
resourceProductMap: Map<number | string, ResourceProductMapping[]>;
|
|
9
|
-
quotationModule?: QuotationModule;
|
|
10
|
-
resolveConfig?: (date: string) => VenueBookingSlotConfig;
|
|
11
|
-
}): VenueDateSummaryItem[];
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/solution/VenueBooking/utils/dateSummary.ts
|
|
30
|
-
var dateSummary_exports = {};
|
|
31
|
-
__export(dateSummary_exports, {
|
|
32
|
-
buildDateRangeSummary: () => buildDateRangeSummary
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(dateSummary_exports);
|
|
35
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
36
|
-
var import_timeSlot = require("./timeSlot");
|
|
37
|
-
function buildDateRangeSummary(params) {
|
|
38
|
-
const {
|
|
39
|
-
startDate,
|
|
40
|
-
endDate,
|
|
41
|
-
config,
|
|
42
|
-
rawResources,
|
|
43
|
-
resourceProductMap,
|
|
44
|
-
quotationModule,
|
|
45
|
-
resolveConfig
|
|
46
|
-
} = params;
|
|
47
|
-
const result = [];
|
|
48
|
-
const productIds = quotationModule ? [...new Set([...resourceProductMap.values()].flat().map((m) => m.productId))] : [];
|
|
49
|
-
let cursor = (0, import_dayjs.default)(startDate);
|
|
50
|
-
const end = (0, import_dayjs.default)(endDate);
|
|
51
|
-
while (!cursor.isAfter(end)) {
|
|
52
|
-
const date = cursor.format("YYYY-MM-DD");
|
|
53
|
-
const effectiveConfig = (resolveConfig == null ? void 0 : resolveConfig(date)) || config;
|
|
54
|
-
let quotationPriceMap;
|
|
55
|
-
if (quotationModule && productIds.length) {
|
|
56
|
-
const timeLabels = (0, import_timeSlot.generateTimeLabels)(effectiveConfig);
|
|
57
|
-
const timePoints = timeLabels.map((label) => `${date} ${label}`);
|
|
58
|
-
quotationPriceMap = quotationModule.buildProductPriceMap({ productIds, timePoints });
|
|
59
|
-
}
|
|
60
|
-
const grid = (0, import_timeSlot.buildTimeSlotGrid)({
|
|
61
|
-
date,
|
|
62
|
-
config: effectiveConfig,
|
|
63
|
-
rawResources,
|
|
64
|
-
resourceProductMap,
|
|
65
|
-
quotationPriceMap
|
|
66
|
-
});
|
|
67
|
-
let totalSlots = 0;
|
|
68
|
-
let availableSlots = 0;
|
|
69
|
-
let lowestPrice = null;
|
|
70
|
-
for (const resource of grid.resources) {
|
|
71
|
-
for (const slot of resource.slots) {
|
|
72
|
-
if (slot.status === "past" || slot.status === "unavailable")
|
|
73
|
-
continue;
|
|
74
|
-
totalSlots++;
|
|
75
|
-
if (slot.status === "available" || slot.status === "partially_occupied") {
|
|
76
|
-
availableSlots++;
|
|
77
|
-
if (slot.price !== null) {
|
|
78
|
-
const priceNum = Number(slot.price);
|
|
79
|
-
if (Number.isFinite(priceNum) && (lowestPrice === null || priceNum < lowestPrice)) {
|
|
80
|
-
lowestPrice = priceNum;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
let status;
|
|
87
|
-
if (totalSlots === 0) {
|
|
88
|
-
status = "unavailable";
|
|
89
|
-
} else if (availableSlots === 0) {
|
|
90
|
-
status = "sold_out";
|
|
91
|
-
} else if ((totalSlots - availableSlots) / totalSlots >= effectiveConfig.fewLeftThreshold) {
|
|
92
|
-
status = "few_left";
|
|
93
|
-
} else {
|
|
94
|
-
status = "available";
|
|
95
|
-
}
|
|
96
|
-
result.push({
|
|
97
|
-
date,
|
|
98
|
-
status,
|
|
99
|
-
startingPrice: lowestPrice !== null ? lowestPrice.toFixed(2) : null,
|
|
100
|
-
totalSlots,
|
|
101
|
-
availableSlots
|
|
102
|
-
});
|
|
103
|
-
cursor = cursor.add(1, "day");
|
|
104
|
-
}
|
|
105
|
-
return result;
|
|
106
|
-
}
|
|
107
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
-
0 && (module.exports = {
|
|
109
|
-
buildDateRangeSummary
|
|
110
|
-
});
|