@pisell/pisellos 0.10.76 → 0.10.78

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 (212) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/effects/index.d.ts +19 -0
  3. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  4. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
  5. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  6. package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  7. package/dist/model/strategy/adapter/dataVariant/type.d.ts +173 -0
  8. package/dist/model/strategy/adapter/promotion/adapter.d.ts +70 -0
  9. package/dist/model/strategy/adapter/promotion/examples.d.ts +224 -0
  10. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +535 -0
  12. package/dist/model/strategy/adapter/type.d.ts +28 -0
  13. package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
  14. package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  15. package/dist/model/strategy/adapter/walletPass/type.d.ts +192 -0
  16. package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  17. package/dist/model/strategy/engine.d.ts +119 -0
  18. package/dist/model/strategy/type.d.ts +245 -0
  19. package/dist/modules/Account/types.d.ts +56 -0
  20. package/dist/modules/BookingContext/types.d.ts +104 -0
  21. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  22. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  23. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  24. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  25. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  26. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  27. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  28. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  29. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  30. package/dist/modules/Customer/constants.d.ts +7 -0
  31. package/dist/modules/Date/types.d.ts +84 -0
  32. package/dist/modules/Date/utils.d.ts +36 -0
  33. package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
  34. package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
  35. package/dist/modules/Order/payment-utils.d.ts +26 -0
  36. package/dist/modules/Order/pickupTiming.d.ts +46 -0
  37. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  38. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
  39. package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
  40. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
  41. package/dist/modules/Payment/mx51.d.ts +0 -0
  42. package/dist/modules/Payment/types.d.ts +943 -0
  43. package/dist/modules/Payment/utils.d.ts +19 -0
  44. package/dist/modules/Product/index.d.ts +1 -1
  45. package/dist/modules/ProductList/index.d.ts +2 -0
  46. package/dist/modules/ProductList/index.js +125 -39
  47. package/dist/modules/Quotation/types.d.ts +61 -0
  48. package/dist/modules/Resource/types.d.ts +50 -0
  49. package/dist/modules/Resource/utils.d.ts +23 -0
  50. package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
  51. package/dist/modules/ResourcePlanner/planner.js +5 -0
  52. package/dist/modules/SalesSummary/types.d.ts +69 -0
  53. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  54. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  55. package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
  56. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
  57. package/dist/modules/Schedule/type.d.ts +157 -0
  58. package/dist/modules/Schedule/types.d.ts +201 -0
  59. package/dist/modules/Schedule/utils.d.ts +67 -0
  60. package/dist/modules/Step/tyeps.d.ts +20 -0
  61. package/dist/modules/SurchargeList/types.d.ts +15 -0
  62. package/dist/plugins/app.d.ts +10 -0
  63. package/dist/plugins/shopStore.d.ts +4 -0
  64. package/dist/plugins/user.d.ts +7 -0
  65. package/dist/server/modules/floor-plan/types.d.ts +43 -0
  66. package/dist/server/modules/menu/types.d.ts +68 -0
  67. package/dist/server/modules/payment/types.d.ts +9 -0
  68. package/dist/server/modules/quotation/types.d.ts +50 -0
  69. package/dist/server/modules/resource/types.d.ts +121 -0
  70. package/dist/server/modules/schedule/types.d.ts +1 -0
  71. package/dist/server/modules/schedule/utils.d.ts +32 -0
  72. package/dist/server/types.d.ts +66 -0
  73. package/dist/server/utils/index.d.ts +5 -0
  74. package/dist/server/utils/schedule.d.ts +14 -0
  75. package/dist/server/utils/time.d.ts +18 -0
  76. package/dist/solution/BaseSales/index.d.ts +12 -1
  77. package/dist/solution/BaseSales/index.js +275 -185
  78. package/dist/solution/BookingByStep/index.d.ts +2 -2
  79. package/dist/solution/BookingTicket/index.d.ts +1 -13
  80. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  81. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  82. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  83. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
  84. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  85. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  86. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  87. package/dist/solution/PlaceOrder/index.d.ts +0 -0
  88. package/dist/solution/RegisterAndLogin/config.d.ts +93 -0
  89. package/dist/solution/RegisterAndLogin/types.d.ts +445 -0
  90. package/dist/solution/RegisterAndLogin/utils.d.ts +103 -0
  91. package/dist/solution/UnifiedBookingSales/index.d.ts +23 -1
  92. package/dist/solution/UnifiedBookingSales/index.js +1367 -646
  93. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  94. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
  95. package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  96. package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
  97. package/dist/solution/UnifiedBookingSales/types.d.ts +25 -0
  98. package/dist/solution/UnifiedBookingSales/types.js +2 -0
  99. package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  100. package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +277 -0
  101. package/dist/store/createStore.d.ts +3 -0
  102. package/dist/types/index.d.ts +132 -0
  103. package/dist/utils/os-private-payload.d.ts +5 -0
  104. package/dist/utils/payment-number.d.ts +9 -0
  105. package/dist/utils/task.d.ts +40 -0
  106. package/dist/utils/watch.d.ts +102 -0
  107. package/lib/apis/picoding.d.ts +0 -0
  108. package/lib/effects/index.d.ts +19 -0
  109. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  110. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
  111. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  112. package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  113. package/lib/model/strategy/adapter/dataVariant/type.d.ts +173 -0
  114. package/lib/model/strategy/adapter/promotion/adapter.d.ts +70 -0
  115. package/lib/model/strategy/adapter/promotion/examples.d.ts +224 -0
  116. package/lib/model/strategy/adapter/promotion/type.d.ts +535 -0
  117. package/lib/model/strategy/adapter/type.d.ts +28 -0
  118. package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
  119. package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  120. package/lib/model/strategy/adapter/walletPass/type.d.ts +192 -0
  121. package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  122. package/lib/model/strategy/engine.d.ts +119 -0
  123. package/lib/model/strategy/type.d.ts +245 -0
  124. package/lib/modules/Account/types.d.ts +56 -0
  125. package/lib/modules/BookingContext/types.d.ts +104 -0
  126. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  127. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  128. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  129. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  130. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  131. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  132. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  133. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  134. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  135. package/lib/modules/Customer/constants.d.ts +7 -0
  136. package/lib/modules/Date/types.d.ts +84 -0
  137. package/lib/modules/Date/utils.d.ts +36 -0
  138. package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
  139. package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
  140. package/lib/modules/Order/payment-utils.d.ts +26 -0
  141. package/lib/modules/Order/pickupTiming.d.ts +46 -0
  142. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  143. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
  144. package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
  145. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
  146. package/lib/modules/Payment/mx51.d.ts +0 -0
  147. package/lib/modules/Payment/types.d.ts +943 -0
  148. package/lib/modules/Payment/utils.d.ts +19 -0
  149. package/lib/modules/Product/index.d.ts +1 -1
  150. package/lib/modules/ProductList/index.d.ts +2 -0
  151. package/lib/modules/ProductList/index.js +56 -0
  152. package/lib/modules/Quotation/types.d.ts +61 -0
  153. package/lib/modules/Resource/types.d.ts +50 -0
  154. package/lib/modules/Resource/utils.d.ts +23 -0
  155. package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
  156. package/lib/modules/ResourcePlanner/planner.js +4 -0
  157. package/lib/modules/SalesSummary/types.d.ts +69 -0
  158. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  159. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  160. package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
  161. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
  162. package/lib/modules/Schedule/type.d.ts +157 -0
  163. package/lib/modules/Schedule/types.d.ts +201 -0
  164. package/lib/modules/Schedule/utils.d.ts +67 -0
  165. package/lib/modules/Step/tyeps.d.ts +20 -0
  166. package/lib/modules/SurchargeList/types.d.ts +15 -0
  167. package/lib/plugins/app.d.ts +10 -0
  168. package/lib/plugins/shopStore.d.ts +4 -0
  169. package/lib/plugins/user.d.ts +7 -0
  170. package/lib/server/modules/floor-plan/types.d.ts +43 -0
  171. package/lib/server/modules/menu/types.d.ts +68 -0
  172. package/lib/server/modules/payment/types.d.ts +9 -0
  173. package/lib/server/modules/quotation/types.d.ts +50 -0
  174. package/lib/server/modules/resource/types.d.ts +121 -0
  175. package/lib/server/modules/schedule/types.d.ts +1 -0
  176. package/lib/server/modules/schedule/utils.d.ts +32 -0
  177. package/lib/server/types.d.ts +66 -0
  178. package/lib/server/utils/index.d.ts +5 -0
  179. package/lib/server/utils/schedule.d.ts +14 -0
  180. package/lib/server/utils/time.d.ts +18 -0
  181. package/lib/solution/BaseSales/index.d.ts +12 -1
  182. package/lib/solution/BaseSales/index.js +65 -0
  183. package/lib/solution/BookingByStep/index.d.ts +2 -2
  184. package/lib/solution/BookingTicket/index.d.ts +1 -13
  185. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  186. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  187. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  188. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
  189. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  190. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  191. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  192. package/lib/solution/PlaceOrder/index.d.ts +0 -0
  193. package/lib/solution/RegisterAndLogin/config.d.ts +93 -0
  194. package/lib/solution/RegisterAndLogin/types.d.ts +445 -0
  195. package/lib/solution/RegisterAndLogin/utils.d.ts +103 -0
  196. package/lib/solution/UnifiedBookingSales/index.d.ts +23 -1
  197. package/lib/solution/UnifiedBookingSales/index.js +399 -14
  198. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  199. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
  200. package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  201. package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
  202. package/lib/solution/UnifiedBookingSales/types.d.ts +25 -0
  203. package/lib/solution/UnifiedBookingSales/types.js +1 -0
  204. package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  205. package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +151 -0
  206. package/lib/store/createStore.d.ts +3 -0
  207. package/lib/types/index.d.ts +132 -0
  208. package/lib/utils/os-private-payload.d.ts +5 -0
  209. package/lib/utils/payment-number.d.ts +9 -0
  210. package/lib/utils/task.d.ts +40 -0
  211. package/lib/utils/watch.d.ts +102 -0
  212. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ export declare const getAvailableMaxAmount: (data: Record<string, any>) => any;
