@tagsamurai/fats-api-services 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +141 -79
- package/api-services.system.js +1 -1
- package/main.d.ts +11 -3
- package/package.json +2 -2
- package/src/dto/groupCategoryService.dto.d.ts +1 -0
- package/src/dto/log.dto.d.ts +63 -0
- package/src/dto/notification.dto.d.ts +7 -0
- package/src/dto/notificationApproval.dto.d.ts +10 -0
- package/src/dto/user.dto.d.ts +131 -0
- package/src/services/groupCategory.service.d.ts +2 -2
- package/src/services/oldAsset.service.d.ts +5 -0
- package/src/services/oldLog.service.d.ts +14 -0
- package/src/services/oldMissing.service.d.ts +5 -0
- package/src/services/oldNotification.service.d.ts +7 -0
- package/src/services/oldNotificationApproval.service.d.ts +7 -0
- package/src/services/oldSessionLog.service.d.ts +5 -0
- package/src/services/oldTag.service.d.ts +6 -0
- package/src/services/oldTracking.service.d.ts +5 -0
- package/src/services/oldUser.service.d.ts +41 -0
- package/src/types/group.type.d.ts +5 -0
- package/src/types/log.type.d.ts +47 -0
- package/src/types/role.type.d.ts +16 -0
- package/src/types/user.type.d.ts +171 -0
- package/src/types/userAsset.type.d.ts +18 -0
- package/src/types/userGlobalRole.type.d.ts +28 -0
- package/src/types/userGroupRole.type.d.ts +30 -0
- package/src/types/userLog.type.d.ts +18 -0
- package/src/types/userSystemRole.type.d.ts +14 -0
- package/src/types/userTransactionRole.type.d.ts +9 -0
package/api-services.es.js
CHANGED
|
@@ -1,101 +1,163 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const { env:
|
|
4
|
-
return
|
|
5
|
-
...
|
|
6
|
-
baseURL:
|
|
7
|
-
headers:
|
|
1
|
+
import _ from "axios";
|
|
2
|
+
const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, l = (t = "APP_API") => f["VITE_" + t], o = (t = {}, e = !1) => {
|
|
3
|
+
const { env: r = "APP_API", prefix: i = "", headers: a = {}, ...A } = t, P = `${l(r)}${i}`, u = JSON.parse(localStorage.getItem("user") ?? "{}"), I = u.jwt ?? u.token ?? "";
|
|
4
|
+
return _.create({
|
|
5
|
+
...A,
|
|
6
|
+
baseURL: P,
|
|
7
|
+
headers: e ? a : {
|
|
8
8
|
"Content-Type": "application/json",
|
|
9
|
-
Authorization: `Bearer ${
|
|
9
|
+
Authorization: `Bearer ${I}`,
|
|
10
10
|
...a
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
},
|
|
13
|
+
}, L = (t) => {
|
|
14
14
|
if (!t || typeof t == "string")
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
return Object.keys(t).forEach((
|
|
18
|
-
Array.isArray(t[
|
|
19
|
-
[
|
|
20
|
-
}) : t[
|
|
21
|
-
[
|
|
16
|
+
const e = {};
|
|
17
|
+
return Object.keys(t).forEach((r) => {
|
|
18
|
+
Array.isArray(t[r]) ? t[r].length > 0 && Object.assign(e, {
|
|
19
|
+
[r]: JSON.stringify(t[r])
|
|
20
|
+
}) : t[r] !== void 0 && Object.assign(e, {
|
|
21
|
+
[r]: t[r]
|
|
22
22
|
});
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
23
|
+
}), e;
|
|
24
|
+
}, O = (t) => {
|
|
25
25
|
if (!t) return;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, l = (t) => {
|
|
33
|
-
if (!t) return;
|
|
34
|
-
const r = u("APP_TAGSAMURAI_API");
|
|
35
|
-
return t.startsWith("http") ? t : `${r}/file-manager/v2/files/${t}`;
|
|
36
|
-
}, n = i({
|
|
37
|
-
prefix: "/settings-attribute/v2"
|
|
38
|
-
}), y = {
|
|
26
|
+
const e = l("APP_TAGSAMURAI_API");
|
|
27
|
+
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
28
|
+
}, n = o({
|
|
29
|
+
prefix: "/settings-attribute/v2",
|
|
30
|
+
env: "APP_TAGSAMURAI_API"
|
|
31
|
+
}), U = {
|
|
39
32
|
getGroupCategory: (t) => {
|
|
40
|
-
const r = t === "category" ? t : "groups";
|
|
41
|
-
return n.get(`/${r}/tree`);
|
|
42
|
-
},
|
|
43
|
-
getGroupCategoryList: (t, r) => {
|
|
44
33
|
const e = t === "category" ? t : "groups";
|
|
45
|
-
return n.get(`/${e}
|
|
46
|
-
},
|
|
47
|
-
getNames: (t) => {
|
|
48
|
-
const r = t === "category" ? t : "groups";
|
|
49
|
-
return n.get(`/${r}/names`);
|
|
50
|
-
},
|
|
51
|
-
postCreateGroupCategory: (t, r) => {
|
|
52
|
-
const e = t === "category" ? t : "groups";
|
|
53
|
-
return n.post(`/${e}`, r);
|
|
54
|
-
},
|
|
55
|
-
putEditGroupCategory: (t, r, e) => {
|
|
56
|
-
const o = t === "category" ? t : "groups";
|
|
57
|
-
return n.put(`/${o}/${e}`, r);
|
|
34
|
+
return n.get(`/${e}/tree`);
|
|
58
35
|
},
|
|
59
|
-
|
|
60
|
-
const o = t === "category" ? t : "groups";
|
|
61
|
-
return n.delete(`/${o}/${e}`, { data: r });
|
|
62
|
-
}
|
|
63
|
-
}, s = i({
|
|
64
|
-
prefix: "/settings-attribute/v2",
|
|
65
|
-
baseURL: "APP_TAGSAMURAI_API"
|
|
66
|
-
}), S = {
|
|
67
|
-
getGroupCategory: (t) => {
|
|
36
|
+
getGroupCategoryList: (t, e) => {
|
|
68
37
|
const r = t === "category" ? t : "groups";
|
|
69
|
-
return
|
|
38
|
+
return n.get(`/${r}/${e}`);
|
|
70
39
|
},
|
|
71
|
-
|
|
40
|
+
getNames: (t) => {
|
|
72
41
|
const e = t === "category" ? t : "groups";
|
|
73
|
-
return
|
|
42
|
+
return n.get(`/${e}/names`);
|
|
74
43
|
},
|
|
75
|
-
|
|
44
|
+
postCreateGroupCategory: (t, e) => {
|
|
76
45
|
const r = t === "category" ? t : "groups";
|
|
77
|
-
return
|
|
78
|
-
},
|
|
79
|
-
postCreateGroupCategory: (t, r) => {
|
|
80
|
-
const e = t === "category" ? t : "groups";
|
|
81
|
-
return s.post(`/${e}`, r);
|
|
46
|
+
return n.post(`/${r}`, e);
|
|
82
47
|
},
|
|
83
|
-
putEditGroupCategory: (t,
|
|
84
|
-
const
|
|
85
|
-
return
|
|
48
|
+
putEditGroupCategory: (t, e, r) => {
|
|
49
|
+
const i = t === "category" ? t : "groups";
|
|
50
|
+
return n.put(`/${i}/${r}`, e);
|
|
86
51
|
},
|
|
87
|
-
putMoveGroup: (t,
|
|
88
|
-
putEditBulkGroups: async (t) =>
|
|
89
|
-
deleteGroupCategory: (t,
|
|
90
|
-
const
|
|
91
|
-
return
|
|
52
|
+
putMoveGroup: (t, e) => n.put(`/groups/${e}/move-group`, t),
|
|
53
|
+
putEditBulkGroups: async (t) => n.put("/bulk", t),
|
|
54
|
+
deleteGroupCategory: (t, e, r) => {
|
|
55
|
+
const i = t === "category" ? t : "groups";
|
|
56
|
+
return n.delete(`/${i}/${r}`, { data: e });
|
|
57
|
+
}
|
|
58
|
+
}, S = o({
|
|
59
|
+
prefix: "/v2",
|
|
60
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
61
|
+
}), y = {
|
|
62
|
+
getTotalApprovals: () => S.get("/approval/count")
|
|
63
|
+
}, g = o({
|
|
64
|
+
prefix: "/v2",
|
|
65
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
66
|
+
}), h = {
|
|
67
|
+
getActionLog: (t) => g.get("/change-log", { params: t }),
|
|
68
|
+
getActionLogOption: (t) => g.get("/change-log/options", { params: t }),
|
|
69
|
+
getSessionLogList: (t) => g.get("/session-log", { params: t }),
|
|
70
|
+
getUserDetailSystemLogList: (t) => g.get("/change-log", { params: t }),
|
|
71
|
+
getUserDetailSystemLogOption: (t) => g.get("/change-log/options", { params: t })
|
|
72
|
+
}, v = o({
|
|
73
|
+
prefix: "/assets/v2/assets"
|
|
74
|
+
}), C = {
|
|
75
|
+
getScanTag: (t) => v.get("/scan", { params: { tag: t } })
|
|
76
|
+
}, T = o({
|
|
77
|
+
prefix: "/tracking/v2/missing"
|
|
78
|
+
}), D = {
|
|
79
|
+
putFoundAsset: (t, e) => {
|
|
80
|
+
const r = { ids: [t], serialNumber: e };
|
|
81
|
+
return T.put("/found", r);
|
|
92
82
|
}
|
|
83
|
+
}, c = o({
|
|
84
|
+
prefix: "/v2/notification",
|
|
85
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
86
|
+
}), N = {
|
|
87
|
+
getNotifications: (t) => c.get("/", { params: t }),
|
|
88
|
+
readNotification: (t) => c.put(`/${t}`)
|
|
89
|
+
}, $ = o({
|
|
90
|
+
prefix: "/v2/session-log",
|
|
91
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
92
|
+
}), R = {
|
|
93
|
+
postLogout: () => $.post("/logout")
|
|
94
|
+
}, p = o({
|
|
95
|
+
prefix: "/tag/v2"
|
|
96
|
+
}), E = {
|
|
97
|
+
getScanQR: (t) => p.get("/qr", { params: { tag: t } }),
|
|
98
|
+
getScanRFID: (t) => p.get("/rfid", { params: { tag: t } })
|
|
99
|
+
}, m = o({
|
|
100
|
+
prefix: "/tracking/v2/tracking"
|
|
101
|
+
}), G = {
|
|
102
|
+
putFoundAsset: (t, e, r) => {
|
|
103
|
+
const i = {
|
|
104
|
+
tag: t,
|
|
105
|
+
group: e,
|
|
106
|
+
serialNumber: r,
|
|
107
|
+
type: "Global"
|
|
108
|
+
};
|
|
109
|
+
return m.put("/found", { params: i });
|
|
110
|
+
}
|
|
111
|
+
}, s = o({
|
|
112
|
+
prefix: "/settings-user-role/v2"
|
|
113
|
+
}), x = {
|
|
114
|
+
reLogin: (t) => s.post("/auth/login", t),
|
|
115
|
+
changePassword: (t) => s.put("/users/change-password", t),
|
|
116
|
+
getUserDetail: (t) => s.get(`/users/${t}`),
|
|
117
|
+
putEditUser: (t, e) => {
|
|
118
|
+
const r = { "Content-Type": "multipart/form-data" };
|
|
119
|
+
return s.put(`/users/${t}`, e, { headers: r });
|
|
120
|
+
},
|
|
121
|
+
putDeleteProfilePicture: (t) => s.put(`/users/${t}/delete-profile-picture`),
|
|
122
|
+
putCancelEmailChange: (t, e) => s.put("/auth/confirm-email-change/cancel", {
|
|
123
|
+
user: t,
|
|
124
|
+
companyCode: e
|
|
125
|
+
}),
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
* @param id {string} User's _id
|
|
129
|
+
* @param type {"Global" | "Group"} Whether the system role's type is global or group
|
|
130
|
+
* @param params {Record<string, unknown>}
|
|
131
|
+
*/
|
|
132
|
+
getUserDetailSystemRoles: (t, e, r) => s.get(`/user-detail/${t}/system-roles`, {
|
|
133
|
+
params: {
|
|
134
|
+
...r,
|
|
135
|
+
type: e
|
|
136
|
+
}
|
|
137
|
+
}),
|
|
138
|
+
// User Detail
|
|
139
|
+
getUserDetailSystemRoleList: (t, e) => s.get(`/user-detail/${t}/system-role-list`, { params: e }),
|
|
140
|
+
getUserDetailSystemRoleOptions: (t, e) => s.get(`/user-detail/${t}/system-role/option`, { params: e }),
|
|
141
|
+
getUserDetailTransactionRoleList: (t, e) => s.get(`/user-detail/${t}/transaction-role-list`, { params: e }),
|
|
142
|
+
getUserDetailUserLogBorrowingList: (t, e) => s.get(`/users-log/${t}/borrowing`, { params: e }),
|
|
143
|
+
getUserDetailUserLogAssignmentList: (t, e) => s.get(`/users-log/${t}/assignment`, { params: e }),
|
|
144
|
+
getUserDetailUserLogBorrowingOption: (t, e) => s.get(`/users-log/${t}/borrowing/option`, { params: e }),
|
|
145
|
+
getUserDetailUserLogAssignmentOption: (t, e) => s.get(`/users-log/${t}/assignment/option`, { params: e }),
|
|
146
|
+
getUserDetailTransactionAdminLogList: (t, e) => s.get(`/users-log/${t}/transaction-log`, { params: e }),
|
|
147
|
+
getUserDetailTransactionAdminLogOption: (t, e) => s.get(`/users-log/${t}/transaction-log/option`, { params: e })
|
|
93
148
|
};
|
|
94
149
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
150
|
+
C as AssetServices,
|
|
151
|
+
h as ChangelogServices,
|
|
152
|
+
U as GroupCategoryServices,
|
|
153
|
+
D as MissingServices,
|
|
154
|
+
y as NotificationApprovalServices,
|
|
155
|
+
N as NotificationServices,
|
|
156
|
+
R as SessionLogServices,
|
|
157
|
+
E as TAGServices,
|
|
158
|
+
G as TrackingServices,
|
|
159
|
+
x as UserServices,
|
|
160
|
+
l as getBaseURL,
|
|
161
|
+
O as getImageURL,
|
|
162
|
+
L as queryParamsStringfy
|
|
101
163
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(n,
|
|
1
|
+
System.register(["axios"],function(n,d){"use strict";var c;return{setters:[u=>{c=u.default}],execute:function(){const u={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_API:"https://dev-api.tagsamurai.com",VITE_APP_COUNTRY_STATE_API:"https://api.countrystatecity.in",VITE_APP_COUNTRY_STATE_API_KEY:"ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==",VITE_APP_LOGS_NOTIFICATION_API:"https://dev-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://dev-api.tagsamurai.com"},p=n("getBaseURL",(e="APP_API")=>u["VITE_"+e]),o=(e={},t=!1)=>{const{env:r="APP_API",prefix:g="",headers:P={},...$}=e,m=`${p(r)}${g}`,S=JSON.parse(localStorage.getItem("user")??"{}"),L=S.jwt??S.token??"";return c.create({...$,baseURL:m,headers:t?P:{"Content-Type":"application/json",Authorization:`Bearer ${L}`,...P}})},U=n("queryParamsStringfy",e=>{if(!e||typeof e=="string")return;const t={};return Object.keys(e).forEach(r=>{Array.isArray(e[r])?e[r].length>0&&Object.assign(t,{[r]:JSON.stringify(e[r])}):e[r]!==void 0&&Object.assign(t,{[r]:e[r]})}),t}),y=n("getImageURL",e=>{if(!e)return;const t=p("APP_TAGSAMURAI_API");return e.startsWith("http")?e:`${t}/file-manager/v2/files/${e}`}),i=o({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),O=n("GroupCategoryServices",{getGroupCategory:e=>{const t=e==="category"?e:"groups";return i.get(`/${t}/tree`)},getGroupCategoryList:(e,t)=>{const r=e==="category"?e:"groups";return i.get(`/${r}/${t}`)},getNames:e=>{const t=e==="category"?e:"groups";return i.get(`/${t}/names`)},postCreateGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return i.post(`/${r}`,t)},putEditGroupCategory:(e,t,r)=>{const g=e==="category"?e:"groups";return i.put(`/${g}/${r}`,t)},putMoveGroup:(e,t)=>i.put(`/groups/${t}/move-group`,e),putEditBulkGroups:async e=>i.put("/bulk",e),deleteGroupCategory:(e,t,r)=>{const g=e==="category"?e:"groups";return i.delete(`/${g}/${r}`,{data:t})}}),I=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),h=n("NotificationApprovalServices",{getTotalApprovals:()=>I.get("/approval/count")}),a=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),C=n("ChangelogServices",{getActionLog:e=>a.get("/change-log",{params:e}),getActionLogOption:e=>a.get("/change-log/options",{params:e}),getSessionLogList:e=>a.get("/session-log",{params:e}),getUserDetailSystemLogList:e=>a.get("/change-log",{params:e}),getUserDetailSystemLogOption:e=>a.get("/change-log/options",{params:e})}),v=o({prefix:"/assets/v2/assets"}),N=n("AssetServices",{getScanTag:e=>v.get("/scan",{params:{tag:e}})}),f=o({prefix:"/tracking/v2/missing"}),R=n("MissingServices",{putFoundAsset:(e,t)=>{const r={ids:[e],serialNumber:t};return f.put("/found",r)}}),l=o({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),D=n("NotificationServices",{getNotifications:e=>l.get("/",{params:e}),readNotification:e=>l.put(`/${e}`)}),_=o({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),G=n("SessionLogServices",{postLogout:()=>_.post("/logout")}),A=o({prefix:"/tag/v2"}),E=n("TAGServices",{getScanQR:e=>A.get("/qr",{params:{tag:e}}),getScanRFID:e=>A.get("/rfid",{params:{tag:e}})}),T=o({prefix:"/tracking/v2/tracking"}),F=n("TrackingServices",{putFoundAsset:(e,t,r)=>{const g={tag:e,group:t,serialNumber:r,type:"Global"};return T.put("/found",{params:g})}}),s=o({prefix:"/settings-user-role/v2"}),b=n("UserServices",{reLogin:e=>s.post("/auth/login",e),changePassword:e=>s.put("/users/change-password",e),getUserDetail:e=>s.get(`/users/${e}`),putEditUser:(e,t)=>{const r={"Content-Type":"multipart/form-data"};return s.put(`/users/${e}`,t,{headers:r})},putDeleteProfilePicture:e=>s.put(`/users/${e}/delete-profile-picture`),putCancelEmailChange:(e,t)=>s.put("/auth/confirm-email-change/cancel",{user:e,companyCode:t}),getUserDetailSystemRoles:(e,t,r)=>s.get(`/user-detail/${e}/system-roles`,{params:{...r,type:t}}),getUserDetailSystemRoleList:(e,t)=>s.get(`/user-detail/${e}/system-role-list`,{params:t}),getUserDetailSystemRoleOptions:(e,t)=>s.get(`/user-detail/${e}/system-role/option`,{params:t}),getUserDetailTransactionRoleList:(e,t)=>s.get(`/user-detail/${e}/transaction-role-list`,{params:t}),getUserDetailUserLogBorrowingList:(e,t)=>s.get(`/users-log/${e}/borrowing`,{params:t}),getUserDetailUserLogAssignmentList:(e,t)=>s.get(`/users-log/${e}/assignment`,{params:t}),getUserDetailUserLogBorrowingOption:(e,t)=>s.get(`/users-log/${e}/borrowing/option`,{params:t}),getUserDetailUserLogAssignmentOption:(e,t)=>s.get(`/users-log/${e}/assignment/option`,{params:t}),getUserDetailTransactionAdminLogList:(e,t)=>s.get(`/users-log/${e}/transaction-log`,{params:t}),getUserDetailTransactionAdminLogOption:(e,t)=>s.get(`/users-log/${e}/transaction-log/option`,{params:t})})}}});
|
package/main.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
export { default as GroupCategoryServices } from './src/services/
|
|
2
|
-
export { default as
|
|
3
|
-
export {
|
|
1
|
+
export { default as GroupCategoryServices } from './src/services/oldGroupCategory.service';
|
|
2
|
+
export { default as NotificationApprovalServices } from './src/services/oldNotificationApproval.service';
|
|
3
|
+
export { default as ChangelogServices } from './src/services/oldLog.service';
|
|
4
|
+
export { default as AssetServices } from './src/services/oldAsset.service';
|
|
5
|
+
export { default as MissingServices } from './src/services/oldMissing.service';
|
|
6
|
+
export { default as NotificationServices } from './src/services/oldNotification.service';
|
|
7
|
+
export { default as SessionLogServices } from './src/services/oldSessionLog.service';
|
|
8
|
+
export { default as TAGServices } from './src/services/oldTag.service';
|
|
9
|
+
export { default as TrackingServices } from './src/services/oldTracking.service';
|
|
10
|
+
export { default as UserServices } from './src/services/oldUser.service';
|
|
11
|
+
export { oldGetImageURL as getImageURL, getBaseURL, queryParamsStringfy, } from './src/utils';
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tagsamurai/fats-api-services",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
4
|
"author": "developer.tagsamurai",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Fixed Asset Tag Samurai Services Library",
|
|
6
6
|
"module": "./api-services.es.js",
|
|
7
7
|
"types": "./main.d.ts",
|
|
8
8
|
"exports": {
|
|
@@ -2,6 +2,7 @@ import { FetchListResponse, ShortFetchListResponse } from '../types/fetchRespons
|
|
|
2
2
|
import { GroupCategoryData } from '../types/groupCategoryData.type';
|
|
3
3
|
export type GroupCategoryResponse = ShortFetchListResponse<GroupCategoryData>;
|
|
4
4
|
export type GroupCategoryTableResponse = FetchListResponse<GroupCategoryData>;
|
|
5
|
+
export type GetGroupTreeParams = Record<string, string>;
|
|
5
6
|
export interface CreateGroupCategoryBody {
|
|
6
7
|
code: string;
|
|
7
8
|
name: string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FetchListResponse, FetchResponse } from '../types/fetchResponse.type';
|
|
2
|
+
import { TableParams } from '../types/groupCategoryData.type';
|
|
3
|
+
import { SessionLog, SystemLog } from '../types/log.type';
|
|
4
|
+
import { MultiSelectOption } from '../types/options.type';
|
|
5
|
+
export type ActionLogParams = {
|
|
6
|
+
object?: string;
|
|
7
|
+
objectId?: string;
|
|
8
|
+
createdAt?: number[];
|
|
9
|
+
action?: string[];
|
|
10
|
+
name?: string[];
|
|
11
|
+
assetName?: string[];
|
|
12
|
+
objectName?: string[];
|
|
13
|
+
field?: string[];
|
|
14
|
+
newValue?: string[];
|
|
15
|
+
oldValue?: string[];
|
|
16
|
+
modifiedBy?: string[];
|
|
17
|
+
};
|
|
18
|
+
export type ActionLogFilterParams = Partial<Record<keyof ActionLogParams, string>>;
|
|
19
|
+
export type ActionLogOptionFilter = {
|
|
20
|
+
actionOptions?: MultiSelectOption[];
|
|
21
|
+
fieldOptions?: MultiSelectOption[];
|
|
22
|
+
modifiedByOptions?: MultiSelectOption[];
|
|
23
|
+
objectNameOptions?: MultiSelectOption[];
|
|
24
|
+
nameOptions?: MultiSelectOption[];
|
|
25
|
+
taskNameOptions?: MultiSelectOption[];
|
|
26
|
+
};
|
|
27
|
+
export type ActionLogOptionParams = {
|
|
28
|
+
object?: string;
|
|
29
|
+
actionOptions?: boolean;
|
|
30
|
+
objectNameOptions?: boolean;
|
|
31
|
+
fieldOptions?: boolean;
|
|
32
|
+
modifiedByOptions?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type SessionLogFilterParams = {
|
|
35
|
+
createdAt?: string;
|
|
36
|
+
activity?: string;
|
|
37
|
+
};
|
|
38
|
+
export type SessionLogFetchParams = TableParams & SessionLogFilterParams & {
|
|
39
|
+
userId: string;
|
|
40
|
+
};
|
|
41
|
+
export type GetSessionLogListResponse = FetchListResponse<SessionLog>;
|
|
42
|
+
export type GetUserSystemLogListResponse = FetchListResponse<SystemLog>;
|
|
43
|
+
export type GetUserSystemLogOptionsResponse = FetchResponse & {
|
|
44
|
+
data: {
|
|
45
|
+
actionOptions: MultiSelectOption[];
|
|
46
|
+
objectOptions: MultiSelectOption[];
|
|
47
|
+
fieldOptions: MultiSelectOption[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export type SystemLogLoadingFilters = {
|
|
51
|
+
actionOptions?: boolean;
|
|
52
|
+
objectOptions?: boolean;
|
|
53
|
+
fieldOptions?: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type SystemLogFilterParams = {
|
|
56
|
+
createdAt?: string;
|
|
57
|
+
action?: string;
|
|
58
|
+
objects?: string;
|
|
59
|
+
field?: string;
|
|
60
|
+
};
|
|
61
|
+
export type SystemLogFetchParams = TableParams & SystemLogFilterParams & {
|
|
62
|
+
userId: string;
|
|
63
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { FetchResponse } from '../types/fetchResponse.type';
|
|
2
|
+
import { TableParams } from '../types/groupCategoryData.type';
|
|
3
|
+
import { MultiSelectOption } from '../types/options.type';
|
|
4
|
+
export interface CreateUserDTO {
|
|
5
|
+
firstName: string;
|
|
6
|
+
lastName: string;
|
|
7
|
+
email: string;
|
|
8
|
+
isTemporary?: boolean;
|
|
9
|
+
expiryDate?: string;
|
|
10
|
+
division: string;
|
|
11
|
+
employeeId?: string;
|
|
12
|
+
position?: string;
|
|
13
|
+
roles?: number[];
|
|
14
|
+
transactionRole: {
|
|
15
|
+
transactionGroupAttribute: string;
|
|
16
|
+
transaction: string;
|
|
17
|
+
roleType: string;
|
|
18
|
+
}[];
|
|
19
|
+
defaultGroup?: {
|
|
20
|
+
_id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
key: number;
|
|
23
|
+
};
|
|
24
|
+
phoneNumber: string;
|
|
25
|
+
profilePicture?: File;
|
|
26
|
+
}
|
|
27
|
+
export interface EditUserDTO {
|
|
28
|
+
firstName: string;
|
|
29
|
+
lastName: string;
|
|
30
|
+
email: string;
|
|
31
|
+
isTemporary?: boolean;
|
|
32
|
+
expiryDate?: string;
|
|
33
|
+
division: string;
|
|
34
|
+
employeeId?: string;
|
|
35
|
+
position?: string;
|
|
36
|
+
defaultGroup?: {
|
|
37
|
+
_id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
key: number;
|
|
40
|
+
};
|
|
41
|
+
phoneNumber: string;
|
|
42
|
+
profilePicture?: File;
|
|
43
|
+
}
|
|
44
|
+
export interface SetActiveBulkUserDTO {
|
|
45
|
+
userIds: string[];
|
|
46
|
+
isActive: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface ChangePasswordBody {
|
|
49
|
+
oldPassword: string;
|
|
50
|
+
newPassword: string;
|
|
51
|
+
}
|
|
52
|
+
export type SystemRoleFilterParams = {
|
|
53
|
+
isActive?: string;
|
|
54
|
+
systemRole?: string;
|
|
55
|
+
group?: string;
|
|
56
|
+
};
|
|
57
|
+
export type SystemRoleFetchParams = TableParams & SystemRoleFilterParams;
|
|
58
|
+
export type TransactionRoleFilterParams = {
|
|
59
|
+
isActive?: string;
|
|
60
|
+
transactionRole?: string;
|
|
61
|
+
roleType?: string;
|
|
62
|
+
group?: string;
|
|
63
|
+
};
|
|
64
|
+
export type TransactionRoleFetchParams = TableParams & TransactionRoleFilterParams;
|
|
65
|
+
export type GetUserLogAssignmentOptionsResponse = FetchResponse & {
|
|
66
|
+
data: {
|
|
67
|
+
assetNameOptions: MultiSelectOption[];
|
|
68
|
+
userFullNameOptions: MultiSelectOption[];
|
|
69
|
+
managerOptions: MultiSelectOption[];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export type GetUserLogBorrowingOptionsResponse = FetchResponse & {
|
|
73
|
+
data: {
|
|
74
|
+
assetNameOptions: MultiSelectOption[];
|
|
75
|
+
userFullNameOptions: MultiSelectOption[];
|
|
76
|
+
managerOptions: MultiSelectOption[];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export type GetTransactionAdminLogOptionsResponse = FetchResponse & {
|
|
80
|
+
data: {
|
|
81
|
+
userFullNameOptions: MultiSelectOption[];
|
|
82
|
+
borrowerOptions: MultiSelectOption[];
|
|
83
|
+
assignedToOptions: MultiSelectOption[];
|
|
84
|
+
assetNameOptions: MultiSelectOption[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export type UserLogAssignmentFilterParams = {
|
|
88
|
+
createdAt?: string;
|
|
89
|
+
action?: string;
|
|
90
|
+
assetName?: string;
|
|
91
|
+
userFullName?: string;
|
|
92
|
+
manager?: string;
|
|
93
|
+
};
|
|
94
|
+
export type UserLogBorrowingFilterParams = {
|
|
95
|
+
createdAt?: string;
|
|
96
|
+
action?: string;
|
|
97
|
+
assetName?: string;
|
|
98
|
+
userFullName?: string;
|
|
99
|
+
manager?: string;
|
|
100
|
+
};
|
|
101
|
+
export type UserLogAssignmentFetchParams = TableParams & UserLogAssignmentFilterParams;
|
|
102
|
+
export type UserLogBorrowingFetchParams = TableParams & UserLogBorrowingFilterParams;
|
|
103
|
+
export type UserLogAssignmentLoadingFilters = {
|
|
104
|
+
assetNameOptions?: boolean;
|
|
105
|
+
userFullNameOptions?: boolean;
|
|
106
|
+
managerOptions?: boolean;
|
|
107
|
+
};
|
|
108
|
+
export type UserLogBorrowingLoadingFilters = {
|
|
109
|
+
assetNameOptions?: boolean;
|
|
110
|
+
userFullNameOptions?: boolean;
|
|
111
|
+
managerOptions?: boolean;
|
|
112
|
+
};
|
|
113
|
+
export type TransactionLogType = 'Borrowing' | 'Transfer' | 'Damaged' | 'Missing' | 'Assignment' | 'Disposal' | 'Audit' | 'Repair Ticketing' | 'Tracking' | 'Maintenance Routine' | 'TAG' | 'License';
|
|
114
|
+
export type TransactionLogFilterParams = {
|
|
115
|
+
createdAt?: string;
|
|
116
|
+
action?: string;
|
|
117
|
+
assetName?: string;
|
|
118
|
+
group?: string;
|
|
119
|
+
license?: string;
|
|
120
|
+
userFullName?: string;
|
|
121
|
+
borrower?: string;
|
|
122
|
+
};
|
|
123
|
+
export type TransactionLogFetchParams = TableParams & TransactionLogFilterParams & {
|
|
124
|
+
type: TransactionLogType;
|
|
125
|
+
};
|
|
126
|
+
export type TransactionLogLoadingFilters = {
|
|
127
|
+
assetNameOptions?: boolean;
|
|
128
|
+
borrowerOptions?: boolean;
|
|
129
|
+
userFullNameOptions?: boolean;
|
|
130
|
+
assignedToOptions?: boolean;
|
|
131
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { CreateGroupCategoryBody, DeleteGroupCategoryBody, EditGroupCategoryBody, GroupCategoryResponse, GroupCategoryTableResponse } from '../dto/groupCategoryService.dto';
|
|
2
|
+
import { CreateGroupCategoryBody, DeleteGroupCategoryBody, EditGroupCategoryBody, GetGroupTreeParams, GroupCategoryResponse, GroupCategoryTableResponse } from '../dto/groupCategoryService.dto';
|
|
3
3
|
import { FetchDetailResponse } from '../types/fetchResponse.type';
|
|
4
4
|
declare const GroupCategoryServices: {
|
|
5
|
-
getGroupCategory: (type: "group" | "category") => Promise<AxiosResponse<GroupCategoryResponse>>;
|
|
5
|
+
getGroupCategory: (type: "group" | "category", params?: GetGroupTreeParams) => Promise<AxiosResponse<GroupCategoryResponse>>;
|
|
6
6
|
getGroupCategoryList: (type: "group" | "category", groupId: string) => Promise<AxiosResponse<GroupCategoryTableResponse>>;
|
|
7
7
|
getNames: (type: "group" | "category") => Promise<AxiosResponse<FetchDetailResponse<string[]>>>;
|
|
8
8
|
postCreateGroupCategory: (type: "group" | "category", body: CreateGroupCategoryBody) => Promise<AxiosResponse<GroupCategoryResponse>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { FetchListResponse, FetchOptionResponse } from '../types/fetchResponse.type';
|
|
3
|
+
import { ActionLogFilterParams, ActionLogOptionParams, GetSessionLogListResponse, GetUserSystemLogListResponse, GetUserSystemLogOptionsResponse, SessionLogFetchParams, SystemLogFetchParams, SystemLogLoadingFilters } from '../dto/log.dto';
|
|
4
|
+
import { ActionLogType } from '../types/log.type';
|
|
5
|
+
declare const ChangelogServices: {
|
|
6
|
+
getActionLog: (params?: ActionLogFilterParams) => Promise<AxiosResponse<FetchListResponse<ActionLogType>>>;
|
|
7
|
+
getActionLogOption: (params?: ActionLogOptionParams) => Promise<AxiosResponse<FetchOptionResponse>>;
|
|
8
|
+
getSessionLogList: (params: SessionLogFetchParams) => Promise<AxiosResponse<GetSessionLogListResponse>>;
|
|
9
|
+
getUserDetailSystemLogList: (params: SystemLogFetchParams) => Promise<AxiosResponse<GetUserSystemLogListResponse>>;
|
|
10
|
+
getUserDetailSystemLogOption: (params: SystemLogLoadingFilters & {
|
|
11
|
+
userId: string;
|
|
12
|
+
}) => Promise<AxiosResponse<GetUserSystemLogOptionsResponse>>;
|
|
13
|
+
};
|
|
14
|
+
export default ChangelogServices;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { GetNotificationParam } from '../dto/notification.dto';
|
|
3
|
+
declare const NotificationServices: {
|
|
4
|
+
getNotifications: (params: GetNotificationParam) => Promise<AxiosResponse>;
|
|
5
|
+
readNotification: (id: string) => Promise<AxiosResponse>;
|
|
6
|
+
};
|
|
7
|
+
export default NotificationServices;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { ApprovalCountData } from '../dto/notificationApproval.dto';
|
|
3
|
+
import { FetchDetailResponse } from '../types/fetchResponse.type';
|
|
4
|
+
declare const NotificationApprovalServices: {
|
|
5
|
+
getTotalApprovals: () => Promise<AxiosResponse<FetchDetailResponse<ApprovalCountData>>>;
|
|
6
|
+
};
|
|
7
|
+
export default NotificationApprovalServices;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { ChangePasswordBody, EditUserDTO, GetTransactionAdminLogOptionsResponse, GetUserLogAssignmentOptionsResponse, GetUserLogBorrowingOptionsResponse, SystemRoleFetchParams, TransactionLogFetchParams, TransactionLogLoadingFilters, TransactionLogType, TransactionRoleFetchParams, UserLogAssignmentFetchParams, UserLogAssignmentLoadingFilters, UserLogBorrowingFetchParams, UserLogBorrowingLoadingFilters } from '../dto/user.dto';
|
|
3
|
+
import { FetchDetailResponse, FetchListResponse, FetchOptionResponse } from '../types/fetchResponse.type';
|
|
4
|
+
import { UserDetail } from '../types/user.type';
|
|
5
|
+
import { UserSystemRole } from '../types/userSystemRole.type';
|
|
6
|
+
import { MultiSelectOption } from '../types/options.type';
|
|
7
|
+
import { UserTransactionRole } from '../types/userTransactionRole.type';
|
|
8
|
+
import { UserLogAssignment, UserLogBorrowing } from '../types/userLog.type';
|
|
9
|
+
declare const UserServices: {
|
|
10
|
+
reLogin: (body: {
|
|
11
|
+
jwt: string;
|
|
12
|
+
}) => Promise<AxiosResponse>;
|
|
13
|
+
changePassword: (body: ChangePasswordBody) => Promise<AxiosResponse>;
|
|
14
|
+
getUserDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<UserDetail>>>;
|
|
15
|
+
putEditUser: (id: string, data: EditUserDTO) => Promise<AxiosResponse>;
|
|
16
|
+
putDeleteProfilePicture: (id: string) => Promise<AxiosResponse>;
|
|
17
|
+
putCancelEmailChange: (id: string, companyCode: string) => Promise<AxiosResponse>;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param id {string} User's _id
|
|
21
|
+
* @param type {"Global" | "Group"} Whether the system role's type is global or group
|
|
22
|
+
* @param params {Record<string, unknown>}
|
|
23
|
+
*/
|
|
24
|
+
getUserDetailSystemRoles: (id: string, type: "Global" | "Group", params: Record<string, unknown>) => Promise<AxiosResponse>;
|
|
25
|
+
getUserDetailSystemRoleList: (id: string, params: SystemRoleFetchParams) => Promise<AxiosResponse<FetchListResponse<UserSystemRole>>>;
|
|
26
|
+
getUserDetailSystemRoleOptions: (id: string, params: {
|
|
27
|
+
roleNameOptions: boolean;
|
|
28
|
+
}) => Promise<AxiosResponse<FetchOptionResponse<{
|
|
29
|
+
roleNameOptions: MultiSelectOption[];
|
|
30
|
+
}>>>;
|
|
31
|
+
getUserDetailTransactionRoleList: (id: string, params: TransactionRoleFetchParams) => Promise<AxiosResponse<FetchListResponse<UserTransactionRole>>>;
|
|
32
|
+
getUserDetailUserLogBorrowingList: (userId: string, params: UserLogBorrowingFetchParams) => Promise<AxiosResponse<FetchListResponse<UserLogBorrowing>>>;
|
|
33
|
+
getUserDetailUserLogAssignmentList: (userId: string, params: UserLogAssignmentFetchParams) => Promise<AxiosResponse<FetchListResponse<UserLogAssignment>>>;
|
|
34
|
+
getUserDetailUserLogBorrowingOption: (userId: string, params: UserLogBorrowingLoadingFilters) => Promise<AxiosResponse<GetUserLogBorrowingOptionsResponse>>;
|
|
35
|
+
getUserDetailUserLogAssignmentOption: (userId: string, params: UserLogAssignmentLoadingFilters) => Promise<AxiosResponse<GetUserLogAssignmentOptionsResponse>>;
|
|
36
|
+
getUserDetailTransactionAdminLogList: <T>(userId: string, params: TransactionLogFetchParams) => Promise<AxiosResponse<FetchListResponse<T>>>;
|
|
37
|
+
getUserDetailTransactionAdminLogOption: (userId: string, params: TransactionLogLoadingFilters & {
|
|
38
|
+
type: TransactionLogType;
|
|
39
|
+
}) => Promise<AxiosResponse<GetTransactionAdminLogOptionsResponse>>;
|
|
40
|
+
};
|
|
41
|
+
export default UserServices;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export type ActionLogType = {
|
|
3
|
+
_id: string;
|
|
4
|
+
action: string;
|
|
5
|
+
field: string;
|
|
6
|
+
oldValue: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
newValue: string;
|
|
9
|
+
modifiedBy: string;
|
|
10
|
+
object: string;
|
|
11
|
+
objectId: string;
|
|
12
|
+
objectName: string;
|
|
13
|
+
assetName?: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
};
|
|
17
|
+
export type LogDialogType = {
|
|
18
|
+
type: string;
|
|
19
|
+
header: string;
|
|
20
|
+
fileName: string;
|
|
21
|
+
objectId?: string;
|
|
22
|
+
fields?: string[];
|
|
23
|
+
buttonModel?: Ref<boolean>;
|
|
24
|
+
};
|
|
25
|
+
export type ChangelogObject = 'Asset' | 'Account Code' | 'Linked Asset' | 'Purchase Attachment' | 'Product Attachment' | 'Depreciation Group' | 'Transaction Settings Audit' | 'Transaction Settings Borrowing/Assignment' | 'Transaction Settings Disposal' | 'Transaction Settings Transfer' | 'General Settings' | 'Group' | 'Category' | 'Measurement' | 'Brand' | 'Asset Name' | 'Asset Policy' | 'Custom Field > General Information' | 'Custom Field > Purchase' | 'Custom Field > Accounting' | 'Custom Field > Maintenance Routine' | 'Custom Field > Audit' | 'Import' | 'Role > Borrowing/Assignment' | 'Role > Transfer' | 'Role > Disposal' | 'Role > Maintenance' | 'Role > Tracking' | 'Role > Missing' | 'Role > Audit' | 'Role > Repair Ticketing' | 'Role > Damaged' | 'Role > Total Control' | 'Role > Read Only' | 'Role > Import data' | 'Role > Manage asset names, brands, categories, and custom fields' | 'Role > Manage asset policy' | 'Role > Manage depreciation group' | 'Role > Manage depreciation method' | 'Role > Manage document deletion' | 'Role > Manage group' | 'Role > Manage user' | 'Role > Manage IOT and reader' | 'Role > Manage license' | 'Role > Manage purchase document' | 'Role > Manage purchase information' | 'Role > Manage role' | 'Role > Manage TAG' | 'Role > Register assets' | 'Role > Manage TAG type' | 'Role > Open API' | 'Report' | 'User' | 'Global Role User' | 'Group Role User' | 'Transaction Role User' | 'Audit' | 'Open API > API Token' | 'Maintenance Routine' | 'Detail Asset > Maintenance' | 'Detail Asset > Audit' | 'Sub User' | 'Allocation' | 'Service Center' | 'IOT > Reader' | 'IOT > Antenna' | 'Fixed Asset License' | 'Repair Ticketing Addon' | 'Maintenance Addon' | 'Tracking Addon' | 'Asset Control Addon' | 'Audit Addon';
|
|
26
|
+
export type LogAction = 'Create' | 'Edit' | 'Delete';
|
|
27
|
+
export type SessionLog = {
|
|
28
|
+
activity: string;
|
|
29
|
+
user: string;
|
|
30
|
+
userId: string;
|
|
31
|
+
employeeId: string;
|
|
32
|
+
position: string;
|
|
33
|
+
ipAddress: string;
|
|
34
|
+
createdAt: Date | string;
|
|
35
|
+
updatedAt: Date | string;
|
|
36
|
+
};
|
|
37
|
+
export type SystemLog = {
|
|
38
|
+
_id: string;
|
|
39
|
+
action: string;
|
|
40
|
+
field: string;
|
|
41
|
+
oldValue: string;
|
|
42
|
+
newValue: string;
|
|
43
|
+
modifiedBy: string;
|
|
44
|
+
object: string;
|
|
45
|
+
objectName: string;
|
|
46
|
+
createdAt: Date | string;
|
|
47
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Role = {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
desc: string;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
isDefault: boolean;
|
|
7
|
+
isUsedByUser: boolean;
|
|
8
|
+
key: number;
|
|
9
|
+
};
|
|
10
|
+
export type RolePermission = {
|
|
11
|
+
create: boolean;
|
|
12
|
+
view: boolean;
|
|
13
|
+
update: boolean;
|
|
14
|
+
delete: boolean;
|
|
15
|
+
defaultView?: boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Role } from './role.type';
|
|
2
|
+
export interface UserData {
|
|
3
|
+
_id: string;
|
|
4
|
+
company: string;
|
|
5
|
+
companyName: string;
|
|
6
|
+
companyCode?: string;
|
|
7
|
+
firstName?: string;
|
|
8
|
+
lastName?: string;
|
|
9
|
+
fullName?: string;
|
|
10
|
+
profilePictureMedium?: string;
|
|
11
|
+
profilePictureBig?: string;
|
|
12
|
+
profilePictureSmall?: string;
|
|
13
|
+
email: string;
|
|
14
|
+
phoneNumber?: string;
|
|
15
|
+
employeeId?: string;
|
|
16
|
+
position?: string;
|
|
17
|
+
token: string;
|
|
18
|
+
transactionRoles?: TransactionRoles;
|
|
19
|
+
systemRoles?: SystemRoles;
|
|
20
|
+
generalSetting?: GeneralSetting;
|
|
21
|
+
addOn?: AddOn;
|
|
22
|
+
userType?: 'Basic' | 'Admin';
|
|
23
|
+
}
|
|
24
|
+
interface AddOn {
|
|
25
|
+
maintenance?: boolean;
|
|
26
|
+
tracking?: boolean;
|
|
27
|
+
audit?: boolean;
|
|
28
|
+
repairTicketing?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface GeneralSetting {
|
|
31
|
+
currency?: Currency;
|
|
32
|
+
timezone?: string;
|
|
33
|
+
dateFormat?: DateFormat;
|
|
34
|
+
timeFormat?: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface DateFormat {
|
|
37
|
+
locale: string;
|
|
38
|
+
year: string;
|
|
39
|
+
month: string;
|
|
40
|
+
day: string;
|
|
41
|
+
weekday: string;
|
|
42
|
+
}
|
|
43
|
+
interface Currency {
|
|
44
|
+
currency?: string;
|
|
45
|
+
symbol?: string;
|
|
46
|
+
locale?: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
_id?: string;
|
|
49
|
+
id?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface SystemRoles {
|
|
52
|
+
importData?: SystemRoleItem;
|
|
53
|
+
assetAttribute?: SystemRoleItem;
|
|
54
|
+
assetPolicies?: SystemRoleItem;
|
|
55
|
+
depreciationGroup?: SystemRoleItem;
|
|
56
|
+
depreciationMethod?: SystemRoleItem;
|
|
57
|
+
documentDeletion?: SystemRoleItem;
|
|
58
|
+
group?: SystemRoleItem;
|
|
59
|
+
user?: SystemRoleItem;
|
|
60
|
+
iotReader?: SystemRoleItem;
|
|
61
|
+
license?: SystemRoleItem;
|
|
62
|
+
purchaseDocument?: SystemRoleItem;
|
|
63
|
+
purchaseInformation?: SystemRoleItem;
|
|
64
|
+
role?: SystemRoleItem;
|
|
65
|
+
tag?: SystemRoleItem;
|
|
66
|
+
registerAsset?: SystemRoleItem;
|
|
67
|
+
}
|
|
68
|
+
interface SystemRoleItem {
|
|
69
|
+
create?: boolean;
|
|
70
|
+
view?: boolean;
|
|
71
|
+
update?: boolean;
|
|
72
|
+
delete?: boolean;
|
|
73
|
+
}
|
|
74
|
+
interface TransactionRoles {
|
|
75
|
+
trackingRole?: TransactionRoleItem;
|
|
76
|
+
disposalRole?: TransactionRoleItem;
|
|
77
|
+
borrowingRole?: TransactionRoleItem;
|
|
78
|
+
transferRole?: TransactionRoleItem;
|
|
79
|
+
auditRole?: TransactionRoleItem;
|
|
80
|
+
repairRole?: TransactionRoleItem;
|
|
81
|
+
maintenanceRole?: TransactionRoleItem;
|
|
82
|
+
}
|
|
83
|
+
interface TransactionRoleItem {
|
|
84
|
+
manager?: boolean;
|
|
85
|
+
monitoringReport?: boolean;
|
|
86
|
+
staff?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export type UserType = 'Basic' | 'Admin';
|
|
89
|
+
export type User = {
|
|
90
|
+
_id: string;
|
|
91
|
+
key: number;
|
|
92
|
+
isActive: boolean;
|
|
93
|
+
name: string;
|
|
94
|
+
userType: UserType;
|
|
95
|
+
systemRole: {
|
|
96
|
+
role: Role;
|
|
97
|
+
}[];
|
|
98
|
+
transactionRole: {
|
|
99
|
+
_id: string;
|
|
100
|
+
transactionGroupAttribute: string;
|
|
101
|
+
transaction: string;
|
|
102
|
+
roleType: string;
|
|
103
|
+
group: {
|
|
104
|
+
_id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
key: number;
|
|
107
|
+
};
|
|
108
|
+
isActive: boolean;
|
|
109
|
+
createdAt: Date | string;
|
|
110
|
+
updatedAt: Date | string;
|
|
111
|
+
}[];
|
|
112
|
+
position: string;
|
|
113
|
+
division: string;
|
|
114
|
+
email: string;
|
|
115
|
+
modifiedBy: {
|
|
116
|
+
_id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
key: number;
|
|
119
|
+
};
|
|
120
|
+
updatedAt: Date | string;
|
|
121
|
+
isDeletable: boolean;
|
|
122
|
+
isConfirmed: boolean;
|
|
123
|
+
profilePictureSmall: string;
|
|
124
|
+
profilePictureMedium: string;
|
|
125
|
+
profilePictureBig: string;
|
|
126
|
+
};
|
|
127
|
+
export type UserDetail = {
|
|
128
|
+
_id: string;
|
|
129
|
+
key: number;
|
|
130
|
+
firstName: string;
|
|
131
|
+
lastName: string;
|
|
132
|
+
division: string;
|
|
133
|
+
position: string;
|
|
134
|
+
employeeId: string;
|
|
135
|
+
phoneNumber: string;
|
|
136
|
+
email: string;
|
|
137
|
+
password: string;
|
|
138
|
+
defaultGroup: {
|
|
139
|
+
_id: string;
|
|
140
|
+
name: string;
|
|
141
|
+
key: number;
|
|
142
|
+
};
|
|
143
|
+
isActive: boolean;
|
|
144
|
+
isTemporary: boolean;
|
|
145
|
+
expiryDate: number;
|
|
146
|
+
profilePictureSmall: string;
|
|
147
|
+
profilePictureMedium: string;
|
|
148
|
+
profilePictureBig: string;
|
|
149
|
+
systemRole: {
|
|
150
|
+
role: Role;
|
|
151
|
+
}[];
|
|
152
|
+
transactionRole: {
|
|
153
|
+
id: string;
|
|
154
|
+
transactionGroupAttribute: string;
|
|
155
|
+
transaction: string;
|
|
156
|
+
roleType: string;
|
|
157
|
+
group: {
|
|
158
|
+
_id: string;
|
|
159
|
+
name: string;
|
|
160
|
+
key: number;
|
|
161
|
+
};
|
|
162
|
+
isActive: boolean;
|
|
163
|
+
createdAt: Date | string;
|
|
164
|
+
updatedAt: Date | string;
|
|
165
|
+
}[];
|
|
166
|
+
name: string;
|
|
167
|
+
userType: UserType;
|
|
168
|
+
userTag: string;
|
|
169
|
+
pendingEmailChange: boolean;
|
|
170
|
+
};
|
|
171
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type UserAssetBorrowed = {
|
|
2
|
+
_id: string;
|
|
3
|
+
transactionId: string;
|
|
4
|
+
manager: {
|
|
5
|
+
_id: string;
|
|
6
|
+
fullName: string;
|
|
7
|
+
key: number;
|
|
8
|
+
};
|
|
9
|
+
assetName: {
|
|
10
|
+
_id: string;
|
|
11
|
+
nameWithSequence: string;
|
|
12
|
+
name: string;
|
|
13
|
+
key: number;
|
|
14
|
+
};
|
|
15
|
+
createdAt: Date | string;
|
|
16
|
+
returnDueDate: Date | string;
|
|
17
|
+
};
|
|
18
|
+
export type UserAssetAssigned = Omit<UserAssetBorrowed, 'returnDueDate'>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RolePermission } from './role.type';
|
|
2
|
+
export type UserGlobalRole = {
|
|
3
|
+
/**
|
|
4
|
+
* =================
|
|
5
|
+
* SERVER SIDE DATA
|
|
6
|
+
* =================
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* System role's _id
|
|
10
|
+
*/
|
|
11
|
+
_id: string;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
isReadOnly: boolean;
|
|
14
|
+
isTotalControl: boolean;
|
|
15
|
+
roleName: string;
|
|
16
|
+
managePermission: RolePermission;
|
|
17
|
+
type: string;
|
|
18
|
+
/**
|
|
19
|
+
* ==================
|
|
20
|
+
* CLIENT SIDE DATA
|
|
21
|
+
* ==================
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Client-side data, used to determine toggle button switch states.
|
|
25
|
+
*/
|
|
26
|
+
permissions: RolePermission;
|
|
27
|
+
defaultView: boolean;
|
|
28
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Group } from './group.type';
|
|
2
|
+
import { RolePermission } from './role.type';
|
|
3
|
+
export type UserGroupRole = {
|
|
4
|
+
/**
|
|
5
|
+
* =================
|
|
6
|
+
* SERVER SIDE DATA
|
|
7
|
+
* =================
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* System role's _id
|
|
11
|
+
*/
|
|
12
|
+
_id: string;
|
|
13
|
+
roleName: string;
|
|
14
|
+
isActive: boolean;
|
|
15
|
+
isReadOnly: boolean;
|
|
16
|
+
isTotalControl: boolean;
|
|
17
|
+
type: string;
|
|
18
|
+
managePermission: RolePermission;
|
|
19
|
+
group: Group[];
|
|
20
|
+
/**
|
|
21
|
+
* ==================
|
|
22
|
+
* CLIENT SIDE DATA
|
|
23
|
+
* ==================
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Client-side data, used to determine toggle button switch states.
|
|
27
|
+
*/
|
|
28
|
+
permissions: RolePermission;
|
|
29
|
+
defaultView: boolean;
|
|
30
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type UserLogAssignment = {
|
|
2
|
+
_id: string;
|
|
3
|
+
transactionId: string;
|
|
4
|
+
assetNameWithSequence: string;
|
|
5
|
+
action: string;
|
|
6
|
+
userFullName: string;
|
|
7
|
+
createdAt: Date | string;
|
|
8
|
+
manager: string;
|
|
9
|
+
};
|
|
10
|
+
export type UserLogBorrowing = {
|
|
11
|
+
_id: string;
|
|
12
|
+
transactionId: string;
|
|
13
|
+
assetNameWithSequence: string;
|
|
14
|
+
action: string;
|
|
15
|
+
userFullName: string;
|
|
16
|
+
createdAt: Date | string;
|
|
17
|
+
manager: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Group } from './group.type';
|
|
2
|
+
import { Role } from './role.type';
|
|
3
|
+
export type UserSystemRole = {
|
|
4
|
+
_id: string;
|
|
5
|
+
role: Role;
|
|
6
|
+
roleName: string;
|
|
7
|
+
user: {
|
|
8
|
+
_id: string;
|
|
9
|
+
fullName: string;
|
|
10
|
+
key: string;
|
|
11
|
+
};
|
|
12
|
+
group: Group[];
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
};
|