@pisell/pisellos 2.3.127 → 2.3.128

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 (103) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +0 -2
  3. package/dist/model/strategy/adapter/walletPass/evaluator.js +2 -4
  4. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +19 -58
  5. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +12 -24
  6. package/dist/modules/Customer/index.js +3 -6
  7. package/dist/modules/Customer/types.d.ts +0 -2
  8. package/dist/modules/Discount/index.d.ts +2 -2
  9. package/dist/modules/Discount/index.js +151 -37
  10. package/dist/modules/Discount/types.d.ts +5 -36
  11. package/dist/modules/Order/index.d.ts +2 -7
  12. package/dist/modules/Order/index.js +331 -480
  13. package/dist/modules/Order/utils/orderCollectionIdentity.js +12 -16
  14. package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
  15. package/dist/modules/Order/utils/weighedProduct.js +94 -0
  16. package/dist/modules/Order/utils.d.ts +1 -1
  17. package/dist/modules/Order/utils.js +65 -104
  18. package/dist/modules/Payment/types.d.ts +1 -21
  19. package/dist/modules/Payment/types.js +0 -2
  20. package/dist/modules/Payment/walletpass.d.ts +1 -1
  21. package/dist/modules/Payment/walletpass.js +47 -80
  22. package/dist/modules/Rules/index.d.ts +2 -2
  23. package/dist/modules/Rules/index.js +190 -482
  24. package/dist/modules/Rules/types.d.ts +2 -4
  25. package/dist/server/modules/order/types.d.ts +0 -2
  26. package/dist/server/utils/small-ticket.js +1 -1
  27. package/dist/solution/BaseSales/index.d.ts +2 -3
  28. package/dist/solution/BaseSales/index.js +77 -44
  29. package/dist/solution/BaseSales/types.d.ts +7 -3
  30. package/dist/solution/BaseSales/utils/cartPromotion.js +126 -141
  31. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +40 -25
  32. package/dist/solution/BaseSales/utils.js +3 -2
  33. package/dist/solution/BookingByStep/index.d.ts +1 -1
  34. package/dist/solution/BookingTicket/index.d.ts +3 -2
  35. package/dist/solution/BookingTicket/index.js +63 -60
  36. package/dist/solution/BookingTicket/types.d.ts +1 -5
  37. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -2
  38. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +147 -338
  39. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +4 -8
  40. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -6
  41. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +6 -19
  42. package/dist/solution/ScanOrder/utils.js +3 -2
  43. package/dist/solution/ShopDiscount/index.d.ts +0 -2
  44. package/dist/solution/ShopDiscount/index.js +42 -99
  45. package/dist/solution/ShopDiscount/utils.d.ts +2 -4
  46. package/dist/solution/ShopDiscount/utils.js +23 -43
  47. package/dist/solution/UnifiedBookingSales/index.js +2 -2
  48. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  49. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +0 -2
  50. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -2
  51. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +6 -35
  52. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -13
  53. package/lib/modules/Customer/index.js +1 -5
  54. package/lib/modules/Customer/types.d.ts +0 -2
  55. package/lib/modules/Discount/index.d.ts +2 -2
  56. package/lib/modules/Discount/index.js +129 -23
  57. package/lib/modules/Discount/types.d.ts +5 -36
  58. package/lib/modules/Order/index.d.ts +2 -7
  59. package/lib/modules/Order/index.js +109 -222
  60. package/lib/modules/Order/utils/orderCollectionIdentity.js +11 -14
  61. package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
  62. package/lib/modules/Order/utils/weighedProduct.js +89 -0
  63. package/lib/modules/Order/utils.d.ts +1 -1
  64. package/lib/modules/Order/utils.js +6 -41
  65. package/lib/modules/Payment/types.d.ts +1 -21
  66. package/lib/modules/Payment/types.js +0 -1
  67. package/lib/modules/Payment/walletpass.d.ts +1 -1
  68. package/lib/modules/Payment/walletpass.js +9 -29
  69. package/lib/modules/Rules/index.d.ts +2 -2
  70. package/lib/modules/Rules/index.js +114 -359
  71. package/lib/modules/Rules/types.d.ts +2 -4
  72. package/lib/server/modules/order/types.d.ts +0 -2
  73. package/lib/server/utils/small-ticket.js +1 -1
  74. package/lib/solution/BaseSales/index.d.ts +2 -3
  75. package/lib/solution/BaseSales/index.js +17 -11
  76. package/lib/solution/BaseSales/types.d.ts +7 -3
  77. package/lib/solution/BaseSales/utils/cartPromotion.js +4 -12
  78. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -9
  79. package/lib/solution/BaseSales/utils.js +2 -1
  80. package/lib/solution/BookingByStep/index.d.ts +1 -1
  81. package/lib/solution/BookingTicket/index.d.ts +3 -2
  82. package/lib/solution/BookingTicket/index.js +33 -36
  83. package/lib/solution/BookingTicket/types.d.ts +1 -5
  84. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -2
  85. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +42 -174
  86. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +4 -8
  87. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -6
  88. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +3 -11
  89. package/lib/solution/ScanOrder/utils.js +2 -1
  90. package/lib/solution/ShopDiscount/index.d.ts +0 -2
  91. package/lib/solution/ShopDiscount/index.js +9 -55
  92. package/lib/solution/ShopDiscount/utils.d.ts +2 -4
  93. package/lib/solution/ShopDiscount/utils.js +25 -42
  94. package/lib/solution/UnifiedBookingSales/index.js +2 -2
  95. package/package.json +1 -1
  96. package/dist/modules/Discount/availability.d.ts +0 -7
  97. package/dist/modules/Discount/availability.js +0 -49
  98. package/dist/modules/Discount/entitlementPass.d.ts +0 -34
  99. package/dist/modules/Discount/entitlementPass.js +0 -147
  100. package/lib/modules/Discount/availability.d.ts +0 -7
  101. package/lib/modules/Discount/availability.js +0 -43
  102. package/lib/modules/Discount/entitlementPass.d.ts +0 -34
  103. package/lib/modules/Discount/entitlementPass.js +0 -141