2
+ /**
3
+ * 将walletPass列表数据转换为prepare_payments需要的数据格式
4
+ * @param list
5
+ */
6
+ export declare const formatWalletPassList2PreparePayments: (list?: any[]) => {
7
+ voucher_id: any;
8
+ amount: number;
9
+ tag: any;
10
+ wallet_pass_usage_unit: any;
11
+ wallet_pass_use_value: any;
12
+ }[];
13
+ /**
14
+ * 对用户识别码列表进行排序
15
+ * 排序规则:正常数据 -> unified_available_status===1 -> 500601/500602 -> unified_available_status===0
16
+ * @param list 用户识别码列表
17
+ * @returns 排序后的列表
18
+ */
19
+ export declare const sortUserIdentificationCodeList: (list: any[]) => any[];
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -37,6 +37,8 @@ export declare class ProductList extends BaseModule implements Module {
37
37
  schedule_date?: string;
38
38
  channel?: string;
39
39
  }): Promise<any>;
40
+ /** Venue-only raw, complete pool load. No date/customer evaluation and no shared catalog publication. */
41
+ loadVenueCatalogPool(params?: Pick<ProductListLoadProductsParams, 'product_ids' | 'collection' | 'category_ids' | 'extension_type' | 'cacheId'>): Promise<ProductData[]>;
40
42
  /**
41
43
  * Remember raw remote product records before client-side Data Variant
42
44
  * evaluation. Quote-only reads can then always start from a clean baseline.
@@ -267,6 +267,62 @@ class ProductList extends _BaseModule.BaseModule {
267
267
  return productsData.data;
268
268
  }
269
269
 
270
+ /** Venue-only raw, complete pool load. No date/customer evaluation and no shared catalog publication. */
271
+ async loadVenueCatalogPool(params = {}) {
272
+ const channelMap = {
273
+ online_store: 'online-store',
274
+ scan_to_order: 'online-store',
275
+ 'scan-to-order': 'online-store',
276
+ scan_to_order_2: 'online-store',
277
+ scan_to_order_3: 'scantoorder3'
278
+ };
279
+ const channel = this.otherParams?.channel;
280
+ const response = await this.request.post('/product/query', {
281
+ // The customer endpoint otherwise filters out future/variant members.
282
+ open_quotation: 0,
283
+ open_bundle: 1,
284
+ with: [..._clientDataVariants.PRODUCT_QUERY_DATA_VARIANT_RELATIONS],
285
+ with_count: ['bundleGroup', 'optionGroup'],
286
+ with_schedule: 1,
287
+ status: 'published',
288
+ num: 500,
289
+ skip: 1,
290
+ is_eject: 1,
291
+ // Channel is stable for this runtime owner and remains a server publication
292
+ // filter. Date/customer/menu membership and pricing are evaluated locally.
293
+ application_code: typeof channel === 'string' ? channelMap[channel] || channel : channel,
294
+ ...(params.product_ids?.length ? {
295
+ ids: params.product_ids
296
+ } : {}),
297
+ ...(params.collection ? {
298
+ collection: params.collection
299
+ } : {}),
300
+ ...(params.category_ids?.length ? {
301
+ category_ids: params.category_ids
302
+ } : {}),
303
+ ...(params.extension_type?.length ? {
304
+ extension_type: params.extension_type
305
+ } : {}),
306
+ front_end_cache_id: params.cacheId
307
+ }, {
308
+ useCache: false,
309
+ customToast: () => {}
310
+ });
311
+ const data = response?.data;
312
+ if (response?.status === false || response?.code != null && Number(response.code) !== 200 || !Array.isArray(data?.list)) {
313
+ throw Object.assign(new Error(response?.message || 'The complete venue product pool could not be loaded.'), {
314
+ code: 'VENUE_CATALOG_LOAD_FAILED'
315
+ });
316
+ }
317
+ const total = data.total ?? data.total_count ?? data.total_num;
318
+ if (total != null && Number.isFinite(Number(total)) && Number(total) > data.list.length || total == null && data.list.length >= 500) {
319
+ throw Object.assign(new Error('The venue product pool is incomplete. A single complete catalog response is required.'), {
320
+ code: 'VENUE_CATALOG_INCOMPLETE'
321
+ });
322
+ }
323
+ return (0, _lodashEs.cloneDeep)(data.list);
324
+ }
325
+
270
326
  /**
271
327
  * Remember raw remote product records before client-side Data Variant
272
328
  * evaluation. Quote-only reads can then always start from a clean baseline.
@@ -0,0 +1,61 @@
1
+ export interface QuotationProductData {
2
+ id: number;
3
+ shelf_id: number;
4
+ product_id: number;
5
+ variant_id: number;
6
+ type: string;
7
+ value: number;
8
+ }
9
+ export interface QuotationSchedule {
10
+ id: number;
11
+ name: string;
12
+ type: 'standard' | 'time-slots' | 'designation';
13
+ start_time: string;
14
+ end_time: string;
15
+ is_all: number;
16
+ repeat_type?: string;
17
+ repeat_rule?: any;
18
+ designation?: any;
19
+ time_slot?: Array<{
20
+ start_time: string;
21
+ end_time: string;
22
+ }>;
23
+ pivot?: Record<string, any>;
24
+ }
25
+ export interface QuotationCustomer {
26
+ id: number | string;
27
+ [key: string]: any;
28
+ }
29
+ export interface QuotationItem {
30
+ id: number;
31
+ shop_id: number;
32
+ shelf_type_id?: number;
33
+ name: string;
34
+ description?: string;
35
+ status: string;
36
+ sort: number;
37
+ channel: string[];
38
+ created_at?: string;
39
+ updated_at?: string;
40
+ deleted_at?: string | null;
41
+ customer?: QuotationCustomer[];
42
+ schedule: QuotationSchedule[];
43
+ product_data: QuotationProductData[];
44
+ }
45
+ export interface QuotationState {
46
+ list: QuotationItem[];
47
+ }
48
+ export interface QuotationCustomerScope {
49
+ quotationId: number;
50
+ quotationName: string;
51
+ customerIds: string[];
52
+ customers: QuotationCustomer[];
53
+ }
54
+ export interface QuotationCustomerScopeInfo {
55
+ quotationCount: number;
56
+ hasCustomerScopedQuotations: boolean;
57
+ allQuotationsCustomerScoped: boolean;
58
+ customerIds: string[];
59
+ customers: QuotationCustomer[];
60
+ quotationScopes: QuotationCustomerScope[];
61
+ }
@@ -0,0 +1,50 @@
1
+ export declare enum ResourceHooks {
2
+ OnResourceSelect = "resource:onResourceSelect",
3
+ OnResourceChange = "resource:onResourceChange",
4
+ OnAvailabilityCheck = "resource:onAvailabilityCheck"
5
+ }
6
+ /**
7
+ * 资源可用时间段
8
+ */
9
+ export interface ResourceTimeSlot {
10
+ start: Date;
11
+ end: Date;
12
+ capacity: number;
13
+ availableCapacity: number;
14
+ }
15
+ /**
16
+ * 资源信息
17
+ */
18
+ export interface Resource {
19
+ like_status: 'common' | 'like';
20
+ id: string | number;
21
+ main_field: string;
22
+ form_id: string | number;
23
+ type: string;
24
+ capacity: number;
25
+ timeSlots: ResourceTimeSlot[];
26
+ metadata?: Record<string, any>;
27
+ startTime?: string;
28
+ endTime?: string;
29
+ resourceType?: string;
30
+ children?: Resource[];
31
+ }
32
+ /**
33
+ * 资源列表状态
34
+ */
35
+ export interface ResourceState {
36
+ list: Resource[];
37
+ selectedResource: Resource | null;
38
+ }
39
+ /**
40
+ * 资源列表模块 API
41
+ */
42
+ export interface ResourceListModuleAPI {
43
+ getResources: () => Promise<Resource[]>;
44
+ selectResource: (resourceId: string) => Promise<void>;
45
+ getSelectedResource: () => Resource | null;
46
+ checkAvailability: (resourceId: string, start: Date, end: Date) => Promise<boolean>;
47
+ getAvailableTimeSlots: (resourceId: string) => Promise<ResourceTimeSlot[]>;
48
+ getAvailableCapacity: (resourceId: string, timeSlot: ResourceTimeSlot) => number;
49
+ updateResource: (resourceId: string, updates: Partial<Resource>) => Promise<void>;
50
+ }
@@ -0,0 +1,23 @@
1
+ interface Resource {
2
+ id: string;
3
+ [key: string]: any;
4
+ }
5
+ /**
6
+ * @title: 获取资源map
7
+ * @description:
8
+ * @param {any} resourceList
9
+ * @return {*}
10
+ * @Author: zhiwei.Wang
11
+ */
12
+ export declare const getResourcesMap: (resourceList: Resource[]) => Record<string, Resource>;
13
+ /**
14
+ * @title: 根据ids筛选资源列表
15
+ * @description:
16
+ * @param {any} resourcesMap
17
+ * @param {any} ids
18
+ * @return {*}
19
+ * @Author: zhiwei.Wang
20
+ * @Date: 2024-09-19 20:23
21
+ */
22
+ export declare const getResourcesByIds: (resourcesMap: Record<string, Resource>, ids: number[]) => Resource[];
23
+ export {};
@@ -0,0 +1,33 @@
1
+ export interface LocalDateParts {
2
+ year: number;
3
+ month: number;
4
+ day: number;
5
+ }
6
+ export interface LocalDateTimeParts extends LocalDateParts {
7
+ hour: number;
8
+ minute: number;
9
+ second: number;
10
+ }
11
+ type LocalDateInput = string | LocalDateParts;
12
+ type LocalDateTimeInput = string | number | LocalDateTimeParts;
13
+ export declare function parseLocalDate(value: string): LocalDateParts;
14
+ export declare function parseLocalDateTime(value: string): LocalDateTimeParts;
15
+ export declare function extractFixedOffsetMinutes(value: string | null | undefined): number | null;
16
+ export declare function captureRuntimeOffsetMinutes(value?: Date): number;
17
+ export declare function formatFixedOffset(offsetMinutes: number | null | undefined): string;
18
+ export declare function localDateTimeToScalar(value: LocalDateTimeParts): number;
19
+ export declare function localDateToScalar(value: Date): number;
20
+ export declare function localDateToScalarStart(value: LocalDateInput): number;
21
+ export declare function scalarToLocalDateParts(value: number): LocalDateParts;
22
+ export declare function scalarToLocalDateTimeParts(value: number): LocalDateTimeParts;
23
+ export declare function dateOrdinalFromLocalDate(value: LocalDateInput): number;
24
+ export declare function weekdayFromLocalDate(value: LocalDateInput): number;
25
+ export declare function formatLocalDate(value: LocalDateInput | number): string;
26
+ export declare function formatLocalTime(value: LocalDateTimeInput, includeSeconds?: boolean): string;
27
+ export declare function formatLocalDateTime(value: LocalDateTimeInput, fixedOffsetMinutes?: number | null): string;
28
+ export declare function addLocalMinutes(value: number, minutes: number): number;
29
+ export declare function addLocalHours(value: number, hours: number): number;
30
+ export declare function addLocalCalendarDays(value: number, days: number): number;
31
+ export declare function nextDate(value: LocalDateInput): string;
32
+ export declare function ceilLocalScalarToTenMinutes(value: number): number;
33
+ export {};
@@ -515,6 +515,10 @@ function buildCellKey(params) {
515
515
  return [String(params.productId), params.groupId, String(params.resourceId), params.start, params.end].join(':');
516
516
  }
