@pisell/pisellos 2.3.51 → 2.3.53

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 (161) hide show
  1. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
  2. package/dist/modules/Discount/index.d.ts +0 -1
  3. package/dist/modules/Discount/index.js +11 -40
  4. package/dist/modules/Discount/types.d.ts +0 -1
  5. package/dist/modules/OpenData/index.js +2 -2
  6. package/dist/modules/Order/index.d.ts +7 -9
  7. package/dist/modules/Order/index.js +165 -140
  8. package/dist/modules/Order/types.d.ts +21 -12
  9. package/dist/modules/Order/types.js +11 -0
  10. package/dist/modules/Order/utils.d.ts +0 -10
  11. package/dist/modules/Order/utils.js +3 -35
  12. package/dist/modules/Product/types.d.ts +0 -1
  13. package/dist/modules/ProductList/index.js +14 -33
  14. package/dist/modules/Quotation/index.d.ts +1 -1
  15. package/dist/modules/Quotation/index.js +2 -2
  16. package/dist/modules/Rules/index.js +32 -56
  17. package/dist/modules/SalesSummary/index.js +13 -12
  18. package/dist/modules/SalesSummary/utils.js +7 -1
  19. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  20. package/dist/modules/ScanOrderLogger/index.js +2 -15
  21. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  22. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  23. package/dist/modules/Schedule/index.d.ts +1 -3
  24. package/dist/modules/Schedule/index.js +16 -21
  25. package/dist/modules/Summary/utils.js +13 -38
  26. package/dist/modules/index.d.ts +0 -2
  27. package/dist/modules/index.js +1 -3
  28. package/dist/plugins/window.d.ts +0 -1
  29. package/dist/server/index.d.ts +0 -14
  30. package/dist/server/index.js +793 -907
  31. package/dist/solution/BaseSales/index.d.ts +15 -12
  32. package/dist/solution/BaseSales/index.js +194 -178
  33. package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
  34. package/dist/solution/BookingByStep/index.d.ts +1 -16
  35. package/dist/solution/BookingByStep/index.js +215 -294
  36. package/dist/solution/BookingByStep/types.d.ts +1 -2
  37. package/dist/solution/BookingByStep/types.js +1 -3
  38. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  39. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  40. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  41. package/dist/solution/BookingTicket/index.d.ts +2 -14
  42. package/dist/solution/BookingTicket/index.js +2 -2
  43. package/dist/solution/BookingTicket/types.d.ts +3 -0
  44. package/dist/solution/BookingTicket/utils/cartView.js +44 -32
  45. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  46. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  47. package/dist/solution/Sales/index.d.ts +1 -0
  48. package/dist/solution/Sales/index.js +16 -2
  49. package/dist/solution/ScanOrder/index.d.ts +14 -26
  50. package/dist/solution/ScanOrder/index.js +739 -1142
  51. package/dist/solution/ScanOrder/types.d.ts +1 -21
  52. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  53. package/dist/solution/ScanOrder/utils.js +25 -66
  54. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  55. package/dist/solution/ShopDiscount/index.js +87 -125
  56. package/dist/solution/VenueBooking/index.d.ts +11 -39
  57. package/dist/solution/VenueBooking/index.js +841 -1167
  58. package/dist/solution/VenueBooking/types.d.ts +0 -3
  59. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  60. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  61. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  62. package/dist/solution/index.d.ts +0 -1
  63. package/dist/solution/index.js +1 -2
  64. package/dist/types/index.d.ts +0 -1
  65. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  66. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  67. package/lib/modules/Discount/index.d.ts +0 -1
  68. package/lib/modules/Discount/index.js +0 -9
  69. package/lib/modules/Discount/types.d.ts +0 -1
  70. package/lib/modules/OpenData/index.js +1 -1
  71. package/lib/modules/Order/index.d.ts +7 -9
  72. package/lib/modules/Order/index.js +89 -38
  73. package/lib/modules/Order/types.d.ts +21 -12
  74. package/lib/modules/Order/utils.d.ts +0 -10
  75. package/lib/modules/Order/utils.js +5 -36
  76. package/lib/modules/Product/types.d.ts +0 -1
  77. package/lib/modules/ProductList/index.js +31 -40
  78. package/lib/modules/Quotation/index.d.ts +1 -1
  79. package/lib/modules/Quotation/index.js +2 -2
  80. package/lib/modules/Rules/index.js +32 -44
  81. package/lib/modules/SalesSummary/index.js +7 -6
  82. package/lib/modules/SalesSummary/utils.js +5 -1
  83. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  84. package/lib/modules/ScanOrderLogger/index.js +1 -13
  85. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  86. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  87. package/lib/modules/Schedule/index.d.ts +1 -3
  88. package/lib/modules/Schedule/index.js +8 -10
  89. package/lib/modules/Summary/utils.js +1 -21
  90. package/lib/modules/index.d.ts +0 -2
  91. package/lib/modules/index.js +1 -5
  92. package/lib/plugins/window.d.ts +0 -1
  93. package/lib/server/index.d.ts +0 -14
  94. package/lib/server/index.js +15 -72
  95. package/lib/solution/BaseSales/index.d.ts +15 -12
  96. package/lib/solution/BaseSales/index.js +52 -35
  97. package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
  98. package/lib/solution/BookingByStep/index.d.ts +1 -16
  99. package/lib/solution/BookingByStep/index.js +18 -60
  100. package/lib/solution/BookingByStep/types.d.ts +1 -2
  101. package/lib/solution/BookingByStep/types.js +0 -5
  102. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  103. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  104. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  105. package/lib/solution/BookingTicket/index.d.ts +2 -14
  106. package/lib/solution/BookingTicket/index.js +2 -10
  107. package/lib/solution/BookingTicket/types.d.ts +3 -0
  108. package/lib/solution/BookingTicket/utils/cartView.js +43 -30
  109. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  110. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  111. package/lib/solution/Sales/index.d.ts +1 -0
  112. package/lib/solution/Sales/index.js +15 -3
  113. package/lib/solution/ScanOrder/index.d.ts +14 -26
  114. package/lib/solution/ScanOrder/index.js +182 -449
  115. package/lib/solution/ScanOrder/types.d.ts +1 -21
  116. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  117. package/lib/solution/ScanOrder/utils.js +0 -31
  118. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  119. package/lib/solution/ShopDiscount/index.js +0 -14
  120. package/lib/solution/VenueBooking/index.d.ts +11 -39
  121. package/lib/solution/VenueBooking/index.js +110 -322
  122. package/lib/solution/VenueBooking/types.d.ts +0 -3
  123. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  124. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  125. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  126. package/lib/solution/index.d.ts +0 -1
  127. package/lib/solution/index.js +1 -3
  128. package/lib/types/index.d.ts +0 -1
  129. package/package.json +1 -1
  130. package/dist/modules/Holder/index.d.ts +0 -48
  131. package/dist/modules/Holder/index.js +0 -640
  132. package/dist/modules/Holder/types.d.ts +0 -123
  133. package/dist/modules/Holder/types.js +0 -1
  134. package/dist/modules/Holder/utils.d.ts +0 -13
  135. package/dist/modules/Holder/utils.js +0 -34
  136. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  137. package/dist/modules/ResourcePlanner/index.js +0 -181
  138. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  139. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  140. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  141. package/dist/modules/ResourcePlanner/types.js +0 -1
  142. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  143. package/dist/solution/UnifiedBookingSales/index.js +0 -1891
  144. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  145. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  146. package/lib/modules/Holder/index.d.ts +0 -48
  147. package/lib/modules/Holder/index.js +0 -402
  148. package/lib/modules/Holder/types.d.ts +0 -123
  149. package/lib/modules/Holder/types.js +0 -17
  150. package/lib/modules/Holder/utils.d.ts +0 -13
  151. package/lib/modules/Holder/utils.js +0 -71
  152. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  153. package/lib/modules/ResourcePlanner/index.js +0 -148
  154. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  155. package/lib/modules/ResourcePlanner/planner.js +0 -933
  156. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  157. package/lib/modules/ResourcePlanner/types.js +0 -17
  158. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  159. package/lib/solution/UnifiedBookingSales/index.js +0 -1084
  160. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  161. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -12,6 +12,10 @@ export declare function buildPriceBreakdown(params: {
12
12
  }) => number;
