@be-link/ecommerce-trade-service-node-sdk 0.1.71 → 0.1.73

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/enums.d.ts CHANGED
@@ -202,7 +202,9 @@ export declare namespace ENUM {
202
202
  /** 满减优惠券 */
203
203
  FULL_REDUCE = "FULL_REDUCE",
204
204
  /** 积分抵扣 */
205
- POINT_REDUCE = "POINT_REDUCE"
205
+ POINT_REDUCE = "POINT_REDUCE",
206
+ /** 会员价 */
207
+ MEMBER_PRICE = "MEMBER_PRICE"
206
208
  }
207
209
  /** 活动类型 */
208
210
  enum ActivityType {
@@ -248,6 +250,54 @@ export declare namespace ENUM {
248
250
  /** 结束 */
249
251
  ENDED = "4"
250
252
  }
253
+ /** 业务打点场景 */
254
+ enum BizStatScene {
255
+ /** 正向订单 */
256
+ TRADE_ORDER = "TRADE_ORDER",
257
+ /** 逆向订单 */
258
+ TRADE_REVERSE_ORDER = "TRADE_REVERSE_ORDER"
259
+ }
260
+ /** 业务打点子场景 */
261
+ enum BizStatSubScene {
262
+ /** 订单预扣资源 */
263
+ FREEZE_RESOURCE = "FREEZE_RESOURCE",
264
+ /** 释放预扣资源 */
265
+ UNFREEZE_RESOURCE = "UNFREEZE_RESOURCE",
266
+ /** 创建正向订单 */
267
+ CREATE_ORDER = "CREATE_ORDER",
268
+ /** 订单实扣资源 */
269
+ DEDUCT_RESOURCE = "DEDUCT_RESOURCE",
270
+ /** 积分商城支付 */
271
+ POINT_MALL_PAY = "POINT_MALL_PAY",
272
+ /** 订单支付 */
273
+ ORDER_PAY = "ORDER_PAY",
274
+ /** 获取订单支付参数 */
275
+ FETCH_PAYMENT_PARAM = "FETCH_PAYMENT_PARAM",
276
+ /** 创建逆向订单 */
277
+ CREATE_REVERSE_ORDER = "CREATE_REVERSE_ORDER",
278
+ /** 逆向订单商家审批通过 */
279
+ REVERSE_AUDIT_PASS = "REVERSE_AUDIT_PASS",
280
+ /** 逆向订单商家审批拒绝 */
281
+ REVERSE_AUDIT_REJECT = "REVERSE_AUDIT_REJECT",
282
+ /** 逆向订单系统自动审批通过 */
283
+ REVERSE_AUTO_AUDIT_PASS = "REVERSE_AUTO_AUDIT_PASS",
284
+ /** 逆向订单资源退还 */
285
+ REVERSE_REFUND_RESOURCE = "REVERSE_REFUND_RESOURCE",
286
+ /** 逆向订单退款成功 */
287
+ REVERSE_REFUND_SUCCESS = "REVERSE_REFUND_SUCCESS",
288
+ /** 正向订单关闭 */
289
+ ORDER_CLOSED = "ORDER_CLOSED",
290
+ /** 正向订单用户确认收货 */
291
+ ORDER_CONFIRM_RECEIVE = "ORDER_CONFIRM_RECEIVE",
292
+ /** 正向订单系统自动确认收货 */
293
+ ORDER_AUTO_CONFIRM_RECEIVE = "ORDER_AUTO_CONFIRM_RECEIVE",
294
+ /** 正向订单用户取消 */
295
+ ORDER_CANCEL_BY_USER = "ORDER_CANCEL_BY_USER",
296
+ /** 正向订单超时取消 */
297
+ ORDER_CANCEL_BY_TIMEOUT = "ORDER_CANCEL_BY_TIMEOUT",
298
+ /** 逆向订单用户取消 */
299
+ REVERSE_ORDER_CANCEL_BY_USER = "REVERSE_ORDER_CANCEL_BY_USER"
300
+ }
251
301
  }
252
302
  /** RabbitMQ 交换机路由枚举 */
