@tagsamurai/fats-api-services 1.0.3-alpha.43 → 1.0.3-alpha.44
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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QueryParams } from '../types/fetchResponse.type';
|
|
2
|
+
import { Option } from '../types/options.type';
|
|
3
|
+
export interface GetDocumentParams extends QueryParams {
|
|
4
|
+
page?: string;
|
|
5
|
+
limit?: string;
|
|
6
|
+
sortBy?: string;
|
|
7
|
+
sortOrder?: string;
|
|
8
|
+
search?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GetDocumentOptionsParams {
|
|
11
|
+
typeOptions?: boolean;
|
|
12
|
+
roleAccessOptions?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface DocumentOptions {
|
|
15
|
+
typeOptions: Option[];
|
|
16
|
+
roleAccessOptions: Option[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { DocumentItem, DocumentPayload } from '../types/document.type';
|
|
3
|
+
import { DocumentOptions, GetDocumentOptionsParams, GetDocumentParams } from '../dto/document.dto';
|
|
4
|
+
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
5
|
+
declare const DocumentServices: {
|
|
6
|
+
getAllDocuments: (params: GetDocumentParams) => Promise<AxiosResponse<FetchListResponse<DocumentItem>>>;
|
|
7
|
+
getDocumentOptions: (params: GetDocumentOptionsParams) => Promise<AxiosResponse<FetchListResponse<DocumentOptions>>>;
|
|
8
|
+
addDocument: (data: DocumentPayload) => Promise<AxiosResponse>;
|
|
9
|
+
editDocument: (id: string, data: DocumentPayload) => Promise<AxiosResponse>;
|
|
10
|
+
deleteDocument: (id: string[]) => Promise<AxiosResponse>;
|
|
11
|
+
getDocumentFilterOptions: (params: GetDocumentOptionsParams) => Promise<AxiosResponse<FetchDetailResponse<DocumentOptions>>>;
|
|
12
|
+
};
|
|
13
|
+
export default DocumentServices;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface DocumentItem {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
document: File;
|
|
5
|
+
type: string;
|
|
6
|
+
roleAccess: RoleAccess[];
|
|
7
|
+
lastModified: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DocumentPayload {
|
|
10
|
+
documentName: string;
|
|
11
|
+
documentType: string;
|
|
12
|
+
documentFile: File;
|
|
13
|
+
roleAccess: RoleAccess[];
|
|
14
|
+
}
|
|
15
|
+
export type RoleAccess = 'Borrowing/Assignment Role' | 'Transfer Role' | 'Disposal Role' | 'Audit Role' | 'Maintenance Routine Role' | 'Repair Ticketing Role' | 'Tracking Role';
|