@pisell/pisellos 0.0.571 → 0.0.572

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.
Files changed (143) hide show
  1. package/dist/effects/index.d.ts +2 -2
  2. package/dist/model/strategy/adapter/dataVariant/type.d.ts +3 -3
  3. package/dist/model/strategy/adapter/itemRule/type.d.ts +6 -6
  4. package/dist/model/strategy/adapter/promotion/index.d.ts +4 -0
  5. package/dist/model/strategy/adapter/promotion/type.d.ts +5 -5
  6. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  7. package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -2
  8. package/dist/model/strategy/type.d.ts +1 -1
  9. package/dist/modules/BookingContext/types.d.ts +4 -4
  10. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +1 -1
  11. package/dist/modules/Customer/types.d.ts +1 -1
  12. package/dist/modules/Discount/availability.d.ts +7 -0
  13. package/dist/modules/Discount/availability.js +52 -0
  14. package/dist/modules/Discount/entitlementPass.d.ts +34 -0
  15. package/dist/modules/Discount/entitlementPass.js +147 -0
  16. package/dist/modules/Discount/entitlementState.d.ts +8 -0
  17. package/dist/modules/Discount/entitlementState.js +205 -0
  18. package/dist/modules/Discount/index.d.ts +5 -2
  19. package/dist/modules/Discount/index.js +124 -25
  20. package/dist/modules/Discount/types.d.ts +29 -6
  21. package/dist/modules/Holder/types.d.ts +1 -1
  22. package/dist/modules/OpenData/types.d.ts +1 -1
  23. package/dist/modules/Order/types.d.ts +5 -5
  24. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +1 -1
  25. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +1 -1
  26. package/dist/modules/Order/utils.d.ts +1 -1
  27. package/dist/modules/Payment/types.d.ts +7 -7
  28. package/dist/modules/Product/index.d.ts +1 -1
  29. package/dist/modules/ResourcePlanner/types.d.ts +4 -4
  30. package/dist/modules/Rules/entitlementLines.d.ts +8 -0
  31. package/dist/modules/Rules/entitlementLines.js +159 -0
  32. package/dist/modules/Rules/index.d.ts +13 -3
  33. package/dist/modules/Rules/index.js +617 -342
  34. package/dist/modules/Rules/types.d.ts +4 -4
  35. package/dist/modules/ScanOrderLogger/types.d.ts +2 -2
  36. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
  37. package/dist/modules/Schedule/type.d.ts +7 -7
  38. package/dist/modules/Schedule/types.d.ts +9 -9
  39. package/dist/plugins/app.d.ts +1 -1
  40. package/dist/plugins/request.d.ts +2 -2
  41. package/dist/plugins/window.d.ts +2 -2
  42. package/dist/server/modules/floor-plan/types.d.ts +1 -1
  43. package/dist/server/modules/menu/types.d.ts +1 -1
  44. package/dist/server/modules/order/types.d.ts +16 -16
  45. package/dist/server/modules/products/types.d.ts +1 -1
  46. package/dist/server/modules/resource/types.d.ts +1 -1
  47. package/dist/server/modules/schedule/utils.d.ts +1 -1
  48. package/dist/server/types.d.ts +4 -4
  49. package/dist/server/utils/small-ticket.d.ts +1 -1
  50. package/dist/solution/BaseSales/index.d.ts +1 -1
  51. package/dist/solution/BaseSales/types.d.ts +7 -7
  52. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -1
  53. package/dist/solution/BookingByStep/index.d.ts +1 -1
  54. package/dist/solution/BookingByStep/utils/resources.d.ts +1 -1
  55. package/dist/solution/BookingTicket/index.d.ts +13 -1
  56. package/dist/solution/BookingTicket/types.d.ts +3 -3
  57. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  58. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +1 -1
  59. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +1 -1
  60. package/dist/solution/Sales/types.d.ts +4 -4
  61. package/dist/solution/ScanOrder/types.d.ts +5 -5
  62. package/dist/solution/ShopDiscount/index.d.ts +3 -0
  63. package/dist/solution/ShopDiscount/index.js +161 -78
  64. package/dist/solution/ShopDiscount/types.d.ts +1 -1
  65. package/dist/solution/ShopDiscount/utils.d.ts +3 -2
  66. package/dist/solution/ShopDiscount/utils.js +40 -1
  67. package/dist/solution/UnifiedBookingSales/types.d.ts +1 -1
  68. package/dist/solution/VenueBooking/types.d.ts +1 -1
  69. package/dist/types/index.d.ts +1 -1
  70. package/dist/utils/task.d.ts +2 -2
  71. package/dist/utils/watch.d.ts +2 -2
  72. package/lib/effects/index.d.ts +2 -2
  73. package/lib/model/strategy/adapter/dataVariant/type.d.ts +3 -3
  74. package/lib/model/strategy/adapter/itemRule/type.d.ts +6 -6
  75. package/lib/model/strategy/adapter/promotion/index.d.ts +4 -0
  76. package/lib/model/strategy/adapter/promotion/type.d.ts +5 -5
  77. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  78. package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -0
  79. package/lib/model/strategy/type.d.ts +1 -1
  80. package/lib/modules/BookingContext/types.d.ts +4 -4
  81. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +1 -1
  82. package/lib/modules/Customer/types.d.ts +1 -1
  83. package/lib/modules/Discount/availability.d.ts +7 -0
  84. package/lib/modules/Discount/availability.js +46 -0
  85. package/lib/modules/Discount/entitlementPass.d.ts +34 -0
  86. package/lib/modules/Discount/entitlementPass.js +141 -0
  87. package/lib/modules/Discount/entitlementState.d.ts +8 -0
  88. package/lib/modules/Discount/entitlementState.js +150 -0
  89. package/lib/modules/Discount/index.d.ts +5 -2
  90. package/lib/modules/Discount/index.js +59 -14
  91. package/lib/modules/Discount/types.d.ts +29 -6
  92. package/lib/modules/Holder/types.d.ts +1 -1
  93. package/lib/modules/OpenData/types.d.ts +1 -1
  94. package/lib/modules/Order/types.d.ts +5 -5
  95. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +1 -1
  96. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +1 -1
  97. package/lib/modules/Order/utils.d.ts +1 -1
  98. package/lib/modules/Payment/types.d.ts +7 -7
  99. package/lib/modules/Product/index.d.ts +1 -1
  100. package/lib/modules/ResourcePlanner/types.d.ts +4 -4
  101. package/lib/modules/Rules/entitlementLines.d.ts +8 -0
  102. package/lib/modules/Rules/entitlementLines.js +128 -0
  103. package/lib/modules/Rules/index.d.ts +13 -3
  104. package/lib/modules/Rules/index.js +284 -61
  105. package/lib/modules/Rules/types.d.ts +4 -4
  106. package/lib/modules/ScanOrderLogger/types.d.ts +2 -2
  107. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
  108. package/lib/modules/Schedule/type.d.ts +7 -7
  109. package/lib/modules/Schedule/types.d.ts +9 -9
  110. package/lib/plugins/app.d.ts +1 -1
  111. package/lib/plugins/request.d.ts +2 -2
  112. package/lib/plugins/window.d.ts +2 -2
  113. package/lib/server/modules/floor-plan/types.d.ts +1 -1
  114. package/lib/server/modules/menu/types.d.ts +1 -1
  115. package/lib/server/modules/order/types.d.ts +16 -16
  116. package/lib/server/modules/products/types.d.ts +1 -1
  117. package/lib/server/modules/resource/types.d.ts +1 -1
  118. package/lib/server/modules/schedule/utils.d.ts +1 -1
  119. package/lib/server/types.d.ts +4 -4
  120. package/lib/server/utils/small-ticket.d.ts +1 -1
  121. package/lib/solution/BaseSales/index.d.ts +1 -1
  122. package/lib/solution/BaseSales/types.d.ts +7 -7
  123. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -1
  124. package/lib/solution/BookingByStep/index.d.ts +1 -1
  125. package/lib/solution/BookingByStep/utils/resources.d.ts +1 -1
  126. package/lib/solution/BookingTicket/index.d.ts +13 -1
  127. package/lib/solution/BookingTicket/types.d.ts +3 -3
  128. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  129. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +1 -1
  130. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +1 -1
  131. package/lib/solution/Sales/types.d.ts +4 -4
  132. package/lib/solution/ScanOrder/types.d.ts +5 -5
  133. package/lib/solution/ShopDiscount/index.d.ts +3 -0
  134. package/lib/solution/ShopDiscount/index.js +55 -18
  135. package/lib/solution/ShopDiscount/types.d.ts +1 -1
  136. package/lib/solution/ShopDiscount/utils.d.ts +3 -2
  137. package/lib/solution/ShopDiscount/utils.js +39 -3
  138. package/lib/solution/UnifiedBookingSales/types.d.ts +1 -1
  139. package/lib/solution/VenueBooking/types.d.ts +1 -1
  140. package/lib/types/index.d.ts +1 -1
  141. package/lib/utils/task.d.ts +2 -2
  142. package/lib/utils/watch.d.ts +2 -2
  143. package/package.json +19 -18