253
303
  export declare namespace EXCHANGE_ENUM {
package/enums.js CHANGED
@@ -232,6 +232,8 @@ var ENUM;
232
232
  OrderPromotionType["FULL_REDUCE"] = "FULL_REDUCE";
233
233
  /** 积分抵扣 */
234
234
  OrderPromotionType["POINT_REDUCE"] = "POINT_REDUCE";
235
+ /** 会员价 */
236
+ OrderPromotionType["MEMBER_PRICE"] = "MEMBER_PRICE";
235
237
  })(OrderPromotionType = ENUM.OrderPromotionType || (ENUM.OrderPromotionType = {}));
236
238
  /** 活动类型 */
237
239
  let ActivityType;
@@ -281,6 +283,56 @@ var ENUM;
281
283
  /** 结束 */
282
284
  LiveRoomStatus["ENDED"] = "4";
283
285
  })(LiveRoomStatus = ENUM.LiveRoomStatus || (ENUM.LiveRoomStatus = {}));
286
+ /** 业务打点场景 */
287
+ let BizStatScene;
288
+ (function (BizStatScene) {
289
+ /** 正向订单 */
290
+ BizStatScene["TRADE_ORDER"] = "TRADE_ORDER";
291
+ /** 逆向订单 */
292
+ BizStatScene["TRADE_REVERSE_ORDER"] = "TRADE_REVERSE_ORDER";
293
+ })(BizStatScene = ENUM.BizStatScene || (ENUM.BizStatScene = {}));
294
+ /** 业务打点子场景 */
295
+ let BizStatSubScene;
296
+ (function (BizStatSubScene) {
297
+ /** 订单预扣资源 */
298
+ BizStatSubScene["FREEZE_RESOURCE"] = "FREEZE_RESOURCE";
299
+ /** 释放预扣资源 */
300
+ BizStatSubScene["UNFREEZE_RESOURCE"] = "UNFREEZE_RESOURCE";
301
+ /** 创建正向订单 */
302
+ BizStatSubScene["CREATE_ORDER"] = "CREATE_ORDER";
303
+ /** 订单实扣资源 */
304
+ BizStatSubScene["DEDUCT_RESOURCE"] = "DEDUCT_RESOURCE";
305
+ /** 积分商城支付 */
306
+ BizStatSubScene["POINT_MALL_PAY"] = "POINT_MALL_PAY";
307
+ /** 订单支付 */
308
+ BizStatSubScene["ORDER_PAY"] = "ORDER_PAY";
309
+ /** 获取订单支付参数 */
310
+ BizStatSubScene["FETCH_PAYMENT_PARAM"] = "FETCH_PAYMENT_PARAM";
311
+ /** 创建逆向订单 */
312
+ BizStatSubScene["CREATE_REVERSE_ORDER"] = "CREATE_REVERSE_ORDER";
313
+ /** 逆向订单商家审批通过 */
314
+ BizStatSubScene["REVERSE_AUDIT_PASS"] = "REVERSE_AUDIT_PASS";
315
+ /** 逆向订单商家审批拒绝 */
316
+ BizStatSubScene["REVERSE_AUDIT_REJECT"] = "REVERSE_AUDIT_REJECT";
317
+ /** 逆向订单系统自动审批通过 */
318
+ BizStatSubScene["REVERSE_AUTO_AUDIT_PASS"] = "REVERSE_AUTO_AUDIT_PASS";
319
+ /** 逆向订单资源退还 */
320
+ BizStatSubScene["REVERSE_REFUND_RESOURCE"] = "REVERSE_REFUND_RESOURCE";
321
+ /** 逆向订单退款成功 */
322
+ BizStatSubScene["REVERSE_REFUND_SUCCESS"] = "REVERSE_REFUND_SUCCESS";
323
+ /** 正向订单关闭 */
324
+ BizStatSubScene["ORDER_CLOSED"] = "ORDER_CLOSED";
325
+ /** 正向订单用户确认收货 */
326
+ BizStatSubScene["ORDER_CONFIRM_RECEIVE"] = "ORDER_CONFIRM_RECEIVE";
327
+ /** 正向订单系统自动确认收货 */
328
+ BizStatSubScene["ORDER_AUTO_CONFIRM_RECEIVE"] = "ORDER_AUTO_CONFIRM_RECEIVE";
329
+ /** 正向订单用户取消 */
330
+ BizStatSubScene["ORDER_CANCEL_BY_USER"] = "ORDER_CANCEL_BY_USER";
331
+ /** 正向订单超时取消 */
332
+ BizStatSubScene["ORDER_CANCEL_BY_TIMEOUT"] = "ORDER_CANCEL_BY_TIMEOUT";
333
+ /** 逆向订单用户取消 */
334
+ BizStatSubScene["REVERSE_ORDER_CANCEL_BY_USER"] = "REVERSE_ORDER_CANCEL_BY_USER";
335
+ })(BizStatSubScene = ENUM.BizStatSubScene || (ENUM.BizStatSubScene = {}));
284
336
  })(ENUM || (exports.ENUM = ENUM = {}));
