@be-link/ecommerce-promotion-service-node-sdk 0.1.36 → 0.1.37

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 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 = "\u4F18\u60E0\u5238",
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"] = "\u4F18\u60E0\u5238";
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 = {}));
@@ -384,6 +384,8 @@ export declare namespace Service {
384
384
  /** 范围类型 */
385
385
  scopeType: ENUM.COUPON_ENUM.SCOPE_TYPE;
386
386
  }>;
387
+ /** 叠加使用配置(仅订单满减券有值) */
388
+ stackConfig?: Entity.CouponStackConfig;
387
389
  }
388
390
  /** 扣减券库存响应 */
389
391
  interface deductCouponStock {
@@ -59,6 +59,7 @@ export declare namespace Service {
59
59
  productName: string;
60
60
  productId: string;
61
61
  productImage: string;
62
+ price: number;
62
63
  exchangeType: ENUM.POINT_MALL.ExchangeType;
63
64
  pointsRequired: number;
64
65
  couponRequired: number;
@@ -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,65 @@ 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
+ selectedCoupons: {
228
+ couponId: string;
229
+ couponName: string;
230
+ couponCode: string;
231
+ discountAmount: number;
232
+ endtime: number;
233
+ }[];
234
+ /** 可用单品券模版ID列表 */
235
+ availableItemCouponTemplates: string[];
236
+ /** 订单券可用性信息 */
237
+ orderCouponsAvailability: {
238
+ /** 可用的订单券列表 */
239
+ available: Array<{
240
+ couponId: string;
241
+ couponName: string;
242
+ couponCode: string;
243
+ discountAmount: number;
244
+ endtime: number;
245
+ }>;
246
+ /** 不可用的订单券列表 */
247
+ unavailable: Array<{
248
+ couponId: string;
249
+ couponName: string;
250
+ couponCode: string;
251
+ /** 不可用原因 */
252
+ unavailableReason: string;
253
+ }>;
254
+ };
255
+ /** 校验结果(仅在用户选择场景下有值) */
256
+ validation?: ValidateSelectedCouponResult;
257
+ }
182
258
  /** 积分商城提单算价响应 */
183
259
  interface calculatePointsMallOrder {
184
260
  /** 商品ID */
@@ -243,6 +319,8 @@ export declare namespace Service {
243
319
  calculateOrderPrice(request: Service.Request.calculateOrderPrice, req: any): Promise<Service.Response.calculateOrderPrice>;
244
320
  /** 用户手动选择优惠后算价 */
245
321
  calculateWithSelectedDiscounts(request: Service.Request.calculateWithSelectedDiscounts, req: any): Promise<Service.Response.calculateOrderPrice>;
322
+ /** 提单页算价V2(支持订单满减券) */
323
+ calculateOrderPriceV2(request: Service.Request.calculateOrderPriceV2, req: any): Promise<Service.Response.calculateOrderPriceV2>;
246
324
  /** 积分商城提单算价 */
247
325
  calculatePointsMallOrder(request: Service.Request.calculatePointsMallOrder, req: any): Promise<Service.Response.calculatePointsMallOrder>;
248
326
  /** 积分商城用户选择后再次算价 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-promotion-service-node-sdk",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "EcommercePromotionService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",