@pisell/pisellos 0.0.500 → 0.0.501
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.
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +8 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +52 -8
- package/dist/model/strategy/adapter/itemRule/examples.d.ts +15 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +68 -1
- package/dist/model/strategy/adapter/itemRule/index.d.ts +1 -1
- package/dist/model/strategy/adapter/itemRule/index.js +1 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +20 -1
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/Order/index.d.ts +6 -0
- package/dist/modules/Order/index.js +42 -38
- package/dist/modules/Order/types.d.ts +4 -0
- package/dist/modules/Order/utils.d.ts +28 -0
- package/dist/modules/Order/utils.js +93 -13
- package/dist/modules/ProductList/index.js +2 -2
- package/dist/modules/Quotation/index.js +6 -3
- package/dist/modules/SalesSummary/types.d.ts +2 -1
- package/dist/modules/SalesSummary/utils.js +10 -10
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/ScanOrder/index.d.ts +7 -0
- package/dist/solution/ScanOrder/index.js +284 -67
- package/dist/solution/ScanOrder/types.d.ts +22 -5
- package/dist/solution/ScanOrder/utils.d.ts +26 -0
- package/dist/solution/ScanOrder/utils.js +191 -44
- package/dist/solution/VenueBooking/index.d.ts +14 -0
- package/dist/solution/VenueBooking/index.js +318 -144
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +6 -4
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +8 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +41 -2
- package/lib/model/strategy/adapter/itemRule/examples.d.ts +15 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +47 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +1 -1
- package/lib/model/strategy/adapter/itemRule/index.js +2 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +20 -1
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/modules/Order/index.d.ts +6 -0
- package/lib/modules/Order/index.js +20 -36
- package/lib/modules/Order/types.d.ts +4 -0
- package/lib/modules/Order/utils.d.ts +28 -0
- package/lib/modules/Order/utils.js +78 -9
- package/lib/modules/ProductList/index.js +3 -2
- package/lib/modules/Quotation/index.js +3 -0
- package/lib/modules/SalesSummary/types.d.ts +2 -1
- package/lib/modules/SalesSummary/utils.js +2 -2
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/ScanOrder/index.d.ts +7 -0
- package/lib/solution/ScanOrder/index.js +162 -18
- package/lib/solution/ScanOrder/types.d.ts +22 -5
- package/lib/solution/ScanOrder/utils.d.ts +26 -0
- package/lib/solution/ScanOrder/utils.js +128 -19
- package/lib/solution/VenueBooking/index.d.ts +14 -0
- package/lib/solution/VenueBooking/index.js +156 -30
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +13 -4
- package/package.json +1 -1
|
@@ -78,18 +78,21 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
78
78
|
case 0:
|
|
79
79
|
query = {};
|
|
80
80
|
if (params !== null && params !== void 0 && params.channel) query.channel = params.channel;
|
|
81
|
-
|
|
81
|
+
if ((params === null || params === void 0 ? void 0 : params.channel) === 'online_store') {
|
|
82
|
+
query.channel = 'online-store';
|
|
83
|
+
}
|
|
84
|
+
_context2.next = 5;
|
|
82
85
|
return this.request.get('/quotation/available', query, {
|
|
83
86
|
useCache: false
|
|
84
87
|
});
|
|
85
|
-
case
|
|
88
|
+
case 5:
|
|
86
89
|
res = _context2.sent;
|
|
87
90
|
list = (res === null || res === void 0 || (_data = res.data) === null || _data === void 0 ? void 0 : _data.list) || (res === null || res === void 0 ? void 0 : res.list) || [];
|
|
88
91
|
list.sort(function (a, b) {
|
|
89
92
|
return a.sort - b.sort;
|
|
90
93
|
});
|
|
91
94
|
this.store.list = list;
|
|
92
|
-
case
|
|
95
|
+
case 9:
|
|
93
96
|
case "end":
|
|
94
97
|
return _context2.stop();
|
|
95
98
|
}
|
|
@@ -2,9 +2,10 @@ export interface SalesSummaryProduct {
|
|
|
2
2
|
product_id: number | null;
|
|
3
3
|
product_variant_id: number;
|
|
4
4
|
num: number;
|
|
5
|
+
/** 券后单品单价(订单域成交单价),由 OrderModule 维护。 */
|
|
5
6
|
selling_price: string;
|
|
7
|
+
/** 券前单品单价(店铺售价)。 */
|
|
6
8
|
original_price: string;
|
|
7
|
-
payment_price: string;
|
|
8
9
|
tax_fee: string;
|
|
9
10
|
is_charge_tax?: number;
|
|
10
11
|
product_option_item?: any[];
|
|
@@ -68,7 +68,7 @@ function getBundleUnitPrice(product) {
|
|
|
68
68
|
// 单商品总价口径:主商品单价 + option + bundle(随后再乘商品数量)
|
|
69
69
|
function getUnitPaymentTotal(product) {
|
|
70
70
|
var variantPrice = getVariantPrice(product);
|
|
71
|
-
var basePrice = variantPrice || toDecimal(product.selling_price
|
|
71
|
+
var basePrice = variantPrice || toDecimal(product.selling_price);
|
|
72
72
|
return basePrice.plus(getOptionUnitPrice(product)).plus(getBundleUnitPrice(product));
|
|
73
73
|
}
|
|
74
74
|
function getUnitOriginalTotal(product) {
|
|
@@ -254,9 +254,9 @@ function calculateSingleItemTax(params) {
|
|
|
254
254
|
* 与 Summary/utils.ts 的 getMainProductTotal 逻辑对齐,适配 SalesSummaryProduct 结构。
|
|
255
255
|
*/
|
|
256
256
|
function getMainProductPaymentTotal(product) {
|
|
257
|
-
var
|
|
257
|
+
var _product$metadata$mai, _product$metadata4, _product$_origin3, _product$_origin4;
|
|
258
258
|
var variantPrice = getVariantPrice(product);
|
|
259
|
-
var total = variantPrice || toDecimal((
|
|
259
|
+
var total = variantPrice || toDecimal((_product$metadata$mai = (_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.main_product_selling_price) !== null && _product$metadata$mai !== void 0 ? _product$metadata$mai : product.selling_price);
|
|
260
260
|
var mainDiscountList = ((_product$_origin3 = product._origin) === null || _product$_origin3 === void 0 || (_product$_origin3 = _product$_origin3.product) === null || _product$_origin3 === void 0 ? void 0 : _product$_origin3.discount_list) || ((_product$_origin4 = product._origin) === null || _product$_origin4 === void 0 ? void 0 : _product$_origin4.discount_list) || [];
|
|
261
261
|
var mainDiscountAmount = getDiscountListAmount(mainDiscountList.filter(function (d) {
|
|
262
262
|
var _d$metadata;
|
|
@@ -271,8 +271,8 @@ function getMainProductPaymentTotal(product) {
|
|
|
271
271
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
272
272
|
var bundleItem = _step5.value;
|
|
273
273
|
if (isBundleMarkupOrDiscount(bundleItem)) {
|
|
274
|
-
var
|
|
275
|
-
total = total.plus(toDecimal((
|
|
274
|
+
var _ref2, _bundleItem$bundle_se;
|
|
275
|
+
total = total.plus(toDecimal((_ref2 = (_bundleItem$bundle_se = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se !== void 0 ? _bundleItem$bundle_se : bundleItem.price) !== null && _ref2 !== void 0 ? _ref2 : 0));
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} catch (err) {
|
|
@@ -340,24 +340,24 @@ function calculateProductsTax(products, taxRate, isPriceIncludeTax) {
|
|
|
340
340
|
_step7;
|
|
341
341
|
try {
|
|
342
342
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
343
|
-
var _bundleItem$num,
|
|
343
|
+
var _bundleItem$num, _ref3, _bundleItem$bundle_se2, _ref4, _ref5, _bundleItem$original_, _ref6, _bundleItem$is_charge, _ref7, _bundleItem$is_charge2;
|
|
344
344
|
var bundleItem = _step7.value;
|
|
345
345
|
if (!isBundleOriginalPrice(bundleItem)) continue;
|
|
346
346
|
var bundleQuantity = new Decimal(getSafeNum((_bundleItem$num = bundleItem.num) !== null && _bundleItem$num !== void 0 ? _bundleItem$num : bundleItem.quantity));
|
|
347
|
-
var bundlePrice = toDecimal((
|
|
348
|
-
var bundleOriginalPrice = toDecimal((
|
|
347
|
+
var bundlePrice = toDecimal((_ref3 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref3 !== void 0 ? _ref3 : 0);
|
|
348
|
+
var bundleOriginalPrice = toDecimal((_ref4 = (_ref5 = (_bundleItem$original_ = bundleItem.original_price) !== null && _bundleItem$original_ !== void 0 ? _bundleItem$original_ : bundleItem.product_price) !== null && _ref5 !== void 0 ? _ref5 : bundleItem.price) !== null && _ref4 !== void 0 ? _ref4 : 0);
|
|
349
349
|
var bundleTaxPrecise = calculateSingleItemTax({
|
|
350
350
|
price: bundlePrice,
|
|
351
351
|
taxRate: rate,
|
|
352
352
|
isPriceIncludeTax: isPriceIncludeTax,
|
|
353
|
-
isChargeTax: (
|
|
353
|
+
isChargeTax: (_ref6 = (_bundleItem$is_charge = bundleItem.is_charge_tax) !== null && _bundleItem$is_charge !== void 0 ? _bundleItem$is_charge : product.is_charge_tax) !== null && _ref6 !== void 0 ? _ref6 : 0
|
|
354
354
|
});
|
|
355
355
|
var bundleTaxRounded = bundleTaxPrecise.toDecimalPlaces(2, Decimal.ROUND_HALF_UP);
|
|
356
356
|
var bundleOrigTaxPrecise = calculateSingleItemTax({
|
|
357
357
|
price: bundleOriginalPrice,
|
|
358
358
|
taxRate: rate,
|
|
359
359
|
isPriceIncludeTax: isPriceIncludeTax,
|
|
360
|
-
isChargeTax: (
|
|
360
|
+
isChargeTax: (_ref7 = (_bundleItem$is_charge2 = bundleItem.is_charge_tax) !== null && _bundleItem$is_charge2 !== void 0 ? _bundleItem$is_charge2 : product.is_charge_tax) !== null && _ref7 !== void 0 ? _ref7 : 0
|
|
361
361
|
});
|
|
362
362
|
var bundleOrigTaxRounded = bundleOrigTaxPrecise.toDecimalPlaces(2, Decimal.ROUND_HALF_UP);
|
|
363
363
|
bundleItem.tax_fee = bundleTaxRounded.toNumber();
|
|
@@ -46,7 +46,7 @@ export declare const formatScheduleResult: (schedule: ScheduleItem) => {
|
|
|
46
46
|
};
|
|
47
47
|
export declare const calcScheduleDateRange: (schedule: ScheduleItem) => any[];
|
|
48
48
|
export declare const calcCalendarDataBySchedules: (schedules: ScheduleItem[]) => unknown[];
|
|
49
|
-
export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap?: ScheduleAllMap, selectDate?: string) =>
|
|
49
|
+
export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap?: ScheduleAllMap, selectDate?: string) => ScheduleAllMap;
|
|
50
50
|
/**
|
|
51
51
|
* @title: 格式化日程数据
|
|
52
52
|
* @description:
|
|
@@ -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 |
|
|
314
|
+
weekNum: 0 | 5 | 1 | 4 | 2 | 3 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -330,7 +330,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
330
330
|
count: number;
|
|
331
331
|
left: number;
|
|
332
332
|
summaryCount: number;
|
|
333
|
-
status: "
|
|
333
|
+
status: "sold_out" | "lots_of_space" | "filling_up_fast";
|
|
334
334
|
}[];
|
|
335
335
|
/**
|
|
336
336
|
* 找到多个资源的公共可用时间段
|
|
@@ -27,6 +27,8 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
27
27
|
private itemRuleConfigsPromise;
|
|
28
28
|
private itemRulePrefillApplied;
|
|
29
29
|
private itemRuleRuntimeConfig;
|
|
30
|
+
/** 最近一次 checkResourceAvailable 从预约规则 link 拉取的商品快照 */
|
|
31
|
+
private enabledReservationRuleProducts;
|
|
30
32
|
private getScanOrderLoggerContext;
|
|
31
33
|
private serializeError;
|
|
32
34
|
private addScanOrderLog;
|
|
@@ -87,4 +89,9 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
87
89
|
}>;
|
|
88
90
|
getProductList(): Promise<any>;
|
|
89
91
|
getOtherParams(): Record<string, any>;
|
|
92
|
+
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
93
|
+
cover?: boolean;
|
|
94
|
+
}): Promise<void>;
|
|
95
|
+
setEntryPaxNumber(number: number): Promise<void>;
|
|
96
|
+
getEntryPaxNumber(): number | null;
|
|
90
97
|
}
|