@be-link/ecommerce-trade-service-node-sdk 0.1.11 → 0.1.12
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/index.d.ts
CHANGED
|
@@ -3,3 +3,5 @@ export * as ROS from './modules/ros';
|
|
|
3
3
|
export { ENUM, EXCHANGE_ENUM } from './enums';
|
|
4
4
|
export * as CONSTS from './consts';
|
|
5
5
|
export * as DTO from './types';
|
|
6
|
+
export { verificationService } from './modules/verification/service';
|
|
7
|
+
export type { VerificationService as VerificationServiceTypes } from './modules/verification/types';
|
package/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.DTO = exports.CONSTS = exports.EXCHANGE_ENUM = exports.ENUM = exports.ROS = exports.POS = void 0;
|
|
36
|
+
exports.verificationService = exports.DTO = exports.CONSTS = exports.EXCHANGE_ENUM = exports.ENUM = exports.ROS = exports.POS = void 0;
|
|
37
37
|
exports.POS = __importStar(require("./modules/pos"));
|
|
38
38
|
exports.ROS = __importStar(require("./modules/ros"));
|
|
39
39
|
var enums_1 = require("./enums");
|
|
@@ -41,3 +41,6 @@ Object.defineProperty(exports, "ENUM", { enumerable: true, get: function () { re
|
|
|
41
41
|
Object.defineProperty(exports, "EXCHANGE_ENUM", { enumerable: true, get: function () { return enums_1.EXCHANGE_ENUM; } });
|
|
42
42
|
exports.CONSTS = __importStar(require("./consts"));
|
|
43
43
|
exports.DTO = __importStar(require("./types"));
|
|
44
|
+
// 核销
|
|
45
|
+
var service_1 = require("./modules/verification/service");
|
|
46
|
+
Object.defineProperty(exports, "verificationService", { enumerable: true, get: function () { return service_1.verificationService; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VerificationService as Service } from './types';
|
|
2
|
+
import BaseService from '../BaseService';
|
|
3
|
+
declare class VerificationService extends BaseService implements Service.VerificationController {
|
|
4
|
+
protected prefixUrl: string;
|
|
5
|
+
/** 根据手机号尾号获取完整手机号列表 */
|
|
6
|
+
getPhonesByPhoneEndStoreId(request: Service.Request.getPhonesByPhoneEndStoreId): Promise<Service.Response.getPhonesByPhoneEndStoreId>;
|
|
7
|
+
/** 查询核销订单 */
|
|
8
|
+
queryOrders(request: Service.Request.queryOrders): Promise<Service.Response.queryOrders>;
|
|
9
|
+
/** 核销订单 */
|
|
10
|
+
verifyOrders(request: Service.Request.verifyOrders): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare const verificationService: VerificationService;
|
|
13
|
+
export default verificationService;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
9
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.verificationService = void 0;
|
|
16
|
+
const tsoa_1 = require("tsoa");
|
|
17
|
+
const http_1 = require("../../utils/http");
|
|
18
|
+
const BaseService_1 = __importDefault(require("../BaseService"));
|
|
19
|
+
let VerificationService = class VerificationService extends BaseService_1.default {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.prefixUrl = '/verification';
|
|
23
|
+
}
|
|
24
|
+
/** 根据手机号尾号获取完整手机号列表 */
|
|
25
|
+
async getPhonesByPhoneEndStoreId(request) {
|
|
26
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getPhonesByPhoneEndStoreId), request);
|
|
27
|
+
}
|
|
28
|
+
/** 查询核销订单 */
|
|
29
|
+
async queryOrders(request) {
|
|
30
|
+
return (0, http_1.callApi)(this.getApiUrl(this.queryOrders), request);
|
|
31
|
+
}
|
|
32
|
+
/** 核销订单 */
|
|
33
|
+
async verifyOrders(request) {
|
|
34
|
+
return (0, http_1.callApi)(this.getApiUrl(this.verifyOrders), request);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, tsoa_1.OperationId)('根据手机号尾号获取完整手机号列表'),
|
|
39
|
+
(0, tsoa_1.Post)('get-phones-by-phone-end-store-id'),
|
|
40
|
+
__param(0, (0, tsoa_1.Body)())
|
|
41
|
+
], VerificationService.prototype, "getPhonesByPhoneEndStoreId", null);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, tsoa_1.OperationId)('查询核销订单'),
|
|
44
|
+
(0, tsoa_1.Post)('query-orders'),
|
|
45
|
+
__param(0, (0, tsoa_1.Body)())
|
|
46
|
+
], VerificationService.prototype, "queryOrders", null);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, tsoa_1.OperationId)('核销订单'),
|
|
49
|
+
(0, tsoa_1.Post)('verify-orders'),
|
|
50
|
+
__param(0, (0, tsoa_1.Body)())
|
|
51
|
+
], VerificationService.prototype, "verifyOrders", null);
|
|
52
|
+
VerificationService = __decorate([
|
|
53
|
+
(0, tsoa_1.Route)('verification'),
|
|
54
|
+
(0, tsoa_1.Tags)('Verification')
|
|
55
|
+
], VerificationService);
|
|
56
|
+
exports.verificationService = new VerificationService();
|
|
57
|
+
exports.default = exports.verificationService;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare namespace VerificationService {
|
|
2
|
+
interface ProductBase {
|
|
3
|
+
productId: string;
|
|
4
|
+
productName: string;
|
|
5
|
+
productImg: string;
|
|
6
|
+
skuId: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
skuValue: string;
|
|
9
|
+
}
|
|
10
|
+
export interface verifyCommonItem extends ProductBase {
|
|
11
|
+
orderId: string;
|
|
12
|
+
consignee?: string;
|
|
13
|
+
userId?: string;
|
|
14
|
+
memberLevel?: number;
|
|
15
|
+
addTime?: number;
|
|
16
|
+
isReadonly?: boolean;
|
|
17
|
+
tips?: string;
|
|
18
|
+
bindItems: ProductBase[];
|
|
19
|
+
}
|
|
20
|
+
export type orderItem = verifyCommonItem;
|
|
21
|
+
export interface couponItem extends verifyCommonItem {
|
|
22
|
+
couponName?: string;
|
|
23
|
+
}
|
|
24
|
+
export namespace Request {
|
|
25
|
+
interface getPhonesByPhoneEndStoreId {
|
|
26
|
+
/** 手机尾号 */
|
|
27
|
+
phoneEnd: string;
|
|
28
|
+
/** 门店Id */
|
|
29
|
+
storeId: string;
|
|
30
|
+
}
|
|
31
|
+
interface queryOrders {
|
|
32
|
+
/** 手机号 */
|
|
33
|
+
phone?: string;
|
|
34
|
+
/** 用户userId */
|
|
35
|
+
userId?: string;
|
|
36
|
+
/** 门店Id */
|
|
37
|
+
storeId: string;
|
|
38
|
+
}
|
|
39
|
+
interface verifyOrders {
|
|
40
|
+
/** 门店ID */
|
|
41
|
+
storeId: string;
|
|
42
|
+
/** 核销方式 */
|
|
43
|
+
verifyType: 'PHONE' | 'USER';
|
|
44
|
+
verifyOrderItem: {
|
|
45
|
+
/** 订单ID */
|
|
46
|
+
orderId: string;
|
|
47
|
+
/** 核销数量 */
|
|
48
|
+
quantity: number;
|
|
49
|
+
}[];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export namespace Response {
|
|
53
|
+
interface getPhonesByPhoneEndStoreId {
|
|
54
|
+
/** 手机号列表 */
|
|
55
|
+
phones: string[];
|
|
56
|
+
}
|
|
57
|
+
interface queryOrders {
|
|
58
|
+
order: orderItem[];
|
|
59
|
+
coupon: couponItem[];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export interface VerificationController {
|
|
63
|
+
/** 根据手机尾号、门店,查询核销订单手机号列表 */
|
|
64
|
+
getPhonesByPhoneEndStoreId(request: Request.getPhonesByPhoneEndStoreId): Promise<Response.getPhonesByPhoneEndStoreId>;
|
|
65
|
+
/** 查询核销订单 */
|
|
66
|
+
queryOrders(request: Request.queryOrders): Promise<Response.queryOrders>;
|
|
67
|
+
/** 核销订单 */
|
|
68
|
+
verifyOrders(request: Request.verifyOrders): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
71
|
+
}
|