@pisell/pisellos 0.0.512 → 0.0.513

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.
@@ -82,7 +82,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
82
82
  enhancePayload?: SubmitPayloadEnhancer;
83
83
  }): Promise<T>;
84
84
  createOrder(params: CommitOrderParams['query']): {
85
- type: "virtual" | "appointment_booking";
85
+ type: "appointment_booking" | "virtual";
86
86
  platform: string;
87
87
  sales_channel: string;
88
88
  order_sales_channel: string;
@@ -236,8 +236,10 @@ function getMainProductPaymentTotal(product) {
236
236
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
237
237
  var bundleItem = _step5.value;
238
238
  if (isBundleMarkupOrDiscount(bundleItem)) {
239
- var _ref3, _bundleItem$bundle_se;
240
- total = total.plus(toDecimal((_ref3 = (_bundleItem$bundle_se = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se !== void 0 ? _bundleItem$bundle_se : bundleItem.price) !== null && _ref3 !== void 0 ? _ref3 : 0));
239
+ var _ref3, _bundleItem$bundle_se, _bundleItem$num;
240
+ var unit = toDecimal((_ref3 = (_bundleItem$bundle_se = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se !== void 0 ? _bundleItem$bundle_se : bundleItem.price) !== null && _ref3 !== void 0 ? _ref3 : 0);
241
+ var qty = getSafeNum((_bundleItem$num = bundleItem.num) !== null && _bundleItem$num !== void 0 ? _bundleItem$num : bundleItem.quantity);
242
+ total = total.plus(unit.times(qty));
241
243
  }
242
244
  }
243
245
  } catch (err) {
@@ -305,10 +307,10 @@ function calculateProductsTax(products, taxRate, isPriceIncludeTax) {
305
307
  _step7;
306
308
  try {
307
309
  for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
308
- var _bundleItem$num, _ref4, _bundleItem$bundle_se2, _ref5, _ref6, _bundleItem$original_, _ref7, _bundleItem$is_charge, _ref8, _bundleItem$is_charge2;
310
+ var _bundleItem$num2, _ref4, _bundleItem$bundle_se2, _ref5, _ref6, _bundleItem$original_, _ref7, _bundleItem$is_charge, _ref8, _bundleItem$is_charge2;
309
311
  var bundleItem = _step7.value;
310
312
  if (!isBundleOriginalPrice(bundleItem)) continue;
311
- var bundleQuantity = new Decimal(getSafeNum((_bundleItem$num = bundleItem.num) !== null && _bundleItem$num !== void 0 ? _bundleItem$num : bundleItem.quantity));
313
+ var bundleQuantity = new Decimal(getSafeNum((_bundleItem$num2 = bundleItem.num) !== null && _bundleItem$num2 !== void 0 ? _bundleItem$num2 : bundleItem.quantity));
312
314
  var bundlePrice = toDecimal((_ref4 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref4 !== void 0 ? _ref4 : 0);
313
315
  var bundleOriginalPrice = toDecimal((_ref5 = (_ref6 = (_bundleItem$original_ = bundleItem.original_price) !== null && _bundleItem$original_ !== void 0 ? _bundleItem$original_ : bundleItem.product_price) !== null && _ref6 !== void 0 ? _ref6 : bundleItem.price) !== null && _ref5 !== void 0 ? _ref5 : 0);
314
316
  var bundleTaxPrecise = calculateSingleItemTax({
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
314
+ weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -131,7 +131,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
131
131
  * 获取当前的客户搜索条件
132
132
  * @returns 当前搜索条件
133
133
  */
134
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
134
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
135
135
  /**
136
136
  * 获取客户列表状态(包含滚动加载相关状态)
137
137
  * @returns 客户状态
@@ -82,7 +82,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
82
82
  enhancePayload?: SubmitPayloadEnhancer;
83
83
  }): Promise<T>;
84
84
  createOrder(params: CommitOrderParams['query']): {
85
- type: "virtual" | "appointment_booking";
85
+ type: "appointment_booking" | "virtual";
86
86
  platform: string;
87
87
  sales_channel: string;
88
88
  order_sales_channel: string;
@@ -210,7 +210,9 @@ function getMainProductPaymentTotal(product) {
210
210
  const bundleItems = product.product_bundle || [];
211
211
  for (const bundleItem of bundleItems) {
212
212
  if (isBundleMarkupOrDiscount(bundleItem)) {
213
- total = total.plus(toDecimal(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0));
213
+ const unit = toDecimal(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
214
+ const qty = getSafeNum(bundleItem.num ?? bundleItem.quantity);
215
+ total = total.plus(unit.times(qty));
214
216
  }
215
217
  }
216
218
  return import_decimal.default.max(total, 0);
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
314
+ weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -131,7 +131,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
131
131
  * 获取当前的客户搜索条件
132
132
  * @returns 当前搜索条件
133
133
  */
134
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
134
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
135
135
  /**
136
136
  * 获取客户列表状态(包含滚动加载相关状态)
137
137
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.512",
4
+ "version": "0.0.513",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",