@pisell/pisellos 2.2.10 → 2.2.11

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 (55) hide show
  1. package/dist/modules/Cart/utils/cartProduct.js +26 -41
  2. package/dist/modules/Customer/index.js +1 -1
  3. package/dist/modules/Discount/index.d.ts +0 -2
  4. package/dist/modules/Discount/index.js +36 -69
  5. package/dist/modules/Discount/types.d.ts +0 -16
  6. package/dist/modules/Order/index.js +1 -4
  7. package/dist/modules/Order/utils.d.ts +0 -1
  8. package/dist/modules/Order/utils.js +0 -9
  9. package/dist/modules/Payment/index.js +2 -2
  10. package/dist/modules/Payment/types.d.ts +0 -1
  11. package/dist/modules/Payment/walletpass.js +1 -3
  12. package/dist/modules/Product/index.d.ts +1 -1
  13. package/dist/modules/ProductList/index.js +9 -8
  14. package/dist/modules/Rules/index.d.ts +0 -7
  15. package/dist/modules/Rules/index.js +196 -1065
  16. package/dist/modules/Rules/types.d.ts +1 -4
  17. package/dist/solution/BookingByStep/index.d.ts +1 -1
  18. package/dist/solution/BookingByStep/index.js +8 -30
  19. package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
  20. package/dist/solution/BookingByStep/utils/products.js +0 -10
  21. package/dist/solution/BookingTicket/index.d.ts +1 -1
  22. package/dist/solution/Checkout/index.js +49 -93
  23. package/dist/solution/ShopDiscount/index.d.ts +0 -2
  24. package/dist/solution/ShopDiscount/index.js +19 -80
  25. package/dist/solution/ShopDiscount/types.d.ts +1 -4
  26. package/dist/solution/ShopDiscount/utils.d.ts +0 -55
  27. package/dist/solution/ShopDiscount/utils.js +3 -432
  28. package/lib/modules/Cart/utils/cartProduct.js +22 -35
  29. package/lib/modules/Customer/index.js +1 -1
  30. package/lib/modules/Discount/index.d.ts +0 -2
  31. package/lib/modules/Discount/index.js +4 -19
  32. package/lib/modules/Discount/types.d.ts +0 -16
  33. package/lib/modules/Order/index.js +0 -2
  34. package/lib/modules/Order/utils.d.ts +0 -1
  35. package/lib/modules/Order/utils.js +0 -11
  36. package/lib/modules/Payment/index.js +1 -1
  37. package/lib/modules/Payment/types.d.ts +0 -1
  38. package/lib/modules/Payment/walletpass.js +1 -10
  39. package/lib/modules/Product/index.d.ts +1 -1
  40. package/lib/modules/ProductList/index.js +7 -0
  41. package/lib/modules/Rules/index.d.ts +0 -7
  42. package/lib/modules/Rules/index.js +182 -824
  43. package/lib/modules/Rules/types.d.ts +1 -4
  44. package/lib/solution/BookingByStep/index.d.ts +1 -1
  45. package/lib/solution/BookingByStep/index.js +2 -19
  46. package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
  47. package/lib/solution/BookingByStep/utils/products.js +2 -8
  48. package/lib/solution/BookingTicket/index.d.ts +1 -1
  49. package/lib/solution/Checkout/index.js +19 -68
  50. package/lib/solution/ShopDiscount/index.d.ts +0 -2
  51. package/lib/solution/ShopDiscount/index.js +9 -55
  52. package/lib/solution/ShopDiscount/types.d.ts +1 -4
  53. package/lib/solution/ShopDiscount/utils.d.ts +0 -55
  54. package/lib/solution/ShopDiscount/utils.js +3 -266
  55. package/package.json +2 -2
@@ -115,8 +115,6 @@ var OrderModule = class extends import_BaseModule.BaseModule {
115
115
  item._origin.duration = duration;
116
116
  item._origin.sub_type = durationType;
117
117
  }
