@be-link/pos-cli-nodejs 1.0.229 → 1.0.231
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/package.json +1 -1
- package/pos/modules/orderAbnormalFollow/service.d.ts +2 -1
- package/pos/modules/orderAbnormalFollow/service.js +3 -0
- package/pos/modules/orderAbnormalFollow/service.test.d.ts +1 -0
- package/pos/modules/orderAbnormalFollow/service.test.js +72 -0
- package/pos/modules/orderAbnormalFollow/types.d.ts +24 -2
package/package.json
CHANGED
|
@@ -4,10 +4,11 @@ declare class OrderAbnormalFollowService extends BaseService implements Service.
|
|
|
4
4
|
protected prefixUrl: string;
|
|
5
5
|
upsertFollow(request: Service.Request.upsertFollow): Promise<void>;
|
|
6
6
|
listByOrderIds(request: Service.Request.listByOrderIds): Promise<Service.Response.listByOrderIds>;
|
|
7
|
+
listActiveByFollowUnionIds(request: Service.Request.listActiveByFollowUnionIds): Promise<Service.Response.listActiveByFollowUnionIds>;
|
|
7
8
|
markUserReminded(request: Service.Request.markUserReminded): Promise<boolean>;
|
|
8
9
|
createHotelChangeFollow(request: Service.Request.createHotelChangeFollow): Promise<void>;
|
|
9
10
|
updateHotelChangeNotifyStatus(request: Service.Request.updateHotelChangeNotifyStatus): Promise<void>;
|
|
10
|
-
softDelete(request: Service.Request.softDelete): Promise<
|
|
11
|
+
softDelete(request: Service.Request.softDelete): Promise<boolean>;
|
|
11
12
|
countByTypeInScope(request: Service.Request.countByTypeInScope): Promise<number>;
|
|
12
13
|
}
|
|
13
14
|
declare const orderAbnormalFollowService: OrderAbnormalFollowService;
|
|
@@ -16,6 +16,9 @@ class OrderAbnormalFollowService extends service_1.default {
|
|
|
16
16
|
listByOrderIds(request) {
|
|
17
17
|
return (0, http_1.callApi)(this.getApiUrl(this.listByOrderIds), request);
|
|
18
18
|
}
|
|
19
|
+
listActiveByFollowUnionIds(request) {
|
|
20
|
+
return (0, http_1.callApi)(this.getApiUrl(this.listActiveByFollowUnionIds), request);
|
|
21
|
+
}
|
|
19
22
|
markUserReminded(request) {
|
|
20
23
|
return (0, http_1.callApi)(this.getApiUrl(this.markUserReminded), request);
|
|
21
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
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
|
+
jest.mock('../../http', () => ({
|
|
16
|
+
callApi: jest.fn(),
|
|
17
|
+
}));
|
|
18
|
+
const http_1 = require("../../http");
|
|
19
|
+
const service_1 = __importDefault(require("./service"));
|
|
20
|
+
const mockedCallApi = http_1.callApi;
|
|
21
|
+
describe('OrderAbnormalFollowService', () => {
|
|
22
|
+
beforeEach(() => {
|
|
23
|
+
mockedCallApi.mockReset();
|
|
24
|
+
mockedCallApi.mockResolvedValue(undefined);
|
|
25
|
+
});
|
|
26
|
+
it.each([
|
|
27
|
+
['upsertFollow', { orderId: 'order-1', abnormalType: 'REJECTED' }, 'upsert-follow'],
|
|
28
|
+
['listByOrderIds', { orderIds: ['order-1'] }, 'list-by-order-ids'],
|
|
29
|
+
[
|
|
30
|
+
'listActiveByFollowUnionIds',
|
|
31
|
+
{ followUnionIds: ['sales-1'], pageIndex: 0, pageSize: 20 },
|
|
32
|
+
'list-active-by-follow-union-ids',
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
'markUserReminded',
|
|
36
|
+
{
|
|
37
|
+
orderId: 'order-1',
|
|
38
|
+
abnormalType: 'HOTEL_ORDER_CHANGE',
|
|
39
|
+
followUnionId: 'sales-1',
|
|
40
|
+
changeFlowId: 'flow-1',
|
|
41
|
+
},
|
|
42
|
+
'mark-user-reminded',
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
'createHotelChangeFollow',
|
|
46
|
+
{
|
|
47
|
+
orderId: 'order-1',
|
|
48
|
+
followUnionId: 'sales-1',
|
|
49
|
+
changeFlowId: 'flow-1',
|
|
50
|
+
changeType: 'CHANGE_RESCHEDULE_ROOM',
|
|
51
|
+
changeStatus: 'SUCCEED',
|
|
52
|
+
changeContent: '改期',
|
|
53
|
+
processedAt: 1,
|
|
54
|
+
},
|
|
55
|
+
'create-hotel-change-follow',
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
'softDelete',
|
|
59
|
+
{
|
|
60
|
+
orderId: 'order-1',
|
|
61
|
+
abnormalType: 'HOTEL_ORDER_CHANGE',
|
|
62
|
+
followUnionId: 'sales-1',
|
|
63
|
+
changeFlowId: 'flow-1',
|
|
64
|
+
},
|
|
65
|
+
'soft-delete',
|
|
66
|
+
],
|
|
67
|
+
['countByTypeInScope', { followUnionIds: ['sales-1'], abnormalType: 'REJECTED' }, 'count-by-type-in-scope'],
|
|
68
|
+
])('%s 映射到 abnormal-follow kebab URL 并原样序列化请求', (method, request, path) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
yield service_1.default[method](request);
|
|
70
|
+
expect(mockedCallApi).toHaveBeenCalledWith(expect.stringMatching(new RegExp(`/abnormal-follow/${path}$`)), request);
|
|
71
|
+
}));
|
|
72
|
+
});
|
|
@@ -9,14 +9,26 @@ export declare namespace Service {
|
|
|
9
9
|
status?: FollowStatus;
|
|
10
10
|
followUnionId?: string;
|
|
11
11
|
remindedAt?: number;
|
|
12
|
+
/** 酒店变更一单多卡时定位具体变更流;普通异常不传 */
|
|
13
|
+
changeFlowId?: string;
|
|
12
14
|
}
|
|
13
15
|
interface listByOrderIds {
|
|
14
16
|
orderIds: string[];
|
|
15
17
|
}
|
|
18
|
+
/** 按异常负责人查询仍有效的异常记录,用于异常工作台最小可见范围。 */
|
|
19
|
+
interface listActiveByFollowUnionIds {
|
|
20
|
+
followUnionIds: string[];
|
|
21
|
+
abnormalTypes?: AbnormalType[];
|
|
22
|
+
pageIndex: number;
|
|
23
|
+
pageSize: number;
|
|
24
|
+
}
|
|
16
25
|
interface markUserReminded {
|
|
17
26
|
orderId: string;
|
|
18
27
|
abnormalType: AbnormalType.APPEND_FAILED | AbnormalType.UPCOMING | AbnormalType.HOTEL_ORDER_CHANGE;
|
|
19
|
-
|
|
28
|
+
/** 异常负责人授权分支传入;既有常规订单权限分支可省略。 */
|
|
29
|
+
followUnionId?: string;
|
|
30
|
+
/** 酒店订单变更一单多卡时必须传入。 */
|
|
31
|
+
changeFlowId?: string;
|
|
20
32
|
}
|
|
21
33
|
interface createHotelChangeFollow {
|
|
22
34
|
orderId: string;
|
|
@@ -43,6 +55,10 @@ export declare namespace Service {
|
|
|
43
55
|
interface softDelete {
|
|
44
56
|
orderId: string;
|
|
45
57
|
abnormalType: AbnormalType;
|
|
58
|
+
/** 异常负责人授权分支传入;既有常规订单权限分支可省略。 */
|
|
59
|
+
followUnionId?: string;
|
|
60
|
+
/** 酒店订单变更一单多卡时必须传入。 */
|
|
61
|
+
changeFlowId?: string;
|
|
46
62
|
}
|
|
47
63
|
interface countByTypeInScope {
|
|
48
64
|
followUnionIds: string[];
|
|
@@ -51,6 +67,7 @@ export declare namespace Service {
|
|
|
51
67
|
}
|
|
52
68
|
namespace Response {
|
|
53
69
|
type listByOrderIds = DTO.IOrderAbnormalFollowRow[];
|
|
70
|
+
type listActiveByFollowUnionIds = DTO.IOrderAbnormalFollowRow[];
|
|
54
71
|
type countByTypeInScope = number;
|
|
55
72
|
}
|
|
56
73
|
interface OrderAbnormalFollowController {
|
|
@@ -64,6 +81,11 @@ export declare namespace Service {
|
|
|
64
81
|
* @path /abnormal-follow/list-by-order-ids
|
|
65
82
|
*/
|
|
66
83
|
listByOrderIds(request: Request.listByOrderIds): Promise<Response.listByOrderIds>;
|
|
84
|
+
/**
|
|
85
|
+
* 按异常负责人查询仍有效的异常记录
|
|
86
|
+
* @path /abnormal-follow/list-active-by-follow-union-ids
|
|
87
|
+
*/
|
|
88
|
+
listActiveByFollowUnionIds(request: Request.listActiveByFollowUnionIds): Promise<Response.listActiveByFollowUnionIds>;
|
|
67
89
|
/**
|
|
68
90
|
* 标记已提醒用户
|
|
69
91
|
* @path /abnormal-follow/mark-user-reminded
|
|
@@ -79,7 +101,7 @@ export declare namespace Service {
|
|
|
79
101
|
* 软删除跟进记录
|
|
80
102
|
* @path /abnormal-follow/soft-delete
|
|
81
103
|
*/
|
|
82
|
-
softDelete(request: Request.softDelete): Promise<
|
|
104
|
+
softDelete(request: Request.softDelete): Promise<boolean>;
|
|
83
105
|
/**
|
|
84
106
|
* 按范围统计异常跟进数量
|
|
85
107
|
* @path /abnormal-follow/count-by-type-in-scope
|