@be-link/ecommerce-trade-service-node-sdk 0.1.71 → 0.1.72
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 +48 -0
- package/enums.js +50 -0
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/modules/statistics/index.d.ts +2 -0
- package/modules/statistics/index.js +5 -0
- package/modules/statistics/service.d.ts +10 -0
- package/modules/statistics/service.js +48 -0
- package/modules/statistics/types.d.ts +128 -0
- package/modules/statistics/types.js +2 -0
- package/package.json +1 -1
package/enums.d.ts
CHANGED
|
@@ -248,6 +248,54 @@ export declare namespace ENUM {
|
|
|
248
248
|
/** 结束 */
|
|
249
249
|
ENDED = "4"
|
|
250
250
|
}
|
|
251
|
+
/** 业务打点场景 */
|
|
252
|
+
enum BizStatScene {
|
|
253
|
+
/** 正向订单 */
|
|
254
|
+
TRADE_ORDER = "TRADE_ORDER",
|
|
255
|
+
/** 逆向订单 */
|
|
256
|
+
TRADE_REVERSE_ORDER = "TRADE_REVERSE_ORDER"
|
|
257
|
+
}
|
|
258
|
+
/** 业务打点子场景 */
|
|
259
|
+
enum BizStatSubScene {
|
|
260
|
+
/** 订单预扣资源 */
|
|
261
|
+
FREEZE_RESOURCE = "FREEZE_RESOURCE",
|
|
262
|
+
/** 释放预扣资源 */
|
|
263
|
+
UNFREEZE_RESOURCE = "UNFREEZE_RESOURCE",
|
|
264
|
+
/** 创建正向订单 */
|
|
265
|
+
CREATE_ORDER = "CREATE_ORDER",
|
|
266
|
+
/** 订单实扣资源 */
|
|
267
|
+
DEDUCT_RESOURCE = "DEDUCT_RESOURCE",
|
|
268
|
+
/** 积分商城支付 */
|
|
269
|
+
POINT_MALL_PAY = "POINT_MALL_PAY",
|
|
270
|
+
/** 订单支付 */
|
|
271
|
+
ORDER_PAY = "ORDER_PAY",
|
|
272
|
+
/** 获取订单支付参数 */
|
|
273
|
+
FETCH_PAYMENT_PARAM = "FETCH_PAYMENT_PARAM",
|
|
274
|
+
/** 创建逆向订单 */
|
|
275
|
+
CREATE_REVERSE_ORDER = "CREATE_REVERSE_ORDER",
|
|
276
|
+
/** 逆向订单商家审批通过 */
|
|
277
|
+
REVERSE_AUDIT_PASS = "REVERSE_AUDIT_PASS",
|
|
278
|
+
/** 逆向订单商家审批拒绝 */
|
|
279
|
+
REVERSE_AUDIT_REJECT = "REVERSE_AUDIT_REJECT",
|
|
280
|
+
/** 逆向订单系统自动审批通过 */
|
|
281
|
+
REVERSE_AUTO_AUDIT_PASS = "REVERSE_AUTO_AUDIT_PASS",
|
|
282
|
+
/** 逆向订单资源退还 */
|
|
283
|
+
REVERSE_REFUND_RESOURCE = "REVERSE_REFUND_RESOURCE",
|
|
284
|
+
/** 逆向订单退款成功 */
|
|
285
|
+
REVERSE_REFUND_SUCCESS = "REVERSE_REFUND_SUCCESS",
|
|
286
|
+
/** 正向订单关闭 */
|
|
287
|
+
ORDER_CLOSED = "ORDER_CLOSED",
|
|
288
|
+
/** 正向订单用户确认收货 */
|
|
289
|
+
ORDER_CONFIRM_RECEIVE = "ORDER_CONFIRM_RECEIVE",
|
|
290
|
+
/** 正向订单系统自动确认收货 */
|
|
291
|
+
ORDER_AUTO_CONFIRM_RECEIVE = "ORDER_AUTO_CONFIRM_RECEIVE",
|
|
292
|
+
/** 正向订单用户取消 */
|
|
293
|
+
ORDER_CANCEL_BY_USER = "ORDER_CANCEL_BY_USER",
|
|
294
|
+
/** 正向订单超时取消 */
|
|
295
|
+
ORDER_CANCEL_BY_TIMEOUT = "ORDER_CANCEL_BY_TIMEOUT",
|
|
296
|
+
/** 逆向订单用户取消 */
|
|
297
|
+
REVERSE_ORDER_CANCEL_BY_USER = "REVERSE_ORDER_CANCEL_BY_USER"
|
|
298
|
+
}
|
|
251
299
|
}
|
|
252
300
|
/** RabbitMQ 交换机路由枚举 */
|
|
253
301
|
export declare namespace EXCHANGE_ENUM {
|
package/enums.js
CHANGED
|
@@ -281,6 +281,56 @@ var ENUM;
|
|
|
281
281
|
/** 结束 */
|
|
282
282
|
LiveRoomStatus["ENDED"] = "4";
|
|
283
283
|
})(LiveRoomStatus = ENUM.LiveRoomStatus || (ENUM.LiveRoomStatus = {}));
|
|
284
|
+
/** 业务打点场景 */
|
|
285
|
+
let BizStatScene;
|
|
286
|
+
(function (BizStatScene) {
|
|
287
|
+
/** 正向订单 */
|
|
288
|
+
BizStatScene["TRADE_ORDER"] = "TRADE_ORDER";
|
|
289
|
+
/** 逆向订单 */
|
|
290
|
+
BizStatScene["TRADE_REVERSE_ORDER"] = "TRADE_REVERSE_ORDER";
|
|
291
|
+
})(BizStatScene = ENUM.BizStatScene || (ENUM.BizStatScene = {}));
|
|
292
|
+
/** 业务打点子场景 */
|
|
293
|
+
let BizStatSubScene;
|
|
294
|
+
(function (BizStatSubScene) {
|
|
295
|
+
/** 订单预扣资源 */
|
|
296
|
+
BizStatSubScene["FREEZE_RESOURCE"] = "FREEZE_RESOURCE";
|
|
297
|
+
/** 释放预扣资源 */
|
|
298
|
+
BizStatSubScene["UNFREEZE_RESOURCE"] = "UNFREEZE_RESOURCE";
|
|
299
|
+
/** 创建正向订单 */
|
|
300
|
+
BizStatSubScene["CREATE_ORDER"] = "CREATE_ORDER";
|
|
301
|
+
/** 订单实扣资源 */
|
|
302
|
+
BizStatSubScene["DEDUCT_RESOURCE"] = "DEDUCT_RESOURCE";
|
|
303
|
+
/** 积分商城支付 */
|
|
304
|
+
BizStatSubScene["POINT_MALL_PAY"] = "POINT_MALL_PAY";
|
|
305
|
+
/** 订单支付 */
|
|
306
|
+
BizStatSubScene["ORDER_PAY"] = "ORDER_PAY";
|
|
307
|
+
/** 获取订单支付参数 */
|
|
308
|
+
BizStatSubScene["FETCH_PAYMENT_PARAM"] = "FETCH_PAYMENT_PARAM";
|
|
309
|
+
/** 创建逆向订单 */
|
|
310
|
+
BizStatSubScene["CREATE_REVERSE_ORDER"] = "CREATE_REVERSE_ORDER";
|
|
311
|
+
/** 逆向订单商家审批通过 */
|
|
312
|
+
BizStatSubScene["REVERSE_AUDIT_PASS"] = "REVERSE_AUDIT_PASS";
|
|
313
|
+
/** 逆向订单商家审批拒绝 */
|
|
314
|
+
BizStatSubScene["REVERSE_AUDIT_REJECT"] = "REVERSE_AUDIT_REJECT";
|
|
315
|
+
/** 逆向订单系统自动审批通过 */
|
|
316
|
+
BizStatSubScene["REVERSE_AUTO_AUDIT_PASS"] = "REVERSE_AUTO_AUDIT_PASS";
|
|
317
|
+
/** 逆向订单资源退还 */
|
|
318
|
+
BizStatSubScene["REVERSE_REFUND_RESOURCE"] = "REVERSE_REFUND_RESOURCE";
|
|
319
|
+
/** 逆向订单退款成功 */
|
|
320
|
+
BizStatSubScene["REVERSE_REFUND_SUCCESS"] = "REVERSE_REFUND_SUCCESS";
|
|
321
|
+
/** 正向订单关闭 */
|
|
322
|
+
BizStatSubScene["ORDER_CLOSED"] = "ORDER_CLOSED";
|
|
323
|
+
/** 正向订单用户确认收货 */
|
|
324
|
+
BizStatSubScene["ORDER_CONFIRM_RECEIVE"] = "ORDER_CONFIRM_RECEIVE";
|
|
325
|
+
/** 正向订单系统自动确认收货 */
|
|
326
|
+
BizStatSubScene["ORDER_AUTO_CONFIRM_RECEIVE"] = "ORDER_AUTO_CONFIRM_RECEIVE";
|
|
327
|
+
/** 正向订单用户取消 */
|
|
328
|
+
BizStatSubScene["ORDER_CANCEL_BY_USER"] = "ORDER_CANCEL_BY_USER";
|
|
329
|
+
/** 正向订单超时取消 */
|
|
330
|
+
BizStatSubScene["ORDER_CANCEL_BY_TIMEOUT"] = "ORDER_CANCEL_BY_TIMEOUT";
|
|
331
|
+
/** 逆向订单用户取消 */
|
|
332
|
+
BizStatSubScene["REVERSE_ORDER_CANCEL_BY_USER"] = "REVERSE_ORDER_CANCEL_BY_USER";
|
|
333
|
+
})(BizStatSubScene = ENUM.BizStatSubScene || (ENUM.BizStatSubScene = {}));
|
|
284
334
|
})(ENUM || (exports.ENUM = ENUM = {}));
|
|
285
335
|
/** RabbitMQ 交换机路由枚举 */
|
|
286
336
|
var EXCHANGE_ENUM;
|
package/index.d.ts
CHANGED
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; } });
|
|
@@ -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
|
+
}
|