118
- const discountList = (0, import_utils.getAllDiscountList)(item);
119
- item._origin.product.discount_list = discountList;
120
118
  if ((0, import_utils2.isNormalProduct)(item._origin)) {
121
119
  order.relation_products.push(item._origin.product);
122
120
  const relationForms = item._origin.relation_forms || [];
@@ -20,4 +20,3 @@ export declare const mergeRelationForms: (relationForms: {
20
20
  form_id: number;
21
21
  form_record_ids: number[];
22
22
  }[];
23
- export declare const getAllDiscountList: (cartItem: CartItem) => any;
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var utils_exports = {};
31
31
  __export(utils_exports, {
32
32
  generateDuration: () => generateDuration,
33
- getAllDiscountList: () => getAllDiscountList,
34
33
  mergeRelationForms: () => mergeRelationForms
35
34
  });
36
35
  module.exports = __toCommonJS(utils_exports);
@@ -56,18 +55,8 @@ var mergeRelationForms = (relationForms) => {
56
55
  }, {})
57
56
  ).filter((item) => item.form_record_ids.length > 0);
58
57
  };
59
- var getAllDiscountList = (cartItem) => {
60
- var _a, _b, _c, _d;
61
- let discountList = ((_b = (_a = cartItem == null ? void 0 : cartItem._origin) == null ? void 0 : _a.product) == null ? void 0 : _b.discount_list) || [];
62
- (((_d = (_c = cartItem == null ? void 0 : cartItem._origin) == null ? void 0 : _c.product) == null ? void 0 : _d.product_bundle) || []).forEach((item) => {
63
- discountList = [...discountList, ...item.discount_list || []];
64
- item.discount_list = void 0;
65
- });
66
- return discountList;
67
- };
68
58
  // Annotate the CommonJS export names for ESM import in node:
69
59
  0 && (module.exports = {
70
60
  generateDuration,
71
- getAllDiscountList,
72
61
  mergeRelationForms
73
62
  });
@@ -623,7 +623,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
623
623
  this.logInfo("更新订单支付项完成", {
624
624
  orderUuid
625
625
  });
626
- this.core.effects.emit(`${this.name}:onPaymentAdded`, {
626
+ this.core.effects.emit(import_types.PaymentHooks.OnPaymentAdded, {
627
627
  orderUuid,
628
628
  payment: newPaymentItem
629
629
  });
@@ -671,7 +671,6 @@ export interface WalletInitBusinessData {
671
671
  order_wait_pay_amount?: number;
672
672
  /** 订单ID */
673
673
  payment_order_id?: string;
674
- is_price_include_tax: number;
675
674
  }
676
675
  /**
677
676
  * 查询用户识别码列表请求参数
@@ -51,19 +51,10 @@ var WalletPassPaymentImpl = class {
51
51
  */
52
52
  generateWalletParams(businessData) {
53
53
  var _a, _b;
54
- const {
55
- customer_id,
56
- holder,
57
- amountInfo,
58
- products,
59
- order_wait_pay_amount,
60
- payment_order_id,
61
- is_price_include_tax
62
- } = businessData;
54
+ const { customer_id, holder, amountInfo, products, order_wait_pay_amount, payment_order_id } = businessData;
63
55
  const totalAmount = Number(amountInfo.totalAmount);
64
56
  const subTotal = Number(amountInfo.subTotal);
65
57
  const walletParams = {
66
- is_price_include_tax,
67
58
  sale_channel: "pos",
68
59
  customer_id: customer_id || 0,
69
60
  // 提供默认值,确保类型为 number
@@ -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(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -103,6 +103,13 @@ var ProductList = class extends import_BaseModule.BaseModule {
103
103
  { osServer: true }
104
104
  );
105
105
  const sortedList = (productsData.data.list || []).slice().sort((a, b) => Number(b.sort) - Number(a.sort));
106
+ if (sortedList.length) {
107
+ sortedList.forEach((n) => {
108
+ if (n.is_eject !== 1 && n["schedule.ids"] && n["schedule.ids"].length) {
109
+ n.is_eject = 1;
110
+ }
111
+ });
112
+ }
106
113
  this.addProduct(sortedList);
107
114
  return sortedList;
108
115
  }
@@ -37,13 +37,6 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
37
37
  selectedList?: SetDiscountSelectedParams[];
38
38
  scan?: boolean;
39
39
  }): DiscountResult;
40
- /**
41
- * 检查优惠是否符合 PackageSubItemUsageRules 配置
42
- * @param discount 优惠券
43
- * @param flatItem 扁平化后的商品项(可能是主商品或bundle子商品)
44
- * @returns 是否可用
45
- */
46
- private checkPackageSubItemUsageRules;
47
40
  destroy(): Promise<void>;
48
41
  clear(): Promise<void>;
49
42
  }