@be-link/ecommerce-trade-service-node-sdk 0.0.13 → 0.0.15

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
@@ -176,3 +176,12 @@ export declare enum ApplyRefundStatus {
176
176
  /** 暂不允许退款 */
177
177
  NOT_ALLOWED = "NOT_ALLOWED"
178
178
  }
179
+ /** 订单类型状态 */
180
+ export declare enum OrderType {
181
+ /** 普通订单 */
182
+ NORMAL = "NORMAL",
183
+ /** 支付有礼订单 */
184
+ PAY_GIFT = "PAY_GIFT",
185
+ /** 满赠订单 */
186
+ FULL_GIFT = "FULL_GIFT"
187
+ }
package/enums.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApplyRefundStatus = exports.PayWay = exports.PayPlatform = exports.PayChannel = exports.ReverseRefundWay = exports.ReverseRefundType = exports.ReverseArrivalStatus = exports.ReverseOrderStatus = exports.ReverseResourceType = exports.OrderVerificationStatus = exports.OrderRefundStatus = exports.OrderPayStatus = exports.OrderStatus = exports.OrderOsType = exports.OrderPlatform = exports.OrderSource = void 0;
3
+ exports.OrderType = exports.ApplyRefundStatus = exports.PayWay = exports.PayPlatform = exports.PayChannel = exports.ReverseRefundWay = exports.ReverseRefundType = exports.ReverseArrivalStatus = exports.ReverseOrderStatus = exports.ReverseResourceType = exports.OrderVerificationStatus = exports.OrderRefundStatus = exports.OrderPayStatus = exports.OrderStatus = exports.OrderOsType = exports.OrderPlatform = exports.OrderSource = void 0;
4
4
  /** 订单来源 */
5
5
  var OrderSource;
6
6
  (function (OrderSource) {
@@ -195,3 +195,13 @@ var ApplyRefundStatus;
195
195
  /** 暂不允许退款 */
196
196
  ApplyRefundStatus["NOT_ALLOWED"] = "NOT_ALLOWED";
197
197
  })(ApplyRefundStatus || (exports.ApplyRefundStatus = ApplyRefundStatus = {}));
198
+ /** 订单类型状态 */
199
+ var OrderType;
200
+ (function (OrderType) {
201
+ /** 普通订单 */
202
+ OrderType["NORMAL"] = "NORMAL";
203
+ /** 支付有礼订单 */
204
+ OrderType["PAY_GIFT"] = "PAY_GIFT";
205
+ /** 满赠订单 */
206
+ OrderType["FULL_GIFT"] = "FULL_GIFT";
207
+ })(OrderType || (exports.OrderType = OrderType = {}));
@@ -38,6 +38,20 @@ export declare namespace PosCoreService {
38
38
  /** 用户选择使用的积分数 */
39
39
  pointNum?: number;
40
40
  }
41
+ interface IUpdateAddress {
42
+ userId: string;
43
+ receiverName?: string;
44
+ receiverPhone?: string;
45
+ userAddressId?: string;
46
+ }
47
+ interface ICancelOrder {
48
+ userId: string;
49
+ orderId: string;
50
+ }
51
+ interface IConfirmReceive {
52
+ userId: string;
53
+ orderId: string;
54
+ }
41
55
  }
42
56
  namespace Response {
43
57
  interface IOrderCreate {
@@ -51,9 +65,13 @@ export declare namespace PosCoreService {
51
65
  paySign: string;
52
66
  };
53
67
  }
68
+ type IConfirmReceive = void;
54
69
  }
55
70
  }
56
71
  interface CoreByUserController {
57
72
  orderCreate(request: ByUser.Request.IOrderCreate, req: any): Promise<ByUser.Response.IOrderCreate>;
73
+ cancelOrder(request: ByUser.Request.ICancelOrder, req: any): Promise<void>;
74
+ updateAddress(request: ByUser.Request.IUpdateAddress, req: any): Promise<void>;
75
+ confirmReceive(request: ByUser.Request.IConfirmReceive, req: any): Promise<ByUser.Response.IConfirmReceive>;
58
76
  }