285
337
  /** RabbitMQ 交换机路由枚举 */
286
338
  var EXCHANGE_ENUM;
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * as POS from './modules/pos';
2
2
  export * as ROS from './modules/ros';
3
+ export * as STATISTICS from './modules/statistics';
3
4
  export { ENUM, ENUM_CN, EXCHANGE_ENUM } from './enums';
4
5
  export * as CONSTS from './consts';
5
6
  export * as DTO from './types';
package/index.js CHANGED
@@ -33,9 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.verificationService = exports.DTO = exports.CONSTS = exports.EXCHANGE_ENUM = exports.ENUM_CN = exports.ENUM = exports.ROS = exports.POS = void 0;
36
+ exports.verificationService = exports.DTO = exports.CONSTS = exports.EXCHANGE_ENUM = exports.ENUM_CN = exports.ENUM = exports.STATISTICS = exports.ROS = exports.POS = void 0;
37
37
  exports.POS = __importStar(require("./modules/pos"));
38
38
  exports.ROS = __importStar(require("./modules/ros"));
39
+ exports.STATISTICS = __importStar(require("./modules/statistics"));
39
40
  var enums_1 = require("./enums");
40
41
  Object.defineProperty(exports, "ENUM", { enumerable: true, get: function () { return enums_1.ENUM; } });
41
42
  Object.defineProperty(exports, "ENUM_CN", { enumerable: true, get: function () { return enums_1.ENUM_CN; } });
@@ -221,6 +221,10 @@ export declare namespace PosOrderQueryService {
221
221
  name: string;
222
222
  discount?: number;
223
223
  }[];
224
+ member?: {
225
+ discount: number;
226
+ quantity: number;
227
+ }[];
224
228
  };
225
229
  createdAt: number;
226
230
  updatedAt: number;
@@ -384,6 +388,10 @@ export declare namespace PosOrderQueryService {
384
388
  name: string;
385
389
  discount?: number;
386
390
  }[];
391
+ member?: {
392
+ discount: number;
393
+ quantity: number;
394
+ }[];
387
395
  };
388
396
  createdAt: number;
389
397
  updatedAt: number;
@@ -759,6 +767,18 @@ export declare namespace PosOrderQueryService {
759
767
  /** 积分数量 */
760
768
  quantity: number;
761
769
  };
770
+ /** 会员价信息 */
771
+ member?: {
772
+ /** 会员价总优惠金额 */
773
+ totalDiscount: number;
774
+ /** 会员价详情 */
775
+ detail: {
776
+ /** 优惠金额 */
777
+ discount: number;
778
+ /** 份数 */
779
+ quantity: number;
780
+ }[];
781
+ };
762
782
  };
763
783
  /** 任务活动信息 */
