@be-link/ecommerce-trade-service-node-sdk 0.1.11 → 0.1.13

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; } });
@@ -3,6 +3,7 @@ import BaseService from '../../BaseService';
3
3
  declare class OrderQueryByInternalService extends BaseService implements PosOrderQueryService.ByInternal.QueryController {
4
4
  protected prefixUrl: string;
5
5
  getOrderByIdForClientBackend(request: PosOrderQueryService.ByInternal.Request.IGetOrderByIdForClientBackend): Promise<PosOrderQueryService.ByInternal.Response.IGetOrderByIdForClientBackend>;
6
+ getOrderListForClientBackend(request: PosOrderQueryService.ByInternal.Request.IGetOrderListForClientBackend): Promise<PosOrderQueryService.ByInternal.Response.IGetOrderListForClientBackend>;
6
7
  }
7
8
  export declare const orderQueryByInternalService: OrderQueryByInternalService;
8
9
  export default orderQueryByInternalService;
@@ -24,12 +24,20 @@ let OrderQueryByInternalService = class OrderQueryByInternalService extends Base
24
24
  getOrderByIdForClientBackend(request) {
25
25
  return (0, http_1.callApi)(this.getApiUrl(this.getOrderByIdForClientBackend), request);
26
26
  }
27
+ getOrderListForClientBackend(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.getOrderListForClientBackend), request);
29
+ }
27
30
  };
28
31
  __decorate([
29
32
  (0, tsoa_1.OperationId)('根据订单ID查询订单数据接口(直播服务)'),
30
33
  (0, tsoa_1.Post)('get-order-by-id-for-client-backend'),
31
34
  __param(0, (0, tsoa_1.Body)())
32
35
  ], OrderQueryByInternalService.prototype, "getOrderByIdForClientBackend", null);
36
+ __decorate([
37
+ (0, tsoa_1.OperationId)('根据订单ID列表查询订单数据接口(直播服务)'),
38
+ (0, tsoa_1.Post)('get-order-list-for-client-backend'),
39
+ __param(0, (0, tsoa_1.Body)())
40
+ ], OrderQueryByInternalService.prototype, "getOrderListForClientBackend", null);
33
41
  OrderQueryByInternalService = __decorate([
34
42
  (0, tsoa_1.Route)('pos/query/internal'),
35
43
  (0, tsoa_1.Tags)('PosOrderQuery')
@@ -43,7 +43,7 @@ export declare namespace PosOrderQueryService {
43
43
  /** 毫秒 */
44
44
  payTime: number;
45
45
  /** 毫秒 */
46
- completedAt: number;
46
+ refundTime: number;
47
47
  }
48
48
  }
49
49
  namespace ByInternal {
@@ -52,13 +52,24 @@ export declare namespace PosOrderQueryService {
52
52
  /** 订单ID */
53
53
  orderId: string;
54
54
  }
55
+ interface IGetOrderListForClientBackend {
56
+ /** 订单ID列表 */
57
+ orderIds: string[];
58
+ /** 页码(从0开始) */
59
+ pageIndex: number;
60
+ /** 每页数量 */
61
+ pageSize: number;
62
+ }
55
63
  }
56
64
  namespace Response {
57
65
  type IGetOrderByIdForClientBackend = Dto.ITradeOrderForClientBackend;
66
+ type IGetOrderListForClientBackend = Dto.ITradeOrderForClientBackend[];
58
67
  }
59
68
  interface QueryController {
60
69
  /** 根据订单ID查询订单数据接口(直播服务) */
61
70
  getOrderByIdForClientBackend(request: Request.IGetOrderByIdForClientBackend, req: any): Promise<Response.IGetOrderByIdForClientBackend>;
71
+ /** 根据订单ID列表查询订单数据接口(直播服务) */
72
+ getOrderListForClientBackend(request: Request.IGetOrderListForClientBackend, req: any): Promise<Response.IGetOrderListForClientBackend>;
62
73
  }
63
74
  }
