@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.
Files changed (201) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
  4. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  5. package/dist/model/strategy/adapter/walletPass/evaluator.js +61 -8
  6. package/dist/model/strategy/adapter/walletPass/locales.js +12 -3
  7. package/dist/model/strategy/engine.d.ts +18 -5
  8. package/dist/model/strategy/engine.js +145 -45
  9. package/dist/model/strategy/type.d.ts +17 -0
  10. package/dist/model/strategy/type.js +4 -0
  11. package/dist/modules/Cart/types.d.ts +2 -0
  12. package/dist/modules/Cart/utils/cartProduct.js +56 -25
  13. package/dist/modules/Discount/index.d.ts +2 -6
  14. package/dist/modules/Discount/index.js +8 -14
  15. package/dist/modules/Discount/types.d.ts +19 -1
  16. package/dist/modules/Order/index.d.ts +1 -65
  17. package/dist/modules/Order/index.js +30 -901
  18. package/dist/modules/Order/types.d.ts +12 -174
  19. package/dist/modules/Order/types.js +0 -2
  20. package/dist/modules/Order/utils.d.ts +0 -118
  21. package/dist/modules/Order/utils.js +2 -586
  22. package/dist/modules/Payment/index.d.ts +2 -1
  23. package/dist/modules/Payment/index.js +10 -7
  24. package/dist/modules/Payment/utils.js +3 -0
  25. package/dist/modules/Payment/walletpass.d.ts +23 -0
  26. package/dist/modules/Payment/walletpass.js +191 -95
  27. package/dist/modules/Product/utils.js +2 -2
  28. package/dist/modules/ProductList/index.d.ts +1 -1
  29. package/dist/modules/ProductList/index.js +3 -4
  30. package/dist/modules/Rules/index.d.ts +9 -5
  31. package/dist/modules/Rules/index.js +677 -168
  32. package/dist/modules/Rules/types.d.ts +2 -0
  33. package/dist/modules/Schedule/getDateIsInSchedule.js +18 -11
  34. package/dist/modules/Schedule/utils.d.ts +1 -1
  35. package/dist/modules/Summary/types.d.ts +2 -0
  36. package/dist/modules/Summary/utils.d.ts +9 -3
  37. package/dist/modules/Summary/utils.js +52 -41
  38. package/dist/modules/index.d.ts +0 -4
  39. package/dist/modules/index.js +1 -5
  40. package/dist/plugins/window.d.ts +2 -0
  41. package/dist/solution/BookingByStep/index.d.ts +3 -2
  42. package/dist/solution/BookingByStep/index.js +43 -46
  43. package/dist/solution/BookingByStep/types.d.ts +1 -3
  44. package/dist/solution/BookingByStep/types.js +1 -5
  45. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  46. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  47. package/dist/solution/Checkout/index.js +2 -0
  48. package/dist/solution/ShopDiscount/index.d.ts +2 -2
  49. package/dist/solution/ShopDiscount/index.js +41 -37
  50. package/dist/solution/ShopDiscount/types.d.ts +1 -1
  51. package/dist/solution/ShopDiscount/types.js +2 -1
  52. package/dist/solution/ShopDiscount/utils.js +26 -12
  53. package/dist/solution/index.d.ts +0 -2
  54. package/dist/solution/index.js +1 -3
  55. package/lib/index.d.ts +1 -0
  56. package/lib/index.js +3 -1
  57. package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
  58. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  59. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
  60. package/lib/model/strategy/adapter/walletPass/evaluator.js +34 -3
  61. package/lib/model/strategy/adapter/walletPass/locales.js +12 -3
  62. package/lib/model/strategy/engine.d.ts +18 -5
  63. package/lib/model/strategy/engine.js +85 -21
  64. package/lib/model/strategy/type.d.ts +17 -0
  65. package/lib/modules/Cart/types.d.ts +2 -0
  66. package/lib/modules/Cart/utils/cartProduct.js +39 -12
  67. package/lib/modules/Discount/index.d.ts +2 -6
  68. package/lib/modules/Discount/index.js +1 -3
  69. package/lib/modules/Discount/types.d.ts +19 -1
  70. package/lib/modules/Order/index.d.ts +1 -65
  71. package/lib/modules/Order/index.js +1 -513
  72. package/lib/modules/Order/types.d.ts +12 -174
  73. package/lib/modules/Order/utils.d.ts +0 -118
  74. package/lib/modules/Order/utils.js +2 -483
  75. package/lib/modules/Payment/index.d.ts +2 -1
  76. package/lib/modules/Payment/index.js +1 -0
  77. package/lib/modules/Payment/utils.js +3 -0
  78. package/lib/modules/Payment/walletpass.d.ts +23 -0
  79. package/lib/modules/Payment/walletpass.js +94 -17
  80. package/lib/modules/Product/utils.js +2 -2
  81. package/lib/modules/ProductList/index.d.ts +1 -1
  82. package/lib/modules/ProductList/index.js +3 -5
  83. package/lib/modules/Rules/index.d.ts +9 -5
  84. package/lib/modules/Rules/index.js +780 -288
  85. package/lib/modules/Rules/types.d.ts +2 -0
  86. package/lib/modules/Schedule/getDateIsInSchedule.js +11 -9
  87. package/lib/modules/Schedule/utils.d.ts +1 -1
  88. package/lib/modules/Summary/types.d.ts +2 -0
  89. package/lib/modules/Summary/utils.d.ts +9 -3
  90. package/lib/modules/Summary/utils.js +31 -22
  91. package/lib/modules/index.d.ts +0 -4
  92. package/lib/modules/index.js +1 -9
  93. package/lib/plugins/window.d.ts +2 -0
  94. package/lib/solution/BookingByStep/index.d.ts +3 -2
  95. package/lib/solution/BookingByStep/index.js +4 -6
  96. package/lib/solution/BookingByStep/types.d.ts +1 -3
  97. package/lib/solution/BookingByStep/types.js +0 -10
  98. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  99. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  100. package/lib/solution/Checkout/index.js +2 -0
  101. package/lib/solution/ShopDiscount/index.d.ts +2 -2
  102. package/lib/solution/ShopDiscount/index.js +24 -16
  103. package/lib/solution/ShopDiscount/types.d.ts +1 -1
  104. package/lib/solution/ShopDiscount/utils.js +10 -6
  105. package/lib/solution/index.d.ts +0 -2
  106. package/lib/solution/index.js +1 -5
  107. package/package.json +1 -1
  108. package/dist/apis/picoding.d.ts +0 -0
  109. package/dist/apis/picoding.js +0 -1
  110. package/dist/modules/OpenData/index.d.ts +0 -24
  111. package/dist/modules/OpenData/index.js +0 -173
  112. package/dist/modules/OpenData/types.d.ts +0 -73
  113. package/dist/modules/OpenData/types.js +0 -1
  114. package/dist/modules/OpenData/utils.d.ts +0 -2
  115. package/dist/modules/OpenData/utils.js +0 -75
  116. package/dist/modules/Quotation/index.d.ts +0 -48
  117. package/dist/modules/Quotation/index.js +0 -248
  118. package/dist/modules/Quotation/types.d.ts +0 -42
  119. package/dist/modules/Quotation/types.js +0 -1
  120. package/dist/modules/SalesSummary/index.d.ts +0 -63
  121. package/dist/modules/SalesSummary/index.js +0 -174
  122. package/dist/modules/SalesSummary/types.d.ts +0 -60
  123. package/dist/modules/SalesSummary/types.js +0 -1
  124. package/dist/modules/SalesSummary/utils.d.ts +0 -30
  125. package/dist/modules/SalesSummary/utils.js +0 -480
  126. package/dist/modules/ScanOrderLogger/index.d.ts +0 -23
  127. package/dist/modules/ScanOrderLogger/index.js +0 -174
  128. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  129. package/dist/modules/ScanOrderLogger/providers/feishu.js +0 -221
  130. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  131. package/dist/modules/ScanOrderLogger/providers/grafana.js +0 -50
  132. package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
  133. package/dist/modules/ScanOrderLogger/types.js +0 -1
  134. package/dist/solution/ScanOrder/index.d.ts +0 -152
  135. package/dist/solution/ScanOrder/index.js +0 -3132
  136. package/dist/solution/ScanOrder/types.d.ts +0 -287
  137. package/dist/solution/ScanOrder/types.js +0 -35
  138. package/dist/solution/ScanOrder/utils.d.ts +0 -167
  139. package/dist/solution/ScanOrder/utils.js +0 -764
  140. package/dist/solution/VenueBooking/index.d.ts +0 -199
  141. package/dist/solution/VenueBooking/index.js +0 -3459
  142. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
  143. package/dist/solution/VenueBooking/types.d.ts +0 -154
  144. package/dist/solution/VenueBooking/types.js +0 -21
  145. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
  146. package/dist/solution/VenueBooking/utils/dateSummary.js +0 -104
  147. package/dist/solution/VenueBooking/utils/resource.d.ts +0 -14
  148. package/dist/solution/VenueBooking/utils/resource.js +0 -131
  149. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -38
  150. package/dist/solution/VenueBooking/utils/slotMerge.js +0 -239
  151. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
  152. package/dist/solution/VenueBooking/utils/timeSlot.js +0 -453
  153. package/dist/solution/VenueBooking/utils.d.ts +0 -1
  154. package/dist/solution/VenueBooking/utils.js +0 -1
  155. package/lib/apis/picoding.d.ts +0 -0
  156. package/lib/apis/picoding.js +0 -0
  157. package/lib/modules/OpenData/index.d.ts +0 -24
  158. package/lib/modules/OpenData/index.js +0 -119
  159. package/lib/modules/OpenData/types.d.ts +0 -73
  160. package/lib/modules/OpenData/types.js +0 -17
  161. package/lib/modules/OpenData/utils.d.ts +0 -2
  162. package/lib/modules/OpenData/utils.js +0 -111
  163. package/lib/modules/Quotation/index.d.ts +0 -48
  164. package/lib/modules/Quotation/index.js +0 -152
  165. package/lib/modules/Quotation/types.d.ts +0 -42
  166. package/lib/modules/Quotation/types.js +0 -17
  167. package/lib/modules/SalesSummary/index.d.ts +0 -63
  168. package/lib/modules/SalesSummary/index.js +0 -105
  169. package/lib/modules/SalesSummary/types.d.ts +0 -60
  170. package/lib/modules/SalesSummary/types.js +0 -17
  171. package/lib/modules/SalesSummary/utils.d.ts +0 -30
  172. package/lib/modules/SalesSummary/utils.js +0 -420
  173. package/lib/modules/ScanOrderLogger/index.d.ts +0 -23
  174. package/lib/modules/ScanOrderLogger/index.js +0 -147
  175. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  176. package/lib/modules/ScanOrderLogger/providers/feishu.js +0 -157
  177. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  178. package/lib/modules/ScanOrderLogger/providers/grafana.js +0 -52
  179. package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
  180. package/lib/modules/ScanOrderLogger/types.js +0 -17
  181. package/lib/solution/ScanOrder/index.d.ts +0 -152
  182. package/lib/solution/ScanOrder/index.js +0 -1901
  183. package/lib/solution/ScanOrder/types.d.ts +0 -287
  184. package/lib/solution/ScanOrder/types.js +0 -36
  185. package/lib/solution/ScanOrder/utils.d.ts +0 -167
  186. package/lib/solution/ScanOrder/utils.js +0 -635
  187. package/lib/solution/VenueBooking/index.d.ts +0 -199
  188. package/lib/solution/VenueBooking/index.js +0 -1926
  189. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
  190. package/lib/solution/VenueBooking/types.d.ts +0 -154
  191. package/lib/solution/VenueBooking/types.js +0 -44
  192. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
  193. package/lib/solution/VenueBooking/utils/dateSummary.js +0 -110
  194. package/lib/solution/VenueBooking/utils/resource.d.ts +0 -14
  195. package/lib/solution/VenueBooking/utils/resource.js +0 -92
  196. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -38
  197. package/lib/solution/VenueBooking/utils/slotMerge.js +0 -237
  198. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
  199. package/lib/solution/VenueBooking/utils/timeSlot.js +0 -339
  200. package/lib/solution/VenueBooking/utils.d.ts +0 -1
  201. package/lib/solution/VenueBooking/utils.js +0 -69