59
77
  }
@@ -3,6 +3,9 @@ import BaseService from '../../BaseService';
3
3
  declare class OrderCoreByUserService extends BaseService implements PosCoreService.CoreByUserController {
4
4
  protected prefixUrl: string;
5
5
  orderCreate(request: PosCoreService.ByUser.Request.IOrderCreate): Promise<PosCoreService.ByUser.Response.IOrderCreate>;
6
+ updateAddress(request: PosCoreService.ByUser.Request.IUpdateAddress): Promise<void>;
7
+ cancelOrder(request: PosCoreService.ByUser.Request.ICancelOrder): Promise<void>;
8
+ confirmReceive(request: PosCoreService.ByUser.Request.IConfirmReceive): Promise<PosCoreService.ByUser.Response.IConfirmReceive>;
6
9
  }
7
10
  export declare const orderCoreByUserService: OrderCoreByUserService;
8
11
  export default orderCoreByUserService;
@@ -24,12 +24,36 @@ let OrderCoreByUserService = class OrderCoreByUserService extends BaseService_1.
24
24
  orderCreate(request) {
25
25
  return (0, http_1.callApi)(this.getApiUrl(this.orderCreate), request);
26
26
  }
27
+ updateAddress(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.updateAddress), request);
29
+ }
30
+ cancelOrder(request) {
31
+ return (0, http_1.callApi)(this.getApiUrl(this.cancelOrder), request);
32
+ }
33
+ confirmReceive(request) {
34
+ return (0, http_1.callApi)(this.getApiUrl(this.confirmReceive), request);
35
+ }
27
36
  };
28
37
  __decorate([
29
38
  (0, tsoa_1.OperationId)('订单创建'),
30
39
  (0, tsoa_1.Post)('order-create'),
31
40
  __param(0, (0, tsoa_1.Body)())
32
41
  ], OrderCoreByUserService.prototype, "orderCreate", null);
