@tagsamurai/fats-api-services 1.0.3-alpha.103 → 1.0.3-alpha.105
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/api-services.es.js +18 -15
- package/api-services.system.js +18 -15
- package/package.json +1 -1
- package/src/dto/riskRegister.dto.d.ts +32 -15
- package/src/services/riskRegister.service.d.ts +10 -8
- package/src/types/risk.type.d.ts +33 -27
- package/src/types/samp.type.d.ts +6 -6
package/api-services.es.js
CHANGED
|
@@ -2746,35 +2746,38 @@ const DisposalServices = {
|
|
|
2746
2746
|
}
|
|
2747
2747
|
};
|
|
2748
2748
|
const API$5 = createAxiosInstance({
|
|
2749
|
-
prefix: "/
|
|
2749
|
+
prefix: "/planning-strategy/risk-register"
|
|
2750
2750
|
});
|
|
2751
2751
|
const RiskRegisterServices = {
|
|
2752
|
-
|
|
2753
|
-
return API$5.
|
|
2752
|
+
getActiveRisk: (params) => {
|
|
2753
|
+
return API$5.post("/active/list", params);
|
|
2754
2754
|
},
|
|
2755
|
-
|
|
2756
|
-
return API$5.
|
|
2755
|
+
getActiveRiskOptions: (params) => {
|
|
2756
|
+
return API$5.post("/active/options", params);
|
|
2757
2757
|
},
|
|
2758
|
-
|
|
2759
|
-
return API$5.
|
|
2758
|
+
getClosedRisk: (params) => {
|
|
2759
|
+
return API$5.post("/closed/list", params);
|
|
2760
2760
|
},
|
|
2761
|
-
|
|
2762
|
-
return API$5.
|
|
2761
|
+
getClosedRiskOptions: (params) => {
|
|
2762
|
+
return API$5.post("/closed/options", params);
|
|
2763
2763
|
},
|
|
2764
2764
|
postRisk: (data) => {
|
|
2765
2765
|
return API$5.post("", data);
|
|
2766
2766
|
},
|
|
2767
2767
|
editRisk: (id, data) => {
|
|
2768
|
-
return API$5.
|
|
2768
|
+
return API$5.patch(`/${id}`, data);
|
|
2769
2769
|
},
|
|
2770
2770
|
cancelRisk: (id, data) => {
|
|
2771
|
-
return API$5.
|
|
2771
|
+
return API$5.patch(`/${id}/cancel`, data);
|
|
2772
|
+
},
|
|
2773
|
+
reviewRisk: (id, data) => {
|
|
2774
|
+
return API$5.patch(`/${id}/review`, data);
|
|
2772
2775
|
},
|
|
2773
|
-
|
|
2774
|
-
return API$5.
|
|
2776
|
+
completeRisk: (id, data) => {
|
|
2777
|
+
return API$5.patch(`/${id}/complete`, data);
|
|
2775
2778
|
},
|
|
2776
|
-
|
|
2777
|
-
return API$5.
|
|
2779
|
+
getRiskLogs: (id) => {
|
|
2780
|
+
return API$5.get(`/${id}/log`);
|
|
2778
2781
|
}
|
|
2779
2782
|
};
|
|
2780
2783
|
const API$4 = createAxiosInstance({
|
package/api-services.system.js
CHANGED
|
@@ -2754,35 +2754,38 @@ System.register(["axios"], function(exports, module) {
|
|
|
2754
2754
|
}
|
|
2755
2755
|
});
|
|
2756
2756
|
const API$5 = createAxiosInstance({
|
|
2757
|
-
prefix: "/
|
|
2757
|
+
prefix: "/planning-strategy/risk-register"
|
|
2758
2758
|
});
|
|
2759
2759
|
const RiskRegisterServices = exports("RiskRegisterServices", {
|
|
2760
|
-
|
|
2761
|
-
return API$5.
|
|
2760
|
+
getActiveRisk: (params) => {
|
|
2761
|
+
return API$5.post("/active/list", params);
|
|
2762
2762
|
},
|
|
2763
|
-
|
|
2764
|
-
return API$5.
|
|
2763
|
+
getActiveRiskOptions: (params) => {
|
|
2764
|
+
return API$5.post("/active/options", params);
|
|
2765
2765
|
},
|
|
2766
|
-
|
|
2767
|
-
return API$5.
|
|
2766
|
+
getClosedRisk: (params) => {
|
|
2767
|
+
return API$5.post("/closed/list", params);
|
|
2768
2768
|
},
|
|
2769
|
-
|
|
2770
|
-
return API$5.
|
|
2769
|
+
getClosedRiskOptions: (params) => {
|
|
2770
|
+
return API$5.post("/closed/options", params);
|
|
2771
2771
|
},
|
|
2772
2772
|
postRisk: (data) => {
|
|
2773
2773
|
return API$5.post("", data);
|
|
2774
2774
|
},
|
|
2775
2775
|
editRisk: (id, data) => {
|
|
2776
|
-
return API$5.
|
|
2776
|
+
return API$5.patch(`/${id}`, data);
|
|
2777
2777
|
},
|
|
2778
2778
|
cancelRisk: (id, data) => {
|
|
2779
|
-
return API$5.
|
|
2779
|
+
return API$5.patch(`/${id}/cancel`, data);
|
|
2780
|
+
},
|
|
2781
|
+
reviewRisk: (id, data) => {
|
|
2782
|
+
return API$5.patch(`/${id}/review`, data);
|
|
2780
2783
|
},
|
|
2781
|
-
|
|
2782
|
-
return API$5.
|
|
2784
|
+
completeRisk: (id, data) => {
|
|
2785
|
+
return API$5.patch(`/${id}/complete`, data);
|
|
2783
2786
|
},
|
|
2784
|
-
|
|
2785
|
-
return API$5.
|
|
2787
|
+
getRiskLogs: (id) => {
|
|
2788
|
+
return API$5.get(`/${id}/log`);
|
|
2786
2789
|
}
|
|
2787
2790
|
});
|
|
2788
2791
|
const API$4 = createAxiosInstance({
|
package/package.json
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import { QueryParams } from '../types/fetchResponse.type';
|
|
2
|
-
export interface
|
|
3
|
-
page
|
|
4
|
-
limit
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
export interface GetActiveRiskQuery extends QueryParams {
|
|
3
|
+
page: number;
|
|
4
|
+
limit: number;
|
|
5
|
+
search: string;
|
|
6
|
+
sortBy: string;
|
|
7
|
+
sortOrder: number;
|
|
8
|
+
column: string[];
|
|
9
|
+
category: string[];
|
|
10
|
+
riskLevel: number[];
|
|
11
|
+
targetDate: string[];
|
|
12
|
+
status: string[];
|
|
13
|
+
pic: string[];
|
|
14
|
+
updatedAt: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface GetClosedRiskQuery extends QueryParams {
|
|
17
|
+
page: number;
|
|
18
|
+
limit: number;
|
|
19
|
+
search: string;
|
|
20
|
+
sortBy: string;
|
|
21
|
+
sortOrder: number;
|
|
22
|
+
column: string[];
|
|
23
|
+
category: string[];
|
|
24
|
+
riskLevel: number[];
|
|
25
|
+
targetDate: string[];
|
|
26
|
+
completedDate: string[];
|
|
27
|
+
status: string[];
|
|
28
|
+
pic: string[];
|
|
29
|
+
updatedAt: string[];
|
|
14
30
|
}
|
|
15
31
|
export interface GetRiskOptionsQuery extends QueryParams {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
32
|
+
categoryOptions: boolean;
|
|
33
|
+
riskLevelOptions: boolean;
|
|
34
|
+
picOptions: boolean;
|
|
35
|
+
statusOptions: boolean;
|
|
19
36
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { CancelForm, RiskForm, RiskLog,
|
|
2
|
+
import { ActiveRiskType, CancelForm, ClosedRiskType, RiskForm, RiskLog, RiskReview } from '../types/risk.type';
|
|
3
3
|
import { FetchDetailResponse, FetchListResponse, FetchResponse } from '../types/fetchResponse.type';
|
|
4
|
-
import {
|
|
4
|
+
import { GetActiveRiskQuery, GetClosedRiskQuery, GetRiskOptionsQuery } from '../dto/riskRegister.dto';
|
|
5
|
+
import { Option } from '@fewangsit/wangsvue-fats/components/dropdown/Dropdown.vue';
|
|
5
6
|
declare const RiskRegisterServices: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
getActiveRisk: (params: GetActiveRiskQuery) => Promise<AxiosResponse<FetchListResponse<ActiveRiskType>>>;
|
|
8
|
+
getActiveRiskOptions: (params: GetRiskOptionsQuery) => Promise<AxiosResponse<FetchDetailResponse<Option[]>>>;
|
|
9
|
+
getClosedRisk: (params: GetClosedRiskQuery) => Promise<AxiosResponse<FetchListResponse<ClosedRiskType>>>;
|
|
10
|
+
getClosedRiskOptions: (params: GetRiskOptionsQuery) => Promise<AxiosResponse<FetchDetailResponse<Option[]>>>;
|
|
10
11
|
postRisk: (data: RiskForm) => Promise<AxiosResponse<FetchResponse>>;
|
|
11
12
|
editRisk: (id: string, data: RiskForm) => Promise<AxiosResponse<FetchResponse>>;
|
|
12
13
|
cancelRisk: (id: string, data: CancelForm) => Promise<AxiosResponse<FetchResponse>>;
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
reviewRisk: (id: string, data: RiskReview) => Promise<AxiosResponse<FetchResponse>>;
|
|
15
|
+
completeRisk: (id: string, data: FormData) => Promise<AxiosResponse<FetchResponse>>;
|
|
16
|
+
getRiskLogs: (id: string) => Promise<AxiosResponse<FetchDetailResponse<RiskLog[]>>>;
|
|
15
17
|
};
|
|
16
18
|
export default RiskRegisterServices;
|
package/src/types/risk.type.d.ts
CHANGED
|
@@ -1,59 +1,65 @@
|
|
|
1
|
-
import { Option } from './options.type';
|
|
2
1
|
export type Category = 'Operational' | 'Financial' | 'Compliance' | 'Safety' | 'Environment' | 'Technology';
|
|
3
2
|
export type RiskLevel = 'Low' | 'Medium' | 'High' | 'Critical';
|
|
4
3
|
export type Status = 'Waiting for Review' | 'In Progress' | 'Overdue' | 'Completed' | 'Canceled';
|
|
5
|
-
|
|
4
|
+
type BaseRisk = {
|
|
6
5
|
_id: string;
|
|
7
|
-
|
|
6
|
+
riskId: string;
|
|
7
|
+
risk: string;
|
|
8
8
|
cause: string;
|
|
9
9
|
impact: string;
|
|
10
|
-
category:
|
|
10
|
+
category: string;
|
|
11
11
|
likelihoodSeverity: number;
|
|
12
12
|
impactSeverity: number;
|
|
13
|
-
riskLevel:
|
|
13
|
+
riskLevel: string;
|
|
14
14
|
mitigation: string;
|
|
15
15
|
targetDate: string;
|
|
16
|
-
status:
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
status: string;
|
|
17
|
+
pic: {
|
|
18
|
+
_id: string;
|
|
19
|
+
fullName: string;
|
|
20
|
+
};
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
};
|
|
23
|
+
export interface ActiveRiskType extends BaseRisk {
|
|
19
24
|
}
|
|
20
|
-
export interface
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
export interface ClosedRiskType extends BaseRisk {
|
|
26
|
+
completedDate: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RiskReview {
|
|
29
|
+
isVerified: boolean;
|
|
30
|
+
notes: string;
|
|
24
31
|
}
|
|
25
32
|
export interface RiskLog {
|
|
26
33
|
_id: string;
|
|
27
|
-
|
|
34
|
+
activity: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
userFullName: string;
|
|
37
|
+
notes: string;
|
|
38
|
+
risk: string;
|
|
28
39
|
cause: string;
|
|
29
40
|
impact: string;
|
|
30
|
-
category:
|
|
41
|
+
category: string;
|
|
31
42
|
likelihoodSeverity: number;
|
|
32
43
|
impactSeverity: number;
|
|
33
44
|
mitigation: string;
|
|
45
|
+
pic: string;
|
|
34
46
|
targetDate: string;
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
proofDocumentFilePath: string;
|
|
48
|
+
proofDocumentFileName: string;
|
|
37
49
|
createdAt: string;
|
|
38
|
-
proofDocument?: File;
|
|
39
|
-
note?: string;
|
|
40
|
-
action: 'created' | 'edited';
|
|
41
|
-
}
|
|
42
|
-
export interface RiskOptions {
|
|
43
|
-
category?: Option[];
|
|
44
50
|
}
|
|
45
51
|
export interface RiskForm {
|
|
46
|
-
|
|
52
|
+
risk: string;
|
|
47
53
|
cause: string;
|
|
48
54
|
impact: string;
|
|
49
55
|
mitigation: string;
|
|
50
|
-
category:
|
|
56
|
+
category: string;
|
|
51
57
|
likelihoodSeverity: number;
|
|
52
58
|
impactSeverity: number;
|
|
53
59
|
targetDate: string;
|
|
54
|
-
|
|
55
|
-
note?: string;
|
|
60
|
+
pic: string;
|
|
56
61
|
}
|
|
57
62
|
export interface CancelForm {
|
|
58
|
-
|
|
63
|
+
notes: string;
|
|
59
64
|
}
|
|
65
|
+
export {};
|
package/src/types/samp.type.d.ts
CHANGED
|
@@ -56,12 +56,12 @@ export interface SAMPDetail {
|
|
|
56
56
|
legalAndRegulatoryReqirements: string;
|
|
57
57
|
}
|
|
58
58
|
export interface SAMPOptions {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
statusOptions?: Option[];
|
|
60
|
+
actionOptions?: Option[];
|
|
61
|
+
sampIdOptions?: Option[];
|
|
62
|
+
versionOptions?: Option[];
|
|
63
|
+
modifiedByOptions?: Option[];
|
|
64
|
+
categoryOptions?: Option[];
|
|
65
65
|
}
|
|
66
66
|
export interface ContextType {
|
|
67
67
|
_id: string;
|