@pisell/pisellos 0.10.41 → 0.10.43

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 (56) hide show
  1. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +58 -19
  2. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +24 -12
  3. package/dist/modules/Discount/entitlementPass.d.ts +34 -0
  4. package/dist/modules/Discount/entitlementPass.js +147 -0
  5. package/dist/modules/Discount/index.d.ts +2 -0
  6. package/dist/modules/Discount/index.js +39 -13
  7. package/dist/modules/Discount/types.d.ts +26 -5
  8. package/dist/modules/Order/index.d.ts +5 -0
  9. package/dist/modules/Order/index.js +283 -118
  10. package/dist/modules/Order/utils/orderCollectionIdentity.js +16 -12
  11. package/dist/modules/Order/utils.js +17 -1
  12. package/dist/modules/ResourcePlanner/planner.d.ts +2 -2
  13. package/dist/modules/ResourcePlanner/planner.js +163 -46
  14. package/dist/modules/ResourcePlanner/types.d.ts +17 -0
  15. package/dist/modules/Rules/index.js +312 -135
  16. package/dist/solution/BaseSales/index.d.ts +2 -0
  17. package/dist/solution/BaseSales/index.js +9 -1
  18. package/dist/solution/BaseSales/utils/cartPromotion.js +141 -126
  19. package/dist/solution/BookingTicket/types.d.ts +5 -1
  20. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +171 -96
  21. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +3 -1
  22. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +2 -0
  23. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +12 -3
  24. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  25. package/dist/solution/ShopDiscount/index.js +41 -21
  26. package/dist/solution/ShopDiscount/utils.js +3 -2
  27. package/dist/solution/UnifiedBookingSales/index.js +94 -21
  28. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  29. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +35 -6
  30. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +13 -6
  31. package/lib/modules/Discount/entitlementPass.d.ts +34 -0
  32. package/lib/modules/Discount/entitlementPass.js +141 -0
  33. package/lib/modules/Discount/index.d.ts +2 -0
  34. package/lib/modules/Discount/index.js +25 -9
  35. package/lib/modules/Discount/types.d.ts +26 -5
  36. package/lib/modules/Order/index.d.ts +5 -0
  37. package/lib/modules/Order/index.js +172 -28
  38. package/lib/modules/Order/utils/orderCollectionIdentity.js +14 -11
  39. package/lib/modules/Order/utils.js +19 -1
  40. package/lib/modules/ResourcePlanner/planner.d.ts +2 -2
  41. package/lib/modules/ResourcePlanner/planner.js +137 -35
  42. package/lib/modules/ResourcePlanner/types.d.ts +17 -0
  43. package/lib/modules/Rules/index.js +232 -97
  44. package/lib/solution/BaseSales/index.d.ts +2 -0
  45. package/lib/solution/BaseSales/index.js +7 -1
  46. package/lib/solution/BaseSales/utils/cartPromotion.js +12 -4
  47. package/lib/solution/BookingTicket/types.d.ts +5 -1
  48. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +65 -18
  49. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +3 -1
  50. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +2 -0
  51. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +5 -1
  52. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  53. package/lib/solution/ShopDiscount/index.js +26 -6
  54. package/lib/solution/ShopDiscount/utils.js +3 -2
  55. package/lib/solution/UnifiedBookingSales/index.js +86 -22
  56. package/package.json +1 -1
@@ -63,6 +63,13 @@ interface UsageCreditsValue {
63
63
  max_per_week: number;
64
64
  max_per_month: number;
65
65
  }
66
+ export type IncludedUses = {
67
+ type: 'limited';
68
+ value: number;
69
+ } | {
70
+ type: 'unlimited';
71
+ value: null;
72
+ };
66
73
  export type DiscountFilterRejectKey = 'total_credits' | 'per_user_limit' | 'max_per_day' | 'max_per_week' | 'max_per_month';
67
74
  export interface DiscountWithReason {
68
75
  discountList: Discount[];
@@ -107,30 +114,36 @@ interface ExtensionData {
107
114
  }
108
115
  export interface Discount {
109
116
  id: number;
117
+ shop_id?: number;
110
118
  product_name: string;
111
119
  encoded: string;
112
120
  code: string;
113
121
  tag: string;
114
- expire_time?: string;
122
+ expire_time?: string | null;
123
+ expire_date?: string | null;
124
+ end_time?: string | null;
115
125
  product_id: number;
116
126
  relation_type: string;
117
127
  par_value: string;
118
128
  used_par_value: string;
119
129
  limit_status: string;
120
130
  limited_relation_product_data: Limitedrelationproductdata;
121
- balance: string;
131
+ balance?: string | number | null;
132
+ available_num?: number;
133
+ available_products_info?: any[];
122
134
  format_title: Formattitle;
123
135
  metadata?: {
124
136
  discount_card_type?: 'fixed_amount' | 'percent';
125
137
  custom_product_bundle_map_id?: string;
126
138
  validity_type?: 'custom_schedule_validity' | 'fixed_validity';
127
- discount_calculation_mode: 'item_level' | 'order_level';
128
- holder: {
139
+ included_uses?: IncludedUses;
140
+ discount_calculation_mode?: 'item_level' | 'order_level';
141
+ holder?: {
129
142
  type: 'customer' | 'custom';
130
143
  };
131
144
  };
132
145
  product: Product;
133
- type: 'product' | 'good_pass';
146
+ type?: 'product' | 'good_pass' | 'entitlement_pass' | 'discount_card' | 'product_discount_card';
134
147
  resource_id?: number;
135
148
  savedAmount?: number;
136
149
  isEditMode?: boolean;
@@ -163,9 +176,17 @@ export interface Discount {
163
176
  applicableProductIds?: number[];
164
177
  applicableProductDetails: ApplicableProductDetails[];
165
178
  appliedProductDetails: ApplicableProductDetails[];
179
+ /** Entitlement Pass 编辑订单时已经提交的使用明细。 */
180
+ committedAppliedProductDetails?: ApplicableProductDetails[];
166
181
  isDisabledForProductUsed?: boolean;
167
182
  amount?: number;
168
183
  customer_id?: number | string | null;
184
+ holder?: {
185
+ holder_type?: 'customer' | 'form' | string;
186
+ holder_id?: number | string | Array<number | string>;
187
+ created_at?: string | null;
188
+ [key: string]: any;
189
+ };
169
190
  extension_data?: ExtensionData[];
170
191
  total_order_behavior_count?: number;
171
192
  today_order_behavior_count?: number;
@@ -445,7 +445,12 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
445
445
  }>, options?: {
446
446
  skipEditDiscountConfigRefresh?: boolean;
447
447
  }): Promise<OrderProduct[]>;
448
+ private getFullCoveragePassDiscounts;
449
+ private hasEntitlementPassDiscount;
448
450
  private hasGoodPassDiscount;
451
+ private isPersistedProductLine;
452
+ private isRuntimeEntitlementAppend;
453
+ private hasSameEntitlementMergePriceConfig;
449
454
  private getBundleRuntimeIdentity;
450
455
  private preservePersistedBundlePriceFields;
451
456
  private applyOrderProductUpdateToTempOrder;