42
+ __decorate([
43
+ (0, tsoa_1.OperationId)('修改收货地址'),
44
+ (0, tsoa_1.Post)('address-update'),
45
+ __param(0, (0, tsoa_1.Body)())
46
+ ], OrderCoreByUserService.prototype, "updateAddress", null);
47
+ __decorate([
48
+ (0, tsoa_1.OperationId)('取消订单'),
49
+ (0, tsoa_1.Post)('order-cancel'),
50
+ __param(0, (0, tsoa_1.Body)())
51
+ ], OrderCoreByUserService.prototype, "cancelOrder", null);
52
+ __decorate([
53
+ (0, tsoa_1.OperationId)('确认收货'),
54
+ (0, tsoa_1.Post)('confirm-receive'),
55
+ __param(0, (0, tsoa_1.Body)())
56
+ ], OrderCoreByUserService.prototype, "confirmReceive", null);
33
57
  OrderCoreByUserService = __decorate([
34
58
  (0, tsoa_1.Route)('pos/core/user'),
35
59
  (0, tsoa_1.Tags)('PosOrderCore')
@@ -1,5 +1,6 @@
1
1
  import * as DTO from '../../../types';
2
2
  import { ENUMS } from '../../..';
3
+ import { PRODUCT_SERVICE_ENUM } from '@be-link/ecommerce-product-service-node-sdk';
3
4
  export declare namespace PosOrderQueryService {
4
5
  namespace Dto {
5
6
  interface IPagination {
@@ -82,26 +83,133 @@ export declare namespace PosOrderQueryService {
82
83
  orderId: string;
83
84
  queryBlocks?: (keyof DTO.PosQueryBlockMap)[];
84
85
  }
86
+ interface IOrderDetail {
87
+ orderId: string;
88
+ }
85
89
  }
86
90
  namespace Response {
91
+ interface IListItem {
92
+ orderId: string;
93
+ createdAt: number;
94
+ source: ENUMS.OrderSource;
95
+ platform: ENUMS.OrderPlatform;
96
+ productImage: string;
97
+ productName: string;
98
+ productSpec: string;
99
+ unitPrice: number;
100
+ quantity: number;
101
+ actualAmount: number;
102
+ orderStatus: ENUMS.OrderStatus;
103
+ refundStatus: ENUMS.OrderRefundStatus;
104
+ receiverName: string;
105
+ receiverPhone: string;
106
+ productPick: string;
107
+ productType: string;
108
+ orderType: ENUMS.OrderType;
109
+ }
110
+ interface IList {
111
+ list: IListItem[];
112
+ total: number;
113
+ }
87
114
  interface IOrderList {
88
115
  }
89
116
  interface IRecentPickup {
90
117
  }
118
+ interface IOrderDetail {
119
+ order: {
120
+ orderId: string;
121
+ createdAt: number;
122
+ payTime: number;
123
+ source: ENUMS.OrderSource;
124
+ platform: ENUMS.OrderPlatform;
125
+ status: ENUMS.OrderStatus;
126
+ dispatchWay: string;
127
+ productPick: string;
128
+ store: {
129
+ storeId: string;
130
+ storeName: string;
131
+ storeAddr: string;
132
+ };
133
+ user: {
134
+ userId: string;
135
+ memberLevel?: string;
136
+ receiverName: string;
137
+ receiverPhone: string;
138
+ };
139
+ payment: {
140
+ payChannel: ENUMS.PayChannel;
141
+ payPlatform: ENUMS.PayPlatform;
142
+ payWay: ENUMS.PayWay;
143
+ payAmount: number;
144
+ };
145
+ liveRoomId: string;
146
+ };
147
+ userDetail: {
148
+ userId: string;
149
+ memberLevel?: string;
150
+ receiverName: string;
151
+ receiverPhone: string;
152
+ };
153
+ logistics?: {
154
+ company?: string;
155
+ trackingNo?: string;
156
+ };
157
+ selfPickup?: {
158
+ storeName: string;
159
+ storeAddr: string;
160
+ };
161
+ products: {
162
+ productId: string;
163
+ productName: string;
164
+ specName: string;
165
+ specCode: string;
166
+ unitPrice: number;
167
+ }[];
168
+ orderTotals: {
169
+ totalAmount: number;
170
+ discountAmount: number;
171
+ actualAmount: number;
172
+ };
173
+ verificationRecords: {
174
+ productId: string;
175
+ productName: string;
176
+ specName: string;
177
+ specCode: string;
178
+ validStartTime: number;
179
+ validEndTime: number;
180
+ verificationTime?: number;
181
+ orderStoreName?: string;
182
+ operatorName?: string;
183
+ status: ENUMS.OrderVerificationStatus;
184
+ isRefunded?: boolean;
185
+ verificationStoreName?: string;
186
+ verificationWay?: string;
187
+ }[];
188
+ refunds: {
189
+ refundTime: number;
190
+ refundAmount: number;
191
+ verificationStatus: ENUMS.OrderVerificationStatus;
192
+ arrivalStatus: ENUMS.ReverseArrivalStatus;
193
+ operator: string;
194
+ reverseOrderId: string;
195
+ }[];
196
+ }
91
197
  }
92
198
  interface QueryController {
93
199
  /** 示例接口 */
94
200
  orderList(request: Request.IOrderList, req: any): Promise<DTO.PosQueryResult[]>;
95
201
  orderById(request: Request.IOrderById, req: any): Promise<DTO.PosQueryResult>;
202
+ list(request: Request.IOrderList, req: any): Promise<Response.IList>;
203
+ orderDetail(request: Request.IOrderDetail, req: any): Promise<Response.IOrderDetail>;
96
204
  }
97
205
  }
98
206
  namespace ByUser {
99
207
  namespace Request {
100
- interface IGetLastOrderByProductPick {
208
+ interface IGetLastOrderAddrByProductPick {
101
209
  /** 用户ID */
102
210
  userId: string;
103
211
  /** 商品提货方式 */
104
- productPick: string;
212
+ productPick: PRODUCT_SERVICE_ENUM.PRODUCT_ENUM.PICK_TYPE;
105
213
  }
106
214
  interface IGetOrderPayStatus {
107
215
  /** 订单ID */
@@ -123,6 +231,14 @@ export declare namespace PosOrderQueryService {
123
231
  /** 订单状态(可选,不传则统计所有状态) */
124
232
  status?: ENUMS.OrderStatus;
125
233
  }
234
+ interface IGetOrderApplyRefund {
235
+ userId: string;
236
+ orderId: string;
237
+ }
238
+ interface IOrderDetail {
239
+ userId: string;
240
+ orderId: string;
241
+ }
126
242
  }
127
243
  namespace Response {
128
244
  interface IGetOrderPayStatus {
@@ -154,6 +270,10 @@ export declare namespace PosOrderQueryService {
154
270
  autoCancelTime: number;
155
271
  /** 申请退款状态 */
156
272
  applyRefund: ENUMS.ApplyRefundStatus;
273
+ /** 订单来源 */
274
+ source: ENUMS.OrderSource;
275
+ /** 订单类型 */
276
+ orderType: ENUMS.OrderType;
157
277
  }
158
278
  interface IOrderList {
159
279
  /** 订单列表 */
@@ -168,16 +288,92 @@ export declare namespace PosOrderQueryService {
168
288
  total: number;
169
289
  }
170
290
  type ICountOrderByStatus = ICountOrderByStatusItem[];
291
+ interface IGetOrderApplyRefund {
292
+ applyRefund: ENUMS.ApplyRefundStatus;
293
+ }
294
+ interface IOrderDetail {
295
+ orderId: string;
296
+ createdAt: number;
297
+ payTime: number;
298
+ productPick: string;
299
+ orderStatus: ENUMS.OrderStatus;
300
+ actualAmount: number;
301
+ totalAmount: number;
302
+ /** 门店信息 */
303
+ store: {
304
+ /** 门店名称 */
305
+ storeName: string;
306
+ /** 门店地址 */
307
+ storeAddr: string;
308
+ /** 门店联系电话 */
309
+ storePhone: string;
310
+ };
311
+ /** 核销信息 */
312
+ verification: {
313
+ /** 核销有效期 */
314
+ validTimeStart: number;
315
+ validTimeEnd: number;
316
+ /** 已核销 */
317
+ verifiedNum: number;
318
+ /** 未核销 */
319
+ unVerifiedNum: number;
320
+ };
321
+ product: {
322
+ productId: string;
323
+ productName: string;
324
+ productSpec: string;
325
+ totalQuantity: number;
326
+ unitPrice: number;
327
+ productImg: string;
328
+ };
329
+ discounts: {
330
+ coupon: {
331
+ couponCode: string;
332
+ couponId: string;
333
+ couponName: string;
334
+ couponAmount: number;
335
+ } | null;
336
+ points: {
337
+ pointsNum: number;
338
+ amount: number;
339
+ };
340
+ };
341
+ receiver: {
342
+ receiverName: string;
343
+ receiverPhone: string;
344
+ receiverAddress: string;
345
+ };
346
+ refunds: {
347
+ status: ENUMS.ReverseOrderStatus;
348
+ amount: number;
349
+ reason: string;
350
+ applyTime: number;
351
+ }[];
352
+ gifts: {
353
+ validStartTime: number;
354
+ validEndTime: number;
355
+ templateName: string;
356
+ quantity: number;
357
+ }[];
358
+ }
359
+ interface IGetLastOrderAddrByProductPick {
360
+ /** 收货人 */
361
+ receiverName: string;
362
+ /** 收货人联系电话 */
363
+ receiverPhone: string;
364
+ }
171
365
  }
172
366
  interface QueryController {
173
367
  /** 根据商品提货方式查询用户最近一条订单 */
174
- getLastOrderByProductPick(request: Request.IGetLastOrderByProductPick, req: any): Promise<DTO.ITradeOrder | null>;
368
+ getLastOrderAddrByProductPick(request: Request.IGetLastOrderAddrByProductPick, req: any): Promise<Response.IGetLastOrderAddrByProductPick | null>;
175
369
  /** 支付成功,C端轮询查询订单支付状态 */
176
370
  getOrderPayStatus(request: Request.IGetOrderPayStatus, req: any): Promise<Response.IGetOrderPayStatus>;
177
371
  /** 查询用户订单列表 */
178
372
  orderList(request: Request.IOrderList, req: any): Promise<Response.IOrderList>;
179
373
  /** 根据订单状态统计订单总数 */
180
374
  countOrderByStatus(request: Request.ICountOrderByStatus, req: any): Promise<Response.ICountOrderByStatus>;
375
+ getOrderApplyRefund(request: Request.IGetOrderApplyRefund, req: any): Promise<Response.IGetOrderApplyRefund>;
376
+ orderDetail(request: Request.IOrderDetail, req: any): Promise<Response.IOrderDetail>;
181
377
  }
182
378
  }
183
379
  }
@@ -1,12 +1,12 @@
1
1
  import { PosOrderQueryService } from './types';
2
- import * as DTO from '../../../types';
3
2
  import BaseService from '../../BaseService';
4
3
  declare class OrderQueryByUserService extends BaseService {
5
4
  protected prefixUrl: string;
6
- getLastOrderByProductPick(request: PosOrderQueryService.ByUser.Request.IGetLastOrderByProductPick): Promise<DTO.ITradeOrder | null>;
5
+ getLastOrderAddrByProductPick(request: PosOrderQueryService.ByUser.Request.IGetLastOrderAddrByProductPick): Promise<PosOrderQueryService.ByUser.Response.IGetLastOrderAddrByProductPick | null>;
7
6
  getOrderPayStatus(request: PosOrderQueryService.ByUser.Request.IGetOrderPayStatus): Promise<PosOrderQueryService.ByUser.Response.IGetOrderPayStatus>;
8
7
  orderList(request: PosOrderQueryService.ByUser.Request.IOrderList): Promise<PosOrderQueryService.ByUser.Response.IOrderList>;
9
8
  countOrderByStatus(request: PosOrderQueryService.ByUser.Request.ICountOrderByStatus): Promise<PosOrderQueryService.ByUser.Response.ICountOrderByStatus>;
9
+ getOrderApplyRefund(request: PosOrderQueryService.ByUser.Request.IGetOrderApplyRefund): Promise<PosOrderQueryService.ByUser.Response.IGetOrderApplyRefund>;
10
10
  }
11
11
  export declare const queryByUserService: OrderQueryByUserService;
12
12
  export default queryByUserService;
@@ -21,8 +21,8 @@ let OrderQueryByUserService = class OrderQueryByUserService extends BaseService_
21
21
  super(...arguments);
22
22
  this.prefixUrl = '/pos/query/user';
23
23
  }
24
- getLastOrderByProductPick(request) {
25
- return (0, http_1.callApi)(this.getApiUrl(this.getLastOrderByProductPick), request);
24
+ getLastOrderAddrByProductPick(request) {
25
+ return (0, http_1.callApi)(this.getApiUrl(this.getLastOrderAddrByProductPick), request);
26
26
  }
27
27
  getOrderPayStatus(request) {
28
28
  return (0, http_1.callApi)(this.getApiUrl(this.getOrderPayStatus), request);
@@ -33,12 +33,15 @@ let OrderQueryByUserService = class OrderQueryByUserService extends BaseService_
33
33
  countOrderByStatus(request) {
34
34
  return (0, http_1.callApi)(this.getApiUrl(this.countOrderByStatus), request);
35
35
  }
36
+ getOrderApplyRefund(request) {
37
+ return (0, http_1.callApi)(this.getApiUrl(this.getOrderApplyRefund), request);
38
+ }
36
39
  };
37
40
  __decorate([
38
41
  (0, tsoa_1.OperationId)('根据商品提货方式查询用户最近订单'),
39
- (0, tsoa_1.Post)('get-last-order-by-product-pick'),
42
+ (0, tsoa_1.Post)('get-last-order-addr-by-product-pick'),
40
43
  __param(0, (0, tsoa_1.Body)())
41
- ], OrderQueryByUserService.prototype, "getLastOrderByProductPick", null);
44
+ ], OrderQueryByUserService.prototype, "getLastOrderAddrByProductPick", null);
42
45
  __decorate([
43
46
  (0, tsoa_1.OperationId)('查询订单支付状态'),
44
47
  (0, tsoa_1.Post)('get-order-pay-status'),
@@ -54,6 +57,11 @@ __decorate([
54
57
  (0, tsoa_1.Post)('count-order-by-status'),
55
58
  __param(0, (0, tsoa_1.Body)())
56
59
  ], OrderQueryByUserService.prototype, "countOrderByStatus", null);
60
+ __decorate([
61
+ (0, tsoa_1.OperationId)('查询订单申请退款方式'),
62
+ (0, tsoa_1.Post)('get-order-apply-refund'),
63
+ __param(0, (0, tsoa_1.Body)())
64
+ ], OrderQueryByUserService.prototype, "getOrderApplyRefund", null);
57
65
  OrderQueryByUserService = __decorate([
58
66
  (0, tsoa_1.Route)('pos/query/user'),
59
67
  (0, tsoa_1.Tags)('PosOrderQuery')
@@ -4,7 +4,9 @@ import BaseService from '../../BaseService';
4
4
  declare class OrderQueryByWebService extends BaseService {
5
5
  protected prefixUrl: string;
6
6
  orderList(request: PosOrderQueryService.ByWeb.Request.IOrderList): Promise<DTO.PosQueryResult[]>;
7
+ list(request: PosOrderQueryService.ByWeb.Request.IOrderList): Promise<PosOrderQueryService.ByWeb.Response.IList>;
7
8
  orderById(request: PosOrderQueryService.ByWeb.Request.IOrderById): Promise<DTO.PosQueryResult>;
9
+ orderDetail(request: PosOrderQueryService.ByWeb.Request.IOrderDetail): Promise<PosOrderQueryService.ByWeb.Response.IOrderDetail>;
8
10
  }
9
11
  export declare const queryByWebService: OrderQueryByWebService;
10
12
  export default queryByWebService;
@@ -24,20 +24,36 @@ let OrderQueryByWebService = class OrderQueryByWebService extends BaseService_1.
24
24
  orderList(request) {
25
25
  return (0, http_1.callApi)(this.getApiUrl(this.orderList), request);
26
26
  }
27
+ list(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.list), request);
29
+ }
27
30
  orderById(request) {
28
31
  return (0, http_1.callApi)(this.getApiUrl(this.orderById), request);
29
32
  }
33
+ orderDetail(request) {
34
+ return (0, http_1.callApi)(this.getApiUrl(this.orderDetail), request);
35
+ }
30
36
  };
31
37
  __decorate([
32
38
  (0, tsoa_1.OperationId)('订单列表查询'),
33
39
  (0, tsoa_1.Post)('order-list'),
34
40
  __param(0, (0, tsoa_1.Body)())
35
41
  ], OrderQueryByWebService.prototype, "orderList", null);
42
+ __decorate([
43
+ (0, tsoa_1.OperationId)('查询订单列表list'),
44
+ (0, tsoa_1.Post)('list'),
45
+ __param(0, (0, tsoa_1.Body)())
46
+ ], OrderQueryByWebService.prototype, "list", null);
36
47
  __decorate([
37
48
  (0, tsoa_1.OperationId)('订单按ID查询'),
38
49
  (0, tsoa_1.Post)('order-by-id'),
39
50
  __param(0, (0, tsoa_1.Body)())
40
51
  ], OrderQueryByWebService.prototype, "orderById", null);
52
+ __decorate([
53
+ (0, tsoa_1.OperationId)('订单详情查询'),
54
+ (0, tsoa_1.Post)('order-detail'),
55
+ __param(0, (0, tsoa_1.Body)())
56
+ ], OrderQueryByWebService.prototype, "orderDetail", null);
41
57
  OrderQueryByWebService = __decorate([
42
58
  (0, tsoa_1.Route)('pos/query/web'),
43
59
  (0, tsoa_1.Tags)('PosOrderQuery')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-trade-service-node-sdk",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "EcommerceTradeService Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",