64
75
  namespace ByWeb {
@@ -237,6 +237,14 @@ export declare namespace RosOrderQueryService {
237
237
  /** 退款订单ID */
238
238
  reverseOrderId: string;
239
239
  }
240
+ interface IGetRefundableResource {
241
+ /** 订单ID */
242
+ orderId: string;
243
+ /** 退款类型 */
244
+ refundType: ENUM.ReverseRefundType;
245
+ /** 退款商品份数(可选,退货退款时使用) */
246
+ quantity?: number;
247
+ }
240
248
  }
241
249
  namespace Response {
242
250
  interface IRefundOrderListItem {
@@ -305,10 +313,18 @@ export declare namespace RosOrderQueryService {
305
313
  unitPrice: number;
306
314
  };
307
315
  }
316
+ interface IGetRefundableResource {
317
+ /** 可退款金额(分) */
318
+ refundableAmount: number;
319
+ /** 最大可退款商品份数 */
320
+ maxRefundableQuantity: number;
321
+ }
308
322
  }
309
323
  }
310
324
  interface QueryByUserController {
311
325
  orderList(request: RosOrderQueryService.ByUser.Request.IRefundOrderList, req: any): Promise<RosOrderQueryService.ByUser.Response.IRefundOrderList>;
312
326
  orderDetail(request: RosOrderQueryService.ByUser.Request.IRefundOrderDetail, req: any): Promise<RosOrderQueryService.ByUser.Response.IRefundOrderDetail>;
327
+ /** 查询可申请退款的资源信息 */
328
+ getRefundableResource(request: RosOrderQueryService.ByUser.Request.IGetRefundableResource, req: any): Promise<RosOrderQueryService.ByUser.Response.IGetRefundableResource>;
313
329
  }
314
330
  }
@@ -4,6 +4,7 @@ declare class RosOrderQueryByUserService extends BaseService implements RosOrder
4
4
  protected prefixUrl: string;
5
5
  orderList(request: RosOrderQueryService.ByUser.Request.IRefundOrderList): Promise<RosOrderQueryService.ByUser.Response.IRefundOrderList>;
6
6
  orderDetail(request: RosOrderQueryService.ByUser.Request.IRefundOrderDetail): Promise<RosOrderQueryService.ByUser.Response.IRefundOrderDetail>;
7
+ getRefundableResource(request: RosOrderQueryService.ByUser.Request.IGetRefundableResource): Promise<RosOrderQueryService.ByUser.Response.IGetRefundableResource>;
7
8
  }
8
9
  export declare const orderQueryByUserService: RosOrderQueryByUserService;
9
10
  export default orderQueryByUserService;
@@ -27,6 +27,9 @@ let RosOrderQueryByUserService = class RosOrderQueryByUserService extends BaseSe
27
27
  orderDetail(request) {
28
28
  return (0, http_1.callApi)(this.getApiUrl(this.orderDetail), request);
29
29
  }
30
+ getRefundableResource(request) {
31
+ return (0, http_1.callApi)(this.getApiUrl(this.getRefundableResource), request);
32
+ }
30
33
  };
31
34
  __decorate([
32
35
  (0, tsoa_1.OperationId)('查询用户退款订单列表'),
@@ -38,6 +41,11 @@ __decorate([
38
41
  (0, tsoa_1.Post)('order-detail'),
39
42
  __param(0, (0, tsoa_1.Body)())
40
43
  ], RosOrderQueryByUserService.prototype, "orderDetail", null);
44
+ __decorate([
45
+ (0, tsoa_1.OperationId)('查询可申请退款的资源信息'),
46
+ (0, tsoa_1.Post)('get-refundable-resource'),
47
+ __param(0, (0, tsoa_1.Body)())
48
+ ], RosOrderQueryByUserService.prototype, "getRefundableResource", null);
41
49
  RosOrderQueryByUserService = __decorate([
42
50
  (0, tsoa_1.Route)('ros/query/user'),
43
51
  (0, tsoa_1.Tags)('RosOrderQuery')
@@ -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
+ }
@@ -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.11",
3
+ "version": "0.1.13",
4
4
  "description": "EcommerceTradeService Node.js SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",