@pisell/pisellos 2.2.322 → 2.2.323
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/promotion/index.js +0 -9
- package/dist/modules/Order/utils.js +12 -1
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Product/types.d.ts +5 -0
- package/dist/solution/BaseSales/index.d.ts +1 -0
- package/dist/solution/BaseSales/index.js +298 -209
- package/dist/solution/BaseSales/types.d.ts +3 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/dist/solution/UnifiedBookingSales/index.js +34 -16
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/Order/utils.js +13 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Product/types.d.ts +5 -0
- package/lib/solution/BaseSales/index.d.ts +1 -0
- package/lib/solution/BaseSales/index.js +95 -36
- package/lib/solution/BaseSales/types.d.ts +3 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/lib/solution/UnifiedBookingSales/index.js +23 -1
- package/package.json +1 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -1218,7 +1218,7 @@ function formatSubmitBundleItems(bundle) {
|
|
|
1218
1218
|
* 法币仅做字段/metadata 裁剪;虚拟币在出站前再次执行零加价与固定单价断言。
|
|
1219
1219
|
*/
|
|
1220
1220
|
function normalizeSubmitProduct(product) {
|
|
1221
|
-
var _ref39, _submitProduct$bundle, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
|
|
1221
|
+
var _ref39, _submitProduct$bundle, _rawMetadata$pricing_, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
|
|
1222
1222
|
var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1223
1223
|
var _ref38 = product,
|
|
1224
1224
|
_runtimeUid = _ref38.unique_identification_number,
|
|
@@ -1252,6 +1252,17 @@ function normalizeSubmitProduct(product) {
|
|
|
1252
1252
|
cleanMetadata[key] = rawMetadata[key];
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
|
+
// Persist only an applied pricing snapshot, so reopening a saved order can
|
|
1256
|
+
// compare it with the latest catalog without reinterpreting legacy duration.
|
|
1257
|
+
var pricingMethod = (_rawMetadata$pricing_ = rawMetadata.pricing_method) === null || _rawMetadata$pricing_ === void 0 ? void 0 : _rawMetadata$pricing_.type;
|
|
1258
|
+
if (pricingMethod === 'duration_based' || pricingMethod === 'fixed_price') {
|
|
1259
|
+
cleanMetadata.pricing_method = {
|
|
1260
|
+
type: pricingMethod
|
|
1261
|
+
};
|
|
1262
|
+
if (pricingMethod === 'duration_based' && rawMetadata.duration) {
|
|
1263
|
+
cleanMetadata.duration = _objectSpread({}, rawMetadata.duration);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1255
1266
|
cleanMetadata.product_discount_difference = (_rawMetadata$product_ = rawMetadata.product_discount_difference) !== null && _rawMetadata$product_ !== void 0 ? _rawMetadata$product_ : '';
|
|
1256
1267
|
if (rawMetadata.price_breakdown) {
|
|
1257
1268
|
cleanMetadata.price_breakdown = rawMetadata.price_breakdown;
|
|
@@ -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(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -42,6 +42,9 @@ export interface ProductSettlementOption extends Record<string, any> {
|
|
|
42
42
|
available: boolean;
|
|
43
43
|
disabled_reason?: string;
|
|
44
44
|
}
|
|
45
|
+
export interface ProductPricingMethod {
|
|
46
|
+
type: 'fixed_price' | 'duration_based';
|
|
47
|
+
}
|
|
45
48
|
/**
|
|
46
49
|
* 商品基本信息接口
|
|
47
50
|
*/
|
|
@@ -74,6 +77,8 @@ export interface ProductData {
|
|
|
74
77
|
sum_stock: number;
|
|
75
78
|
/** 商品价格 */
|
|
76
79
|
price: string;
|
|
80
|
+
/** POS booking pricing; missing configuration retains existing fixed pricing. */
|
|
81
|
+
pricing_method?: ProductPricingMethod;
|
|
77
82
|
/** 当前上下文解析出的可选结算货币 */
|
|
78
83
|
available_settlement_options?: ProductSettlementOption[];
|
|
79
84
|
/** 商品原价 */
|
|
@@ -524,6 +524,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
524
524
|
getQuotationCustomerScopeInfo(): BaseSalesQuotationCustomerScopeInfo;
|
|
525
525
|
private hasSmartPricingStrategies;
|
|
526
526
|
shouldRecalculateProductBookingPricesForContextChange(params: BaseSalesPriceRecalculationContextChange): boolean;
|
|
527
|
+
private resolveProductBookingPriceGroups;
|
|
527
528
|
calculateProductBookingPrices(paramsList: BaseSalesCalculateProductBookingPriceParams[]): Promise<BaseSalesProductBookingPriceResult[]>;
|
|
528
529
|
addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
529
530
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|