@@ -1,26 +1,13 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { OrderModuleAPI, CommitOrderParams, SubmitScanOrderParams, ScanOrderMoreParams, CheckoutOrderParams, UpdateProductInOrderParams } from './types';
3
+ import { OrderModuleAPI, CommitOrderParams, CheckoutOrderParams } from './types';
4
4
  import { CartItem } from '../Cart/types';
5
- import { type SubmitPayloadEnhancer } from './utils';
6
- import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderSummary, ScanOrderTempOrder } from '../../solution/ScanOrder/types';
7
- import type { Discount } from '../Discount/types';
8
- import { UnavailableReason } from '../Rules/types';
9
5
  export declare class OrderModule extends BaseModule implements Module, OrderModuleAPI {
10
6
  protected defaultName: string;
11
7
  protected defaultVersion: string;
12
8
  private store;
13
9
  private request;
14
10
  private logger;
15
- private window;
16
- private cacheId;
17
- private salesSummaryModuleName;
18
- private rulesHooksOverride?;
19
- /**
20
- * Populate `savedAmount` on each discount based on product-level discount details.
21
- * Only selected discounts get a non-zero value.
22
- */
23
- static populateSavedAmounts(productList: Array<Record<string, any>>, discountList: Array<Record<string, any>>): void;
24
11
  constructor(name?: string, version?: string);
25
12
  initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
26
13
  /**
@@ -35,52 +22,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
35
22
  * 记录错误日志
36
23
  */
37
24
  private logError;
38
- private registerDiscountModules;
39
- private createDefaultRulesHooks;
40
- loadDiscountConfig(params: {
41
- customerId: number;
42
- action?: 'create';
43
- }): Promise<void>;
44
- getDiscountList(): Discount[];
45
- scanCode(code: string, customerId?: number): Promise<{
46
- isAvailable: boolean;
47
- discountList: Discount[];
48
- type: 'server' | 'clientCalc';
49
- unavailableReason?: UnavailableReason;
50
- }>;
51
- applyDiscount(): void;
52
- initTempOrder(params: {
53
- cacheId?: string;
54
- salesSummaryModuleName?: string;
55
- }): void;
56
- private getTempOrderStorageKey;
57
- private restoreTempOrderFromStorage;
58
- persistTempOrder(): void;
59
- private createDefaultTempOrderInstance;
60
- ensureTempOrder(): ScanOrderTempOrder;
61
- restoreOrder(): ScanOrderTempOrder;
62
- getTempOrder(): ScanOrderTempOrder | null;
63
- addNewOrder(): Promise<ScanOrderTempOrder>;
64
- getOrderProducts(): ScanOrderOrderProduct[];
65
- private getSalesSummary;
66
- recalculateSummary(options?: {
67
- createIfMissing?: boolean;
68
- }): Promise<ScanOrderSummary | null>;
69
- getScanOrderSummary(): Promise<ScanOrderSummary>;
70
- updateTempOrderNote(note: string): string;
71
- updateTempOrderBuzzer(buzzer: string): string;
72
- updateTempOrderContactsInfo(contactsInfo: any[]): any[];
73
- addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
74
- updateProductInOrder(params: UpdateProductInOrderParams): Promise<ScanOrderOrderProduct[]>;
75
- removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
76
- submitTempOrder<T = any>(params?: {
77
- cacheId?: string;
78
- platform?: string;
79
- businessCode?: string;
80
- channel?: string;
81
- type?: string;
82
- enhancePayload?: SubmitPayloadEnhancer;
83
- }): Promise<T>;
84
25
  createOrder(params: CommitOrderParams['query']): {
85
26
  type: "virtual" | "appointment_booking";
86
27
  platform: string;
@@ -110,9 +51,4 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
110
51
  * @returns 后端返回的订单数据(包含订单ID等)
111
52
  */
112
53
  createOrderByCheckout(params: CheckoutOrderParams): Promise<any>;
113
- submitScanOrder<T = any>(params: SubmitScanOrderParams): Promise<T>;
114
- scanOrderMore<T = any>(params: ScanOrderMoreParams): Promise<T>;
115
- getOrderInfoByRemote(order_id: number): Promise<any>;
116
- getLastOrderInfo(): Record<string, any> | undefined;
117
54
  }
118
- export type { UpdateProductInOrderParams } from './types';