@@ -44,10 +44,7 @@ interface ApplicableProductDetails {
44
44
  original_amount: string;
45
45
  num: number;
46
46
  metadata?: {
47
- encoded?: string;
48
47
  product_discount_difference?: number;
49
- /** 月卡扣除本单新增使用后的剩余次数;不限次数时为 null。 */
50
- balance?: number | null;
51
48
  };
52
49
  discount?: {
53
50
  fixed_amount?: number;
@@ -66,13 +63,6 @@ interface UsageCreditsValue {
66
63
  max_per_week: number;
67
64
  max_per_month: number;
68
65
  }
69
- export type IncludedUses = {
70
- type: 'limited';
71
- value: number;
72
- } | {
73
- type: 'unlimited';
74
- value: null;
75
- };
76
66
  export type DiscountFilterRejectKey = 'total_credits' | 'per_user_limit' | 'max_per_day' | 'max_per_week' | 'max_per_month';
77
67
  export interface DiscountWithReason {
78
68
  discountList: Discount[];
@@ -117,37 +107,30 @@ interface ExtensionData {
117
107
  }
118
108
  export interface Discount {
119
109
  id: number;
120
- shop_id?: number;
121
110
  product_name: string;
122
111
  encoded: string;
123
112
  code: string;
124
113
  tag: string;
125
- expire_time?: string | null;
126
- expire_date?: string | null;
127
- end_time?: string | null;
114
+ expire_time?: string;
128
115
  product_id: number;
129
116
  relation_type: string;
130
117
  par_value: string;
131
118
  used_par_value: string;
132
119
  limit_status: string;
133
120
  limited_relation_product_data: Limitedrelationproductdata;
134
- balance?: string | number | null;
135
- available_num?: number;
136
- available_products_info?: any[];
121
+ balance: string;
137
122
  format_title: Formattitle;
138
123
  metadata?: {
139
- encoded?: string;
140
124
  discount_card_type?: 'fixed_amount' | 'percent';
141
125
  custom_product_bundle_map_id?: string;
142
126
  validity_type?: "custom_schedule_validity" | "fixed_validity";
143
- included_uses?: IncludedUses;
144
- discount_calculation_mode?: 'item_level' | 'order_level';
145
- holder?: {
127
+ discount_calculation_mode: 'item_level' | 'order_level';
128
+ holder: {
146
129
  type: "customer" | "custom";
147
130
  };
148
131
  };
149
132
  product: Product;
150
- type?: "product" | 'good_pass' | 'entitlement_pass' | 'discount_card' | 'product_discount_card';
133
+ type: "product" | 'good_pass';
151
134
  resource_id?: number;
152
135
  savedAmount?: number;
153
136
  isEditMode?: boolean;
@@ -180,17 +163,9 @@ export interface Discount {
180
163
  applicableProductIds?: number[];
181
164
  applicableProductDetails: ApplicableProductDetails[];
182
165
  appliedProductDetails: ApplicableProductDetails[];
183
- /** Entitlement Pass 编辑订单时已经提交的使用明细。 */
184
- committedAppliedProductDetails?: ApplicableProductDetails[];
185
166
  isDisabledForProductUsed?: boolean;
186
167
  amount?: number;
187
168
  customer_id?: number | string | null;
188
- holder?: {
189
- holder_type?: 'customer' | 'form' | string;
190
- holder_id?: number | string | Array<number | string>;
191
- created_at?: string | null;
192
- [key: string]: any;
193
- };
194
169
  extension_data?: ExtensionData[];
195
170
  total_order_behavior_count?: number;
196
171
  today_order_behavior_count?: number;
@@ -205,12 +180,6 @@ export interface Discount {
205
180
  start_time?: string;
206
181
  discount_rule_uncheck_flag?: boolean;
207
182
  usageLimitFailKey?: string | null;
208
- /** 本次规则计算的不可用原因;可用性恢复后清除。 */
209
- reason?: string;
210
- reasonCode?: string;
211
- unified_messages?: {
212
- title?: string | Record<string, string>;
213
- };
214
183
  unified_available_status?: number | undefined | null;
215
184
  }
216
185
  export interface DiscountState {
@@ -110,7 +110,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
110
110
  }>;
111
111
  applyDiscount(options?: {
112
112
  reapplyBookingDiscountProductUids?: string[];
113
- preferredEntitlementPassIds?: number[];
113
+ reapplyWeighedDiscountProductUids?: string[];
114
114
  }): void;
115
115
  /**
116
116
  * 注入促销评估器。
@@ -489,12 +489,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
489
489
  }>, options?: {
490
490
  skipEditDiscountConfigRefresh?: boolean;
491
491
  }): Promise<OrderProduct[]>;
492
- private getFullCoveragePassDiscounts;
493
- private hasEntitlementPassDiscount;
494
492
  private hasGoodPassDiscount;
495
- private isPersistedProductLine;
496
- private isRuntimeEntitlementAppend;
497
- private hasSameEntitlementMergePriceConfig;
498
493
  private getBundleRuntimeIdentity;
499
494
  private preservePersistedBundlePriceFields;
500
495
  private applyOrderProductUpdateToTempOrder;
@@ -584,7 +579,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
584
579
  generateIdempotencyToken(): string;
585
580
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
586
581
  createOrder(params: CommitOrderParams['query']): {
587
- type: "virtual" | "appointment_booking";
582
+ type: "appointment_booking" | "virtual";
588
583
  platform: string;
589
584
  sales_channel: string;
590
585
  order_sales_channel: string;