@be-link/pos-cli-nodejs 0.0.156 → 0.0.158
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/.husky/commit-msg +0 -0
- package/CHANGELOG.md +4 -0
- package/dist/pos/http.js +19 -2
- package/dist/pos/modules/orderCore/service.d.ts +4 -0
- package/dist/pos/modules/orderCore/service.js +9 -0
- package/dist/pos/modules/orderCore/types.d.ts +52 -0
- package/dist/pos/modules/orderFulfill/service.d.ts +2 -0
- package/dist/pos/modules/orderFulfill/service.js +6 -0
- package/dist/pos/modules/orderFulfill/types.d.ts +16 -0
- package/dist/pos/modules/orderJob/service.d.ts +4 -0
- package/dist/pos/modules/orderJob/service.js +12 -0
- package/dist/pos/modules/orderJob/types.d.ts +8 -0
- package/dist/pos/modules/orderQuery/types.d.ts +48 -0
- package/dist/pos/modules/orderQuery/user.d.ts +4 -0
- package/dist/pos/modules/orderQuery/user.js +12 -0
- package/dist/types.d.ts +104 -1
- package/package.json +12 -13
- package/src/pos/modules/orderCore/service.ts +3 -2
- package/dist/README.md +0 -40
- package/dist/package.json +0 -52
package/.husky/commit-msg
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
### [0.0.158](https://github.com/snowmountain-top/pos-cli-nodejs/compare/v0.0.157...v0.0.158) (2024-04-24)
|
|
5
|
+
|
|
6
|
+
### [0.0.157](https://github.com/snowmountain-top/pos-cli-nodejs/compare/v0.0.156...v0.0.157) (2024-04-24)
|
|
7
|
+
|
|
4
8
|
### [0.0.156](https://github.com/snowmountain-top/pos-cli-nodejs/compare/v0.0.114...v0.0.156) (2024-04-24)
|
|
5
9
|
|
|
6
10
|
|
package/dist/pos/http.js
CHANGED
|
@@ -8,13 +8,30 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
8
8
|
const uuid_1 = require("uuid");
|
|
9
9
|
const BizError_1 = __importDefault(require("../errors/BizError"));
|
|
10
10
|
const SystemError_1 = __importDefault(require("../errors/SystemError"));
|
|
11
|
+
const axios_retry_1 = __importDefault(require("axios-retry"));
|
|
12
|
+
const axiosInstance = axios_1.default.create();
|
|
13
|
+
(0, axios_retry_1.default)(axiosInstance, {
|
|
14
|
+
retries: 1,
|
|
15
|
+
retryCondition(error) {
|
|
16
|
+
return error.message.includes('getaddrinfo ENOTFOUND') || [502, 503].includes(error.response.status);
|
|
17
|
+
},
|
|
18
|
+
retryDelay: (retryCount, error) => {
|
|
19
|
+
console.info(`retryCount: ${retryCount}, retryDelay: ${retryCount * 500}`);
|
|
20
|
+
return retryCount * 500;
|
|
21
|
+
},
|
|
22
|
+
onRetry(retryCount, error, requestConfig) {
|
|
23
|
+
console.info(`retryCount: ${retryCount}, onRetry: ${error}, requestHeader: ${JSON.stringify(requestConfig.headers)}`);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
11
26
|
async function callApi(url, ...request) {
|
|
12
27
|
const requestId = (0, uuid_1.v4)();
|
|
13
28
|
try {
|
|
14
29
|
console.info(`准备发起POS请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
|
|
15
|
-
const response = await
|
|
30
|
+
const response = await axiosInstance.post(url, request[0], {
|
|
16
31
|
headers: {
|
|
17
|
-
'X-Request-Id': requestId
|
|
32
|
+
'X-Request-Id': requestId,
|
|
33
|
+
'x-belink-accessType': 'authorizationTokenInside',
|
|
34
|
+
'x-belink-authorization': process.env.authorizationTokenInside || ""
|
|
18
35
|
}
|
|
19
36
|
});
|
|
20
37
|
const responseData = response.data;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Service } from './types';
|
|
2
2
|
import BaseService from '../service';
|
|
3
|
+
import { IPositiveOrderInvoice } from '../../../types';
|
|
3
4
|
declare class OrderCoreService extends BaseService implements Service.OrderCoreController {
|
|
4
5
|
protected prefixUrl: string;
|
|
6
|
+
updateOrderInvoice(request: IPositiveOrderInvoice): Promise<string>;
|
|
7
|
+
orderCreateInvoice(request: IPositiveOrderInvoice): Promise<IPositiveOrderInvoice>;
|
|
5
8
|
onRefundTrigger(request: Service.Request.onRefundTrigger): Promise<void>;
|
|
6
9
|
orderCreate(request: Service.Request.orderCreate): Promise<Service.Response.orderCreate>;
|
|
7
10
|
thirdOrderInfoConfirmed(request: Service.Request.thirdOrderInfoConfirmed): Promise<void>;
|
|
@@ -12,6 +15,7 @@ declare class OrderCoreService extends BaseService implements Service.OrderCoreC
|
|
|
12
15
|
sendOrderPaidNotification(request: Service.Request.sendOrderPaidNotification): Promise<void>;
|
|
13
16
|
orderSettled(request: Service.Request.orderSettled): Promise<void>;
|
|
14
17
|
changeOrderContactInfo(request: Service.Request.changeOrderContactInfo): Promise<void>;
|
|
18
|
+
changeOrderPromotionStatus(request: Service.Request.changeOrderPromotionStatusRequest): Promise<void>;
|
|
15
19
|
}
|
|
16
20
|
declare const orderCoreService: OrderCoreService;
|
|
17
21
|
export default orderCoreService;
|
|
@@ -10,6 +10,12 @@ class OrderCoreService extends service_1.default {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.prefixUrl = '/core';
|
|
12
12
|
}
|
|
13
|
+
updateOrderInvoice(request) {
|
|
14
|
+
return (0, http_1.callApi)(this.getApiUrl(this.updateOrderInvoice), request);
|
|
15
|
+
}
|
|
16
|
+
orderCreateInvoice(request) {
|
|
17
|
+
return (0, http_1.callApi)(this.getApiUrl(this.orderCreateInvoice), request);
|
|
18
|
+
}
|
|
13
19
|
onRefundTrigger(request) {
|
|
14
20
|
return (0, http_1.callApi)(this.getApiUrl(this.onRefundTrigger), request);
|
|
15
21
|
}
|
|
@@ -40,6 +46,9 @@ class OrderCoreService extends service_1.default {
|
|
|
40
46
|
changeOrderContactInfo(request) {
|
|
41
47
|
return (0, http_1.callApi)(this.getApiUrl(this.changeOrderContactInfo), request);
|
|
42
48
|
}
|
|
49
|
+
changeOrderPromotionStatus(request) {
|
|
50
|
+
throw new Error('Method not implemented.');
|
|
51
|
+
}
|
|
43
52
|
}
|
|
44
53
|
const orderCoreService = new OrderCoreService();
|
|
45
54
|
exports.default = orderCoreService;
|
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
import * as PosConstants from 'vitality-meta/enums/pos';
|
|
2
|
+
import * as DTO from '../../../types';
|
|
2
3
|
export declare namespace Service {
|
|
3
4
|
namespace Request {
|
|
5
|
+
interface createOrderInvoice {
|
|
6
|
+
/** 快照:订单ID */
|
|
7
|
+
tradeOrderId?: string;
|
|
8
|
+
/** 开票类型 */
|
|
9
|
+
invoiceType?: string;
|
|
10
|
+
/** 发票抬头 */
|
|
11
|
+
invoiceHeader?: string;
|
|
12
|
+
/** 发票抬头类型 */
|
|
13
|
+
invoiceHeaderType?: string;
|
|
14
|
+
/** 税号 */
|
|
15
|
+
taxNumber?: string;
|
|
16
|
+
/** address */
|
|
17
|
+
address?: string;
|
|
18
|
+
/** 注册电话 */
|
|
19
|
+
mobile?: string;
|
|
20
|
+
/** 开户银行 */
|
|
21
|
+
bankBase?: string;
|
|
22
|
+
/** 银行账号 */
|
|
23
|
+
bankAccount?: string;
|
|
24
|
+
/** 收货地址 */
|
|
25
|
+
receivingExtraInfo?: {
|
|
26
|
+
/** 收货地址 */
|
|
27
|
+
receivingAddress?: string;
|
|
28
|
+
/** 收件人 */
|
|
29
|
+
receivingName?: string;
|
|
30
|
+
/** 收件电话 */
|
|
31
|
+
receivingMobile?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
4
34
|
interface orderCreate {
|
|
5
35
|
/** 基础信息 */
|
|
6
36
|
basicInfo: {
|
|
@@ -158,6 +188,14 @@ export declare namespace Service {
|
|
|
158
188
|
refundOrderId: string;
|
|
159
189
|
positiveOrderId: string;
|
|
160
190
|
}
|
|
191
|
+
interface changeOrderPromotionStatusRequest {
|
|
192
|
+
/** 订单号 */
|
|
193
|
+
orderId: string;
|
|
194
|
+
/** 优惠工具状态映射表 */
|
|
195
|
+
promotionStatusMap: {
|
|
196
|
+
[promotionId: string]: PosConstants.PromotionStatusEnum;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
161
199
|
}
|
|
162
200
|
namespace Response {
|
|
163
201
|
interface orderCreate {
|
|
@@ -183,6 +221,16 @@ export declare namespace Service {
|
|
|
183
221
|
}
|
|
184
222
|
}
|
|
185
223
|
interface OrderCoreController {
|
|
224
|
+
/**
|
|
225
|
+
* 订单发票修改
|
|
226
|
+
* @path /core/update-order-invoice
|
|
227
|
+
*/
|
|
228
|
+
updateOrderInvoice(request: DTO.IPositiveOrderInvoice): Promise<string>;
|
|
229
|
+
/**
|
|
230
|
+
* 订单发票创建
|
|
231
|
+
* @path /core/order-create-invoice
|
|
232
|
+
*/
|
|
233
|
+
orderCreateInvoice(request: Request.createOrderInvoice): Promise<DTO.IPositiveOrderInvoice>;
|
|
186
234
|
/**
|
|
187
235
|
* 订单创建
|
|
188
236
|
* @path /core/order-create
|
|
@@ -233,5 +281,9 @@ export declare namespace Service {
|
|
|
233
281
|
* @path /core/on-refund-trigger
|
|
234
282
|
*/
|
|
235
283
|
onRefundTrigger(request: Request.onRefundTrigger): Promise<void>;
|
|
284
|
+
/**
|
|
285
|
+
* 扭转订单优惠工具状态
|
|
286
|
+
*/
|
|
287
|
+
changeOrderPromotionStatus(request: Request.changeOrderPromotionStatusRequest): Promise<void>;
|
|
236
288
|
}
|
|
237
289
|
}
|
|
@@ -35,6 +35,8 @@ declare class OrderFulfillService extends BaseService implements Service.orderFu
|
|
|
35
35
|
markServiceNoticeAuth(request: Service.Request.markServiceNoticeAuth): Promise<void>;
|
|
36
36
|
mgetSkuChangeCount(request: string[]): Promise<Record<string, number>>;
|
|
37
37
|
markOrderHasSentWXNotification(request: Service.Request.markOrderHasSentWXNotification): Promise<void>;
|
|
38
|
+
markNeedCheckShuttleBus(request: Service.Request.markNeedCheckShuttleBus): Promise<void>;
|
|
39
|
+
cancelNeedCheckShuttleBus(request: Service.Request.cancelNeedCheckShuttleBus): Promise<void>;
|
|
38
40
|
}
|
|
39
41
|
declare const orderFulfillService: OrderFulfillService;
|
|
40
42
|
export default orderFulfillService;
|
|
@@ -106,6 +106,12 @@ class OrderFulfillService extends service_1.default {
|
|
|
106
106
|
markOrderHasSentWXNotification(request) {
|
|
107
107
|
return (0, http_1.callApi)(this.getApiUrl(this.markOrderHasSentWXNotification), request);
|
|
108
108
|
}
|
|
109
|
+
markNeedCheckShuttleBus(request) {
|
|
110
|
+
return (0, http_1.callApi)(this.getApiUrl(this.markNeedCheckShuttleBus), request);
|
|
111
|
+
}
|
|
112
|
+
cancelNeedCheckShuttleBus(request) {
|
|
113
|
+
return (0, http_1.callApi)(this.getApiUrl(this.cancelNeedCheckShuttleBus), request);
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
const orderFulfillService = new OrderFulfillService();
|
|
111
117
|
exports.default = orderFulfillService;
|
|
@@ -254,6 +254,12 @@ export declare namespace Service {
|
|
|
254
254
|
interface getOrderFulfillInfoByOrderId {
|
|
255
255
|
orderId: string;
|
|
256
256
|
}
|
|
257
|
+
interface markNeedCheckShuttleBus {
|
|
258
|
+
orderId: string;
|
|
259
|
+
}
|
|
260
|
+
interface cancelNeedCheckShuttleBus {
|
|
261
|
+
orderId: string;
|
|
262
|
+
}
|
|
257
263
|
}
|
|
258
264
|
namespace Response {
|
|
259
265
|
interface queryItineraryInfoByOrderIdList {
|
|
@@ -472,5 +478,15 @@ export declare namespace Service {
|
|
|
472
478
|
* @path /fulfill/mget-sku-change-count
|
|
473
479
|
*/
|
|
474
480
|
mgetSkuChangeCount(request: string[]): Promise<Record<string, number>>;
|
|
481
|
+
/**
|
|
482
|
+
* 标记需要确认班车信息
|
|
483
|
+
* @path /fulfill/mark-need-check-shuttle-bus
|
|
484
|
+
*/
|
|
485
|
+
markNeedCheckShuttleBus(request: Request.markNeedCheckShuttleBus): Promise<void>;
|
|
486
|
+
/**
|
|
487
|
+
* 标记取消确认班车信息
|
|
488
|
+
* @path /fulfill/cancel-need-check-shuttle-bus
|
|
489
|
+
*/
|
|
490
|
+
cancelNeedCheckShuttleBus(request: Request.cancelNeedCheckShuttleBus): Promise<void>;
|
|
475
491
|
}
|
|
476
492
|
}
|
|
@@ -2,10 +2,12 @@ import BaseService from '../service';
|
|
|
2
2
|
import { Service } from './types';
|
|
3
3
|
declare class OrderJobService extends BaseService implements Service.OrderJobController {
|
|
4
4
|
protected prefixUrl: string;
|
|
5
|
+
jobCreateTourNotifyTask(): Promise<void>;
|
|
5
6
|
jobAutoCompleteOrder(): Promise<void>;
|
|
6
7
|
jobAutoFulfillingOrder(): Promise<void>;
|
|
7
8
|
jobAutoCloseUnpaidOrder(): Promise<void>;
|
|
8
9
|
jobCreateHotelNotifyTask(): Promise<void>;
|
|
10
|
+
jobCreateFarmHouseNotifyTask(): Promise<void>;
|
|
9
11
|
jobCreateOneSecondPartyNotifyTask(): Promise<void>;
|
|
10
12
|
jobSendCommentRemindSms(): Promise<void>;
|
|
11
13
|
jobSendCommentRemindSmsForOneSecondParty(): Promise<void>;
|
|
@@ -16,6 +18,8 @@ declare class OrderJobService extends BaseService implements Service.OrderJobCon
|
|
|
16
18
|
jobNotifyFeishuOfMissingTourItineraryInfo(): Promise<void>;
|
|
17
19
|
jobNotifySupplierPendingOrder(): Promise<void>;
|
|
18
20
|
jobNotifySupplierTomorrowOrder(): Promise<void>;
|
|
21
|
+
jobNotifySupplierInvoiceOrder(): Promise<void>;
|
|
22
|
+
jobNotifyFeishuOfConfirmBus(): Promise<void>;
|
|
19
23
|
}
|
|
20
24
|
declare const orderJobService: OrderJobService;
|
|
21
25
|
export default orderJobService;
|
|
@@ -10,6 +10,9 @@ class OrderJobService extends service_1.default {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.prefixUrl = '/job';
|
|
12
12
|
}
|
|
13
|
+
jobCreateTourNotifyTask() {
|
|
14
|
+
return (0, http_1.callApi)(this.getApiUrl(this.jobCreateTourNotifyTask));
|
|
15
|
+
}
|
|
13
16
|
jobAutoCompleteOrder() {
|
|
14
17
|
return (0, http_1.callApi)(this.getApiUrl(this.jobAutoCompleteOrder));
|
|
15
18
|
}
|
|
@@ -22,6 +25,9 @@ class OrderJobService extends service_1.default {
|
|
|
22
25
|
jobCreateHotelNotifyTask() {
|
|
23
26
|
return (0, http_1.callApi)(this.getApiUrl(this.jobCreateHotelNotifyTask));
|
|
24
27
|
}
|
|
28
|
+
jobCreateFarmHouseNotifyTask() {
|
|
29
|
+
return (0, http_1.callApi)(this.getApiUrl(this.jobCreateFarmHouseNotifyTask));
|
|
30
|
+
}
|
|
25
31
|
jobCreateOneSecondPartyNotifyTask() {
|
|
26
32
|
return (0, http_1.callApi)(this.getApiUrl(this.jobCreateOneSecondPartyNotifyTask));
|
|
27
33
|
}
|
|
@@ -52,6 +58,12 @@ class OrderJobService extends service_1.default {
|
|
|
52
58
|
jobNotifySupplierTomorrowOrder() {
|
|
53
59
|
return (0, http_1.callApi)(this.getApiUrl(this.jobNotifySupplierTomorrowOrder));
|
|
54
60
|
}
|
|
61
|
+
jobNotifySupplierInvoiceOrder() {
|
|
62
|
+
return (0, http_1.callApi)(this.getApiUrl(this.jobNotifySupplierInvoiceOrder));
|
|
63
|
+
}
|
|
64
|
+
jobNotifyFeishuOfConfirmBus() {
|
|
65
|
+
return (0, http_1.callApi)(this.getApiUrl(this.jobNotifyFeishuOfConfirmBus));
|
|
66
|
+
}
|
|
55
67
|
}
|
|
56
68
|
const orderJobService = new OrderJobService();
|
|
57
69
|
exports.default = orderJobService;
|
|
@@ -8,8 +8,12 @@ export declare namespace Service {
|
|
|
8
8
|
jobAutoCloseUnpaidOrder(): Promise<void>;
|
|
9
9
|
/** 每天两点创建企微群发任务(酒店订单) */
|
|
10
10
|
jobCreateHotelNotifyTask(): Promise<void>;
|
|
11
|
+
/** 每天两点创建企微群发任务(农家乐订单) */
|
|
12
|
+
jobCreateFarmHouseNotifyTask(): Promise<void>;
|
|
11
13
|
/** 每天两点创建企微群发任务(一日聚订单) */
|
|
12
14
|
jobCreateOneSecondPartyNotifyTask(): Promise<void>;
|
|
15
|
+
/** 每天两点创建企微群发任务(旅游订单) */
|
|
16
|
+
jobCreateTourNotifyTask(): Promise<void>;
|
|
13
17
|
/** 每天下午两点发送昨天出团商品评论提醒短信 */
|
|
14
18
|
jobSendCommentRemindSms(): Promise<void>;
|
|
15
19
|
/** 每天下午8.发送当天出团一日聚商品评论提醒短信 */
|
|
@@ -28,5 +32,9 @@ export declare namespace Service {
|
|
|
28
32
|
jobNotifySupplierPendingOrder(): Promise<void>;
|
|
29
33
|
/** 每天20点通知酒店和一日聚门店查看明日到店的订单 */
|
|
30
34
|
jobNotifySupplierTomorrowOrder(): Promise<void>;
|
|
35
|
+
/** 每天15点通知酒店和一日聚门店处理待开发票的订单 */
|
|
36
|
+
jobNotifySupplierInvoiceOrder(): Promise<void>;
|
|
37
|
+
/** 每天早上10点,出团前5天飞书通知客服再次确认班车 */
|
|
38
|
+
jobNotifyFeishuOfConfirmBus(): Promise<void>;
|
|
31
39
|
}
|
|
32
40
|
}
|
|
@@ -19,6 +19,30 @@ export declare namespace Service {
|
|
|
19
19
|
fulfillAt?: number;
|
|
20
20
|
/** skuId */
|
|
21
21
|
skuIdList?: string[];
|
|
22
|
+
/** 创建时间范围 */
|
|
23
|
+
createdAtRange?: [number, number];
|
|
24
|
+
}
|
|
25
|
+
interface getOrderInvoiceRequest {
|
|
26
|
+
/** 开票状态 */
|
|
27
|
+
invoiceStatus: string;
|
|
28
|
+
/** 开票方 */
|
|
29
|
+
invoiceBase: string;
|
|
30
|
+
page: number;
|
|
31
|
+
limit: number;
|
|
32
|
+
itemIds?: string[];
|
|
33
|
+
tradeOrderId?: string;
|
|
34
|
+
categoryTwoList?: string[];
|
|
35
|
+
/**排序 */
|
|
36
|
+
sort?: {
|
|
37
|
+
/**
|
|
38
|
+
* 创建时间
|
|
39
|
+
*/
|
|
40
|
+
createdAt?: 'ASC' | 'DESC';
|
|
41
|
+
/**
|
|
42
|
+
* 更新时间
|
|
43
|
+
*/
|
|
44
|
+
updatedAt?: 'ASC' | 'DESC';
|
|
45
|
+
};
|
|
22
46
|
}
|
|
23
47
|
interface queryOrderByIdList<K> {
|
|
24
48
|
/** 订单id列表 */
|
|
@@ -643,6 +667,30 @@ export declare namespace Service {
|
|
|
643
667
|
}
|
|
644
668
|
/** 用户维度查询 */
|
|
645
669
|
interface QueryByUserController {
|
|
670
|
+
/**
|
|
671
|
+
* list开票记录
|
|
672
|
+
* @returns 开票记录
|
|
673
|
+
* @path /query/user/list-order-invoice
|
|
674
|
+
*/
|
|
675
|
+
listOrderInvoice(request: Request.getOrderInvoiceRequest): Promise<DTO.IPositiveOrderInvoice[]>;
|
|
676
|
+
/**
|
|
677
|
+
* list开票记录
|
|
678
|
+
* @returns 开票记录
|
|
679
|
+
* @path /query/user/list-order-invoice-count
|
|
680
|
+
*/
|
|
681
|
+
listOrderInvoiceCount(request: Request.getOrderInvoiceRequest): Promise<number>;
|
|
682
|
+
/**
|
|
683
|
+
* 根据订单id查询开票记录
|
|
684
|
+
* @returns 开票记录
|
|
685
|
+
* @path /query/user/get-order-invoice-by-order-id
|
|
686
|
+
*/
|
|
687
|
+
getOrderInvoiceByOrderId(request: any): Promise<DTO.IPositiveOrderInvoice>;
|
|
688
|
+
/**
|
|
689
|
+
* 根据发票 id 查询发票
|
|
690
|
+
* @returns 开票记录
|
|
691
|
+
* @path /query/user/get-order-invoice-by-invoice-id
|
|
692
|
+
*/
|
|
693
|
+
getOrderInvoiceByInvoiceId(request: any): Promise<DTO.IPositiveOrderInvoice>;
|
|
646
694
|
/**
|
|
647
695
|
* 根据订单id查询订单
|
|
648
696
|
* @path /query/user/get-order-by-id
|
|
@@ -3,6 +3,10 @@ import { Service } from './types';
|
|
|
3
3
|
import * as DTO from '../../../types';
|
|
4
4
|
declare class QueryByUserService extends BaseService implements Service.QueryByUserController {
|
|
5
5
|
protected prefixUrl: string;
|
|
6
|
+
listOrderInvoiceCount(request: Service.Request.getOrderInvoiceRequest): Promise<number>;
|
|
7
|
+
listOrderInvoice(request: Service.Request.getOrderInvoiceRequest): Promise<DTO.IPositiveOrderInvoice[]>;
|
|
8
|
+
getOrderInvoiceByOrderId(request: any): Promise<DTO.IPositiveOrderInvoice>;
|
|
9
|
+
getOrderInvoiceByInvoiceId(request: any): Promise<DTO.IPositiveOrderInvoice>;
|
|
6
10
|
getOrderById<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.getOrderById<K>): Promise<DTO.QueryDataRes<K>>;
|
|
7
11
|
queryOrderByIdList<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryOrderByIdList<K>): Promise<DTO.QueryDataRes<K>[]>;
|
|
8
12
|
queryUserOrder<K extends (keyof DTO.QueryDataBlockTypeMap)[]>(request: Service.Request.queryUserOrder<K>): Promise<DTO.QueryDataRes<K>[]>;
|
|
@@ -10,6 +10,18 @@ class QueryByUserService extends service_1.default {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.prefixUrl = '/query/user';
|
|
12
12
|
}
|
|
13
|
+
listOrderInvoiceCount(request) {
|
|
14
|
+
return (0, http_1.callApi)(this.getApiUrl(this.listOrderInvoiceCount), request);
|
|
15
|
+
}
|
|
16
|
+
listOrderInvoice(request) {
|
|
17
|
+
return (0, http_1.callApi)(this.getApiUrl(this.listOrderInvoice), request);
|
|
18
|
+
}
|
|
19
|
+
getOrderInvoiceByOrderId(request) {
|
|
20
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getOrderInvoiceByOrderId), request);
|
|
21
|
+
}
|
|
22
|
+
getOrderInvoiceByInvoiceId(request) {
|
|
23
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getOrderInvoiceByInvoiceId), request);
|
|
24
|
+
}
|
|
13
25
|
getOrderById(request) {
|
|
14
26
|
return (0, http_1.callApi)(this.getApiUrl(this.getOrderById), request);
|
|
15
27
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface IPositiveOrder {
|
|
|
24
24
|
originalFee: number;
|
|
25
25
|
/** 快照:订单实付金额(优惠后金额) */
|
|
26
26
|
actuallyPaidFee: number;
|
|
27
|
-
/** 订单剩余金额 */
|
|
27
|
+
/** 订单剩余金额 *listOrderInvoiceCount */
|
|
28
28
|
remainFee: number;
|
|
29
29
|
/** 快照:归属用户unionId */
|
|
30
30
|
unionId: string;
|
|
@@ -32,6 +32,8 @@ export interface IPositiveOrder {
|
|
|
32
32
|
openId: string;
|
|
33
33
|
/** 快照:来源用户unionId */
|
|
34
34
|
fromUnionId: string;
|
|
35
|
+
/** 快照:专属小管家unionId */
|
|
36
|
+
privateButlerUnionId: string;
|
|
35
37
|
/** 快照:来源用户角色 */
|
|
36
38
|
fromUserRole: string;
|
|
37
39
|
/** 快照:交易主商品一级类目 */
|
|
@@ -88,6 +90,12 @@ export interface IPositiveAttributes {
|
|
|
88
90
|
isAuthSendItineraryInfoSubscribeMessage: boolean;
|
|
89
91
|
/** 出行人是否填写完整 */
|
|
90
92
|
isTouristsCompletely: boolean;
|
|
93
|
+
/** 是否班车信息需要确认 */
|
|
94
|
+
isShuttleBusNeedCheck: boolean;
|
|
95
|
+
/** 快照创建时间 */
|
|
96
|
+
createdAt: number;
|
|
97
|
+
/** 快照更新时间 */
|
|
98
|
+
updatedAt: number;
|
|
91
99
|
}
|
|
92
100
|
export interface CostInclusionJson {
|
|
93
101
|
/** 标题 */
|
|
@@ -246,6 +254,10 @@ export interface IPositiveItemInfo {
|
|
|
246
254
|
settlementPrice: number;
|
|
247
255
|
};
|
|
248
256
|
};
|
|
257
|
+
/** 创建时间 */
|
|
258
|
+
createdAt: number;
|
|
259
|
+
/** 更新时间 */
|
|
260
|
+
updatedAt: number;
|
|
249
261
|
}
|
|
250
262
|
export interface IPositiveSkuInfo {
|
|
251
263
|
/** SKU ID */
|
|
@@ -339,12 +351,34 @@ export interface IPositiveSkuInfo {
|
|
|
339
351
|
settlementPrice: number;
|
|
340
352
|
};
|
|
341
353
|
};
|
|
354
|
+
/** 农家乐 SKU 额外信息 */
|
|
355
|
+
farmHouseExtraInfo?: {
|
|
356
|
+
/** SKU ID */
|
|
357
|
+
_id: string;
|
|
358
|
+
/** SKU 所属商品 ID */
|
|
359
|
+
itemId: string;
|
|
360
|
+
/** SKU 餐饮信息 */
|
|
361
|
+
mealInfo: string;
|
|
362
|
+
/** SKU 是否有下午茶 */
|
|
363
|
+
hasAfternoonTea: number;
|
|
364
|
+
/** SKU 是否有班车 */
|
|
365
|
+
hasShuttleBus: number;
|
|
366
|
+
/** 单房差价信息 */
|
|
367
|
+
singleRoomAdjustmentInfo: {
|
|
368
|
+
salePrice: number;
|
|
369
|
+
settlementPrice: number;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
342
372
|
/** 剩余数量 */
|
|
343
373
|
remainQuantity: number;
|
|
344
374
|
/** 一级类目 */
|
|
345
375
|
categoryOne: string;
|
|
346
376
|
/** 二级类目 */
|
|
347
377
|
categoryTwo: string;
|
|
378
|
+
/** sku快照创建时间 */
|
|
379
|
+
createdAt: number;
|
|
380
|
+
/** sku快照更新时间 */
|
|
381
|
+
updatedAt: number;
|
|
348
382
|
}
|
|
349
383
|
export interface IWxPaymentInfo {
|
|
350
384
|
appId: string;
|
|
@@ -384,6 +418,10 @@ export interface IPositivePaymentInfo {
|
|
|
384
418
|
/** 外部订单 */
|
|
385
419
|
outOrderId?: string;
|
|
386
420
|
};
|
|
421
|
+
/** 支付交易创建时间 */
|
|
422
|
+
createdAt: number;
|
|
423
|
+
/** 支付交易更新时间 */
|
|
424
|
+
updatedAt: number;
|
|
387
425
|
}
|
|
388
426
|
export interface CouponSnapShotInfo {
|
|
389
427
|
/** 优惠券Id */
|
|
@@ -423,6 +461,12 @@ export interface IPositivePromotionInfo {
|
|
|
423
461
|
reduce: number;
|
|
424
462
|
/** 与营销关联的优惠券的快照信息。 */
|
|
425
463
|
snapShotInfo: CouponSnapShotInfo;
|
|
464
|
+
/** 营销记录创建时间 */
|
|
465
|
+
createdAt: number;
|
|
466
|
+
/** 营销记录更新时间 */
|
|
467
|
+
updatedAt: number;
|
|
468
|
+
/** 优惠工具状态 */
|
|
469
|
+
status: PosConstants.PromotionStatusEnum;
|
|
426
470
|
}
|
|
427
471
|
export interface IPositiveItineraryInfo {
|
|
428
472
|
_id: string;
|
|
@@ -672,6 +716,7 @@ export interface IRawOrderStructure {
|
|
|
672
716
|
hasSentWXNotification: number;
|
|
673
717
|
isAuthSendItineraryInfoSubscribeMessage: number;
|
|
674
718
|
isTouristsCompletely: number;
|
|
719
|
+
isShuttleBusNeedCheck: number;
|
|
675
720
|
};
|
|
676
721
|
commodityInfo?: (IPositiveItemInfo & {
|
|
677
722
|
skus: IPositiveSkuInfo[];
|
|
@@ -714,6 +759,11 @@ export interface IMessagePayload {
|
|
|
714
759
|
toStatus: string;
|
|
715
760
|
unionId: string;
|
|
716
761
|
}
|
|
762
|
+
export interface IFulfillingMessagePayload {
|
|
763
|
+
orderId: string;
|
|
764
|
+
eventTime: number;
|
|
765
|
+
unionId: string;
|
|
766
|
+
}
|
|
717
767
|
export interface IMessageHeader {
|
|
718
768
|
categoryOne: string;
|
|
719
769
|
categoryTwo: string;
|
|
@@ -810,6 +860,59 @@ export interface QueryDataBlockTypeMap {
|
|
|
810
860
|
/** 营销信息 */
|
|
811
861
|
promotionInfo: IPositivePromotionInfo[];
|
|
812
862
|
}
|
|
863
|
+
export interface IPositiveOrderInvoice {
|
|
864
|
+
/** ID */
|
|
865
|
+
id?: string;
|
|
866
|
+
/** itemId */
|
|
867
|
+
itemId?: string;
|
|
868
|
+
/** status */
|
|
869
|
+
status?: string;
|
|
870
|
+
/** 创建时间 */
|
|
871
|
+
createdAt?: number;
|
|
872
|
+
/** 更新时间 */
|
|
873
|
+
updatedAt?: number;
|
|
874
|
+
/** 是否删除 0否1是 */
|
|
875
|
+
isDeleted?: number;
|
|
876
|
+
/** 快照:订单ID */
|
|
877
|
+
tradeOrderId?: string;
|
|
878
|
+
/** 开票类型 */
|
|
879
|
+
invoiceType?: string;
|
|
880
|
+
/** 发票抬头 */
|
|
881
|
+
invoiceHeader?: string;
|
|
882
|
+
/** 发票抬头类型 */
|
|
883
|
+
invoiceHeaderType?: string;
|
|
884
|
+
/** 税号 */
|
|
885
|
+
taxNumber?: string;
|
|
886
|
+
/** address */
|
|
887
|
+
address?: string;
|
|
888
|
+
/** 注册电话 */
|
|
889
|
+
mobile?: string;
|
|
890
|
+
/** 开户银行 */
|
|
891
|
+
bankBase?: string;
|
|
892
|
+
/** 银行账号 */
|
|
893
|
+
bankAccount?: string;
|
|
894
|
+
/** url */
|
|
895
|
+
url?: string;
|
|
896
|
+
/** 开票方 */
|
|
897
|
+
invoiceBase?: string;
|
|
898
|
+
/** 开票金额 */
|
|
899
|
+
invoiceMoney?: number;
|
|
900
|
+
/** 收货地址 */
|
|
901
|
+
receivingExtraInfo?: {
|
|
902
|
+
/** 收货地址 */
|
|
903
|
+
receivingAddress?: string;
|
|
904
|
+
/** 收件人 */
|
|
905
|
+
receivingName?: string;
|
|
906
|
+
/** 收件电话 */
|
|
907
|
+
receivingMobile?: string;
|
|
908
|
+
};
|
|
909
|
+
/** 商品名称 */
|
|
910
|
+
itemName?: string;
|
|
911
|
+
/** 二级类目*/
|
|
912
|
+
categoryTwo?: string;
|
|
913
|
+
/** 备注 */
|
|
914
|
+
remark?: string;
|
|
915
|
+
}
|
|
813
916
|
/** 订单查询结果 */
|
|
814
917
|
export type QueryDataRes<K extends (keyof QueryDataBlockTypeMap)[]> = {
|
|
815
918
|
[key in K[number]]: QueryDataBlockTypeMap[key];
|
package/package.json
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@be-link/pos-cli-nodejs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.158",
|
|
4
4
|
"description": "正向订单服务Nodejs客户端",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rm -rf ./dist && tsc && cp package.json README.md ./dist/",
|
|
8
|
-
"test": "npx jest",
|
|
9
|
-
"gen-doc": "npx typedoc --options typedoc.json",
|
|
10
|
-
"update:major": "standard-version --release-as major",
|
|
11
|
-
"update:minor": "standard-version --release-as minor",
|
|
12
|
-
"update:patch": "standard-version --release-as patch",
|
|
13
|
-
"update:beta": "standard-version --prerelease beta",
|
|
14
|
-
"publish": "ts-node ./ci/index"
|
|
15
|
-
},
|
|
16
6
|
"repository": {
|
|
17
7
|
"type": "git",
|
|
18
8
|
"url": "git+https://github.com/snowmountain-top/pos-cli-nodejs.git"
|
|
@@ -48,6 +38,15 @@
|
|
|
48
38
|
"axios": "0.27.2",
|
|
49
39
|
"axios-retry": "^4.0.0",
|
|
50
40
|
"uuid": "^9.0.1",
|
|
51
|
-
"vitality-meta": "1.0.
|
|
41
|
+
"vitality-meta": "1.0.74"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "rm -rf ./dist && tsc && cp package.json README.md ./dist/",
|
|
45
|
+
"test": "npx jest",
|
|
46
|
+
"gen-doc": "npx typedoc --options typedoc.json",
|
|
47
|
+
"update:major": "standard-version --release-as major",
|
|
48
|
+
"update:minor": "standard-version --release-as minor",
|
|
49
|
+
"update:patch": "standard-version --release-as patch",
|
|
50
|
+
"update:beta": "standard-version --prerelease beta"
|
|
52
51
|
}
|
|
53
|
-
}
|
|
52
|
+
}
|
|
@@ -5,8 +5,6 @@ import { IPositiveOrderInvoice } from '../../../types'
|
|
|
5
5
|
|
|
6
6
|
class OrderCoreService extends BaseService implements Service.OrderCoreController {
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
8
|
protected prefixUrl: string = '/core'
|
|
11
9
|
updateOrderInvoice(request: IPositiveOrderInvoice): Promise<string> {
|
|
12
10
|
return callApi<Service.OrderCoreController['updateOrderInvoice']>(this.getApiUrl(this.updateOrderInvoice), request)
|
|
@@ -44,6 +42,9 @@ class OrderCoreService extends BaseService implements Service.OrderCoreControlle
|
|
|
44
42
|
changeOrderContactInfo(request: Service.Request.changeOrderContactInfo): Promise<void> {
|
|
45
43
|
return callApi<Service.OrderCoreController['changeOrderContactInfo']>(this.getApiUrl(this.changeOrderContactInfo), request)
|
|
46
44
|
}
|
|
45
|
+
changeOrderPromotionStatus(request: Service.Request.changeOrderPromotionStatusRequest): Promise<void> {
|
|
46
|
+
return callApi<Service.OrderCoreController['changeOrderPromotionStatus']>(this.getApiUrl(this.changeOrderPromotionStatus), request)
|
|
47
|
+
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
const orderCoreService = new OrderCoreService()
|
package/dist/README.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# pos-cli-nodejs
|
|
2
|
-
正向订单服务Nodejs客户端
|
|
3
|
-
|
|
4
|
-
## 安装
|
|
5
|
-
```
|
|
6
|
-
npm install @be-link/pos-cli-nodejs
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## 使用
|
|
10
|
-
|
|
11
|
-
### 配置环境变量
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
CONTAINER_ENV = SFC(云函数) || CLOUD_RUN(云托管)
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
SDK依赖`CONTAINER_ENV`来识别当前运行环境,默认为`SFC`, 请根据使用SDK的环境来配置该变量。
|
|
18
|
-
|
|
19
|
-
当`CONTAINER_ENV`为`SFC`时,SDK会从公网访问POS, 否则使用内网域名(更快, 更安全).
|
|
20
|
-
|
|
21
|
-
### 引入模块
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
// 订单操作类
|
|
25
|
-
import { orderCoreService } from '@be-link/pos-cli-nodejs'
|
|
26
|
-
// 订单履约类
|
|
27
|
-
import { orderFulfillService } from '@be-link/pos-cli-nodejs'
|
|
28
|
-
// 商品维度查询订单
|
|
29
|
-
import { queryByCommodityService } from '@be-link/pos-cli-nodejs'
|
|
30
|
-
// 用户维度查询订单
|
|
31
|
-
import { queryByUserService } from '@be-link/pos-cli-nodejs'
|
|
32
|
-
// 门店维度查询订单
|
|
33
|
-
import { queryByStoreService } from '@be-link/pos-cli-nodejs'
|
|
34
|
-
// web端后台查询订单
|
|
35
|
-
import { queryByWebService } from '@be-link/pos-cli-nodejs'
|
|
36
|
-
// 订单备注类
|
|
37
|
-
import { orderNoteService } from '@be-link/pos-cli-nodejs'
|
|
38
|
-
// 枚举类
|
|
39
|
-
import { PosConstants } from '@be-link/pos-cli-nodejs'
|
|
40
|
-
```
|
package/dist/package.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@be-link/pos-cli-nodejs",
|
|
3
|
-
"version": "0.0.114",
|
|
4
|
-
"description": "正向订单服务Nodejs客户端",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rm -rf ./dist && tsc && cp package.json README.md ./dist/",
|
|
8
|
-
"test": "npx jest",
|
|
9
|
-
"gen-doc": "npx typedoc --options typedoc.json",
|
|
10
|
-
"update:major": "standard-version --release-as major",
|
|
11
|
-
"update:minor": "standard-version --release-as minor",
|
|
12
|
-
"update:patch": "standard-version --release-as patch",
|
|
13
|
-
"update:beta": "standard-version --prerelease beta",
|
|
14
|
-
"publish": "ts-node ./ci/index"
|
|
15
|
-
},
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/snowmountain-top/pos-cli-nodejs.git"
|
|
19
|
-
},
|
|
20
|
-
"author": "dev@8848top.com",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/snowmountain-top/pos-cli-nodejs/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/snowmountain-top/pos-cli-nodejs#readme",
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public",
|
|
28
|
-
"registry": "https://registry.npmjs.org/"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@commitlint/cli": "^18.4.3",
|
|
32
|
-
"@commitlint/config-conventional": "^18.4.3",
|
|
33
|
-
"@types/inquirer": "^9.0.7",
|
|
34
|
-
"@types/jest": "29.5.6",
|
|
35
|
-
"@types/node": "^20.8.9",
|
|
36
|
-
"@types/uuid": "^9.0.6",
|
|
37
|
-
"husky": "^8.0.3",
|
|
38
|
-
"inquirer": "8.2.6",
|
|
39
|
-
"jest": "29.7.0",
|
|
40
|
-
"standard-version": "^9.5.0",
|
|
41
|
-
"ts-jest": "29.1.1",
|
|
42
|
-
"ts-node": "^10.9.2",
|
|
43
|
-
"typedoc": "0.25.2",
|
|
44
|
-
"typedoc-plugin-missing-exports": "2.1.0",
|
|
45
|
-
"typescript": "5.2.2"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"axios": "0.27.2",
|
|
49
|
-
"uuid": "^9.0.1",
|
|
50
|
-
"vitality-meta": "1.0.49"
|
|
51
|
-
}
|
|
52
|
-
}
|