@tagsamurai/fats-api-services 1.0.3-alpha.41 → 1.0.3-alpha.43

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.3-alpha.41",
3
+ "version": "1.0.3-alpha.43",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -0,0 +1,19 @@
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;
14
+ }
15
+ export interface GetRiskOptionsQuery extends QueryParams {
16
+ category?: boolean;
17
+ riskLevel?: boolean;
18
+ status?: boolean;
19
+ }
@@ -0,0 +1,16 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { CancelForm, RiskForm, RiskLog, RiskOptions, RiskReview, RiskType } from '../types/risk.type';
3
+ import { FetchDetailResponse, FetchListResponse, FetchResponse } from '../types/fetchResponse.type';
4
+ import { GetRiskOptionsQuery, GetRiskQuery } from '../dto/riskRegister.dto';
5
+ declare const RiskRegisterServices: {
6
+ getRisk: (params: GetRiskQuery) => Promise<AxiosResponse<FetchListResponse<RiskType>>>;
7
+ getRiskLogs: (id: string) => Promise<AxiosResponse<FetchListResponse<RiskLog[]>>>;
8
+ getRiskOptions: (params: GetRiskOptionsQuery) => Promise<AxiosResponse<FetchDetailResponse<RiskOptions>>>;
9
+ getRiskReview: (id: string) => Promise<AxiosResponse<FetchDetailResponse<RiskReview>>>;
10
+ postRisk: (data: RiskForm) => Promise<AxiosResponse<FetchResponse>>;
11
+ editRisk: (data: RiskForm) => Promise<AxiosResponse<FetchResponse>>;
12
+ cancelRisk: (id: string, data: CancelForm) => Promise<AxiosResponse<FetchResponse>>;
13
+ verifyRisk: (id: string, data: RiskForm) => Promise<AxiosResponse<FetchResponse>>;
14
+ reopenRisk: (id: string, data: RiskForm) => Promise<AxiosResponse<FetchResponse>>;
15
+ };
16
+ export default RiskRegisterServices;
@@ -0,0 +1,55 @@
1
+ import { Option } from './options.type';
2
+ export interface RiskType {
3
+ _id: string;
4
+ riskName: string;
5
+ cause: string;
6
+ impact: string;
7
+ category: 'Operational' | 'Financial' | 'Compliance' | 'Safety' | 'Environment' | 'Technology';
8
+ likelihoodSeverity: number;
9
+ impactSeverity: number;
10
+ riskLevel: 'Low' | 'Medium' | 'High' | 'Critical';
11
+ mitigation: string;
12
+ targetDate: string;
13
+ status: 'Waiting for Review' | 'In Progress' | 'Overdue' | 'Completed' | 'Canceled';
14
+ personInCharge: string;
15
+ lastModified: string;
16
+ }
17
+ export interface RiskReview extends Omit<RiskType, 'likelihoodSeverity' | 'impactSeverity' | 'targetDate' | 'status' | 'lastModified'> {
18
+ proofDocument: File;
19
+ note?: string;
20
+ reopenNote?: string;
21
+ }
22
+ export interface RiskLog {
23
+ _id: string;
24
+ riskName: string;
25
+ cause: string;
26
+ impact: string;
27
+ category: string;
28
+ likelihoodSeverity: number;
29
+ impactSeverity: number;
30
+ mitigation: string;
31
+ targetDate: string;
32
+ personInCharge: string;
33
+ lastModified: string;
34
+ proofDocument?: File;
35
+ note?: string;
36
+ action: 'created' | 'edited';
37
+ }
38
+ export interface RiskOptions {
39
+ category?: Option[];
40
+ }
41
+ export interface RiskForm {
42
+ riskName: string;
43
+ cause: string;
44
+ impact: string;
45
+ mitigation: string;
46
+ category: string;
47
+ likelihoodSeverity: number;
48
+ impactSeverity: number;
49
+ initialDate: string;
50
+ personInCharge?: string;
51
+ note?: string;
52
+ }
53
+ export interface CancelForm {
54
+ note: string;
55
+ }