@be-link/ecommerce-promotion-service-node-sdk 0.1.36 → 0.1.38
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/enum.d.ts +5 -2
- package/enum.js +5 -2
- package/modules/coupon/types.d.ts +2 -0
- package/modules/pointsMall/types.d.ts +1 -0
- package/modules/pricingCalculation/service.d.ts +1 -0
- package/modules/pricingCalculation/service.js +8 -0
- package/modules/pricingCalculation/types.d.ts +86 -0
- package/package.json +1 -1
package/enum.d.ts
CHANGED
|
@@ -333,8 +333,10 @@ export declare namespace ENUM {
|
|
|
333
333
|
}
|
|
334
334
|
/** 券类型 */
|
|
335
335
|
enum COUPON_TYPE {
|
|
336
|
-
/**
|
|
336
|
+
/** 单品满减券 */
|
|
337
337
|
DISCOUNT = "DISCOUNT",
|
|
338
|
+
/** 订单满减券 */
|
|
339
|
+
ORDER_DISCOUNT = "ORDER_DISCOUNT",
|
|
338
340
|
/** 兑换券 */
|
|
339
341
|
EXCHANGE = "EXCHANGE",
|
|
340
342
|
/** 核销券 */
|
|
@@ -342,7 +344,8 @@ export declare namespace ENUM {
|
|
|
342
344
|
}
|
|
343
345
|
/** 券类型中文 */
|
|
344
346
|
enum COUPON_TYPE_CHINESE {
|
|
345
|
-
DISCOUNT = "\
|
|
347
|
+
DISCOUNT = "\u5355\u54C1\u6EE1\u51CF\u5238",
|
|
348
|
+
ORDER_DISCOUNT = "\u8BA2\u5355\u6EE1\u51CF\u5238",
|
|
346
349
|
EXCHANGE = "\u5151\u6362\u5238",
|
|
347
350
|
VERIFY = "\u6838\u9500\u5238"
|
|
348
351
|
}
|
package/enum.js
CHANGED
|
@@ -381,8 +381,10 @@ var ENUM;
|
|
|
381
381
|
/** 券类型 */
|
|
382
382
|
let COUPON_TYPE;
|
|
383
383
|
(function (COUPON_TYPE) {
|
|
384
|
-
/**
|
|
384
|
+
/** 单品满减券 */
|
|
385
385
|
COUPON_TYPE["DISCOUNT"] = "DISCOUNT";
|
|
386
|
+
/** 订单满减券 */
|
|
387
|
+
COUPON_TYPE["ORDER_DISCOUNT"] = "ORDER_DISCOUNT";
|
|
386
388
|
/** 兑换券 */
|
|
387
389
|
COUPON_TYPE["EXCHANGE"] = "EXCHANGE";
|
|
388
390
|
/** 核销券 */
|
|
@@ -391,7 +393,8 @@ var ENUM;
|
|
|
391
393
|
/** 券类型中文 */
|
|
392
394
|
let COUPON_TYPE_CHINESE;
|
|
393
395
|
(function (COUPON_TYPE_CHINESE) {
|
|
394
|
-
COUPON_TYPE_CHINESE["DISCOUNT"] = "\
|
|
396
|
+
COUPON_TYPE_CHINESE["DISCOUNT"] = "\u5355\u54C1\u6EE1\u51CF\u5238";
|
|
397
|
+
COUPON_TYPE_CHINESE["ORDER_DISCOUNT"] = "\u8BA2\u5355\u6EE1\u51CF\u5238";
|
|
395
398
|
COUPON_TYPE_CHINESE["EXCHANGE"] = "\u5151\u6362\u5238";
|
|
396
399
|
COUPON_TYPE_CHINESE["VERIFY"] = "\u6838\u9500\u5238";
|
|
397
400
|
})(COUPON_TYPE_CHINESE = PRICING_CALCULATION_ENUM.COUPON_TYPE_CHINESE || (PRICING_CALCULATION_ENUM.COUPON_TYPE_CHINESE = {}));
|
|
@@ -4,6 +4,7 @@ declare class PricingCalculationService extends BaseService implements Service.P
|
|
|
4
4
|
protected prefixUrl: string;
|
|
5
5
|
calculateOrderPrice(request: Service.Request.calculateOrderPrice): Promise<Service.Response.calculateOrderPrice>;
|
|
6
6
|
calculateWithSelectedDiscounts(request: Service.Request.calculateWithSelectedDiscounts): Promise<Service.Response.calculateOrderPrice>;
|
|
7
|
+
calculateOrderPriceV2(request: Service.Request.calculateOrderPriceV2): Promise<Service.Response.calculateOrderPriceV2>;
|
|
7
8
|
calculatePointsMallOrder(request: Service.Request.calculatePointsMallOrder): Promise<Service.Response.calculatePointsMallOrder>;
|
|
8
9
|
recalculatePointsMallOrder(request: Service.Request.recalculatePointsMallOrder): Promise<Service.Response.recalculatePointsMallOrder>;
|
|
9
10
|
}
|
|
@@ -27,6 +27,9 @@ let PricingCalculationService = class PricingCalculationService extends BaseServ
|
|
|
27
27
|
calculateWithSelectedDiscounts(request) {
|
|
28
28
|
return (0, http_1.callApi)(this.getApiUrl(this.calculateWithSelectedDiscounts), request);
|
|
29
29
|
}
|
|
30
|
+
calculateOrderPriceV2(request) {
|
|
31
|
+
return (0, http_1.callApi)(this.getApiUrl(this.calculateOrderPriceV2), request);
|
|
32
|
+
}
|
|
30
33
|
calculatePointsMallOrder(request) {
|
|
31
34
|
return (0, http_1.callApi)(this.getApiUrl(this.calculatePointsMallOrder), request);
|
|
32
35
|
}
|
|
@@ -44,6 +47,11 @@ __decorate([
|
|
|
44
47
|
(0, tsoa_1.Post)('calculate-with-selected-discounts'),
|
|
45
48
|
__param(0, (0, tsoa_1.Body)())
|
|
46
49
|
], PricingCalculationService.prototype, "calculateWithSelectedDiscounts", null);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, tsoa_1.OperationId)('提单页算价V2(支持订单满减券)'),
|
|
52
|
+
(0, tsoa_1.Post)('calculate-order-price-v2'),
|
|
53
|
+
__param(0, (0, tsoa_1.Body)())
|
|
54
|
+
], PricingCalculationService.prototype, "calculateOrderPriceV2", null);
|
|
47
55
|
__decorate([
|
|
48
56
|
(0, tsoa_1.OperationId)('积分商城提单算价'),
|
|
49
57
|
(0, tsoa_1.Post)('calculate-points-mall-order'),
|
|
@@ -78,6 +78,23 @@ export declare namespace Service {
|
|
|
78
78
|
/** SKU ID */
|
|
79
79
|
skuId: string;
|
|
80
80
|
}
|
|
81
|
+
/** 提单页算价V2(支持订单满减券,合并了自动算价和用户选择两种场景) */
|
|
82
|
+
interface calculateOrderPriceV2 {
|
|
83
|
+
/** 用户ID */
|
|
84
|
+
userId: string;
|
|
85
|
+
/** 商品ID */
|
|
86
|
+
productId: string;
|
|
87
|
+
/** 商品数量 */
|
|
88
|
+
quantity: number;
|
|
89
|
+
/** SKU ID */
|
|
90
|
+
skuId: string;
|
|
91
|
+
/** 是否自动选择最优券(true=首次最优算价,false=用户选择后算价) */
|
|
92
|
+
autoSelectCoupons: boolean;
|
|
93
|
+
/** 选择的优惠券券码列表(autoSelectCoupons=false时使用) */
|
|
94
|
+
selectedCouponCodes?: string[];
|
|
95
|
+
/** 是否使用积分(autoSelectCoupons=false时使用) */
|
|
96
|
+
usePoints?: boolean;
|
|
97
|
+
}
|
|
81
98
|
/** 用户手动选择优惠后算价 */
|
|
82
99
|
interface calculateWithSelectedDiscounts {
|
|
83
100
|
/** 用户ID */
|
|
@@ -179,6 +196,73 @@ export declare namespace Service {
|
|
|
179
196
|
/** 校验结果 */
|
|
180
197
|
validation?: ValidateSelectedCouponResult;
|
|
181
198
|
}
|
|
199
|
+
/** 提单页算价V2响应(支持订单满减券) */
|
|
200
|
+
interface calculateOrderPriceV2 {
|
|
201
|
+
/** 本单最多可用积分 */
|
|
202
|
+
maxUsablePoints: number;
|
|
203
|
+
/** 用户可用积分数量 */
|
|
204
|
+
userAvailablePoints: number;
|
|
205
|
+
/** 价格计算结果 */
|
|
206
|
+
priceResult: {
|
|
207
|
+
/** 订单原价(分) */
|
|
208
|
+
originalAmount: number;
|
|
209
|
+
/** 单品券优惠金额(分) */
|
|
210
|
+
itemCouponDiscountAmount: number;
|
|
211
|
+
/** 订单券优惠金额(分) */
|
|
212
|
+
orderCouponDiscountAmount: number;
|
|
213
|
+
/** 会员优惠金额(分) */
|
|
214
|
+
memberDiscount: {
|
|
215
|
+
totalAmount: number;
|
|
216
|
+
itemAmount: number;
|
|
217
|
+
quantity: number;
|
|
218
|
+
};
|
|
219
|
+
/** 优惠后金额(分) */
|
|
220
|
+
discountedAmount: number;
|
|
221
|
+
/** 积分最高抵扣金额(分) */
|
|
222
|
+
pointsDeductionAmount: number;
|
|
223
|
+
/** 剩余待支付金额(分) */
|
|
224
|
+
remainingAmount: number;
|
|
225
|
+
};
|
|
226
|
+
/** 选中的单品券列表 */
|
|
227
|
+
selectedItemCoupons: {
|
|
228
|
+
couponId: string;
|
|
229
|
+
couponName: string;
|
|
230
|
+
couponCode: string;
|
|
231
|
+
discountAmount: number;
|
|
232
|
+
endtime: number;
|
|
233
|
+
}[];
|
|
234
|
+
/** 选中的订单券列表 */
|
|
235
|
+
selectedOrderCoupons: {
|
|
236
|
+
couponId: string;
|
|
237
|
+
couponName: string;
|
|
238
|
+
couponCode: string;
|
|
239
|
+
discountAmount: number;
|
|
240
|
+
endtime: number;
|
|
241
|
+
}[];
|
|
242
|
+
/** 可用单品券模版ID列表 */
|
|
243
|
+
availableItemCouponTemplates: string[];
|
|
244
|
+
/** 订单券可用性信息 */
|
|
245
|
+
orderCouponsAvailability: {
|
|
246
|
+
/** 可用的订单券列表 */
|
|
247
|
+
available: Array<{
|
|
248
|
+
couponId: string;
|
|
249
|
+
couponName: string;
|
|
250
|
+
couponCode: string;
|
|
251
|
+
discountAmount: number;
|
|
252
|
+
endtime: number;
|
|
253
|
+
}>;
|
|
254
|
+
/** 不可用的订单券列表 */
|
|
255
|
+
unavailable: Array<{
|
|
256
|
+
couponId: string;
|
|
257
|
+
couponName: string;
|
|
258
|
+
couponCode: string;
|
|
259
|
+
/** 不可用原因 */
|
|
260
|
+
unavailableReason: string;
|
|
261
|
+
}>;
|
|
262
|
+
};
|
|
263
|
+
/** 校验结果(仅在用户选择场景下有值) */
|
|
264
|
+
validation?: ValidateSelectedCouponResult;
|
|
265
|
+
}
|
|
182
266
|
/** 积分商城提单算价响应 */
|
|
183
267
|
interface calculatePointsMallOrder {
|
|
184
268
|
/** 商品ID */
|
|
@@ -243,6 +327,8 @@ export declare namespace Service {
|
|
|
243
327
|
calculateOrderPrice(request: Service.Request.calculateOrderPrice, req: any): Promise<Service.Response.calculateOrderPrice>;
|
|
244
328
|
/** 用户手动选择优惠后算价 */
|
|
245
329
|
calculateWithSelectedDiscounts(request: Service.Request.calculateWithSelectedDiscounts, req: any): Promise<Service.Response.calculateOrderPrice>;
|
|
330
|
+
/** 提单页算价V2(支持订单满减券) */
|
|
331
|
+
calculateOrderPriceV2(request: Service.Request.calculateOrderPriceV2, req: any): Promise<Service.Response.calculateOrderPriceV2>;
|
|
246
332
|
/** 积分商城提单算价 */
|
|
247
333
|
calculatePointsMallOrder(request: Service.Request.calculatePointsMallOrder, req: any): Promise<Service.Response.calculatePointsMallOrder>;
|
|
248
334
|
/** 积分商城用户选择后再次算价 */
|