@@ -23,7 +23,7 @@ export interface DiscountResult {
23
23
  productList: any[];
24
24
  discountList: any[];
25
25
  }
26
- export declare type RulesFormSubject = boolean | ((product: any) => boolean);
26
+ export type RulesFormSubject = boolean | ((product: any) => boolean);
27
27
  export interface RulesCalcDiscountOptions {
28
28
  isSelected?: boolean;
29
29
  discountId?: number;
@@ -39,13 +39,13 @@ export interface RulesModuleAPI {
39
39
  discountList: any[];
40
40
  productList: any[];
41
41
  holders: {
42
- form_record_id: number;
42
+ form_record_id: number | string;
43
43
  }[];
44
44
  isFormSubject: RulesFormSubject;
45
45
  orderTotalAmount: number;
46
46
  }, options?: RulesCalcDiscountOptions) => DiscountResult;
47
47
  }
48
- declare type ProductDetail = {
48
+ type ProductDetail = {
49
49
  isClient?: boolean;
50
50
  isManualDiscount?: boolean;
51
51
  booking_id: any;
@@ -61,7 +61,7 @@ declare type ProductDetail = {
61
61
  num?: number;
62
62
  quantity: number;
63
63
  vouchersApplicable?: boolean;
64
- holder_id?: number;
64
+ holder_id?: number | string | Array<number | string>;
65
65
  startDate?: any;
66
66
  main_product_selling_price?: number | string;
67
67
  };
@@ -1,5 +1,5 @@
1
- export declare type ScanOrderLogLevel = 'info' | 'warning' | 'error' | 'debug';
2
- export declare type ScanOrderLoggerProviderType = 'feishu' | 'grafana';
1
+ export type ScanOrderLogLevel = 'info' | 'warning' | 'error' | 'debug';
2
+ export type ScanOrderLoggerProviderType = 'feishu' | 'grafana';
3
3
  export interface ScanOrderLoggerProviderFeishuConfig {
4
4
  webhook?: string;
5
5
  errorHook?: string;
@@ -1,7 +1,7 @@
1
1
  import dayjs from "dayjs";
2
2
  import { ScheduleItem } from "./types";
3
3
  export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
4
- export declare type ScheduleTimeSlot = {
4
+ export type ScheduleTimeSlot = {
5
5
  /** 开始时间 HH:mm */
6
6
  start_time: string;
7
7
  /** 结束时间 HH:mm */
@@ -1,4 +1,4 @@
1
- export declare type ScheduleItem = {
1
+ export type ScheduleItem = {
2
2
  /** 颜色 */
3
3
  color: string;
4
4
  /** 创建时间 */
@@ -65,7 +65,7 @@ export declare type ScheduleItem = {
65
65
  schedule_id: number;
66
66
  }[];
67
67
  };
68
- export declare type ScheduleFormOtherValue = {
68
+ export type ScheduleFormOtherValue = {
69
69
  /** 截止模式
70
70
  * 1: 永不截止
71
71
  * 2: 按日期截止
@@ -79,11 +79,11 @@ export declare type ScheduleFormOtherValue = {
79
79
  includeStatus: boolean;
80
80
  type: 'standard' | 'time-slots' | 'designation';
81
81
  };
82
- export declare type ExcIncDate = {
82
+ export type ExcIncDate = {
83
83
  start: string;
84
84
  end: string;
85
85
  };
86
- export declare type ScheduleFormData = {
86
+ export type ScheduleFormData = {
87
87
  /** 颜色 */
88
88
  color: string;
89
89
  /** 日程名称 */
@@ -131,20 +131,20 @@ export declare type ScheduleFormData = {
131
131
  start_time: any;
132
132
  end_time: any;
133
133
  };
134
- export declare type CalendarDataItem = {
134
+ export type CalendarDataItem = {
135
135
  date: string;
136
136
  color: string[];
137
137
  isExcluded: boolean;
138
138
  schedule_ids?: number[];
139
139
  [key: string]: any;
140
140
  };
141
- export declare type RequestData<Data> = {
141
+ export type RequestData<Data> = {
142
142
  data: Data;
143
143
  status: boolean;
144
144
  message: string;
145
145
  code: number;
146
146
  };
147
- export declare type ResponseListData<Data> = {
147
+ export type ResponseListData<Data> = {
148
148
  status: boolean;
149
149
  message: string;
150
150
  code: number;
@@ -6,7 +6,7 @@ export interface ScheduleState {
6
6
  availabilityDateList: ScheduleAvailabilityDateItem[];
7
7
  otherProductsIds: number[];
8
8
  }
9
- export declare type ScheduleAvailabilityDateItem = {
9
+ export type ScheduleAvailabilityDateItem = {
10
10
  date: string;
11
11
  schedule_id: number[];
12
12
  product_ids: number[];
@@ -28,7 +28,7 @@ export interface ScheduleModuleAPI {
28
28
  getScheduleList: () => ScheduleItem[];
29
29
  isScheduleListLoaded: () => boolean;
30
30
  }
31
- export declare type ScheduleItem = {
31
+ export type ScheduleItem = {
32
32
  /** 颜色 */
33
33
  color: string;
34
34
  /** 创建时间 */
@@ -95,7 +95,7 @@ export declare type ScheduleItem = {
95
95
  schedule_id: number;
96
96
  }[];
97
97
  };
98
- export declare type ScheduleFormOtherValue = {
98
+ export type ScheduleFormOtherValue = {
99
99
  /** 截止模式
100
100
  * 1: 永不截止
101
101
  * 2: 按日期截止
@@ -109,11 +109,11 @@ export declare type ScheduleFormOtherValue = {
109
109
  includeStatus: boolean;
110
110
  type: 'standard' | 'time-slots' | 'designation';
111
111
  };
112
- export declare type ExcIncDate = {
112
+ export type ExcIncDate = {
113
113
  start: string;
114
114
  end: string;
115
115
  };
116
- export declare type ScheduleFormData = {
116
+ export type ScheduleFormData = {
117
117
  /** 颜色 */
118
118
  color: string;
119
119
  /** 日程名称 */
@@ -161,20 +161,20 @@ export declare type ScheduleFormData = {
161
161
  start_time: any;
162
162
  end_time: any;
163
163
  };
164
- export declare type CalendarDataItem = {
164
+ export type CalendarDataItem = {
165
165
  date: string;
166
166
  color: string[];
167
167
  isExcluded: boolean;
168
168
  schedule_ids?: number[];
169
169
  [key: string]: any;
170
170
  };
171
- export declare type RequestData<Data> = {
171
+ export type RequestData<Data> = {
172
172
  data: Data;
173
173
  status: boolean;
174
174
  message: string;
175
175
  code: number;
176
176
  };
177
- export declare type ResponseListData<Data> = {
177
+ export type ResponseListData<Data> = {
178
178
  status: boolean;
179
179
  message: string;
180
180
  code: number;
@@ -185,7 +185,7 @@ export declare type ResponseListData<Data> = {
185
185
  skip: number;
186
186
  };
187
187
  };
188
- export declare type ScheduleAllMap = Record<string, {
188
+ export type ScheduleAllMap = Record<string, {
189
189
  minTime: dayjs.Dayjs | null;
190
190
  maxTime: dayjs.Dayjs | null;
191
191
  minTimeStr: string | null;
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from '../types';
2
2
  import App from './app-types/app';
3
- export declare type AppDataGetter = (key: string) => any;
3
+ export type AppDataGetter = (key: string) => any;
4
4
  /**
5
5
  * AppPlugin 接口定义
6
6
  */
@@ -42,8 +42,8 @@ export declare enum RequestModeENUM {
42
42
  REMOTE_LOCAL = "remote_local",
43
43
  OS_SERVER = "os_server"
44
44
  }
45
- export declare type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
46
- export declare type CacheType = 'memory' | 'storage' | 'indexDB';
45
+ export type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
46
+ export type CacheType = 'memory' | 'storage' | 'indexDB';
47
47
  export interface CacheProps {
48
48
  key?: string;
49
49
  type?: CacheType;
@@ -1,5 +1,5 @@
1
- import { WalletPassEvaluator } from '../model';
2
1
  import { Plugin } from '../types';
2
+ import type { WalletPassEvaluator } from '../model/strategy/adapter/walletPass/evaluator';
3
3
  /**
4
4
  * WindowPlugin 接口定义
5
5
  */
@@ -15,7 +15,7 @@ export interface WindowPlugin extends Plugin {
15
15
  document: Partial<Document>;
16
16
  history: History;
17
17
  interaction?: any;
18
- getWalletPassEvaluator?: () => WalletPassEvaluator;
18
+ getWalletPassEvaluator?: () => WalletPassEvaluator | undefined;
19
19
  getLocalStorage?: (key: string) => string | null;
20
20
  }
21
21
  /**
@@ -40,4 +40,4 @@ export declare const FloorPlanHooks: {
40
40
  /** pubsub 同步处理完成,供 Server 向订阅者推送最新查询结果 */
41
41
  readonly onFloorPlanSyncCompleted: "server_floor_plan:onFloorPlanSyncCompleted";
42
42
  };
43
- export declare type FloorPlanHooksType = (typeof FloorPlanHooks)[keyof typeof FloorPlanHooks];
43
+ export type FloorPlanHooksType = (typeof FloorPlanHooks)[keyof typeof FloorPlanHooks];
@@ -9,7 +9,7 @@ export interface MenuState {
9
9
  /** 当前生效的餐牌 */
10
10
  currentMenu?: MenuData;
11
11
  }
12
- declare type ProductItemType = {
12
+ type ProductItemType = {
13
13
  /** 商品集合 ID */
14
14
  product_collection_id: number;
15
15
  /** 商品 ID */
@@ -2,36 +2,36 @@ import type { ScheduleEventResource } from '../resource/types';
2
2
  /**
3
3
  * Order 模块主键类型(对齐标准 Sales 协议的 order_id)
4
4
  */
5
- export declare type OrderId = number | string;
5
+ export type OrderId = number | string;
6
6
  /**
7
7
  * 协议中金额类字段多为 string 快照(交易时价格不可从基准商品重算)
8
8
  */
9
- export declare type OrderMoneyString = string;
9
+ export type OrderMoneyString = string;
10
10
  /** 订单类型。文档:appointment_booking / ticket / virtual。来源:Order.type */
11
- export declare type OrderType = 'appointment_booking' | 'ticket' | 'virtual' | string;
11
+ export type OrderType = 'appointment_booking' | 'ticket' | 'virtual' | string;
12
12
  /**
13
13
  * 来源平台。文档:shop / pos / kiosk / h5 / app / mini-program。
14
14
  * 来源:Order.platform
15
15
  */
16
- export declare type OrderPlatform = 'shop' | 'pos' | 'kiosk' | 'h5' | 'app' | 'mini-program' | string;
16
+ export type OrderPlatform = 'shop' | 'pos' | 'kiosk' | 'h5' | 'app' | 'mini-program' | string;
17
17
  /** 订单状态(仅输出)。文档:open / completed / cancelled。来源:Order.status */
18
- export declare type OrderStatus = 'open' | 'completed' | 'cancelled' | string;
18
+ export type OrderStatus = 'open' | 'completed' | 'cancelled' | string;
19
19
  /** 支付状态。来源:Order.payment_status */
20
- export declare type OrderPaymentStatus = 'payment_processing' | 'paid' | 'unpaid' | 'partially_paid' | string;
20
+ export type OrderPaymentStatus = 'payment_processing' | 'paid' | 'unpaid' | 'partially_paid' | string;
21
21
  /** 发货状态(仅输出)。来源:Order.shipping_status */
22
- export declare type OrderShippingStatus = 'unfulfilled' | 'fulfilled' | string;
22
+ export type OrderShippingStatus = 'unfulfilled' | 'fulfilled' | string;
23
23
  /**
24
24
  * 预约子事件状态(仅输出)。
25
25
  * 文档:new / confirmed / arrived / started / completed / cancelled。
26
26
  * 来源:ScheduleEvent.appointment_status
27
27
  */
28
- export declare type AppointmentStatus = 'new' | 'confirmed' | 'arrived' | 'started' | 'completed' | 'cancelled' | string;
28
+ export type AppointmentStatus = 'new' | 'confirmed' | 'arrived' | 'started' | 'completed' | 'cancelled' | string;
29
29
  /** 折扣类型:shop(整单)/ product(商品)。来源:Discount.type */
30
- export declare type OrderProductDiscountType = 'shop' | 'product' | string;
30
+ export type OrderProductDiscountType = 'shop' | 'product' | string;
31
31
  /** 支付记录状态:paid / voided / payment_pending 等。来源:OrderPayment.status */
32
- export declare type OrderPaymentRecordStatus = 'paid' | 'voided' | 'payment_pending' | string;
32
+ export type OrderPaymentRecordStatus = 'paid' | 'voided' | 'payment_pending' | string;
33
33
  /** 附加费类型。来源:OrderSurcharge.type */
34
- export declare type OrderSurchargeType = string;
34
+ export type OrderSurchargeType = string;
35
35
  /** 商品折扣 metadata,常含 unique_identification_number */
36
36
  export interface OrderProductDiscountMetadata {
37
37
  /** 设备端本地唯一标识,用于与服务端记录对齐 */
@@ -419,12 +419,12 @@ export interface OrderData {
419
419
  [key: string]: any;
420
420
  }
421
421
  /** 去掉 bookings 后的订单快照;展开预约行时挂在 {@link BookingData.order} 上 */
422
- export declare type OrderWithoutBookings = Omit<OrderData, 'bookings'>;
422
+ export type OrderWithoutBookings = Omit<OrderData, 'bookings'>;
423
423
  /**
424
424
  * 展开后的单条预约视图:协议 {@link OrderBookingItem} 平铺字段 + 所属订单(不含 bookings)+
425
425
  * 当前预约归属的商品行(由订单 products 按 schedule_event_id / relation_items 归集,不修改 order)
426
426
  */
427
- export declare type BookingData = OrderBookingItem & {
427
+ export type BookingData = OrderBookingItem & {
428
428
  order: OrderWithoutBookings;
429
429
  products: OrderProductLineItem[];
430
430
  };
@@ -519,11 +519,11 @@ export interface OrderFilterRejectedEntry {
519
519
  /** 按筛选顺序命中的第一条未满足条件 */
520
520
  reason: OrderFilterRejectDetail;
521
521
  }
522
- export declare type OrderFilterResult = OrderModulePagedResult<OrderData> & {
522
+ export type OrderFilterResult = OrderModulePagedResult<OrderData> & {
523
523
  /** 被过滤掉的订单及首个命中原因(与筛选短路顺序一致;不含仅分页未展示的已通过订单) */
524
524
  rejected: OrderFilterRejectedEntry[];
525
525
  };
526
- export declare type BookingFilterResult = OrderModulePagedResult<BookingData>;
526
+ export type BookingFilterResult = OrderModulePagedResult<BookingData>;
527
527
  /**
528
528
  * SSE 同步配置
529
529
  */
@@ -535,7 +535,7 @@ export interface OrderSSESyncConfig {
535
535
  /**
536
536
  * Ably 事件类型
537
537
  */
538
- export declare type OrderAblyEventType = 'created' | 'updated' | 'deleted';
538
+ export type OrderAblyEventType = 'created' | 'updated' | 'deleted';
539
539
  /**
540
540
  * Ably 事件载荷
541
541
  */
@@ -148,4 +148,4 @@ export interface ProductFormatterContext {
148
148
  * 商品格式化器类型
149
149
  * 用于对商品数据进行处理和格式化(包括价格应用、字段扩展等)
150
150
  */
151
- export declare type ProductFormatter = (products: ProductData[], context: ProductFormatterContext) => ProductData[] | Promise<ProductData[]>;
151
+ export type ProductFormatter = (products: ProductData[], context: ProductFormatterContext) => ProductData[] | Promise<ProductData[]>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Resource 模块主键类型
3
3
  */
4
- export declare type ResourceId = number | string;
4
+ export type ResourceId = number | string;
5
5
  /**
6
6
  * Sales / ScheduleEventResource:预约条目内关联资源(仅 ID 与占用,详情由设备端基准数据解析)
7
7
  * @see 统一 Sales 数据协议 3.4.1 resources
@@ -1,7 +1,7 @@
1
1
  import dayjs from "dayjs";
2
2
  import { ScheduleItem } from "../../../modules/Schedule/types";
3
3
  export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
4
- export declare type ScheduleTimeSlot = {
4
+ export type ScheduleTimeSlot = {
5
5
  /** 开始时间 HH:mm */
6
6
  start_time: string;
7
7
  /** 结束时间 HH:mm */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Server 类型定义
3
3
  */
4
- export declare type CacheType = 'memory' | 'storage' | 'indexDB';
4
+ export type CacheType = 'memory' | 'storage' | 'indexDB';
5
5
  export interface CacheProps {
6
6
  key?: string;
7
7
  type?: CacheType;
@@ -20,7 +20,7 @@ export interface RequestSetting {
20
20
  /**
21
21
  * 路由处理函数类型
22
22
  */
23
- export declare type RouteHandler = (params: {
23
+ export type RouteHandler = (params: {
24
24
  url: string;
25
25
  method: 'get' | 'post' | 'remove' | 'put';
26
26
  data?: any;
@@ -31,11 +31,11 @@ export declare type RouteHandler = (params: {
31
31
  /**
32
32
  * HTTP 方法类型
33
33
  */
34
- export declare type HttpMethod = 'get' | 'post' | 'remove' | 'put';
34
+ export type HttpMethod = 'get' | 'post' | 'remove' | 'put';
35
35
  /**
36
36
  * 路由定义类型
37
37
  */
38
- export declare type RouteDefinition = {
38
+ export type RouteDefinition = {
39
39
  method: HttpMethod;
40
40
  path: string;
41
41
  handler: RouteHandler;
@@ -66,6 +66,6 @@ export interface SmallTicketLocaleData {
66
66
  refund_data: any[];
67
67
  expend_data: any[];
68
68
  }
69
- export declare type SmallTicketData = Record<string, SmallTicketLocaleData>;
69
+ export type SmallTicketData = Record<string, SmallTicketLocaleData>;
70
70
  export declare function buildSmallTicketData(params: BuildSmallTicketDataParams): SmallTicketData;
71
71
  export declare function hasSmallTicketData(value: any): boolean;
@@ -24,7 +24,7 @@ export interface BaseSalesState {
24
24
  schedule?: ScheduleModule;
25
25
  quotation?: QuotationModule;
26
26
  }
27
- export declare type BaseSalesPrintLocalOrderReceiptParams = string | number;
27
+ export type BaseSalesPrintLocalOrderReceiptParams = string | number;
28
28
  export declare class BaseSalesImpl extends BaseModule implements Module {
29
29
  protected defaultName: string;
30
30
  protected defaultVersion: string;
@@ -17,10 +17,10 @@ export declare const BaseSalesHookNames: {
17
17
  readonly onPaymentSyncEnd: "onPaymentSyncEnd";
18
18
  readonly onDepositPaymentSyncEnd: "onDepositPaymentSyncEnd";
19
19
  };
20
- export declare type BaseSalesHookName = typeof BaseSalesHookNames[keyof typeof BaseSalesHookNames];
20
+ export type BaseSalesHookName = typeof BaseSalesHookNames[keyof typeof BaseSalesHookNames];
21
21
  export declare function createBaseSalesHook(moduleName: string, hookName: BaseSalesHookName): string;
22
- export declare type BaseSalesStatus = 'idle' | 'initializing' | 'ready' | 'error';
23
- export declare type BaseSalesPaymentStatus = 'paid' | 'partially_paid' | 'unpaid' | 'payment_processing' | string;
22
+ export type BaseSalesStatus = 'idle' | 'initializing' | 'ready' | 'error';
23
+ export type BaseSalesPaymentStatus = 'paid' | 'partially_paid' | 'unpaid' | 'payment_processing' | string;
24
24
  export interface BaseSalesEntryContext {
25
25
  biz: string;
26
26
  mode: 'scan' | 'append';
@@ -247,7 +247,7 @@ export interface BaseSalesCalculateProductBookingPriceParams {
247
247
  datetime?: string;
248
248
  channel?: string;
249
249
  }
250
- export declare type BaseSalesProductBookingPriceSegmentSource = 'quotation' | 'fallback';
250
+ export type BaseSalesProductBookingPriceSegmentSource = 'quotation' | 'fallback';
251
251
  export interface BaseSalesProductBookingPriceSegment {
252
252
  start_datetime: string;
253
253
  end_datetime?: string;
@@ -283,13 +283,13 @@ export interface BaseSalesProductBookingPriceResult {
283
283
  segments: BaseSalesProductBookingPriceSegment[];
284
284
  product_bundle?: BaseSalesBundleProductBookingPriceResult[];
285
285
  }
286
- export declare type BaseSalesQuotationCustomerScopeInfo = QuotationCustomerScopeInfo;
286
+ export type BaseSalesQuotationCustomerScopeInfo = QuotationCustomerScopeInfo;
287
287
  export interface BaseSalesPriceRecalculationContextChange {
288
288
  previousCustomerId?: number | string | null;
289
289
  nextCustomerId?: number | string | null;
290
290
  [key: string]: any;
291
291
  }
292
- export declare type BaseSalesAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | 'additional_order_with_code' | 'additional_order';
292
+ export type BaseSalesAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | 'additional_order_with_code' | 'additional_order';
293
293
  export interface BaseSalesTableFormRecord {
294
294
  policy?: string | null;
295
295
  partyroom_booking?: string | null;
@@ -344,7 +344,7 @@ export interface BaseSalesResourceOccupyDetailApiResponse {
344
344
  occupy_details?: BaseSalesResourceOccupyDetail[] | null;
345
345
  } | null;
346
346
  }
347
- export declare type BaseSalesResourceSelectType = 'single' | 'multiple' | 'capacity';
347
+ export type BaseSalesResourceSelectType = 'single' | 'multiple' | 'capacity';
348
348
  export interface BaseSalesResourceState extends BaseSalesAvailabilityInfo {
349
349
  relationId?: string;
350
350
  tableFormId?: string;
@@ -52,7 +52,7 @@ export interface TransformBaseProductToOrderProductParams {
52
52
  sourceProduct?: ProductData | Record<string, any> | null;
53
53
  sourceItem?: ProductData | Record<string, any> | null;
54
54
  }
55
- export declare type BaseProductOrderProductInput = Partial<OrderProduct> & OrderProductIdentity & {
55
+ export type BaseProductOrderProductInput = Partial<OrderProduct> & OrderProductIdentity & {
56
56
  _origin?: Record<string, any>;
57
57
  };
58
58
  /**
@@ -373,7 +373,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
373
373
  };
374
374
  setOtherData(key: string, value: any): void;
375
375
  getOtherData(key: string): any;
376
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
376
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
377
377
  /**
378
378
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
379
379
  *
@@ -6,7 +6,7 @@ import { CartItem, ProductData } from '../../../modules';
6
6
  * 3. 格式化资源相关 格式化资源列表 --> 格式化资源 --> 获取时间切片列表 --> 判断单个时间切片是否可用 formatResources
7
7
  *
8
8
  */
9
- declare type DateType = Dayjs;
9
+ type DateType = Dayjs;
10
10
  export interface TimeSliceItem {
11
11
  start_time: string;
12
12
  end_time: string;
@@ -441,7 +441,19 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
441
441
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
442
442
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
443
443
  */
444
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
444
+ decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
445
+ action: "reloadCatalog";
446
+ } | {
447
+ action: "add";
448
+ cacheItem: any;
449
+ } | {
450
+ action: "requiresDetail";
451
+ payload: AddProductRequiresDetailPayload;
452
+ } | {
453
+ action: "requiresBookingEdit";
454
+ cacheItem: any;
455
+ payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
456
+ };
445
457
  /** 规格弹窗 callback 后的第二段决策。 */
446
458
  decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
447
459
  /**
@@ -107,7 +107,7 @@ export interface IScanResult {
107
107
  *
108
108
  * 直接透传 tempOrder.products 协议行,不做 Solution 层 enrichment。
109
109
  */
110
- export declare type BookingTicketCartItemView = BaseSalesOrderProduct;
110
+ export type BookingTicketCartItemView = BaseSalesOrderProduct;
111
111
  /**
112
112
  * BookingTicket 面向 UI 的 booking 行视图(平铺,附带关联商品)。
113
113
  */
@@ -183,7 +183,7 @@ export interface AddAddTimeProductToBookingInput {
183
183
  * @example
184
184
  * const line: AddAddTimeProductLineInput = { product, product_add_schedule_time: 30 };
185
185
  */
186
- export declare type AddAddTimeProductLineInput = Omit<AddAddTimeProductToBookingInput, 'booking' | 'coveredMinutes'>;
186
+ export type AddAddTimeProductLineInput = Omit<AddAddTimeProductToBookingInput, 'booking' | 'coveredMinutes'>;
187
187
  /**
188
188
  * 批量添加加时商品到已有 booking 的输入。
189
189
  *
@@ -236,7 +236,7 @@ export interface GlobalScanHostBridge {
236
236
  refresh?: () => void;
237
237
  }
238
238
  /** handleGlobalScanCode 结构化返回 */
239
- export declare type GlobalScanHandleResult = {
239
+ export type GlobalScanHandleResult = {
240
240
  status: 'success';
241
241
  kind: 'customer' | 'products' | 'promotion';
242
242
  meta?: {
@@ -8,7 +8,7 @@ import type { OrderProduct, OrderProductIdentity, AddProductBookingInput } from
8
8
  * 2. `requiresBookingEdit`:资源 / 时间编辑抽屉(门禁:`getIsAutoClose` on prepared cacheItem)
9
9
  * 3. `add`:两关均通过,直接 transform + 加车
10
10
  */
11
- export declare type AddProductDecision = {
11
+ export type AddProductDecision = {
12
12
  action: 'add';
13
13
  cacheItem: any;
14
14
  } | {
@@ -18,7 +18,7 @@
18
18
  * action: 'confirm',
19
19
  * });
20
20
  */
21
- export declare type BookingTransitionAction = 'confirm' | 'reject' | 'arrive' | 'start' | 'complete' | 'cancel' | 'no_show' | 'reschedule';
21
+ export type BookingTransitionAction = 'confirm' | 'reject' | 'arrive' | 'start' | 'complete' | 'cancel' | 'no_show' | 'reschedule';
22
22
  /** 子预约状态转移入参 */
23
23
  export interface TransitionChildBookingParams {
24
24
  schedule_event_id: number | string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 全局扫码搜索结果格式化(对齐 ticketBooking `formatScanGlobal`)。
3
3
  */
4
- export declare type GlobalScanSearchType = 'customer' | 'wallet' | 'walletPass' | 'product' | 'local_product' | 'order';
4
+ export type GlobalScanSearchType = 'customer' | 'wallet' | 'walletPass' | 'product' | 'local_product' | 'order';
5
5
  export interface GlobalScanFormattedResult {
6
6
  searchType: GlobalScanSearchType;
7
7
  data: any;
@@ -15,9 +15,9 @@ export declare enum SalesHooks {
15
15
  * 将 Server/Order 原始数据转换为真正的 Reservation DTO,
16
16
  * 当前不要直接把 OrderData 当作最终 UI 数据结构。
17
17
  */
18
- export declare type Reservation = OrderData;
19
- export declare type SalesBookingStatus = 'reserved' | 'occupied' | 'locked' | 'completed' | undefined;
20
- export declare type SalesReservedStatus = 'not_arrived' | 'late' | undefined;
18
+ export type Reservation = OrderData;
19
+ export type SalesBookingStatus = 'reserved' | 'occupied' | 'locked' | 'completed' | undefined;
20
+ export type SalesReservedStatus = 'not_arrived' | 'late' | undefined;
21
21
  export interface SalesResourceMatchedBooking extends Omit<BookingData, 'status'> {
22
22
  status: SalesBookingStatus;
23
23
  isNext?: boolean;
@@ -39,7 +39,7 @@ export interface SalesResourceBookingItemWithGroups extends SalesResourceBooking
39
39
  completedBookings: SalesResourceMatchedBooking[];
40
40
  unpaidBookings: SalesResourceMatchedBooking[];
41
41
  }
42
- export declare type SalesTimelineHighlights = number[];
42
+ export type SalesTimelineHighlights = number[];
43
43
  export interface ChangeBookingStatusParams {
44
44
  booking_id: number | string;
45
45
  appointment_status: string;
@@ -10,8 +10,8 @@ export declare enum ScanOrderHooks {
10
10
  onRefresh = "scanOrder:onRefresh",
11
11
  onCartValidationChanged = "scanOrder:onCartValidationChanged"
12
12
  }
13
- export declare type ScanOrderStatus = 'idle' | 'initializing' | 'ready' | 'error';
14
- export declare type ScanOrderEntryContext = {
13
+ export type ScanOrderStatus = 'idle' | 'initializing' | 'ready' | 'error';
14
+ export type ScanOrderEntryContext = {
15
15
  biz: string;
16
16
  mode: 'scan' | 'append';
17
17
  resourceId?: string;
@@ -208,7 +208,7 @@ export interface ScanOrderSubmitPayload extends Omit<ScanOrderTempOrder, 'platfo
208
208
  }>;
209
209
  products: ScanOrderSubmitProduct[];
210
210
  }
211
- export declare type ScanOrderAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | 'multiple_orders' | 'additional_order_with_code' | 'additional_order';
211
+ export type ScanOrderAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | 'multiple_orders' | 'additional_order_with_code' | 'additional_order';
212
212
  export interface ScanOrderTableFormRecord {
213
213
  policy?: string | null;
214
214
  partyroom_booking?: string | null;
@@ -267,7 +267,7 @@ export interface ScanOrderResourceOccupyDetailApiResponse {
267
267
  occupy_details?: ScanOrderResourceOccupyDetail[] | null;
268
268
  } | null;
269
269
  }
270
- export declare type ScanOrderResourceSelectType = 'single' | 'multiple' | 'capacity';
270
+ export type ScanOrderResourceSelectType = 'single' | 'multiple' | 'capacity';
271
271
  export interface ScanOrderReservationResourceSelectInfo {
272
272
  resourceSelectType?: ScanOrderResourceSelectType;
273
273
  isSingleReservation: boolean;
@@ -277,7 +277,7 @@ export interface ScanOrderReservationResourceSelectInfo {
277
277
  export interface ScanOrderAllowAddItemsInfo {
278
278
  enabled: boolean;
279
279
  }
280
- export declare type ScanOrderSyncAdditionalOrderReason = 'missing_resource_id' | 'no_order' | 'multiple_orders' | 'add_items_disabled' | 'invalid_order_id';
280
+ export type ScanOrderSyncAdditionalOrderReason = 'missing_resource_id' | 'no_order' | 'multiple_orders' | 'add_items_disabled' | 'invalid_order_id';
281
281
  export interface ScanOrderSyncAdditionalOrderResult {
282
282
  matched: boolean;
283
283
  order_id?: string;
@@ -12,6 +12,8 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
12
12
  private store;
13
13
  private options;
14
14
  private hooks?;
15
+ private entitlementPassEnabled;
16
+ setEntitlementPassEnabled(enabled: boolean): void;
15
17
  constructor(name?: string, version?: string);
16
18
  initialize(core: PisellCore, options: any): Promise<void>;
17
19
  destroy(): Promise<void>;
@@ -43,6 +45,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
43
45
  batchSearchByProductIds(productIds: number[]): Promise<Discount[]>;
44
46
  scanCode(code: string, customerId?: number): Promise<{
45
47
  isAvailable: boolean;
48
+ isAccepted?: boolean;
46
49
  productList: Record<string, any>[];
47
50
  discountList: Discount[];
48
51
  type: "server" | "clientCalc";