764
784
  taskActivity?: {
@@ -0,0 +1,2 @@
1
+ export { statisticsService } from './service';
2
+ export { StatisticsService as StatisticsTypes } from './types';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.statisticsService = void 0;
4
+ var service_1 = require("./service");
5
+ Object.defineProperty(exports, "statisticsService", { enumerable: true, get: function () { return service_1.statisticsService; } });
@@ -0,0 +1,10 @@
1
+ import { StatisticsService } from './types';
2
+ import BaseService from '../BaseService';
3
+ declare class StatisticsServiceImpl extends BaseService implements StatisticsService.ByPos.QueryController, StatisticsService.ByRos.QueryController, StatisticsService.ByUs.QueryController {
4
+ protected prefixUrl: string;
5
+ forwardStatistics(request: StatisticsService.ByPos.Request.IForwardStatistics, req?: any): Promise<StatisticsService.ByPos.Response.IForwardStatistics>;
6
+ reverseStatistics(request: StatisticsService.ByRos.Request.IReverseStatistics, req?: any): Promise<StatisticsService.ByRos.Response.IReverseStatistics>;
7
+ orderUserStatistics(request: StatisticsService.ByUs.Request.IOrderUserStatistics, req?: any): Promise<StatisticsService.ByUs.Response.IOrderUserStatistics>;
8
+ }
9
+ export declare const statisticsService: StatisticsServiceImpl;
10
+ export default statisticsService;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.statisticsService = void 0;
13
+ const tsoa_1 = require("tsoa");
14
+ const http_1 = require("../../utils/http");
15
+ const BaseService_1 = __importDefault(require("../BaseService"));
16
+ let StatisticsServiceImpl = class StatisticsServiceImpl extends BaseService_1.default {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.prefixUrl = '/statistics';
20
+ }
21
+ forwardStatistics(request, req) {
22
+ return (0, http_1.callApi)(this.getApiUrl(this.forwardStatistics), request);
23
+ }
24
+ reverseStatistics(request, req) {
25
+ return (0, http_1.callApi)(this.getApiUrl(this.reverseStatistics), request);
26
+ }
27
+ orderUserStatistics(request, req) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.orderUserStatistics), request);
29
+ }
30
+ };
31
+ __decorate([
32
+ (0, tsoa_1.OperationId)('正向统计接口'),
33
+ (0, tsoa_1.Post)('forward-statistics')
34
+ ], StatisticsServiceImpl.prototype, "forwardStatistics", null);
35
+ __decorate([
36
+ (0, tsoa_1.OperationId)('逆向统计接口'),
37
+ (0, tsoa_1.Post)('reverse-statistics')
38
+ ], StatisticsServiceImpl.prototype, "reverseStatistics", null);
39
+ __decorate([
40
+ (0, tsoa_1.OperationId)('下单人统计接口'),
41
+ (0, tsoa_1.Post)('order-user-statistics')
42
+ ], StatisticsServiceImpl.prototype, "orderUserStatistics", null);
43
+ StatisticsServiceImpl = __decorate([
44
+ (0, tsoa_1.Route)('statistics'),
45
+ (0, tsoa_1.Tags)('Statistics')
46
+ ], StatisticsServiceImpl);
47
+ exports.statisticsService = new StatisticsServiceImpl();
48
+ exports.default = exports.statisticsService;
@@ -0,0 +1,128 @@
1
+ export declare namespace StatisticsService {
2
+ namespace Dto {
3
+ interface IPagination {
4
+ /** 页码(从0开始) */
5
+ pageIndex: number;
6
+ /** 每页数量 */
7
+ pageSize: number;
8
+ }
9
+ interface IStore {
10
+ /** 门店ID */
11
+ storeId?: string;
12
+ }
13
+ }
14
+ namespace ByPos {
15
+ namespace Request {
16
+ interface IForwardStatistics {
17
+ /** 开始时间 */
18
+ startTime?: number;
19
+ /** 结束时间 */
20
+ endTime?: number;
21
+ /** 分页 */
22
+ pagination: Dto.IPagination;
23
+ /** 门店条件 */
24
+ store?: Dto.IStore;
25
+ }
26
+ }
27
+ namespace Response {
28
+ interface IForwardStatisticsItem {
29
+ /** 门店ID */
30
+ storeId: string;
31
+ /** 总GMV - 销售日期内,门店客户支付成功的订单金额之和(包括退款订单) */
32
+ totalGMV: number;
33
+ /** 总订单量 - 销售日期内,门店客户支付成功的订单数(包括退款订单) */
34
+ totalOrderCount: number;
35
+ /** 下单人数 - 销售日期内,门店客户支付成功的人数(已做订单去重) */
36
+ orderUserCount: number;
37
+ /** 直播GMV - 销售日期内,门店客户支付成功且带直播间Id的订单金额之和(包括退款订单) */
38
+ liveGMV: number;
39
+ /** 私域GMV - 销售日期内,门店客户支付成功且无直播间Id的订单金额之和(包括退款订单) */
40
+ privateGMV: number;
41
+ /** 快递到家GMV - 销售日期内,门店客户支付成功且取货方式=快递到家的订单金额之和(包括退款订单) */
42
+ deliveryHomeGMV: number;
43
+ /** 门店自提GMV - 销售日期内,门店客户支付成功且取货方式=门店自提的订单金额之和(包括虚拟订单及退款订单) */
44
+ selfPickupGMV: number;
45
+ /** 快递到家订单数 - 销售日期内,门店客户支付成功且取货方式=快递到家的订单数(包括退款订单) */
46
+ deliveryHomeOrderCount: number;
47
+ /** 门店自提订单数 - 销售日期内,门店客户支付成功且取货方式=门店自提的订单数(包括虚拟订单及退款订单) */
48
+ selfPickupOrderCount: number;
49
+ /** 客单价 - 总GMV / 总订单量 */
50
+ customerPrice: number;
51
+ /** ARPU(人均支付金额) - 总GMV / 下单人数 */
52
+ arpu: number;
53
+ /** 会员用户数 - 销售日期内,门店客户支付成功且是会员的订单人数(已做订单去重) */
54
+ memberUserCount: number;
55
+ }
56
+ interface IForwardStatistics {
57
+ list: IForwardStatisticsItem[];
58
+ total: number;
59
+ }
60
+ }
61
+ interface QueryController {
62
+ /** 正向统计接口 */
63
+ forwardStatistics(request: Request.IForwardStatistics, req: any): Promise<Response.IForwardStatistics>;
64
+ }
65
+ }
66
+ namespace ByRos {
67
+ namespace Request {
68
+ interface IReverseStatistics {
69
+ /** 开始时间 */
70
+ startTime?: number;
71
+ /** 结束时间 */
72
+ endTime?: number;
73
+ /** 分页 */
74
+ pagination: Dto.IPagination;
75
+ /** 门店条件 */
76
+ store?: Dto.IStore;
77
+ }
78
+ }
79
+ namespace Response {
80
+ interface IReverseStatisticsItem {
81
+ /** 门店ID */
82
+ storeId: string;
83
+ /** 退款GMV - 选定时间段内,门店客户退款成功的订单金额之和 */
84
+ refundGMV: number;
85
+ /** 退款订单数 - 选定时间段内,门店客户退款成功的订单数 */
86
+ refundOrderCount: number;
87
+ }
88
+ interface IReverseStatistics {
89
+ list: IReverseStatisticsItem[];
90
+ total: number;
91
+ }
92
+ }
93
+ interface QueryController {
94
+ /** 逆向统计接口 */
95
+ reverseStatistics(request: Request.IReverseStatistics, req: any): Promise<Response.IReverseStatistics>;
96
+ }
97
+ }
98
+ namespace ByUs {
99
+ namespace Request {
100
+ interface IOrderUserStatistics {
101
+ /** 开始时间 */
102
+ startTime?: number;
103
+ /** 结束时间 */
104
+ endTime?: number;
105
+ /** 分页 */
106
+ pagination: Dto.IPagination;
107
+ /** 门店条件 */
108
+ store?: Dto.IStore;
109
+ }
110
+ }
111
+ namespace Response {
112
+ interface IOrderUserStatisticsItem {
113
+ /** 门店ID */
114
+ storeId: string;
115
+ /** 用户ID列表 */
116
+ userIds: string[];
117
+ }
118
+ interface IOrderUserStatistics {
119
+ list: IOrderUserStatisticsItem[];
120
+ total: number;
121
+ }
122
+ }
123
+ interface QueryController {
124
+ /** 下单人统计接口 */
125
+ orderUserStatistics(request: Request.IOrderUserStatistics, req: any): Promise<Response.IOrderUserStatistics>;
126
+ }
127
+ }
128
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-trade-service-node-sdk",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "description": "EcommerceTradeService Node.js SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",