517
517
  function dedupeOccupancyRefKey(occupancy) {
518
+ const sessionKey = occupancy.raw?.__availabilitySessionOccupancyKey;
519
+ if (typeof sessionKey === 'string' && sessionKey) {
520
+ return `session:${JSON.stringify([String(occupancy.resourceId), sessionKey])}`;
521
+ }
518
522
  if (occupancy.scheduleEventId !== undefined && occupancy.scheduleEventId !== null) {
519
523
  return `scheduleEvent:${String(occupancy.resourceId)}:${String(occupancy.scheduleEventId)}`;
520
524
  }
@@ -0,0 +1,69 @@
1
+ export interface SalesSummaryProduct {
2
+ order_detail_id?: number | string | null;
3
+ product_id: number | null;
4
+ product_variant_id: number;
5
+ num: number;
6
+ /** 券后单品单价(订单域成交单价),由 OrderModule 维护。 */
7
+ selling_price: string;
8
+ /** 券前单品单价(店铺售价)。 */
9
+ original_price: string;
10
+ tax_fee: string;
11
+ is_charge_tax?: number;
12
+ product_sku?: Record<string, any> & {
13
+ option?: any[];
14
+ };
15
+ discount_list?: any[];
16
+ product_bundle?: any[];
17
+ metadata?: Record<string, any>;
18
+ _origin?: Record<string, any>;
19
+ }
20
+ export interface DepositPolicyData {
21
+ id: number;
22
+ title: string;
23
+ }
24
+ export interface DepositInfo {
25
+ total: string;
26
+ deposit_policy_ids: number[];
27
+ deposit_policy_data: DepositPolicyData[];
28
+ hasDeposit: boolean;
29
+ }
30
+ export interface SalesSummaryData {
31
+ product_quantity: number;
32
+ product_original_amount: string;
33
+ product_amount: string;
34
+ product_expect_amount: string;
35
+ product_tax_fee: string;
36
+ shipping_fee: string;
37
+ shipping_tax_fee: string;
38
+ tax_fee: string;
39
+ surcharge_fee: string;
40
+ surcharges: any[];
41
+ discount_amount: string;
42
+ deposit_amount: string;
43
+ deposit?: DepositInfo;
44
+ expect_amount: string;
45
+ total_amount: string;
46
+ total_refund_amount: string;
47
+ customer_paid_amount: string;
48
+ order_paid_amount: string;
49
+ amount_gap: string;
50
+ rounding_amount: string;
51
+ pay_service_charge_amount: string;
52
+ is_price_include_tax?: number;
53
+ tax_title?: string;
54
+ tax_rate?: number;
55
+ }
56
+ export interface SalesSummaryState {
57
+ surchargeList: any[];
58
+ summary: SalesSummaryData;
59
+ }
60
+ export interface SalesSummaryModuleAPI {
61
+ getSummary(params: {
62
+ products: SalesSummaryProduct[];
63
+ isPriceIncludeTax?: number;
64
+ taxRate?: number;
65
+ shopDiscount?: string | number;
66
+ channel?: string;
67
+ virtualSettlementMode?: boolean;
68
+ }): Promise<SalesSummaryData>;
69
+ }
@@ -0,0 +1,2 @@
1
+ import { ScanOrderLoggerProvider } from '../types';
2
+ export declare const feishuLoggerProvider: ScanOrderLoggerProvider;
@@ -0,0 +1,2 @@
1
+ import { ScanOrderLoggerProvider } from '../types';
2
+ export declare const grafanaLoggerProvider: ScanOrderLoggerProvider;
@@ -0,0 +1,53 @@
1
+ export type ScanOrderLogLevel = 'info' | 'warning' | 'error' | 'debug';
2
+ export type ScanOrderLoggerProviderType = 'feishu' | 'grafana';
3
+ export interface ScanOrderLoggerProviderFeishuConfig {
4
+ webhook?: string;
5
+ errorHook?: string;
6
+ /**
7
+ * 节流窗口毫秒数,默认 3000ms
8
+ * - >0:首条日志进入队列并启动定时器,窗口结束后合并成一条 Feishu post 统一发送
9
+ * - <=0:关闭节流,保持每条日志立即单独发送
10
+ */
11
+ throttleMs?: number;
12
+ }
13
+ export interface ScanOrderLoggerProviderGrafanaConfig {
14
+ endpoint?: string;
15
+ headers?: Record<string, string>;
16
+ }
17
+ export interface ScanOrderLoggerProviderConfig {
18
+ feishu?: ScanOrderLoggerProviderFeishuConfig;
19
+ grafana?: ScanOrderLoggerProviderGrafanaConfig;
20
+ }
21
+ export interface ScanOrderLoggerContext {
22
+ cacheId?: string;
23
+ solutionName?: string;
24
+ moduleName?: string;
25
+ [key: string]: any;
26
+ }
27
+ export interface ScanOrderLogInput {
28
+ level?: ScanOrderLogLevel;
29
+ title: string;
30
+ payload?: Record<string, any>;
31
+ extra?: Record<string, any>;
32
+ timestamp?: string;
33
+ }
34
+ export interface ScanOrderLogRecord {
35
+ level: ScanOrderLogLevel;
36
+ title: string;
37
+ timestamp: string;
38
+ payload: Record<string, any>;
39
+ extra: Record<string, any>;
40
+ context: ScanOrderLoggerContext;
41
+ }
42
+ export interface ScanOrderLoggerDispatchPayload {
43
+ record: ScanOrderLogRecord;
44
+ providerConfig?: ScanOrderLoggerProviderConfig;
45
+ }
46
+ export interface ScanOrderLoggerProvider {
47
+ send: (payload: ScanOrderLoggerDispatchPayload) => Promise<void>;
48
+ }
49
+ export interface ScanOrderLoggerState {
50
+ provider: ScanOrderLoggerProviderType;
51
+ providerConfig: ScanOrderLoggerProviderConfig;
52
+ context: ScanOrderLoggerContext;
53
+ }
@@ -0,0 +1,32 @@
1
+ import dayjs from "dayjs";
2
+ import { ScheduleItem } from "./types";
3
+ export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
4
+ export type ScheduleTimeSlot = {
5
+ /** 开始时间 HH:mm */
6
+ start_time: string;
7
+ /** 结束时间 HH:mm */
8
+ end_time: string;
9
+ /** 开始日期时间 YYYY-MM-DD HH:mm:ss */
10
+ start_at: dayjs.Dayjs;
11
+ /** 结束日期时间 YYYY-MM-DD HH:mm:ss */
12
+ end_at: dayjs.Dayjs;
13
+ };
14
+ /**
15
+ * 获取当前日期日程时间点
16
+ * @param date 日期 YYYY-MM-DD
17
+ * @param scheduleList 日程列表
18
+ * @returns 当前日期日程时间点 结构,数组 [{
19
+ *
20
+ * // HH:mm
21
+ * end_time: string,
22
+ * // HH:mm
23
+ * start_time: string,
24
+ * // 日期时间
25
+ * // YYYY-MM-DD HH:mm:ss
26
+ * end_at: Dayjs,
27
+ * // YYYY-MM-DD HH:mm:ss
28
+ * start_at: Dayjs,
29
+ *
30
+ * }]
31
+ */
32
+ export declare const getScheduleStartEndTimePoints: (date: string, scheduleList: ScheduleItem[]) => ScheduleTimeSlot[];
@@ -0,0 +1,157 @@
1
+ export type ScheduleItem = {
2
+ /** 颜色 */
3
+ color: string;
4
+ /** 创建时间 */
5
+ created_at: string;
6
+ /** 更新时间 */
7
+ updated_at: string;
8
+ /** 开始时间 */
9
+ start_time: string;
10
+ /** 结束时间 */
11
+ end_time: string;
12
+ /** 日程名称 */
13
+ name: string;
14
+ /** 关联订单 */
15
+ order_count: number;
16
+ /** 关联项目数据*/
17
+ relation_count: number;
18
+ repeat_rule: {
19
+ end: {
20
+ /** 截止类型 */
21
+ type: 'date' | 'never';
22
+ /** 结束时间 */
23
+ end_date: string | null;
24
+ occurrence: any | null;
25
+ };
26
+ frequency: number;
27
+ excluded_date: ExcIncDate[];
28
+ included_date: ExcIncDate[];
29
+ frequency_date: number[];
30
+ };
31
+ repeat_type: 'daily' | 'none' | 'weekly';
32
+ /** 日程类型
33
+ * standard: 标准日程
34
+ * time-slots: 时间段日程
35
+ * designation: 指定日期日程
36
+ * */
37
+ type: 'standard' | 'time-slots' | 'designation';
38
+ conflict?: boolean;
39
+ time_slot: {
40
+ start_time: string;
41
+ end_time: string;
42
+ id: number;
43
+ }[];
44
+ id: number;
45
+ /** 指定的开始时间结束时间 */
46
+ designation: {
47
+ start_date: string;
48
+ end_date: string;
49
+ start_time: string;
50
+ end_time: string;
51
+ } | {
52
+ start_date: string;
53
+ end_date: string;
54
+ start_time: string;
55
+ end_time: string;
56
+ }[];
57
+ /** 是否全天 */
58
+ is_all: 1 | 0;
59
+ [key: string]: any;
60
+ relation?: {
61
+ id: number;
62
+ item_id: number;
63
+ item_type: string;
64
+ relation_table_type: string;
65
+ schedule_id: number;
66
+ }[];
67
+ };
68
+ export type ScheduleFormOtherValue = {
69
+ /** 截止模式
70
+ * 1: 永不截止
71
+ * 2: 按日期截止
72
+ * */
73
+ endRadio: 1 | 2;
74
+ /** 是否为全天 */
75
+ isAllDay: boolean;
76
+ /** 是否开启排除日期 */
77
+ excludedStatus: boolean;
78
+ /** 是否包含排除日期 */
79
+ includeStatus: boolean;
80
+ type: 'standard' | 'time-slots' | 'designation';
81
+ };
82
+ export type ExcIncDate = {
83
+ start: string;
84
+ end: string;
85
+ };
86
+ export type ScheduleFormData = {
87
+ /** 颜色 */
88
+ color: string;
89
+ /** 日程名称 */
90
+ name: {
91
+ en: string;
92
+ 'zh-CN': string;
93
+ 'zh-HK': string;
94
+ original: string;
95
+ } | string;
96
+ /** 重复模式
97
+ * 0:不重复
98
+ * 1:按天重复
99
+ * 2:按周重复 */
100
+ repeat_type: '0' | '1' | '2';
101
+ /** 备注 */
102
+ note: string;
103
+ /** 指定的开始时间结束时间 */
104
+ designation: {
105
+ start_date: string;
106
+ end_date: string;
107
+ start_time: string;
108
+ end_time: string;
109
+ } | {
110
+ start_date: string;
111
+ end_date: string;
112
+ start_time: string;
113
+ end_time: string;
114
+ }[];
115
+ time_slot: {
116
+ start_time: string;
117
+ end_time: string;
118
+ id: number;
119
+ }[];
120
+ /** 重复频率 */
121
+ frequency: number;
122
+ /** 按周重复时选择的周数据 */
123
+ frequency_date: number[];
124
+ /** 截止日期 */
125
+ end_date: string;
126
+ /** 排除的日期范围 */
127
+ excluded_date: ExcIncDate[];
128
+ /** 包含的日期范围 */
129
+ included_date: ExcIncDate[];
130
+ /** 多时间段的开始时间 */
131
+ start_time: any;
132
+ end_time: any;
133
+ };
134
+ export type CalendarDataItem = {
135
+ date: string;
136
+ color: string[];
137
+ isExcluded: boolean;
138
+ schedule_ids?: number[];
139
+ [key: string]: any;
140
+ };
141
+ export type RequestData<Data> = {
142
+ data: Data;
143
+ status: boolean;
144
+ message: string;
145
+ code: number;
146
+ };
147
+ export type ResponseListData<Data> = {
148
+ status: boolean;
149
+ message: string;
150
+ code: number;
151
+ data: {
152
+ list: Data;
153
+ count: number;
154
+ size: number;
155
+ skip: number;
156
+ };
157
+ };