@tagsamurai/fats-api-services 2.0.0-alpha.11 → 2.0.0-alpha.13
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 +57 -30
- package/main.d.ts +1 -0
- package/package.json +1 -1
- package/src/dto/customFieldService.dto.d.ts +28 -0
- package/src/dto/divisionService.dto.d.ts +9 -0
- package/src/dto/fileManagerService.dto.d.ts +3 -0
- package/src/dto/positionService.dto.d.ts +9 -0
- package/src/dto/userService.dto.d.ts +51 -0
- package/src/services/customField.service.d.ts +16 -0
- package/src/services/division.service.d.ts +15 -0
- package/src/services/fileManager.service.d.ts +7 -2
- package/src/services/position.service.d.ts +15 -0
- package/src/services/user.service.d.ts +20 -0
- package/src/types/customFieldService.type.d.ts +19 -0
- package/src/types/divisionService.type.d.ts +12 -0
- package/src/types/fileManagerService.type.d.ts +10 -0
- package/src/types/positionService.type.d.ts +12 -0
- package/src/types/userService.type.d.ts +66 -0
package/api-services.es.js
CHANGED
|
@@ -99,48 +99,48 @@ const getAssetsFile = async (file, type = "excel") => {
|
|
|
99
99
|
);
|
|
100
100
|
return response;
|
|
101
101
|
};
|
|
102
|
-
const API$
|
|
102
|
+
const API$3 = createAxiosInstance({
|
|
103
103
|
prefix: "/fam/settings-attribute/v2"
|
|
104
104
|
});
|
|
105
105
|
const BrandService = {
|
|
106
106
|
getBrandList: (params) => {
|
|
107
|
-
return API$
|
|
107
|
+
return API$3.get("/brands", { params });
|
|
108
108
|
},
|
|
109
109
|
createBrand: (body) => {
|
|
110
|
-
return API$
|
|
110
|
+
return API$3.post("/brands", body);
|
|
111
111
|
},
|
|
112
112
|
deleteBrand: (body) => {
|
|
113
|
-
return API$
|
|
113
|
+
return API$3.delete("/brands", { data: body });
|
|
114
114
|
},
|
|
115
115
|
getBrandOptions: (params) => {
|
|
116
|
-
return API$
|
|
116
|
+
return API$3.get("/brands/options", { params });
|
|
117
117
|
},
|
|
118
118
|
getBrandDropdown: (params) => {
|
|
119
|
-
return API$
|
|
119
|
+
return API$3.get("/brands/dropdown", { params });
|
|
120
120
|
},
|
|
121
121
|
getBrandDetail: (id) => {
|
|
122
|
-
return API$
|
|
122
|
+
return API$3.get(`/brands/${id}`);
|
|
123
123
|
},
|
|
124
124
|
editBrand: (id, body) => {
|
|
125
|
-
return API$
|
|
125
|
+
return API$3.put(`/brands/${id}`, body);
|
|
126
126
|
},
|
|
127
127
|
getBrandListCategory: (id, params) => {
|
|
128
|
-
return API$
|
|
128
|
+
return API$3.get(`/brands/${id}/list-category`, { params });
|
|
129
129
|
},
|
|
130
130
|
getBrandListCategoryOptions: (id, params) => {
|
|
131
|
-
return API$
|
|
131
|
+
return API$3.get(`/brands/${id}/list-category/options`, { params });
|
|
132
132
|
},
|
|
133
133
|
getBrandListAsset: (id, params) => {
|
|
134
|
-
return API$
|
|
134
|
+
return API$3.get(`/brands/${id}/list-asset`, { params });
|
|
135
135
|
},
|
|
136
136
|
getBrandListAssetOptions: (id, params) => {
|
|
137
|
-
return API$
|
|
137
|
+
return API$3.get(`/brands/${id}/list-asset/options`, { params });
|
|
138
138
|
},
|
|
139
139
|
assignCategory: (body) => {
|
|
140
|
-
return API$
|
|
140
|
+
return API$3.put("/brands/assign-category", body);
|
|
141
141
|
},
|
|
142
142
|
unassignCategory: (body) => {
|
|
143
|
-
return API$
|
|
143
|
+
return API$3.put("/brands/unassign-category", body);
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
const isValidJSON = (value) => {
|
|
@@ -165,26 +165,26 @@ const buildBodyParams = (params) => {
|
|
|
165
165
|
});
|
|
166
166
|
return result;
|
|
167
167
|
};
|
|
168
|
-
const API$
|
|
168
|
+
const API$2 = createAxiosInstance({
|
|
169
169
|
prefix: "/v2/analytics-reporting"
|
|
170
170
|
});
|
|
171
171
|
const ChangelogServices = {
|
|
172
172
|
getChangelogList: (params) => {
|
|
173
173
|
const body = buildBodyParams(params);
|
|
174
|
-
return API$
|
|
174
|
+
return API$2.post("/change-log/list", body);
|
|
175
175
|
},
|
|
176
176
|
getChangelogOptions: (body) => {
|
|
177
|
-
return API$
|
|
177
|
+
return API$2.post("/change-log/options", body);
|
|
178
178
|
},
|
|
179
179
|
getSessionLogList: (params) => {
|
|
180
180
|
const body = buildBodyParams(params);
|
|
181
|
-
return API$
|
|
181
|
+
return API$2.post("/session-log/list", body);
|
|
182
182
|
},
|
|
183
183
|
getSessionLogOptions: (body) => {
|
|
184
|
-
return API$
|
|
184
|
+
return API$2.post("/session-log/options", body);
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
const API = createAxiosInstance({
|
|
187
|
+
const API$1 = createAxiosInstance({
|
|
188
188
|
env: "APP_GLOBAL_SETTINGS_API",
|
|
189
189
|
prefix: "/v2/iam/auth"
|
|
190
190
|
});
|
|
@@ -201,13 +201,13 @@ const onRejected = (error) => {
|
|
|
201
201
|
const AuthServices = {
|
|
202
202
|
login: (form) => {
|
|
203
203
|
const body = { ...form, isMobile: false };
|
|
204
|
-
return API.post("/login", body);
|
|
204
|
+
return API$1.post("/login", body);
|
|
205
205
|
},
|
|
206
206
|
reLogin: (body) => {
|
|
207
|
-
API.interceptors.response.use((response) => {
|
|
207
|
+
API$1.interceptors.response.use((response) => {
|
|
208
208
|
return response;
|
|
209
209
|
}, onRejected);
|
|
210
|
-
return API.post("/login", {
|
|
210
|
+
return API$1.post("/login", {
|
|
211
211
|
...body,
|
|
212
212
|
ignoreAccess: true
|
|
213
213
|
// Allow users without access to Global Settings to hit relogin
|
|
@@ -215,32 +215,59 @@ const AuthServices = {
|
|
|
215
215
|
},
|
|
216
216
|
requestOTP: (email) => {
|
|
217
217
|
const body = { email };
|
|
218
|
-
return API.post("/request-otp", body);
|
|
218
|
+
return API$1.post("/request-otp", body);
|
|
219
219
|
},
|
|
220
220
|
requestResetPassLink: (email) => {
|
|
221
221
|
const body = { email };
|
|
222
|
-
return API.post("/request-reset-link", body);
|
|
222
|
+
return API$1.post("/request-reset-link", body);
|
|
223
223
|
},
|
|
224
224
|
setPassword: (body) => {
|
|
225
|
-
return API.post("/set-password", body);
|
|
225
|
+
return API$1.post("/set-password", body);
|
|
226
226
|
},
|
|
227
227
|
verifyToken: (token) => {
|
|
228
|
-
return API.get(`/verify-token/${token}`);
|
|
228
|
+
return API$1.get(`/verify-token/${token}`);
|
|
229
229
|
},
|
|
230
230
|
confirmEmailChange: (token) => {
|
|
231
231
|
const body = { token };
|
|
232
|
-
return API.post("/confirm-email-change", body);
|
|
232
|
+
return API$1.post("/confirm-email-change", body);
|
|
233
233
|
},
|
|
234
234
|
cancelEmailChange: (_id) => {
|
|
235
|
-
return API.delete(`cancel-email-change/${_id}`);
|
|
235
|
+
return API$1.delete(`cancel-email-change/${_id}`);
|
|
236
236
|
},
|
|
237
237
|
postLogout: () => {
|
|
238
|
-
return API.post("/logout");
|
|
238
|
+
return API$1.post("/logout");
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
const API = createAxiosInstance({
|
|
242
|
+
prefix: "/v2/file-manager"
|
|
243
|
+
});
|
|
244
|
+
const FileManagerService = {
|
|
245
|
+
getFileList: (body) => {
|
|
246
|
+
return API.post("/file-manager/list", body);
|
|
247
|
+
},
|
|
248
|
+
getFileOptions: (body) => {
|
|
249
|
+
return API.post("/file-manager/options", body);
|
|
250
|
+
},
|
|
251
|
+
getRecycleBinList: (body) => {
|
|
252
|
+
return API.post("/recycle-bin/list", body);
|
|
253
|
+
},
|
|
254
|
+
getRecycleBinOptions: (body) => {
|
|
255
|
+
return API.post("/recycle-bin/options", body);
|
|
256
|
+
},
|
|
257
|
+
delete: (body) => {
|
|
258
|
+
return API.delete("/file-manager/delete", { params: body });
|
|
259
|
+
},
|
|
260
|
+
deletePermanently: (body) => {
|
|
261
|
+
return API.delete("/recycle-bin/permanently-delete", { params: body });
|
|
262
|
+
},
|
|
263
|
+
recover: (body) => {
|
|
264
|
+
return API.put("/recycle-bin/recover", null, { params: body });
|
|
239
265
|
}
|
|
240
266
|
};
|
|
241
267
|
export {
|
|
242
268
|
BrandService,
|
|
243
269
|
ChangelogServices,
|
|
270
|
+
FileManagerService,
|
|
244
271
|
AuthServices as GlobalAuthServices,
|
|
245
272
|
buildFileURL,
|
|
246
273
|
downloadFile,
|
package/main.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { getAssetsFile, getBaseURL } from './src/utils';
|
|
|
3
3
|
export { default as BrandService } from './src/services/brand.service';
|
|
4
4
|
export { default as ChangelogServices } from './src/services/changelog.service';
|
|
5
5
|
export { default as GlobalAuthServices } from './src/services/globalAuth.service';
|
|
6
|
+
export { default as FileManagerService } from './src/services/fileManager.service';
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TableParams } from './dataTable.dto';
|
|
2
|
+
export type CreateCustomFieldBody = {
|
|
3
|
+
isRequired: boolean;
|
|
4
|
+
name: string;
|
|
5
|
+
dataType: string;
|
|
6
|
+
optionValue?: string[];
|
|
7
|
+
};
|
|
8
|
+
export type EditCustomFieldBody = {
|
|
9
|
+
isRequired: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
dataType: string;
|
|
12
|
+
optionValue?: string[];
|
|
13
|
+
};
|
|
14
|
+
export type SetActiveCustomFieldBody = {
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
ids: string[];
|
|
17
|
+
};
|
|
18
|
+
export type DeleteCustomFieldBody = {
|
|
19
|
+
ids: string[];
|
|
20
|
+
};
|
|
21
|
+
export type CustomFieldOptionsQueryParams = {
|
|
22
|
+
dataTypeOptions?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type GetCustomFieldListQueryParams = TableParams & {
|
|
25
|
+
isActive?: boolean[] | null;
|
|
26
|
+
dataType?: string[] | null;
|
|
27
|
+
isRequired?: string[] | null;
|
|
28
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TableParams } from './dataTable.dto';
|
|
2
|
+
export type CreateUserBody = {
|
|
3
|
+
profilePicture?: File | string;
|
|
4
|
+
firstName: string;
|
|
5
|
+
lastName: string;
|
|
6
|
+
positionId?: string;
|
|
7
|
+
divisionId: string;
|
|
8
|
+
employeeId?: string;
|
|
9
|
+
email: string;
|
|
10
|
+
access: string;
|
|
11
|
+
expiryDate?: string;
|
|
12
|
+
tag?: string;
|
|
13
|
+
customFields?: {
|
|
14
|
+
_id: string;
|
|
15
|
+
value: string | string[];
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
export type EditUserBody = CreateUserBody;
|
|
19
|
+
export type UserOptionsQueryParams = {
|
|
20
|
+
isActiveOptions?: boolean;
|
|
21
|
+
positionOptions?: boolean;
|
|
22
|
+
divisionOptions?: boolean;
|
|
23
|
+
modifiedByOptions?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type EditUserFcmTokenBody = {
|
|
26
|
+
data: {
|
|
27
|
+
userId: string;
|
|
28
|
+
token: string;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
export type ResendActivationEmailBody = {
|
|
32
|
+
ids: string[];
|
|
33
|
+
};
|
|
34
|
+
export type ChangePasswordBody = {
|
|
35
|
+
oldPassword?: string;
|
|
36
|
+
newPassword?: string;
|
|
37
|
+
};
|
|
38
|
+
export type DeleteUserBody = {
|
|
39
|
+
ids: string[];
|
|
40
|
+
};
|
|
41
|
+
export type BulkSetActiveUserBody = {
|
|
42
|
+
isActive: boolean;
|
|
43
|
+
ids: string[];
|
|
44
|
+
};
|
|
45
|
+
export type GetUserListQueryParams = TableParams & {
|
|
46
|
+
isActive?: boolean[] | null;
|
|
47
|
+
position?: string[] | null;
|
|
48
|
+
division?: string[] | null;
|
|
49
|
+
modifiedBy?: string[] | null;
|
|
50
|
+
updatedAt?: number[] | null;
|
|
51
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { CreateCustomFieldBody, CustomFieldOptionsQueryParams, DeleteCustomFieldBody, EditCustomFieldBody, GetCustomFieldListQueryParams, SetActiveCustomFieldBody } from '../dto/customFieldService.dto';
|
|
3
|
+
import { CustomFieldListResponse, CustomFieldOptionsResponse } from '../types/customFieldService.type';
|
|
4
|
+
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
5
|
+
declare const CustomFieldService: {
|
|
6
|
+
getList: (params?: GetCustomFieldListQueryParams) => Promise<AxiosResponse<FetchListResponse<CustomFieldListResponse[0]>>>;
|
|
7
|
+
getOptions: (body: CustomFieldOptionsQueryParams) => Promise<AxiosResponse<FetchDetailResponse<CustomFieldOptionsResponse>>>;
|
|
8
|
+
create: (body: CreateCustomFieldBody) => Promise<AxiosResponse<string>>;
|
|
9
|
+
update: (id: string, body: EditCustomFieldBody) => Promise<AxiosResponse<string>>;
|
|
10
|
+
setActive: (body: SetActiveCustomFieldBody) => Promise<AxiosResponse<string>>;
|
|
11
|
+
delete: (body: DeleteCustomFieldBody) => Promise<AxiosResponse<string>>;
|
|
12
|
+
checkNameAvailable: (name: string) => Promise<AxiosResponse<{
|
|
13
|
+
message: string;
|
|
14
|
+
}>>;
|
|
15
|
+
};
|
|
16
|
+
export default CustomFieldService;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { TableParams } from '../dto/dataTable.dto';
|
|
3
|
+
import { CreateDivisionBody, DeleteDivisionBody, EditDivisionBody } from '../dto/divisionService.dto';
|
|
4
|
+
import { DivisionDetailResponse, DivisionDropdownResponse, DivisionListResponse } from '../types/divisionService.type';
|
|
5
|
+
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
6
|
+
declare const DivisionService: {
|
|
7
|
+
getList: (params?: TableParams) => Promise<AxiosResponse<FetchListResponse<DivisionListResponse[0]>>>;
|
|
8
|
+
getDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<DivisionDetailResponse>>>;
|
|
9
|
+
create: (body: CreateDivisionBody) => Promise<AxiosResponse<string>>;
|
|
10
|
+
update: (id: string, body: EditDivisionBody) => Promise<AxiosResponse<string>>;
|
|
11
|
+
delete: (body: DeleteDivisionBody) => Promise<AxiosResponse<string>>;
|
|
12
|
+
getDropdown: () => Promise<AxiosResponse<FetchDetailResponse<DivisionDropdownResponse>>>;
|
|
13
|
+
export: (params?: TableParams) => Promise<AxiosResponse<Blob>>;
|
|
14
|
+
};
|
|
15
|
+
export default DivisionService;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
3
|
-
import { GetFileListBody, GetFileOptionsBody } from '../dto/fileManagerService.dto';
|
|
4
|
-
import { FileItem, FileOptionsData } from '../types/fileManagerService.type';
|
|
3
|
+
import { DeleteFileBody, GetFileListBody, GetFileOptionsBody } from '../dto/fileManagerService.dto';
|
|
4
|
+
import { FileItem, FileOptionsData, RecycleBinItem } from '../types/fileManagerService.type';
|
|
5
5
|
declare const FileManagerService: {
|
|
6
6
|
getFileList: (body: GetFileListBody) => Promise<AxiosResponse<FetchListResponse<FileItem>>>;
|
|
7
7
|
getFileOptions: (body: GetFileOptionsBody) => Promise<AxiosResponse<FetchDetailResponse<FileOptionsData>>>;
|
|
8
|
+
getRecycleBinList: (body: GetFileListBody) => Promise<AxiosResponse<FetchListResponse<RecycleBinItem>>>;
|
|
9
|
+
getRecycleBinOptions: (body: GetFileOptionsBody) => Promise<AxiosResponse<FetchDetailResponse<FileOptionsData>>>;
|
|
10
|
+
delete: (body: DeleteFileBody) => Promise<AxiosResponse<string>>;
|
|
11
|
+
deletePermanently: (body: DeleteFileBody) => Promise<AxiosResponse<string>>;
|
|
12
|
+
recover: (body: DeleteFileBody) => Promise<AxiosResponse<string>>;
|
|
8
13
|
};
|
|
9
14
|
export default FileManagerService;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { TableParams } from '../dto/dataTable.dto';
|
|
3
|
+
import { CreatePositionBody, DeletePositionBody, EditPositionBody } from '../dto/positionService.dto';
|
|
4
|
+
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
5
|
+
import { PositionDetailResponse, PositionDropdownResponse, PositionListResponse } from '../types/positionService.type';
|
|
6
|
+
declare const PositionService: {
|
|
7
|
+
getList: (params?: TableParams) => Promise<AxiosResponse<FetchListResponse<PositionListResponse[0]>>>;
|
|
8
|
+
getDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<PositionDetailResponse>>>;
|
|
9
|
+
create: (body: CreatePositionBody) => Promise<AxiosResponse<string>>;
|
|
10
|
+
update: (id: string, body: EditPositionBody) => Promise<AxiosResponse<string>>;
|
|
11
|
+
delete: (body: DeletePositionBody) => Promise<AxiosResponse<string>>;
|
|
12
|
+
getDropdown: () => Promise<AxiosResponse<FetchDetailResponse<PositionDropdownResponse>>>;
|
|
13
|
+
export: (params?: TableParams) => Promise<AxiosResponse<Blob>>;
|
|
14
|
+
};
|
|
15
|
+
export default PositionService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { BulkSetActiveUserBody, ChangePasswordBody, CreateUserBody, DeleteUserBody, EditUserBody, EditUserFcmTokenBody, GetUserListQueryParams, ResendActivationEmailBody, UserOptionsQueryParams } from '../dto/userService.dto';
|
|
3
|
+
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
4
|
+
import { UserDetailResponse, UserListResponse, UserOptionsResponse } from '../types/userService.type';
|
|
5
|
+
declare const UserService: {
|
|
6
|
+
getList: (params?: GetUserListQueryParams) => Promise<AxiosResponse<FetchListResponse<UserListResponse[0]>>>;
|
|
7
|
+
getOptions: (body: UserOptionsQueryParams) => Promise<AxiosResponse<FetchDetailResponse<UserOptionsResponse>>>;
|
|
8
|
+
getDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<UserDetailResponse>>>;
|
|
9
|
+
create: (body: CreateUserBody) => Promise<AxiosResponse<string>>;
|
|
10
|
+
update: (id: string, body: EditUserBody) => Promise<AxiosResponse<string>>;
|
|
11
|
+
setActive: (body: BulkSetActiveUserBody) => Promise<AxiosResponse<{
|
|
12
|
+
message: string;
|
|
13
|
+
}>>;
|
|
14
|
+
updateFcmToken: (body: EditUserFcmTokenBody) => Promise<AxiosResponse<string>>;
|
|
15
|
+
resendActivationEmail: (body: ResendActivationEmailBody) => Promise<AxiosResponse<string>>;
|
|
16
|
+
changePassword: (id: string, body: ChangePasswordBody) => Promise<AxiosResponse<string>>;
|
|
17
|
+
delete: (body: DeleteUserBody) => Promise<AxiosResponse<string>>;
|
|
18
|
+
export: (params?: GetUserListQueryParams) => Promise<AxiosResponse<Blob>>;
|
|
19
|
+
};
|
|
20
|
+
export default UserService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CustomFieldItem {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
dataType: string;
|
|
5
|
+
optionValue: string[];
|
|
6
|
+
usedOptions: string[];
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
isRequired: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CustomFieldOptions {
|
|
13
|
+
dataTypeOptions: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export type CustomFieldListResponse = CustomFieldItem[];
|
|
19
|
+
export type CustomFieldOptionsResponse = CustomFieldOptions;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DivisionItem {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
inUse?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface DivisionDropdownItem {
|
|
7
|
+
_id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
export type DivisionListResponse = DivisionItem[];
|
|
11
|
+
export type DivisionDetailResponse = DivisionItem;
|
|
12
|
+
export type DivisionDropdownResponse = DivisionDropdownItem[];
|
|
@@ -11,6 +11,16 @@ export interface FileItem {
|
|
|
11
11
|
group: string | null;
|
|
12
12
|
modifiedBy: string;
|
|
13
13
|
createdAt: string;
|
|
14
|
+
hasSystemRole: {
|
|
15
|
+
create: boolean;
|
|
16
|
+
view: boolean;
|
|
17
|
+
update: boolean;
|
|
18
|
+
delete: boolean;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface RecycleBinItem extends FileItem {
|
|
22
|
+
countdown: number;
|
|
23
|
+
deletedAt: string;
|
|
14
24
|
}
|
|
15
25
|
export interface FileOptionsData {
|
|
16
26
|
fileFormatOptions: Option[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PositionItem {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
inUse?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface PositionDropdownItem {
|
|
7
|
+
_id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
export type PositionListResponse = PositionItem[];
|
|
11
|
+
export type PositionDetailResponse = PositionItem;
|
|
12
|
+
export type PositionDropdownResponse = PositionDropdownItem[];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface UserItem {
|
|
2
|
+
_id: string;
|
|
3
|
+
isActive: boolean;
|
|
4
|
+
isDefault: boolean;
|
|
5
|
+
profilePicture: string | null;
|
|
6
|
+
fullName: string;
|
|
7
|
+
email: string;
|
|
8
|
+
position: string | null;
|
|
9
|
+
division: string;
|
|
10
|
+
employeeId: string | null;
|
|
11
|
+
modifiedBy: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
pendingApproval: number;
|
|
14
|
+
assignedAssets: number;
|
|
15
|
+
borrowedAssets: number;
|
|
16
|
+
pendingEmailChange: string | null;
|
|
17
|
+
isEmailConfirmed: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface UserDetail {
|
|
20
|
+
_id: string;
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
isDefault: boolean;
|
|
23
|
+
isEmailConfirmed: boolean;
|
|
24
|
+
profilePicture: string | null;
|
|
25
|
+
userTag: string | null;
|
|
26
|
+
firstName: string;
|
|
27
|
+
lastName: string;
|
|
28
|
+
fullName: string;
|
|
29
|
+
email: string;
|
|
30
|
+
pendingEmailChange: string | null;
|
|
31
|
+
position: string | null;
|
|
32
|
+
division: string;
|
|
33
|
+
employeeId: string | null;
|
|
34
|
+
expiryDate: string | null;
|
|
35
|
+
access: string[];
|
|
36
|
+
customFields: {
|
|
37
|
+
_id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
dataType: string;
|
|
41
|
+
isRequired: boolean;
|
|
42
|
+
optionValue: string[];
|
|
43
|
+
value: unknown;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
46
|
+
export interface UserOptions {
|
|
47
|
+
isActiveOptions: {
|
|
48
|
+
label: string;
|
|
49
|
+
value: boolean;
|
|
50
|
+
}[];
|
|
51
|
+
positionOptions: {
|
|
52
|
+
label: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}[];
|
|
55
|
+
divisionOptions: {
|
|
56
|
+
label: string;
|
|
57
|
+
value: string;
|
|
58
|
+
}[];
|
|
59
|
+
modifiedByOptions: {
|
|
60
|
+
label: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}[];
|
|
63
|
+
}
|
|
64
|
+
export type UserListResponse = UserItem[];
|
|
65
|
+
export type UserDetailResponse = UserDetail;
|
|
66
|
+
export type UserOptionsResponse = UserOptions;
|