13
13
  };
14
14
  }): PriceBreakdownEntry[];
15
+ export declare function buildVenueResourceMetadata(params: {
16
+ mapping: ResourceProductMapping;
17
+ rawResource: VenueResourceRawData | undefined;
18
+ }): Record<string, any>;
15
19
  export interface BuildVenueBookingParams {
16
20
  group: MergedSlotGroup;
17
21
  resourceId: number | string;
@@ -25,10 +29,6 @@ export interface BuildVenueBookingParams {
25
29
  */
26
30
  childResources?: VenueResourceRawData[];
27
31
  }
28
- export declare function buildVenueResourceMetadata(params: {
29
- mapping: ResourceProductMapping;
30
- rawResource: VenueResourceRawData | undefined;
31
- }): Record<string, any>;
32
32
  export declare function buildVenueBookingEntry(params: BuildVenueBookingParams): Record<string, any>;
33
33
  /**
34
34
  * 从一条已合并的订单商品还原出独立的时段列表。
@@ -109,12 +109,10 @@ function buildPriceBreakdown(params) {
109
109
  }
110
110
  function buildVenueResourceMetadata(params) {
111
111
  const { mapping, rawResource } = params;
112
- const combined = rawResource == null ? void 0 : rawResource.combined_resource;
113
- const isCombined = !!(combined && combined.status === 1 && Array.isArray(combined.resource_ids));
114
112
  return {
115
- form_name: mapping.formName ?? mapping.resourceName,
116
- resource_name: (rawResource == null ? void 0 : rawResource.main_field) ?? mapping.resourceName,
117
- combined_resource: isCombined ? combined : null
113
+ form_name: (rawResource == null ? void 0 : rawResource.form_name) ?? "",
114
+ resource_name: (rawResource == null ? void 0 : rawResource.main_field) ?? mapping.resourceName ?? "",
115
+ combined_resource: (rawResource == null ? void 0 : rawResource.combined_resource) ?? null
118
116
  };
119
117
  }
120
118
  function buildVenueBookingEntry(params) {
@@ -130,7 +128,7 @@ function buildVenueBookingEntry(params) {
130
128
  form_id: (rawResource == null ? void 0 : rawResource.form_id) ?? mapping.formId,
131
129
  relation_id: resourceId,
132
130
  capacity: 1,
133
- metadata: buildVenueResourceMetadata({ mapping, rawResource })
131
+ metadata: {}
134
132
  };
135
133
  if (childResources && childResources.length) {
136
134
  resourceEntry.children = childResources.map((child) => ({
@@ -8,4 +8,3 @@ export * from './Sales';
8
8
  export * from './ScanOrder';
9
9
  export * from './BaseSales';
10
10
  export * from './VenueBooking';
11
- export * from './UnifiedBookingSales';
@@ -26,7 +26,6 @@ __reExport(solution_exports, require("./Sales"), module.exports);
26
26
  __reExport(solution_exports, require("./ScanOrder"), module.exports);
27
27
  __reExport(solution_exports, require("./BaseSales"), module.exports);
28
28
  __reExport(solution_exports, require("./VenueBooking"), module.exports);
29
- __reExport(solution_exports, require("./UnifiedBookingSales"), module.exports);
30
29
  // Annotate the CommonJS export names for ESM import in node:
31
30
  0 && (module.exports = {
32
31
  ...require("./BuyTickets"),
@@ -38,6 +37,5 @@ __reExport(solution_exports, require("./UnifiedBookingSales"), module.exports);
38
37
  ...require("./Sales"),
39
38
  ...require("./ScanOrder"),
40
39
  ...require("./BaseSales"),
41
- ...require("./VenueBooking"),
42
- ...require("./UnifiedBookingSales")
40
+ ...require("./VenueBooking")
43
41
  });
@@ -6,7 +6,6 @@ export interface Plugin {
6
6
  version: string;
7
7
  initialize: () => Promise<void> | void;
8
8
  destroy?: () => Promise<void> | void;
9
- getLocalStorage?: (key: string) => string | null;
10
9
  }
11
10
  export interface PluginOptions {
12
11
  dependencies?: string[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.3.51",
4
+ "version": "2.3.53",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,48 +0,0 @@
1
- import { Module, PisellCore, ModuleOptions } from '../../types';
2
- import { BaseModule } from '../BaseModule';
3
- import { IFormInfo, IFormRecord, IFormItemData, IFetchFormInfoParams, IFetchFormRecordsParams, IAddFormRecordParams, IAppendFormRecordParams, IEnsureFormDataParams, IEnsureFormByProductParams, IRefreshAllFormRecordsParams, HolderModuleAPI, HolderFormMap } from './types';
4
- export * from './types';
5
- export * from './utils';
6
- export declare class HolderModule extends BaseModule implements Module, HolderModuleAPI {
7
- protected defaultName: string;
8
- protected defaultVersion: string;
9
- private store;
10
- private request;
11
- private cacheId;
12
- private openCache;
13
- private fatherModule;
14
- private isLoading;
15
- private error;
16
- /** 已加载过表单数据的 form_id 缓存标记 */
17
- private loadedFormIds;
18
- private window;
19
- constructor(name?: string, version?: string);
20
- initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
21
- /** 统一提交 formMap,仅此处触发 store changed */
22
- private commitFormMap;
23
- /** 通知 UI 刷新(数据未变但需要 re-read 的场景) */
24
- private notifyFormMapChanged;
25
- getHolderFormMap(): HolderFormMap;
26
- getHolderFormData(formId: number | string): IFormItemData | undefined;
27
- setFormData(formId: number | string, data: Partial<IFormItemData>): void;
28
- private ensureFormItem;
29
- private hasFormData;
30
- private patchFormMap;
31
- fetchFormInfo(params: IFetchFormInfoParams): Promise<IFormInfo | IFormInfo[]>;
32
- fetchRecords(params: IFetchFormRecordsParams): Promise<any>;
33
- ensureFormData(params: IEnsureFormDataParams): Promise<IFormItemData>;
34
- ensureFormByProduct(params: IEnsureFormByProductParams): Promise<IFormItemData | null>;
35
- addFormRecord(params: IAddFormRecordParams): Promise<any>;
36
- /**
37
- * UI 层自行请求添加接口后,将返回记录合并到 holderMap 对应 form_id 的 records 中
38
- */
39
- appendFormRecord(params: IAppendFormRecordParams): IFormRecord;
40
- removeFormRecord(formId: number | string, formRecordId: number): void;
41
- clearFormData(formId?: number | string): void;
42
- /**
43
- * 登录后按当前 holderMap 批量刷新所有表单的 records。
44
- * 遍历 holderMap,从 form.form 中读取 form_id、shop_id,结合 customer_id 重新拉取记录。
45
- */
46
- refreshAllFormRecords(params?: IRefreshAllFormRecordsParams): Promise<HolderFormMap>;
47
- storeChange(path?: string): void;
48
- }