@pisell/pisellos 2.2.9 → 2.2.10

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 +41 -26
  2. package/dist/modules/Customer/index.js +1 -1
  3. package/dist/modules/Discount/index.d.ts +2 -0
  4. package/dist/modules/Discount/index.js +69 -36
  5. package/dist/modules/Discount/types.d.ts +16 -0
  6. package/dist/modules/Order/index.js +4 -1
  7. package/dist/modules/Order/utils.d.ts +1 -0
  8. package/dist/modules/Order/utils.js +9 -0
  9. package/dist/modules/Payment/index.js +2 -2
  10. package/dist/modules/Payment/types.d.ts +1 -0
  11. package/dist/modules/Payment/walletpass.js +3 -1
  12. package/dist/modules/Product/index.d.ts +1 -1
  13. package/dist/modules/ProductList/index.js +8 -9
  14. package/dist/modules/Rules/index.d.ts +7 -0
  15. package/dist/modules/Rules/index.js +1065 -196
  16. package/dist/modules/Rules/types.d.ts +4 -1
  17. package/dist/solution/BookingByStep/index.d.ts +1 -1
  18. package/dist/solution/BookingByStep/index.js +30 -8
  19. package/dist/solution/BookingByStep/utils/products.d.ts +6 -0
  20. package/dist/solution/BookingByStep/utils/products.js +10 -0
  21. package/dist/solution/BookingTicket/index.d.ts +1 -1
  22. package/dist/solution/Checkout/index.js +61 -17
  23. package/dist/solution/ShopDiscount/index.d.ts +2 -0
  24. package/dist/solution/ShopDiscount/index.js +80 -19
  25. package/dist/solution/ShopDiscount/types.d.ts +4 -1
  26. package/dist/solution/ShopDiscount/utils.d.ts +55 -0
  27. package/dist/solution/ShopDiscount/utils.js +432 -3
  28. package/lib/modules/Cart/utils/cartProduct.js +35 -22
  29. package/lib/modules/Customer/index.js +1 -1
  30. package/lib/modules/Discount/index.d.ts +2 -0
  31. package/lib/modules/Discount/index.js +19 -4
  32. package/lib/modules/Discount/types.d.ts +16 -0
  33. package/lib/modules/Order/index.js +2 -0
  34. package/lib/modules/Order/utils.d.ts +1 -0
  35. package/lib/modules/Order/utils.js +11 -0
  36. package/lib/modules/Payment/index.js +1 -1
  37. package/lib/modules/Payment/types.d.ts +1 -0
  38. package/lib/modules/Payment/walletpass.js +10 -1
  39. package/lib/modules/Product/index.d.ts +1 -1
  40. package/lib/modules/ProductList/index.js +0 -7
  41. package/lib/modules/Rules/index.d.ts +7 -0
  42. package/lib/modules/Rules/index.js +824 -182
  43. package/lib/modules/Rules/types.d.ts +4 -1
  44. package/lib/solution/BookingByStep/index.d.ts +1 -1
  45. package/lib/solution/BookingByStep/index.js +19 -2
  46. package/lib/solution/BookingByStep/utils/products.d.ts +6 -0
  47. package/lib/solution/BookingByStep/utils/products.js +8 -2
  48. package/lib/solution/BookingTicket/index.d.ts +1 -1
  49. package/lib/solution/Checkout/index.js +66 -17
  50. package/lib/solution/ShopDiscount/index.d.ts +2 -0
  51. package/lib/solution/ShopDiscount/index.js +55 -9
  52. package/lib/solution/ShopDiscount/types.d.ts +4 -1
  53. package/lib/solution/ShopDiscount/utils.d.ts +55 -0
  54. package/lib/solution/ShopDiscount/utils.js +266 -3
  55. package/package.json +2 -2
@@ -115,6 +115,8 @@ 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;
118
120
  if ((0, import_utils2.isNormalProduct)(item._origin)) {
119
121
  order.relation_products.push(item._origin.product);
120
122
  const relationForms = item._origin.relation_forms || [];
@@ -20,3 +20,4 @@ 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,6 +30,7 @@ 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,
33
34
  mergeRelationForms: () => mergeRelationForms
34
35
  });
35
36
  module.exports = __toCommonJS(utils_exports);
@@ -55,8 +56,18 @@ var mergeRelationForms = (relationForms) => {
55
56
  }, {})
56
57
  ).filter((item) => item.form_record_ids.length > 0);
57
58
  };
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
+ };
58
68
  // Annotate the CommonJS export names for ESM import in node:
59
69
  0 && (module.exports = {
60
70
  generateDuration,
71
+ getAllDiscountList,
61
72
  mergeRelationForms
62
73
  });
@@ -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(import_types.PaymentHooks.OnPaymentAdded, {
626
+ this.core.effects.emit(`${this.name}:onPaymentAdded`, {
627
627
  orderUuid,
628
628
  payment: newPaymentItem
629
629
  });
@@ -671,6 +671,7 @@ 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;
674
675
  }
675
676
  /**
676
677
  * 查询用户识别码列表请求参数
@@ -51,10 +51,19 @@ var WalletPassPaymentImpl = class {
51
51
  */
52
52
  generateWalletParams(businessData) {
53
53
  var _a, _b;
54
- const { customer_id, holder, amountInfo, products, order_wait_pay_amount, payment_order_id } = businessData;
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;
55
63
  const totalAmount = Number(amountInfo.totalAmount);
56
64
  const subTotal = Number(amountInfo.subTotal);
57
65
  const walletParams = {
66
+ is_price_include_tax,
58
67
  sale_channel: "pos",
59
68
  customer_id: customer_id || 0,
60
69
  // 提供默认值,确保类型为 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(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -103,13 +103,6 @@ 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
- }
113
106
  this.addProduct(sortedList);
114
107
  return sortedList;
115
108
  }
@@ -37,6 +37,13 @@ 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;
40
47
  destroy(): Promise<void>;
41
48
  clear(): Promise<void>;
42
49
  }