@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.
@@ -2746,35 +2746,38 @@ const DisposalServices = {
2746
2746
  }
2747
2747
  };
2748
2748
  const API$5 = createAxiosInstance({
2749
- prefix: "/v2/planning-strategy"
2749
+ prefix: "/planning-strategy/risk-register"
2750
2750
  });
2751
2751
  const RiskRegisterServices = {
2752
- getRisk: (params) => {
2753
- return API$5.get("", { params });
2752
+ getActiveRisk: (params) => {
2753
+ return API$5.post("/active/list", params);
2754
2754
  },
2755
- getRiskLogs: (id) => {
2756
- return API$5.get(`/risk-log/${id}`);
2755
+ getActiveRiskOptions: (params) => {
2756
+ return API$5.post("/active/options", params);
2757
2757
  },
2758
- getRiskOptions: (params) => {
2759
- return API$5.get("/options", { params });
2758
+ getClosedRisk: (params) => {
2759
+ return API$5.post("/closed/list", params);
2760
2760
  },
2761
- getRiskReview: (id) => {
2762
- return API$5.get(`/risk-review/${id}`);
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.put(`/${id}`, data);
2768
+ return API$5.patch(`/${id}`, data);
2769
2769
  },
2770
2770
  cancelRisk: (id, data) => {
2771
- return API$5.put(`/${id}/cancel`, data);
2771
+ return API$5.patch(`/${id}/cancel`, data);
2772
+ },
2773
+ reviewRisk: (id, data) => {
2774
+ return API$5.patch(`/${id}/review`, data);
2772
2775
  },
2773
- verifyRisk: (id, data) => {
2774
- return API$5.put(`/${id}/verify`, data);
2776
+ completeRisk: (id, data) => {
2777
+ return API$5.patch(`/${id}/complete`, data);
2775
2778
  },
2776
- reopenRisk: (id, data) => {
2777
- return API$5.put(`/${id}/reopen`, data);
2779
+ getRiskLogs: (id) => {
2780
+ return API$5.get(`/${id}/log`);
2778
2781
  }
2779
2782
  };
2780
2783
  const API$4 = createAxiosInstance({
@@ -2754,35 +2754,38 @@ System.register(["axios"], function(exports, module) {
2754
2754
  }
2755
2755
  });
2756
2756
  const API$5 = createAxiosInstance({
2757
- prefix: "/v2/planning-strategy"
2757
+ prefix: "/planning-strategy/risk-register"
2758
2758
  });
2759
2759
  const RiskRegisterServices = exports("RiskRegisterServices", {
2760
- getRisk: (params) => {
2761
- return API$5.get("", { params });
2760
+ getActiveRisk: (params) => {
2761
+ return API$5.post("/active/list", params);
2762
2762
  },
2763
- getRiskLogs: (id) => {
2764
- return API$5.get(`/risk-log/${id}`);
2763
+ getActiveRiskOptions: (params) => {
2764
+ return API$5.post("/active/options", params);
2765
2765
  },
2766
- getRiskOptions: (params) => {
2767
- return API$5.get("/options", { params });
2766
+ getClosedRisk: (params) => {
2767
+ return API$5.post("/closed/list", params);
2768
2768
  },
2769
- getRiskReview: (id) => {
2770
- return API$5.get(`/risk-review/${id}`);
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.put(`/${id}`, data);
2776
+ return API$5.patch(`/${id}`, data);
2777
2777
  },
2778
2778
  cancelRisk: (id, data) => {
2779
- return API$5.put(`/${id}/cancel`, data);
2779
+ return API$5.patch(`/${id}/cancel`, data);
2780
+ },
2781
+ reviewRisk: (id, data) => {
2782
+ return API$5.patch(`/${id}/review`, data);
2780
2783
  },
2781
- verifyRisk: (id, data) => {
2782
- return API$5.put(`/${id}/verify`, data);
2784
+ completeRisk: (id, data) => {
2785
+ return API$5.patch(`/${id}/complete`, data);
2783
2786
  },
2784
- reopenRisk: (id, data) => {
2785
- return API$5.put(`/${id}/reopen`, data);
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.3-alpha.103",
3
+ "version": "1.0.3-alpha.105",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -1,19 +1,36 @@
1
1
  import { QueryParams } from '../types/fetchResponse.type';
2
- export interface GetRiskQuery extends QueryParams {
3
- page?: string;
4
- limit?: string;
5
- sortBy?: string;
6
- sortOrder?: string;
7
- search?: string;
8
- type?: string;
9
- status?: boolean;
10
- dataType?: string;
11
- isRequired?: string;
12
- category?: string;
13
- _id?: string;
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
- category?: boolean;
17
- riskLevel?: boolean;
18
- status?: boolean;
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, RiskOptions, RiskReview, RiskType } from '../types/risk.type';
2
+ import { ActiveRiskType, CancelForm, ClosedRiskType, RiskForm, RiskLog, RiskReview } from '../types/risk.type';
3
3
  import { FetchDetailResponse, FetchListResponse, FetchResponse } from '../types/fetchResponse.type';
4
- import { GetRiskOptionsQuery, GetRiskQuery } from '../dto/riskRegister.dto';
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
- getRisk: (params: GetRiskQuery) => Promise<AxiosResponse<FetchListResponse<RiskType>>>;
7
- getRiskLogs: (id: string) => Promise<AxiosResponse<FetchDetailResponse<RiskLog[]>>>;
8
- getRiskOptions: (params: GetRiskOptionsQuery) => Promise<AxiosResponse<FetchDetailResponse<RiskOptions>>>;
9
- getRiskReview: (id: string) => Promise<AxiosResponse<FetchDetailResponse<RiskReview>>>;
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
- verifyRisk: (id: string, data: RiskReview) => Promise<AxiosResponse<FetchResponse>>;
14
- reopenRisk: (id: string, data: RiskReview) => Promise<AxiosResponse<FetchResponse>>;
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;
@@ -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
- export interface RiskType {
4
+ type BaseRisk = {
6
5
  _id: string;
7
- riskName: string;
6
+ riskId: string;
7
+ risk: string;
8
8
  cause: string;
9
9
  impact: string;
10
- category: Category;
10
+ category: string;
11
11
  likelihoodSeverity: number;
12
12
  impactSeverity: number;
13
- riskLevel: RiskLevel;
13
+ riskLevel: string;
14
14
  mitigation: string;
15
15
  targetDate: string;
16
- status: Status;
17
- personInCharge: string;
18
- lastModified: string;
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 RiskReview extends Omit<RiskType, 'likelihoodSeverity' | 'impactSeverity' | 'targetDate' | 'status' | 'lastModified'> {
21
- proofDocument: File;
22
- note?: string;
23
- reopenNote?: string;
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
- riskName: string;
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: Category;
41
+ category: string;
31
42
  likelihoodSeverity: number;
32
43
  impactSeverity: number;
33
44
  mitigation: string;
45
+ pic: string;
34
46
  targetDate: string;
35
- createdBy: string;
36
- personInCharge: string;
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
- riskName: string;
52
+ risk: string;
47
53
  cause: string;
48
54
  impact: string;
49
55
  mitigation: string;
50
- category: Category;
56
+ category: string;
51
57
  likelihoodSeverity: number;
52
58
  impactSeverity: number;
53
59
  targetDate: string;
54
- personInCharge?: string;
55
- note?: string;
60
+ pic: string;
56
61
  }
57
62
  export interface CancelForm {
58
- note: string;
63
+ notes: string;
59
64
  }
65
+ export {};
@@ -56,12 +56,12 @@ export interface SAMPDetail {
56
56
  legalAndRegulatoryReqirements: string;
57
57
  }
58
58
  export interface SAMPOptions {
59
- status?: Option[];
60
- action?: Option[];
61
- sampId?: Option[];
62
- version?: Option[];
63
- modifiedBy?: Option[];
64
- category?: Option[];
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;