@tagsamurai/fats-api-services 1.1.0-dev-alpha.10 → 1.1.0-dev-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 +2839 -191
- package/api-services.system.js +2791 -190
- package/main.d.ts +50 -2
- package/package.json +1 -1
package/api-services.es.js
CHANGED
|
@@ -119,7 +119,187 @@ const getAssetsFile = async (file, type = "excel") => {
|
|
|
119
119
|
);
|
|
120
120
|
return response;
|
|
121
121
|
};
|
|
122
|
-
const
|
|
122
|
+
const isValidJSON = (value) => {
|
|
123
|
+
if (typeof value !== "string") return false;
|
|
124
|
+
const s = value.trim();
|
|
125
|
+
if (!s) return false;
|
|
126
|
+
try {
|
|
127
|
+
JSON.parse(s);
|
|
128
|
+
return true;
|
|
129
|
+
} catch {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const buildBodyParams = (params) => {
|
|
134
|
+
if (!params) {
|
|
135
|
+
return {};
|
|
136
|
+
}
|
|
137
|
+
const result = {};
|
|
138
|
+
Object.keys(params).forEach((key) => {
|
|
139
|
+
const val = params[key];
|
|
140
|
+
result[key] = isValidJSON(val) ? JSON.parse(val.trim()) : val;
|
|
141
|
+
});
|
|
142
|
+
return result;
|
|
143
|
+
};
|
|
144
|
+
const API$O = createAxiosInstance({
|
|
145
|
+
prefix: "/fam/utility/v2"
|
|
146
|
+
});
|
|
147
|
+
const ChangelogServices = {
|
|
148
|
+
getChangelogList: (params) => {
|
|
149
|
+
return API$O.get("/change-log", { params });
|
|
150
|
+
},
|
|
151
|
+
getChangelogListOptions: (params) => {
|
|
152
|
+
return API$O.get("/change-log/options", { params });
|
|
153
|
+
},
|
|
154
|
+
getSessionLogList: (params) => {
|
|
155
|
+
return API$O.get("/session-log", { params });
|
|
156
|
+
},
|
|
157
|
+
getSessionLogListOptions: (params) => {
|
|
158
|
+
return API$O.get("/session-log/options", {
|
|
159
|
+
params
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
getTransactionLog: (params) => {
|
|
163
|
+
return API$O.get("/transaction-log", { params });
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* Retrieves the transaction log options.
|
|
167
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
168
|
+
*/
|
|
169
|
+
getTransactionLogOption: (params) => {
|
|
170
|
+
return API$O.get("/transaction-log/options", { params });
|
|
171
|
+
},
|
|
172
|
+
getUserDetailSystemLogList: (params) => {
|
|
173
|
+
return API$O.get("/change-log", { params });
|
|
174
|
+
},
|
|
175
|
+
getUserDetailSystemLogOption: (params) => {
|
|
176
|
+
return API$O.get("/change-log/options", { params });
|
|
177
|
+
},
|
|
178
|
+
getUserDetailUserLogBorrowingList: (userId, params) => {
|
|
179
|
+
return API$O.get(`/borrowing-log/${userId}`, { params });
|
|
180
|
+
},
|
|
181
|
+
getUserDetailUserLogAssignmentList: (userId, params) => {
|
|
182
|
+
return API$O.get(`/assignment-log/${userId}`, { params });
|
|
183
|
+
},
|
|
184
|
+
getUserDetailUserLogBorrowingOption: (userId, params) => {
|
|
185
|
+
return API$O.get(`/borrowing-log/${userId}/options`, { params });
|
|
186
|
+
},
|
|
187
|
+
getUserDetailUserLogAssignmentOption: (userId, params) => {
|
|
188
|
+
return API$O.get(`/assignment-log/${userId}/options`, { params });
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const AssetsAPIs = createAxiosInstance({
|
|
192
|
+
prefix: "/fam/assets/v2/assets"
|
|
193
|
+
});
|
|
194
|
+
const AssetServices = {
|
|
195
|
+
getAllAssets: (params) => {
|
|
196
|
+
return AssetsAPIs.get("/", { params });
|
|
197
|
+
},
|
|
198
|
+
getAllAssetsOptions: (params) => {
|
|
199
|
+
return AssetsAPIs.get("/options", { params });
|
|
200
|
+
},
|
|
201
|
+
getOptions: (endpoint, params) => {
|
|
202
|
+
return AssetsAPIs.get(endpoint ? `/${endpoint}/options` : "/options", {
|
|
203
|
+
params
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
getUnlinkedAssets: (params) => {
|
|
207
|
+
return AssetsAPIs.get("/unlinked", { params });
|
|
208
|
+
},
|
|
209
|
+
getAssetDetail: (id, params) => {
|
|
210
|
+
return AssetsAPIs.get(`/${id}`, { params });
|
|
211
|
+
},
|
|
212
|
+
getAssetNameTotal: () => {
|
|
213
|
+
return AssetsAPIs.get("/name-amount");
|
|
214
|
+
},
|
|
215
|
+
postRegisterAsset: (body) => {
|
|
216
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
217
|
+
return AssetsAPIs.post("", body, { headers });
|
|
218
|
+
},
|
|
219
|
+
putEditAsset: (id, body) => {
|
|
220
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
221
|
+
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
222
|
+
},
|
|
223
|
+
putEditDetailCustomField: (id, body) => {
|
|
224
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
225
|
+
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
226
|
+
},
|
|
227
|
+
getLinkedAsset: (assetId, params) => {
|
|
228
|
+
return AssetsAPIs.get(`/${assetId}/linked-assets`, { params });
|
|
229
|
+
},
|
|
230
|
+
getPurchase: (assetId) => {
|
|
231
|
+
return AssetsAPIs.get(`/${assetId}/purchase`);
|
|
232
|
+
},
|
|
233
|
+
putPurchase: (body, assetId) => {
|
|
234
|
+
return AssetsAPIs.put(`/${assetId}/purchase`, body);
|
|
235
|
+
},
|
|
236
|
+
getAccounting: (assetId, params) => {
|
|
237
|
+
return AssetsAPIs.get(`/${assetId}/accounting`, { params });
|
|
238
|
+
},
|
|
239
|
+
getLinkedAssetOption: (parentId, params) => {
|
|
240
|
+
return AssetsAPIs.get(`/${parentId}/linked-assets/options`, { params });
|
|
241
|
+
},
|
|
242
|
+
putLinkAsset: (body, parentId) => {
|
|
243
|
+
return AssetsAPIs.put(`/${parentId}/linked-assets`, body);
|
|
244
|
+
},
|
|
245
|
+
putUnlinkAsset: (body, parentId) => {
|
|
246
|
+
return AssetsAPIs.put(`/${parentId}/unlink-assets`, body);
|
|
247
|
+
},
|
|
248
|
+
putEditUsefulLife: (body) => {
|
|
249
|
+
return AssetsAPIs.put("/useful-life", body);
|
|
250
|
+
},
|
|
251
|
+
getAttachment: (assetId, params) => {
|
|
252
|
+
return AssetsAPIs.get(`/attachment/${assetId}`, { params });
|
|
253
|
+
},
|
|
254
|
+
postAttachment: (body, assetId) => {
|
|
255
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
256
|
+
return AssetsAPIs.post(`/attachment/${assetId}`, body, { headers });
|
|
257
|
+
},
|
|
258
|
+
putAttachment: (body, id) => {
|
|
259
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
260
|
+
return AssetsAPIs.put(`/attachment/${id}`, body, { headers });
|
|
261
|
+
},
|
|
262
|
+
/**
|
|
263
|
+
* Deletes the attachment with the given IDs.
|
|
264
|
+
* @param {object} params - The request params containing the IDs of the attachments to delete.
|
|
265
|
+
* @returns {Promise<AxiosResponse>}
|
|
266
|
+
*/
|
|
267
|
+
deleteAttachment: (params) => {
|
|
268
|
+
return AssetsAPIs.delete("/attachment/bulk", { params });
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
const API$N = createAxiosInstance({
|
|
272
|
+
prefix: "/fam/missing-tracking/v2"
|
|
273
|
+
});
|
|
274
|
+
const MissingServices = {
|
|
275
|
+
putFoundAsset: (body) => {
|
|
276
|
+
return API$N.put("/found", body);
|
|
277
|
+
},
|
|
278
|
+
putReportMissing: (id, body) => {
|
|
279
|
+
return API$N.put(`/${id}/report-missing`, body);
|
|
280
|
+
},
|
|
281
|
+
getData: (params) => {
|
|
282
|
+
return API$N.get("/", { params });
|
|
283
|
+
},
|
|
284
|
+
getDataOptions: (params) => {
|
|
285
|
+
return API$N.get("/options", { params });
|
|
286
|
+
},
|
|
287
|
+
getDetail: (id) => {
|
|
288
|
+
return API$N.get(`/${id}`);
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const API$M = createAxiosInstance({
|
|
292
|
+
prefix: "/fam/utility/v2/notification"
|
|
293
|
+
});
|
|
294
|
+
const NotificationServices = {
|
|
295
|
+
getNotifications: (params) => {
|
|
296
|
+
return API$M.get("/", { params });
|
|
297
|
+
},
|
|
298
|
+
readNotification: (id) => {
|
|
299
|
+
return API$M.put(`/${id}`);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const API$L = createAxiosInstance({
|
|
123
303
|
prefix: "/fam/settings-user-role/v2"
|
|
124
304
|
});
|
|
125
305
|
const UserServices = {
|
|
@@ -128,19 +308,19 @@ const UserServices = {
|
|
|
128
308
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
129
309
|
*/
|
|
130
310
|
getUserDropdown: (params) => {
|
|
131
|
-
return API$
|
|
311
|
+
return API$L.get("/users/dropdown", { params });
|
|
132
312
|
},
|
|
133
313
|
getUserOptions: (params) => {
|
|
134
|
-
return API$
|
|
314
|
+
return API$L.get("/users/options", { params });
|
|
135
315
|
},
|
|
136
316
|
getUserList: (params) => {
|
|
137
|
-
return API$
|
|
317
|
+
return API$L.get("/users", { params });
|
|
138
318
|
},
|
|
139
319
|
getUserDetail: (id) => {
|
|
140
|
-
return API$
|
|
320
|
+
return API$L.get(`/users/${id}`);
|
|
141
321
|
},
|
|
142
322
|
putSetActiveBulk: (data) => {
|
|
143
|
-
return API$
|
|
323
|
+
return API$L.put("/users/set-active-bulk", data);
|
|
144
324
|
},
|
|
145
325
|
// User Detail
|
|
146
326
|
/**
|
|
@@ -151,96 +331,159 @@ const UserServices = {
|
|
|
151
331
|
*/
|
|
152
332
|
getUserDetailSystemRoles: (id, params, permissionType) => {
|
|
153
333
|
const additionalPath = permissionType ? `/${permissionType}` : "";
|
|
154
|
-
return API$
|
|
334
|
+
return API$L.get(`/users/${id}/system-roles${additionalPath}`, {
|
|
155
335
|
params
|
|
156
336
|
});
|
|
157
337
|
},
|
|
158
338
|
getUserDetailTransactionRoleList: (id, params) => {
|
|
159
|
-
return API$
|
|
339
|
+
return API$L.get(`/user-detail/${id}/transaction-role-list`, { params });
|
|
160
340
|
},
|
|
161
341
|
postUserDetailAddTransactionRole: (userId, data) => {
|
|
162
|
-
return API$
|
|
342
|
+
return API$L.post(`/users/${userId}/add-transaction-role`, data);
|
|
163
343
|
},
|
|
164
344
|
deleteUserDetailTransactionRole: (userId, body) => {
|
|
165
|
-
return API$
|
|
345
|
+
return API$L.put(`/users/${userId}/delete-transaction-role`, body);
|
|
166
346
|
},
|
|
167
347
|
putUserDetailEditTransactionRole: (userId, data) => {
|
|
168
|
-
return API$
|
|
348
|
+
return API$L.put(`/users/${userId}/edit-transaction-role`, data);
|
|
169
349
|
},
|
|
170
350
|
putAssignGroup: (data, permissionType, id) => {
|
|
171
|
-
return API$
|
|
351
|
+
return API$L.put(`/users/${id}/system-roles/${permissionType}/groups`, data);
|
|
172
352
|
},
|
|
173
353
|
putRoleSetActive: (body, userId) => {
|
|
174
|
-
return API$
|
|
354
|
+
return API$L.put(`/users/${userId}/system-roles/set-active-bulk`, body);
|
|
175
355
|
},
|
|
176
356
|
getUserDetailTransactionAdminLogList: (userId, params) => {
|
|
177
|
-
return API$
|
|
357
|
+
return API$L.get(`/users-log/${userId}/transaction-log`, { params });
|
|
178
358
|
},
|
|
179
359
|
getUserDetailTransactionAdminLogOption: (userId, params) => {
|
|
180
|
-
return API$
|
|
360
|
+
return API$L.get(`/users-log/${userId}/transaction-log/options`, { params });
|
|
181
361
|
},
|
|
182
362
|
getUserDetailUserAssetBorrowedList: (userId, params) => {
|
|
183
|
-
return API$
|
|
363
|
+
return API$L.get(`/user-detail/${userId}/assets/borrowed`, { params });
|
|
184
364
|
},
|
|
185
365
|
getUserDetailUserAssetAssignedList: (userId, params) => {
|
|
186
|
-
return API$
|
|
366
|
+
return API$L.get(`/user-detail/${userId}/assets/assigned`, { params });
|
|
187
367
|
},
|
|
188
368
|
getUserDetailUserAssetBorrowedOption: (userId, params) => {
|
|
189
|
-
return API$
|
|
369
|
+
return API$L.get(`/user-detail/${userId}/assets/borrowed/option`, { params });
|
|
190
370
|
},
|
|
191
371
|
getUserDetailUserAssetAssignedOption: (userId, params) => {
|
|
192
|
-
return API$
|
|
372
|
+
return API$L.get(`/user-detail/${userId}/assets/assigned/option`, { params });
|
|
193
373
|
}
|
|
194
374
|
};
|
|
195
|
-
const API$
|
|
375
|
+
const API$K = createAxiosInstance({
|
|
196
376
|
prefix: "/fam/settings-user-role/v2/sub-users"
|
|
197
377
|
});
|
|
198
378
|
const SubUserServices = {
|
|
199
379
|
// Sub User
|
|
200
380
|
getSubUserList: (userId, params) => {
|
|
201
|
-
return API$
|
|
381
|
+
return API$K.get(`/${userId}`, { params });
|
|
202
382
|
},
|
|
203
383
|
getSubUserOptions: (userId, params) => {
|
|
204
|
-
return API$
|
|
384
|
+
return API$K.get(`/${userId}/option`, { params });
|
|
205
385
|
},
|
|
206
386
|
postCreateSubUser: (userId, data) => {
|
|
207
387
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
208
|
-
return API$
|
|
388
|
+
return API$K.post(`/${userId}`, data, { headers });
|
|
209
389
|
},
|
|
210
390
|
putSubUserSetActiveBulk: (userId, data) => {
|
|
211
|
-
return API$
|
|
391
|
+
return API$K.put(`/${userId}/set-active-bulk`, data);
|
|
212
392
|
},
|
|
213
393
|
deleteSubUser: (userId, subUserIds) => {
|
|
214
|
-
return API$
|
|
394
|
+
return API$K.put(`/${userId}/bulk`, { subUserIds });
|
|
215
395
|
},
|
|
216
396
|
putEditSubUser: (userId, subUserId, data) => {
|
|
217
397
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
218
|
-
return API$
|
|
398
|
+
return API$K.put(`/${userId}/${subUserId}`, data, {
|
|
219
399
|
headers
|
|
220
400
|
});
|
|
221
401
|
},
|
|
222
402
|
getBorrowedAsset: (userId, subUserId, params) => {
|
|
223
|
-
return API$
|
|
403
|
+
return API$K.get(`/${userId}/${subUserId}/borrowed-asset`, {
|
|
224
404
|
params
|
|
225
405
|
});
|
|
226
406
|
},
|
|
227
407
|
getBorrowedAssetOptions: (userId, subUserId, params) => {
|
|
228
|
-
return API$
|
|
408
|
+
return API$K.get(`/${userId}/${subUserId}/borrowed-asset/options`, {
|
|
229
409
|
params
|
|
230
410
|
});
|
|
231
411
|
},
|
|
232
412
|
getAssignedAsset: (userId, subUserId, params) => {
|
|
233
|
-
return API$
|
|
413
|
+
return API$K.get(`/${userId}/${subUserId}/assigned-asset`, {
|
|
234
414
|
params
|
|
235
415
|
});
|
|
236
416
|
},
|
|
237
417
|
getAssignedAssetOptions: (userId, subUserId, params) => {
|
|
238
|
-
return API$
|
|
418
|
+
return API$K.get(`/${userId}/${subUserId}/assigned-asset/options`, {
|
|
239
419
|
params
|
|
240
420
|
});
|
|
241
421
|
}
|
|
242
422
|
};
|
|
243
|
-
const API$
|
|
423
|
+
const API$J = createAxiosInstance({
|
|
424
|
+
prefix: "/fam/utility/v2"
|
|
425
|
+
});
|
|
426
|
+
const FileManagerServices = {
|
|
427
|
+
/**
|
|
428
|
+
* Get storage information.
|
|
429
|
+
*
|
|
430
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
431
|
+
*/
|
|
432
|
+
getStorageInformation: () => {
|
|
433
|
+
return API$J.get("/files/storage");
|
|
434
|
+
},
|
|
435
|
+
/**
|
|
436
|
+
* Get file manager data.
|
|
437
|
+
*
|
|
438
|
+
* @param {FileType} type - The type of the file.
|
|
439
|
+
* @param {FileManagerFilterParams} [params] - The parameters for filtering.
|
|
440
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
441
|
+
*/
|
|
442
|
+
getFileManager: (type, params) => {
|
|
443
|
+
return API$J.get(`/${type}`, { params });
|
|
444
|
+
},
|
|
445
|
+
/**
|
|
446
|
+
* Get file manager options.
|
|
447
|
+
*
|
|
448
|
+
* @param {FileType} type - The type of the file.
|
|
449
|
+
* @param {FileManagerOptionBoolean} [params] - The parameters for options.
|
|
450
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
451
|
+
*/
|
|
452
|
+
getFileManagerOption: (type, params) => {
|
|
453
|
+
return API$J.get(`/${type}/options`, { params });
|
|
454
|
+
},
|
|
455
|
+
/**
|
|
456
|
+
* Recover files.
|
|
457
|
+
*
|
|
458
|
+
* @param {FileType} type - The type of the file.
|
|
459
|
+
* @param {object} body - The body of the request.
|
|
460
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
461
|
+
*/
|
|
462
|
+
recoverFiles: (type, body) => {
|
|
463
|
+
return API$J.put(`/${type}/recover`, body);
|
|
464
|
+
},
|
|
465
|
+
/**
|
|
466
|
+
* Delete files.
|
|
467
|
+
*
|
|
468
|
+
* @param {FileType} type - The type of the file.
|
|
469
|
+
* @param {DeleteFileManagerDto} params - The params of the request.
|
|
470
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
471
|
+
*/
|
|
472
|
+
deleteFiles: (type, params) => {
|
|
473
|
+
return API$J.delete(`/${type}`, { params });
|
|
474
|
+
},
|
|
475
|
+
/**
|
|
476
|
+
* Delete files permanently.
|
|
477
|
+
*
|
|
478
|
+
* @param {FileType} type - The type of the file.
|
|
479
|
+
* @param {object} body - The body of the request.
|
|
480
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
481
|
+
*/
|
|
482
|
+
deletePermanently: (type, params) => {
|
|
483
|
+
return API$J.delete(`/${type}/delete-permanent`, { params });
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
const API$I = createAxiosInstance({
|
|
244
487
|
prefix: "/fam/settings-user-role/v2"
|
|
245
488
|
});
|
|
246
489
|
const RoleServices = {
|
|
@@ -251,10 +494,10 @@ const RoleServices = {
|
|
|
251
494
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
252
495
|
*/
|
|
253
496
|
getTransactionRole: (groupId, transactionName) => {
|
|
254
|
-
return API$
|
|
497
|
+
return API$I.get(`/transaction-roles/${groupId}/${transactionName}`);
|
|
255
498
|
},
|
|
256
499
|
getTransactionRoleTypes: (groupKeys, transactionName) => {
|
|
257
|
-
return API$
|
|
500
|
+
return API$I.get(`/transaction-roles/${transactionName}/types`, {
|
|
258
501
|
params: { groupKeys }
|
|
259
502
|
});
|
|
260
503
|
},
|
|
@@ -266,7 +509,7 @@ const RoleServices = {
|
|
|
266
509
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
267
510
|
*/
|
|
268
511
|
putUpdateUsers: (groupId, transactionName, body) => {
|
|
269
|
-
return API$
|
|
512
|
+
return API$I.put(
|
|
270
513
|
`/transaction-roles/${groupId}/${transactionName}/update-user`,
|
|
271
514
|
body
|
|
272
515
|
);
|
|
@@ -279,7 +522,7 @@ const RoleServices = {
|
|
|
279
522
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
280
523
|
*/
|
|
281
524
|
putUpdateLevel: (groupId, transactionName, body) => {
|
|
282
|
-
return API$
|
|
525
|
+
return API$I.put(
|
|
283
526
|
`/transaction-roles/${groupId}/${transactionName}/update-approval-level`,
|
|
284
527
|
body
|
|
285
528
|
);
|
|
@@ -292,265 +535,2670 @@ const RoleServices = {
|
|
|
292
535
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
293
536
|
*/
|
|
294
537
|
putUpdateGroupManage: (groupId, transactionName, body) => {
|
|
295
|
-
return API$
|
|
538
|
+
return API$I.put(
|
|
296
539
|
`/transaction-roles/${groupId}/${transactionName}/update-manage-by-parent`,
|
|
297
540
|
body
|
|
298
541
|
);
|
|
299
542
|
},
|
|
300
543
|
getUserAssignedSystemRole: (userId) => {
|
|
301
|
-
return API$
|
|
544
|
+
return API$I.get(`/system-roles/user/${userId}`);
|
|
302
545
|
},
|
|
303
546
|
getAssignedUserAmounts: () => {
|
|
304
|
-
return API$
|
|
547
|
+
return API$I.get("/system-roles/amounts");
|
|
305
548
|
},
|
|
306
549
|
getPermissionUser: (permissionType, params) => {
|
|
307
550
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
308
551
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
309
|
-
return API$
|
|
552
|
+
return API$I.get(`/system-roles/total-control-read-only/${type}`, {
|
|
310
553
|
params
|
|
311
554
|
});
|
|
312
555
|
}
|
|
313
|
-
return API$
|
|
556
|
+
return API$I.get(`/system-roles/permission/${permissionType}`, { params });
|
|
314
557
|
},
|
|
315
558
|
getPermissionUserOptions: (permissionType, params) => {
|
|
316
559
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
317
560
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
318
|
-
return API$
|
|
561
|
+
return API$I.get(`/system-roles/total-control-read-only/${type}/options`, {
|
|
319
562
|
params
|
|
320
563
|
});
|
|
321
564
|
}
|
|
322
|
-
return API$
|
|
565
|
+
return API$I.get(`/system-roles/permission/${permissionType}/options`, {
|
|
323
566
|
params
|
|
324
567
|
});
|
|
325
568
|
},
|
|
326
569
|
getUserGroups: (params, permissionType) => {
|
|
327
|
-
return API$
|
|
570
|
+
return API$I.get(`/system-roles/permission/${permissionType}/groups`, {
|
|
328
571
|
params
|
|
329
572
|
});
|
|
330
573
|
},
|
|
331
574
|
postAssignUser: (body, permissionType) => {
|
|
332
575
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
333
576
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
334
|
-
return API$
|
|
577
|
+
return API$I.post(`/system-roles/total-control-read-only/${type}`, body);
|
|
335
578
|
}
|
|
336
|
-
return API$
|
|
579
|
+
return API$I.post(`/system-roles/permission/${permissionType}`, body);
|
|
337
580
|
},
|
|
338
581
|
putEditUser: (body, roleId) => {
|
|
339
|
-
return API$
|
|
582
|
+
return API$I.put(`/system-roles/${roleId}`, body);
|
|
340
583
|
},
|
|
341
584
|
deleteRemoveUser: (body, permissionType) => {
|
|
342
585
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
343
586
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
344
|
-
return API$
|
|
587
|
+
return API$I.put(`/system-roles/total-control-read-only/${type}`, body);
|
|
345
588
|
}
|
|
346
|
-
return API$
|
|
589
|
+
return API$I.put("/system-roles", body);
|
|
347
590
|
}
|
|
348
591
|
};
|
|
349
|
-
const API$
|
|
350
|
-
prefix: "/fam/settings-attribute/v2/
|
|
592
|
+
const API$H = createAxiosInstance({
|
|
593
|
+
prefix: "/fam/settings-attribute/v2/open-api"
|
|
351
594
|
});
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
return API$
|
|
355
|
-
},
|
|
356
|
-
getCustomFieldsByCategory: (category, params) => {
|
|
357
|
-
return API$3.get(`/${category}`, { params });
|
|
358
|
-
},
|
|
359
|
-
getOptions: async (params) => {
|
|
360
|
-
return API$3.get("/options", { params });
|
|
595
|
+
const OpenAPIServices = {
|
|
596
|
+
getOpenAPIDocs: (params) => {
|
|
597
|
+
return API$H.get(`/${params.doc}`);
|
|
361
598
|
},
|
|
362
|
-
|
|
363
|
-
return API$
|
|
364
|
-
},
|
|
365
|
-
putEditCustomField: async (params, data, id) => {
|
|
366
|
-
return API$3.put(`/${id}`, data, { params });
|
|
599
|
+
putGenerateToken: () => {
|
|
600
|
+
return API$H.put("/generate");
|
|
367
601
|
},
|
|
368
|
-
|
|
369
|
-
|
|
602
|
+
// This is if the dummy was not dummy
|
|
603
|
+
getToken: () => {
|
|
604
|
+
return API$H.get("");
|
|
370
605
|
},
|
|
371
|
-
|
|
372
|
-
return API$
|
|
606
|
+
putRequestOpenAPI: () => {
|
|
607
|
+
return API$H.put("/request");
|
|
373
608
|
},
|
|
374
|
-
|
|
375
|
-
return API$
|
|
609
|
+
putCancelRequestOpenAPI: () => {
|
|
610
|
+
return API$H.put("/cancel-request");
|
|
376
611
|
}
|
|
377
612
|
};
|
|
378
|
-
const API$
|
|
379
|
-
prefix: "/fam/
|
|
613
|
+
const API$G = createAxiosInstance({
|
|
614
|
+
prefix: "/fam/import/v2"
|
|
380
615
|
});
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
return
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
API$
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
return API$
|
|
616
|
+
const ImportServices = {
|
|
617
|
+
getImport: (importUrl, params) => {
|
|
618
|
+
return API$G.get(`/${importUrl}`, { params });
|
|
619
|
+
},
|
|
620
|
+
postImportTemporary: (importUrl, data) => {
|
|
621
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
622
|
+
return API$G.post(`/${importUrl}/temporary`, data, { headers });
|
|
623
|
+
},
|
|
624
|
+
deleteImportTemporary: (importUrl, params) => {
|
|
625
|
+
return API$G.delete(`/${importUrl}/temporary`, { params });
|
|
626
|
+
},
|
|
627
|
+
postDuplicateImport: (importUrl, body) => {
|
|
628
|
+
return API$G.post(`/${importUrl}/duplicate`, body);
|
|
629
|
+
},
|
|
630
|
+
putEditImport: (importUrl, body) => {
|
|
631
|
+
return API$G.put(`/${importUrl}`, body);
|
|
632
|
+
},
|
|
633
|
+
postImport: (importUrl, controller, body) => {
|
|
634
|
+
return API$G.post(importUrl, body, { signal: controller.signal });
|
|
635
|
+
},
|
|
636
|
+
putImportCancelProgress: (importUrl) => {
|
|
637
|
+
return API$G.put(`/${importUrl}/cancel-progress`);
|
|
397
638
|
}
|
|
398
639
|
};
|
|
399
|
-
const API$
|
|
400
|
-
|
|
640
|
+
const API$F = createAxiosInstance({
|
|
641
|
+
env: "APP_TAGSAMURAI_API",
|
|
642
|
+
prefix: "/assignment/v2"
|
|
401
643
|
});
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
return API$
|
|
644
|
+
const AssignmentServices$1 = {
|
|
645
|
+
getPreListData: (params) => {
|
|
646
|
+
return API$F.get("/prelist", { params });
|
|
405
647
|
},
|
|
406
|
-
|
|
407
|
-
return API$
|
|
408
|
-
},
|
|
409
|
-
getSessionLogList: (params) => {
|
|
410
|
-
return API$1.get("/session-log", { params });
|
|
648
|
+
getPreListOptions: (params) => {
|
|
649
|
+
return API$F.get("/prelist/options", { params });
|
|
411
650
|
},
|
|
412
|
-
|
|
413
|
-
return API$
|
|
414
|
-
params
|
|
415
|
-
});
|
|
651
|
+
getRequestData: (params) => {
|
|
652
|
+
return API$F.get("/prelist/request", { params });
|
|
416
653
|
},
|
|
417
|
-
|
|
418
|
-
return API$
|
|
654
|
+
postAddPrelistData: (body) => {
|
|
655
|
+
return API$F.post("/prelist", body);
|
|
419
656
|
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
423
|
-
*/
|
|
424
|
-
getTransactionLogOption: (params) => {
|
|
425
|
-
return API$1.get("/transaction-log/options", { params });
|
|
657
|
+
getDetailRequestData: (id, params) => {
|
|
658
|
+
return API$F.get(`/transaction/${id}/request`, { params });
|
|
426
659
|
},
|
|
427
|
-
|
|
428
|
-
return API$
|
|
660
|
+
getDetailRequestOption: (params, id) => {
|
|
661
|
+
return API$F.get(`/transaction/${id}/request/options`, { params });
|
|
429
662
|
},
|
|
430
|
-
|
|
431
|
-
return API$
|
|
663
|
+
getTransactionData: (params) => {
|
|
664
|
+
return API$F.get("/transaction", { params });
|
|
432
665
|
},
|
|
433
|
-
|
|
434
|
-
return API$
|
|
666
|
+
getTransactionOptions: (params) => {
|
|
667
|
+
return API$F.get("/transaction/options", { params });
|
|
435
668
|
},
|
|
436
|
-
|
|
437
|
-
return API$
|
|
669
|
+
getDetailTransactionData: (id) => {
|
|
670
|
+
return API$F.get(`/transaction/${id}`);
|
|
438
671
|
},
|
|
439
|
-
|
|
440
|
-
return API$
|
|
672
|
+
getTransactionApproval: (params) => {
|
|
673
|
+
return API$F.get("/approval", { params });
|
|
441
674
|
},
|
|
442
|
-
|
|
443
|
-
return API$
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
const AssetsAPIs = createAxiosInstance({
|
|
447
|
-
prefix: "/fam/assets/v2/assets"
|
|
448
|
-
});
|
|
449
|
-
const AssetServices = {
|
|
450
|
-
getAllAssets: (params) => {
|
|
451
|
-
return AssetsAPIs.get("/", { params });
|
|
675
|
+
getApprovalData: (transactionId, params) => {
|
|
676
|
+
return API$F.get(`/approval/transaction/${transactionId}`, { params });
|
|
452
677
|
},
|
|
453
|
-
|
|
454
|
-
return
|
|
678
|
+
getTransactionApprovalOptions: (params) => {
|
|
679
|
+
return API$F.get("/approval/options", { params });
|
|
455
680
|
},
|
|
456
|
-
|
|
457
|
-
return
|
|
681
|
+
getApprovalOptions: (transactionId, params) => {
|
|
682
|
+
return API$F.get(`/approval/transaction/${transactionId}/options`, {
|
|
458
683
|
params
|
|
459
684
|
});
|
|
460
685
|
},
|
|
461
|
-
|
|
462
|
-
return
|
|
686
|
+
getTransactionApprovers: (id) => {
|
|
687
|
+
return API$F.get(`/approval/transaction/${id}/transaction`);
|
|
463
688
|
},
|
|
464
|
-
|
|
465
|
-
return
|
|
689
|
+
putApproveApproval: (body) => {
|
|
690
|
+
return API$F.put("/approval/approve", body);
|
|
466
691
|
},
|
|
467
|
-
|
|
468
|
-
return
|
|
692
|
+
getDetailTransactionLog: (id) => {
|
|
693
|
+
return API$F.get(`/transaction/request/${id}/transaction-log`);
|
|
469
694
|
},
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
return AssetsAPIs.post("", body, { headers });
|
|
695
|
+
getVerifyAsset: (params, id) => {
|
|
696
|
+
return API$F.get(`/transaction/${id}/request/scan`, { params });
|
|
473
697
|
},
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
698
|
+
putEditAssignedUser: (id, body) => {
|
|
699
|
+
return API$F.put(`/transaction/${id}/user`, body);
|
|
477
700
|
},
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
701
|
+
putEditEmailConfirmation: (id, body) => {
|
|
702
|
+
return API$F.put(`/transaction/${id}/update-email-or-assigned-user`, body);
|
|
481
703
|
},
|
|
482
|
-
|
|
483
|
-
return
|
|
704
|
+
postSendConfirmationEmail: (id) => {
|
|
705
|
+
return API$F.post(`/transaction/${id}/send-confirmation-email`);
|
|
484
706
|
},
|
|
485
|
-
|
|
486
|
-
return
|
|
707
|
+
postTransaction: (body) => {
|
|
708
|
+
return API$F.post("/transaction", body);
|
|
709
|
+
},
|
|
710
|
+
putTransactionRequest: (id, body) => {
|
|
711
|
+
return API$F.put(`/transaction/${id}/request`, body);
|
|
712
|
+
},
|
|
713
|
+
putCancelTransaction: (body) => {
|
|
714
|
+
return API$F.put("/transaction/cancel", body);
|
|
715
|
+
},
|
|
716
|
+
putCancelAssignmentRequest: (body) => {
|
|
717
|
+
return API$F.put("/transaction/request/cancel", body);
|
|
718
|
+
},
|
|
719
|
+
putVerifyRequest: (body, id) => {
|
|
720
|
+
return API$F.put(`/transaction/${id}/verify-requests`, body);
|
|
721
|
+
},
|
|
722
|
+
putVerifyToken: (body) => {
|
|
723
|
+
return API$F.put("/transaction/verify-token", body);
|
|
724
|
+
},
|
|
725
|
+
putHandoverConfirm: (body) => {
|
|
726
|
+
return API$F.put("/transaction/handover-confirmation", body);
|
|
727
|
+
},
|
|
728
|
+
putAssignHandover: (transaction) => {
|
|
729
|
+
return API$F.put(`/transaction/${transaction}/handover`);
|
|
730
|
+
},
|
|
731
|
+
deletePrelistData: (params) => {
|
|
732
|
+
return API$F.delete("/prelist", { params });
|
|
733
|
+
},
|
|
734
|
+
deleteRequestPrelistData: (body) => {
|
|
735
|
+
return API$F.delete("/prelist/request", { data: body });
|
|
736
|
+
},
|
|
737
|
+
getAssignedByAsset: (params) => {
|
|
738
|
+
return API$F.get("/transaction/request/assigned/by-asset", { params });
|
|
739
|
+
},
|
|
740
|
+
getAssignedByAssetOptions: (params) => {
|
|
741
|
+
return API$F.get("/transaction/request/assigned/by-asset/options", {
|
|
742
|
+
params
|
|
743
|
+
});
|
|
744
|
+
},
|
|
745
|
+
getAssignedByUser: (params) => {
|
|
746
|
+
return API$F.get("/transaction/request/assigned/by-user", { params });
|
|
747
|
+
},
|
|
748
|
+
getAssignedByUserOptions: (params) => {
|
|
749
|
+
return API$F.get("/transaction/request/assigned/by-user/options", { params });
|
|
750
|
+
},
|
|
751
|
+
postUnassignPrelistAsset: (body) => {
|
|
752
|
+
return API$F.post("/prelist", body);
|
|
753
|
+
},
|
|
754
|
+
postUnassignPrelistUser: (body) => {
|
|
755
|
+
return API$F.post("/prelist/unassign/by-user", body);
|
|
756
|
+
},
|
|
757
|
+
putUnassignRequest: (body) => {
|
|
758
|
+
return API$F.put("/transaction/request/unassign", body);
|
|
759
|
+
},
|
|
760
|
+
putReportDone: (id, body) => {
|
|
761
|
+
return API$F.put(`/transaction/${id}/confirm-report-done`, body);
|
|
762
|
+
},
|
|
763
|
+
getHistory: (type, params) => {
|
|
764
|
+
const urlType = type.split(" ").join("-").toLowerCase();
|
|
765
|
+
return API$F.get(`/transaction/history/${urlType}`, { params });
|
|
766
|
+
},
|
|
767
|
+
getHistoryOptions: (params) => {
|
|
768
|
+
return API$F.get("/transaction/history/options", { params });
|
|
769
|
+
},
|
|
770
|
+
getHistoryByTransactionOptions: (params) => {
|
|
771
|
+
return API$F.get("/transaction/history/by-transaction/options", { params });
|
|
772
|
+
},
|
|
773
|
+
putCancelReport: (body) => {
|
|
774
|
+
return API$F.put("/transaction/request/cancel-report", body);
|
|
775
|
+
},
|
|
776
|
+
getTaskAssignment: async (params) => {
|
|
777
|
+
return API$F.get("/transaction/my-asset/task", { params });
|
|
778
|
+
},
|
|
779
|
+
getTaskAssignmentOptions: async (params) => {
|
|
780
|
+
return API$F.get("/transaction/my-asset/task/options", { params });
|
|
781
|
+
},
|
|
782
|
+
getAssignedAsset: async (params) => {
|
|
783
|
+
return API$F.get("/transaction/my-asset/assigned-asset", { params });
|
|
784
|
+
},
|
|
785
|
+
getAssignedAssetOptions: async (params) => {
|
|
786
|
+
return API$F.get("/transaction/my-asset/assigned-asset/options", { params });
|
|
787
|
+
},
|
|
788
|
+
putCancelAssignment: async (body) => {
|
|
789
|
+
return API$F.put("/transaction/cancel", { id: body.id });
|
|
790
|
+
},
|
|
791
|
+
putCancelReportById: async (body) => {
|
|
792
|
+
return API$F.put(`/transaction/request/${body.id}/cancel-report`);
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
const API$E = createAxiosInstance({
|
|
796
|
+
prefix: "/fam/assignment/v2"
|
|
797
|
+
});
|
|
798
|
+
const AssignmentServices = {
|
|
799
|
+
...AssignmentServices$1,
|
|
800
|
+
// Temporary inclusion of methods from OldAssignmentServices. Move individual methods here once they are refactored and ready.
|
|
801
|
+
getTransactionData: (params) => {
|
|
802
|
+
return API$E.get("/transaction", { params });
|
|
803
|
+
},
|
|
804
|
+
getTransactionOptions: (params) => {
|
|
805
|
+
return API$E.get("/transaction/options", { params });
|
|
806
|
+
},
|
|
807
|
+
getDetailTransactionLog: (id) => {
|
|
808
|
+
return API$E.get(`/transaction/request/${id}/transaction-log`);
|
|
809
|
+
},
|
|
810
|
+
postTransaction: (body) => {
|
|
811
|
+
return API$E.post("/transaction", body);
|
|
812
|
+
},
|
|
813
|
+
putTransaction: (body) => {
|
|
814
|
+
return API$E.put("/transaction", body);
|
|
815
|
+
},
|
|
816
|
+
putUnassignTransaction: (body) => {
|
|
817
|
+
return API$E.put("/transaction/unassign", body);
|
|
818
|
+
},
|
|
819
|
+
putCancelReport: (body) => {
|
|
820
|
+
return API$E.put("/transaction/request/cancel-report", body);
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
const API$D = createAxiosInstance({
|
|
824
|
+
prefix: "/fam/license/v2"
|
|
825
|
+
});
|
|
826
|
+
const TotalLicenseServices = {
|
|
827
|
+
getTotalLicense: () => {
|
|
828
|
+
return API$D.get("/total-license");
|
|
829
|
+
},
|
|
830
|
+
getPurchasedData: (params) => {
|
|
831
|
+
return API$D.get("/purchase", { params });
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
const LicenseConcurrentServices = {
|
|
835
|
+
getConcurrentUserData: () => {
|
|
836
|
+
return API$D.get("/concurrent-user-data");
|
|
837
|
+
},
|
|
838
|
+
getConcurrentUserList: (params) => {
|
|
839
|
+
return API$D.get("/concurrent-user", { params });
|
|
840
|
+
},
|
|
841
|
+
putLogoutUsers: (body) => {
|
|
842
|
+
return API$D.put("/concurrent-user", body);
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
const LicenseAssetServices = {
|
|
846
|
+
getFixedAssetPerGroup: (groupId, params) => {
|
|
847
|
+
return API$D.get(`/${groupId}/assets`, { params });
|
|
848
|
+
},
|
|
849
|
+
deleteAssetData: (params) => {
|
|
850
|
+
return API$D.delete("/assets", { params });
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
const LicenseServices = {
|
|
854
|
+
getFilterOptions: (path, params) => {
|
|
855
|
+
return API$D.get(`/${path}`, { params });
|
|
856
|
+
},
|
|
857
|
+
...TotalLicenseServices,
|
|
858
|
+
...LicenseConcurrentServices,
|
|
859
|
+
...LicenseAssetServices
|
|
860
|
+
};
|
|
861
|
+
const API$C = createAxiosInstance({
|
|
862
|
+
prefix: "/fam/damage-repair-ticketing/v2"
|
|
863
|
+
});
|
|
864
|
+
const DamageServices = {
|
|
865
|
+
getDamageReportList: (params) => {
|
|
866
|
+
return API$C.get("/", { params });
|
|
867
|
+
},
|
|
868
|
+
getDamageReportListFilterOptions: (params) => {
|
|
869
|
+
return API$C.get("/options", { params });
|
|
870
|
+
},
|
|
871
|
+
getDamageReportDetail: (reportId) => {
|
|
872
|
+
return API$C.get(`/${reportId}`);
|
|
873
|
+
},
|
|
874
|
+
putReportDamage: (id, body) => {
|
|
875
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
876
|
+
return API$C.put(`/${id}/report-damage`, body, { headers });
|
|
877
|
+
},
|
|
878
|
+
putMarkAsRepaired: (body) => {
|
|
879
|
+
return API$C.put("/repair", body);
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
const API$B = createAxiosInstance({
|
|
883
|
+
prefix: "/fam/assets/v2/my-assets"
|
|
884
|
+
});
|
|
885
|
+
const MyAssetServices = {
|
|
886
|
+
getAssigned: async (params) => {
|
|
887
|
+
return API$B.get("/assigned", { params });
|
|
888
|
+
},
|
|
889
|
+
getAssignedOptions: async (params) => {
|
|
890
|
+
return API$B.get("/assigned/options", { params });
|
|
891
|
+
},
|
|
892
|
+
getBorrowed: async (params) => {
|
|
893
|
+
return API$B.get("/borrowed", { params });
|
|
894
|
+
},
|
|
895
|
+
getBorrowedOptions: async (params) => {
|
|
896
|
+
return API$B.get("/borrowed/options", { params });
|
|
897
|
+
},
|
|
898
|
+
getHistory: async (params) => {
|
|
899
|
+
return API$B.get("/history", { params });
|
|
900
|
+
},
|
|
901
|
+
getHistoryOptions: async (params) => {
|
|
902
|
+
return API$B.get("/history/options", { params });
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
const PREFIX = "/transfer/v2";
|
|
906
|
+
const PrelistAPI = createAxiosInstance({
|
|
907
|
+
env: "APP_TAGSAMURAI_API",
|
|
908
|
+
prefix: `${PREFIX}/prelist`
|
|
909
|
+
});
|
|
910
|
+
const TransactionAPI = createAxiosInstance({
|
|
911
|
+
env: "APP_TAGSAMURAI_API",
|
|
912
|
+
prefix: `${PREFIX}/transaction`
|
|
913
|
+
});
|
|
914
|
+
const ApprovalAPI$1 = createAxiosInstance({
|
|
915
|
+
env: "APP_TAGSAMURAI_API",
|
|
916
|
+
prefix: `${PREFIX}/approval`
|
|
917
|
+
});
|
|
918
|
+
const TransferServices = {
|
|
919
|
+
// ------ TRANSACTION ------
|
|
920
|
+
getTransactions: (params) => {
|
|
921
|
+
return TransactionAPI.get("/", { params });
|
|
922
|
+
},
|
|
923
|
+
getTransactionDetail: (id) => {
|
|
924
|
+
return TransactionAPI.get(`/${id}`);
|
|
925
|
+
},
|
|
926
|
+
getTransactionDetailAssets: (id, params) => {
|
|
927
|
+
return TransactionAPI.get(`/${id}/request`, { params });
|
|
928
|
+
},
|
|
929
|
+
getRequestFilterOptions: (id, field) => {
|
|
930
|
+
const params = {};
|
|
931
|
+
if (field) {
|
|
932
|
+
params[field] = true;
|
|
933
|
+
} else {
|
|
934
|
+
params.nameOptions = true;
|
|
935
|
+
params.brandOptions = true;
|
|
936
|
+
params.modelOptions = true;
|
|
937
|
+
}
|
|
938
|
+
return TransactionAPI.get(`/${id}/request/options`, { params });
|
|
939
|
+
},
|
|
940
|
+
getOldTransactionLog: (id) => {
|
|
941
|
+
return TransactionAPI.get(`/request/${id}/transaction-log`);
|
|
942
|
+
},
|
|
943
|
+
getOldTransactionOptions: (field) => {
|
|
944
|
+
const params = {};
|
|
945
|
+
params[field] = true;
|
|
946
|
+
return TransactionAPI.get("/options", { params });
|
|
947
|
+
},
|
|
948
|
+
postOldCreateTransaction: (body) => {
|
|
949
|
+
return TransactionAPI.post("/", body);
|
|
950
|
+
},
|
|
951
|
+
putCancelTransactions: (ids) => {
|
|
952
|
+
const body = { id: ids };
|
|
953
|
+
return TransactionAPI.put("/cancel", body);
|
|
954
|
+
},
|
|
955
|
+
putUpdateTransaction: (id, body) => {
|
|
956
|
+
return TransactionAPI.put(`/${id}`, body);
|
|
957
|
+
},
|
|
958
|
+
putCancelRequests: (ids) => {
|
|
959
|
+
const body = { id: ids };
|
|
960
|
+
return TransactionAPI.put("/request/cancel", body);
|
|
961
|
+
},
|
|
962
|
+
getHistoryByTransaction: (params) => {
|
|
963
|
+
return TransactionAPI.get("/history", { params });
|
|
964
|
+
},
|
|
965
|
+
getHistoryByTransactionOptions: (field) => {
|
|
966
|
+
const params = {};
|
|
967
|
+
params[field] = true;
|
|
968
|
+
return TransactionAPI.get("/history/options", { params });
|
|
969
|
+
},
|
|
970
|
+
getHistoryByAsset: (params) => {
|
|
971
|
+
return TransactionAPI.get("/history/by-asset", { params });
|
|
972
|
+
},
|
|
973
|
+
getHistoryByAssetOptions: (field) => {
|
|
974
|
+
const params = {};
|
|
975
|
+
params[field] = true;
|
|
976
|
+
return TransactionAPI.get("/history/by-asset/options", { params });
|
|
977
|
+
},
|
|
978
|
+
getApproverList: (tranasctionId) => {
|
|
979
|
+
return TransactionAPI.get(`/${tranasctionId}/approval-history`);
|
|
980
|
+
},
|
|
981
|
+
putHandoverTransaction: (id, body) => {
|
|
982
|
+
return TransactionAPI.put(`/${id}/handover`, body);
|
|
983
|
+
},
|
|
984
|
+
// ------ PRELIST ------
|
|
985
|
+
getPrelist: (params) => {
|
|
986
|
+
return PrelistAPI.get("/", { params });
|
|
987
|
+
},
|
|
988
|
+
postAddPrelistData: (body) => {
|
|
989
|
+
return PrelistAPI.post("/", body);
|
|
990
|
+
},
|
|
991
|
+
deletePrelist: (ids) => {
|
|
992
|
+
return PrelistAPI.delete("/", {
|
|
993
|
+
params: {
|
|
994
|
+
id: JSON.stringify(ids)
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
},
|
|
998
|
+
getPrelistAssets: (id) => {
|
|
999
|
+
const params = { id };
|
|
1000
|
+
return PrelistAPI.get("/request", { params });
|
|
1001
|
+
},
|
|
1002
|
+
// APPROVAL
|
|
1003
|
+
getApprovals: (status, params) => {
|
|
1004
|
+
const formattedParams = { ...params, status: JSON.stringify([status]) };
|
|
1005
|
+
return ApprovalAPI$1.get("/", { params: formattedParams });
|
|
1006
|
+
},
|
|
1007
|
+
getApprovalOptions: (status, field) => {
|
|
1008
|
+
const params = {
|
|
1009
|
+
status: JSON.stringify([status])
|
|
1010
|
+
};
|
|
1011
|
+
params[field] = true;
|
|
1012
|
+
return ApprovalAPI$1.get("/options", { params });
|
|
1013
|
+
},
|
|
1014
|
+
getApprovalDetail: (id, approvalType) => {
|
|
1015
|
+
const params = {
|
|
1016
|
+
groupType: approvalType
|
|
1017
|
+
};
|
|
1018
|
+
return ApprovalAPI$1.get(`/transaction/${id}`, { params });
|
|
1019
|
+
},
|
|
1020
|
+
getApprovalDetailOptions: (id, field, approvalType) => {
|
|
1021
|
+
const params = {};
|
|
1022
|
+
params[field] = true;
|
|
1023
|
+
params.groupType = approvalType;
|
|
1024
|
+
return ApprovalAPI$1.get(`/transaction/${id}/options`, { params });
|
|
1025
|
+
},
|
|
1026
|
+
putUpdateApproval: (body) => {
|
|
1027
|
+
return ApprovalAPI$1.put("/approve", body);
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
const API$A = createAxiosInstance({
|
|
1031
|
+
prefix: "/fam/transfer/v2"
|
|
1032
|
+
});
|
|
1033
|
+
const TransferServicesGo = {
|
|
1034
|
+
...TransferServices,
|
|
1035
|
+
getTransactionData: (params) => {
|
|
1036
|
+
return API$A.get("/transaction", { params });
|
|
1037
|
+
},
|
|
1038
|
+
getTransactionOptions: (params) => {
|
|
1039
|
+
return API$A.get("/transaction/options", { params });
|
|
1040
|
+
},
|
|
1041
|
+
getTransactionLog: (id) => {
|
|
1042
|
+
return API$A.get(`/transaction/request/${id}/transaction-log`);
|
|
1043
|
+
},
|
|
1044
|
+
postCreateTransaction: (body) => {
|
|
1045
|
+
return API$A.post("/transaction", body);
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
const API$z = createAxiosInstance({
|
|
1049
|
+
env: "APP_TAGSAMURAI_API",
|
|
1050
|
+
prefix: "/borrowing/v2"
|
|
1051
|
+
});
|
|
1052
|
+
const BorrowServices = {
|
|
1053
|
+
getTaskBorrowing: async (params) => {
|
|
1054
|
+
return API$z.get("/transaction/my-asset/task", { params });
|
|
1055
|
+
},
|
|
1056
|
+
getTaskBorrowingOptions: async (params) => {
|
|
1057
|
+
return API$z.get("/transaction/my-asset/task/options", { params });
|
|
1058
|
+
},
|
|
1059
|
+
getBorrowedAsset: async (params) => {
|
|
1060
|
+
return API$z.get("/transaction/my-asset/borrowed-asset", { params });
|
|
1061
|
+
},
|
|
1062
|
+
getBorrowedOptions: async (params) => {
|
|
1063
|
+
return API$z.get("/transaction/my-asset/borrowed-asset/options", { params });
|
|
1064
|
+
},
|
|
1065
|
+
getHistory: async (params) => {
|
|
1066
|
+
return API$z.get("/transaction/my-asset/history", { params });
|
|
1067
|
+
},
|
|
1068
|
+
getHistoryOptions: async (params) => {
|
|
1069
|
+
return API$z.get("/transaction/my-asset/history/options", { params });
|
|
1070
|
+
},
|
|
1071
|
+
postAddPrelistData: (body) => {
|
|
1072
|
+
return API$z.post("/prelist", body);
|
|
1073
|
+
},
|
|
1074
|
+
putCancelBorrowing: async (body) => {
|
|
1075
|
+
return API$z.put("/transaction/cancel", { id: body.id });
|
|
1076
|
+
},
|
|
1077
|
+
putCancelExtensionRequest: async (body) => {
|
|
1078
|
+
return API$z.put(`/transaction/${body.id}/cancel-extension`);
|
|
1079
|
+
},
|
|
1080
|
+
putCancelRequestReport: async (body) => {
|
|
1081
|
+
return API$z.put(`/transaction/request/${body.id}/cancel-report`);
|
|
1082
|
+
},
|
|
1083
|
+
putDeclineExtensionRequest: async (body) => {
|
|
1084
|
+
return API$z.put("transaction/request/decline", body);
|
|
1085
|
+
},
|
|
1086
|
+
putUpdateRequestExtension: async (body) => {
|
|
1087
|
+
return API$z.put("transaction/request/duration", body);
|
|
1088
|
+
},
|
|
1089
|
+
// ------------------------------------------------------------------------------------------------------------ //
|
|
1090
|
+
getBorrowingPrelist: (params) => {
|
|
1091
|
+
return API$z.get("/prelist", { params });
|
|
1092
|
+
},
|
|
1093
|
+
getBorrowingPrelistOptions: (params) => {
|
|
1094
|
+
return API$z.get("/prelist/options", { params });
|
|
1095
|
+
},
|
|
1096
|
+
deleteBorrowingPrelist: (id) => {
|
|
1097
|
+
return API$z.delete("/prelist", { data: { id } });
|
|
1098
|
+
},
|
|
1099
|
+
getBorrowingRequest: (params) => {
|
|
1100
|
+
return API$z.get("/prelist/request", { params });
|
|
1101
|
+
},
|
|
1102
|
+
getBorrowingRequestOptions: (params) => {
|
|
1103
|
+
return API$z.get("/prelist/request/options", { params });
|
|
1104
|
+
},
|
|
1105
|
+
postBorrowingRequest: (data) => {
|
|
1106
|
+
return API$z.post("/prelist/request", data);
|
|
1107
|
+
},
|
|
1108
|
+
putBorrowingRequest: (data) => {
|
|
1109
|
+
return API$z.put("/prelist/request", data);
|
|
1110
|
+
},
|
|
1111
|
+
deleteBorrowingRequest: (id) => {
|
|
1112
|
+
return API$z.delete("/prelist/request", { data: { id } });
|
|
1113
|
+
},
|
|
1114
|
+
postBorrowingTransaction: (data) => {
|
|
1115
|
+
return API$z.post("/transaction", data, { params: { sourceWeb: true } });
|
|
1116
|
+
},
|
|
1117
|
+
getBorrowingTransaction: (params) => {
|
|
1118
|
+
return API$z.get("/transaction", { params });
|
|
1119
|
+
},
|
|
1120
|
+
getBorrowingTransactionOptions: (params) => {
|
|
1121
|
+
return API$z.get("/transaction/options", { params });
|
|
1122
|
+
},
|
|
1123
|
+
putCancelBorrowingTransaction: (id) => {
|
|
1124
|
+
return API$z.put("/transaction/cancel", { id });
|
|
1125
|
+
},
|
|
1126
|
+
putCancelBorrowingRequest: (id) => {
|
|
1127
|
+
return API$z.put("/transaction/request/cancel", { id });
|
|
1128
|
+
},
|
|
1129
|
+
putCancelExtendBorrowingRequest: (id) => {
|
|
1130
|
+
return API$z.put("/transaction/request/extend/cancel", { id });
|
|
1131
|
+
},
|
|
1132
|
+
getBorrowingTransactionDetail: (id) => {
|
|
1133
|
+
return API$z.get(`/transaction/${id}`);
|
|
1134
|
+
},
|
|
1135
|
+
getBorrowingTransactionRequestList: (params) => {
|
|
1136
|
+
return API$z.get("/transaction/request", { params });
|
|
1137
|
+
},
|
|
1138
|
+
getBorrowingTransactionRequest: (id, params) => {
|
|
1139
|
+
return API$z.get(`/transaction/${id}/request`, { params });
|
|
1140
|
+
},
|
|
1141
|
+
getBorrowingTransactionRequestOptions: (id, params) => {
|
|
1142
|
+
return API$z.get(`/transaction/${id}/request/options`, { params });
|
|
1143
|
+
},
|
|
1144
|
+
putBorrowingTransactionRequest: (id, data) => {
|
|
1145
|
+
return API$z.put(`/transaction/${id}/request`, data);
|
|
1146
|
+
},
|
|
1147
|
+
getApprovalList: (id) => {
|
|
1148
|
+
return API$z.get(`/approval/transaction/${id}/transaction`);
|
|
1149
|
+
},
|
|
1150
|
+
putUpdateEmailorBorrower: (id, data) => {
|
|
1151
|
+
return API$z.put(`/transaction/${id}/update-email-or-borrower`, data);
|
|
1152
|
+
},
|
|
1153
|
+
getTransactionRequestScan: (id, tag) => {
|
|
1154
|
+
return API$z.get(`/transaction/${id}/request/scan`, { params: { tag } });
|
|
1155
|
+
},
|
|
1156
|
+
putUpdateBorrower: (id, userId) => {
|
|
1157
|
+
return API$z.put(`/transaction/${id}/user`, { user: userId });
|
|
1158
|
+
},
|
|
1159
|
+
postSendConfirmationEmail: (id) => {
|
|
1160
|
+
return API$z.post(`/transaction/${id}/send-confirmation-email`);
|
|
1161
|
+
},
|
|
1162
|
+
putVerifyRequests: (id, data) => {
|
|
1163
|
+
return API$z.put(`/transaction/${id}/verify-requests`, data);
|
|
1164
|
+
},
|
|
1165
|
+
getBorrowingTransactionHistoryByTransaction: (params) => {
|
|
1166
|
+
return API$z.get("/transaction/history/by-transaction", { params });
|
|
1167
|
+
},
|
|
1168
|
+
getBorrowingTransactionHistoryByAsset: (params) => {
|
|
1169
|
+
return API$z.get("/transaction/history/by-asset", { params });
|
|
1170
|
+
},
|
|
1171
|
+
getBorrowingTransactionHistoryOptions: (params) => {
|
|
1172
|
+
return API$z.get("/transaction/history/options", { params });
|
|
1173
|
+
},
|
|
1174
|
+
putBorrowingVerifyToken: (token) => {
|
|
1175
|
+
return API$z.put("/transaction/verify-token", { token });
|
|
1176
|
+
},
|
|
1177
|
+
putBorrowingHandoverConfirmation: (data) => {
|
|
1178
|
+
return API$z.put("/transaction/handover-confirmation", data);
|
|
1179
|
+
},
|
|
1180
|
+
putBorrowingHandover: (id) => {
|
|
1181
|
+
return API$z.put(`/transaction/${id}/handover`);
|
|
1182
|
+
},
|
|
1183
|
+
putBorrowingExtendRequest: (data) => {
|
|
1184
|
+
return API$z.put("/transaction/request/extend", data);
|
|
1185
|
+
},
|
|
1186
|
+
putBorrowingExtendApproval: (data) => {
|
|
1187
|
+
return API$z.put("/approval/approve/request-extension", data, {
|
|
1188
|
+
params: { sourceWeb: true }
|
|
1189
|
+
});
|
|
1190
|
+
},
|
|
1191
|
+
putBorrowingDeclineExtendRequest: (id) => {
|
|
1192
|
+
return API$z.put("/transaction/request/decline", { id });
|
|
1193
|
+
},
|
|
1194
|
+
getBorrowingBorrowedAsset: (params) => {
|
|
1195
|
+
return API$z.get("/transaction/request/borrowed/by-asset", { params });
|
|
1196
|
+
},
|
|
1197
|
+
getBorrowingBorrowedAssetOptions: (params) => {
|
|
1198
|
+
return API$z.get("/transaction/request/borrowed/by-asset/options", {
|
|
1199
|
+
params
|
|
1200
|
+
});
|
|
1201
|
+
},
|
|
1202
|
+
getBorrowingBorrowedBorrower: (params) => {
|
|
1203
|
+
return API$z.get("/transaction/request/borrowed/by-user", { params });
|
|
1204
|
+
},
|
|
1205
|
+
putBorrowingReportDamaged: (id, data) => {
|
|
1206
|
+
return API$z.put(`/transaction/request/${id}/damaged`, data);
|
|
1207
|
+
},
|
|
1208
|
+
putBorrowingReportMissing: (id, data) => {
|
|
1209
|
+
return API$z.put(`/transaction/request/${id}/missing`, data);
|
|
1210
|
+
},
|
|
1211
|
+
putBorrowingReturn: (id) => {
|
|
1212
|
+
return API$z.put("/transaction/request/return", { id });
|
|
1213
|
+
},
|
|
1214
|
+
getBorrowingLog: (id) => {
|
|
1215
|
+
return API$z.get(`/transaction/request/${id}/transaction-log`);
|
|
1216
|
+
},
|
|
1217
|
+
putConfirmReportDone: (id, data) => {
|
|
1218
|
+
return API$z.put(`/transaction/request/${id}/confirm-report-done`, data);
|
|
1219
|
+
},
|
|
1220
|
+
putCancelReportBulk: (id) => {
|
|
1221
|
+
return API$z.put("/transaction/request/cancel-report", {
|
|
1222
|
+
id
|
|
1223
|
+
});
|
|
1224
|
+
},
|
|
1225
|
+
putBorrowingEditExtension: (data) => {
|
|
1226
|
+
return API$z.put("/transaction/request/duration", data);
|
|
1227
|
+
},
|
|
1228
|
+
getApproval: (params) => {
|
|
1229
|
+
return API$z.get("/approval", { params });
|
|
1230
|
+
},
|
|
1231
|
+
getApprovalOptions: (params) => {
|
|
1232
|
+
return API$z.get("/approval/options", { params });
|
|
1233
|
+
},
|
|
1234
|
+
getApprovalTransactionRequest: (id, params) => {
|
|
1235
|
+
return API$z.get(`/approval/transaction/${id}`, { params });
|
|
1236
|
+
},
|
|
1237
|
+
getApprovalTransactionRequestOptions: (id, params) => {
|
|
1238
|
+
return API$z.get(`/approval/transaction/${id}/options`, { params });
|
|
1239
|
+
},
|
|
1240
|
+
putApprovalApprove: (data) => {
|
|
1241
|
+
return API$z.put("/approval/approve", data, {
|
|
1242
|
+
params: { sourceWeb: true }
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
const API$y = createAxiosInstance({
|
|
1247
|
+
prefix: "/fam/borrowing/v2"
|
|
1248
|
+
});
|
|
1249
|
+
const BorrowServicesGo = {
|
|
1250
|
+
...BorrowServices,
|
|
1251
|
+
// Temporary inclusion of methods from OldBorrowServices. Move individual methods here once they are refactored and ready.
|
|
1252
|
+
getTransactions: async (params) => {
|
|
1253
|
+
return API$y.get("/transaction", { params });
|
|
1254
|
+
},
|
|
1255
|
+
getTransactionOptions: async (params) => {
|
|
1256
|
+
return API$y.get("/transaction/options", { params });
|
|
1257
|
+
},
|
|
1258
|
+
getTransactionLog: async (id) => {
|
|
1259
|
+
return API$y.get(`/transaction/request/${id}/transaction-log`);
|
|
1260
|
+
},
|
|
1261
|
+
postTransaction: async (body) => {
|
|
1262
|
+
return API$y.post("/transaction", body);
|
|
1263
|
+
},
|
|
1264
|
+
putTransaction: async (body) => {
|
|
1265
|
+
return API$y.put("/transaction", body);
|
|
1266
|
+
},
|
|
1267
|
+
putTransactionReturn: async (requestIds) => {
|
|
1268
|
+
const body = { id: requestIds };
|
|
1269
|
+
return API$y.put("/transaction/return", body);
|
|
1270
|
+
},
|
|
1271
|
+
putCancelReport: async (requestIds) => {
|
|
1272
|
+
const body = { id: requestIds };
|
|
1273
|
+
return API$y.put("/transaction/request/cancel-report", body);
|
|
1274
|
+
}
|
|
1275
|
+
};
|
|
1276
|
+
const API$x = createAxiosInstance({
|
|
1277
|
+
prefix: "/fam/disposal/v2/"
|
|
1278
|
+
});
|
|
1279
|
+
const DisposalServices$1 = {
|
|
1280
|
+
getReportedDisposal: (params) => {
|
|
1281
|
+
return API$x.get("/report", { params });
|
|
1282
|
+
},
|
|
1283
|
+
getReportedDisposalOptions: (params) => {
|
|
1284
|
+
return API$x.get("/report/options", { params });
|
|
1285
|
+
},
|
|
1286
|
+
postReportDisposal: (body) => {
|
|
1287
|
+
return API$x.post("/report", body);
|
|
1288
|
+
},
|
|
1289
|
+
deleteCancelReport: (params) => {
|
|
1290
|
+
params.isFromDisposal = "false";
|
|
1291
|
+
return API$x.delete("/report/cancel-report", { params });
|
|
1292
|
+
},
|
|
1293
|
+
deleteDeclineReport: (params) => {
|
|
1294
|
+
params.isFromDisposal = "true";
|
|
1295
|
+
return API$x.delete("/report/cancel-report", { params });
|
|
1296
|
+
},
|
|
1297
|
+
getDisposalHistory: (params) => {
|
|
1298
|
+
return API$x.get("/transaction", { params });
|
|
1299
|
+
},
|
|
1300
|
+
getHistoryByAssetOptions: (params) => {
|
|
1301
|
+
return API$x.get("/transaction/options", { params });
|
|
1302
|
+
},
|
|
1303
|
+
getDisposalTransactionLog: (requestId) => {
|
|
1304
|
+
return API$x.get(`/transaction/request/${requestId}/transaction-log`);
|
|
1305
|
+
},
|
|
1306
|
+
postCreateTransaction: (body) => {
|
|
1307
|
+
return API$x.post("/transaction", body);
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
const API$w = createAxiosInstance({
|
|
1311
|
+
prefix: "/fam/report/v2/reports"
|
|
1312
|
+
});
|
|
1313
|
+
const ReportServices = {
|
|
1314
|
+
getReportList: (params) => {
|
|
1315
|
+
return API$w.get("/schedules", { params });
|
|
1316
|
+
},
|
|
1317
|
+
getReportSchedule: (scheduleId) => {
|
|
1318
|
+
return API$w.get("/schedules/" + scheduleId);
|
|
1319
|
+
},
|
|
1320
|
+
getUniqueScheduleName: (name) => {
|
|
1321
|
+
return API$w.get("/schedules/unique-name", { params: { name } });
|
|
1322
|
+
},
|
|
1323
|
+
getFilterOptions: (params) => {
|
|
1324
|
+
return API$w.get("/schedules/options", { params });
|
|
1325
|
+
},
|
|
1326
|
+
putSetActive: (body) => {
|
|
1327
|
+
return API$w.put("/schedules/set-active", body);
|
|
1328
|
+
},
|
|
1329
|
+
putEditSchedule: (id, body) => {
|
|
1330
|
+
return API$w.put(`/schedules/${id}`, body);
|
|
1331
|
+
},
|
|
1332
|
+
deleteReports: (id) => {
|
|
1333
|
+
return API$w.delete("/schedules", { params: { id } });
|
|
1334
|
+
},
|
|
1335
|
+
postCreateSchedule: (data) => {
|
|
1336
|
+
return API$w.post("/schedules", data);
|
|
1337
|
+
},
|
|
1338
|
+
postDownloadReport: (data) => {
|
|
1339
|
+
return API$w.post("/download", data, { responseType: "arraybuffer" });
|
|
1340
|
+
},
|
|
1341
|
+
postGenerateReport: (data) => {
|
|
1342
|
+
return API$w.post("/generate", data);
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
const API$v = createAxiosInstance({
|
|
1346
|
+
prefix: "/fam/settings-attribute/v2"
|
|
1347
|
+
});
|
|
1348
|
+
const getEndpoint = (type) => {
|
|
1349
|
+
return type === "category" ? "category" : "groups";
|
|
1350
|
+
};
|
|
1351
|
+
const GroupCategoryServices = {
|
|
1352
|
+
getGroupCategory: (type, params) => {
|
|
1353
|
+
return API$v.get(`/${getEndpoint(type)}/tree`, { params });
|
|
1354
|
+
},
|
|
1355
|
+
getCategoryTree: () => {
|
|
1356
|
+
return API$v.get("/category/tree");
|
|
1357
|
+
},
|
|
1358
|
+
getGroupTree: (params) => {
|
|
1359
|
+
return API$v.get("/groups/tree", { params });
|
|
1360
|
+
},
|
|
1361
|
+
// Doesn't exist in company plan other than "Basic"
|
|
1362
|
+
getGroupCategoryList: (type, groupId, params) => {
|
|
1363
|
+
return API$v.get(`/${getEndpoint(type)}/${groupId}`, { params });
|
|
1364
|
+
},
|
|
1365
|
+
getNames: (type) => {
|
|
1366
|
+
return API$v.get(`/${getEndpoint(type)}/names`);
|
|
1367
|
+
},
|
|
1368
|
+
getCodes: (type) => {
|
|
1369
|
+
return API$v.get(`/${getEndpoint(type)}/codes`);
|
|
1370
|
+
},
|
|
1371
|
+
postCreateGroupCategory: (type, body) => {
|
|
1372
|
+
return API$v.post(`/${getEndpoint(type)}`, body);
|
|
1373
|
+
},
|
|
1374
|
+
putEditGroupCategory: (type, body, objectId) => {
|
|
1375
|
+
return API$v.put(`/${getEndpoint(type)}/${objectId}`, body);
|
|
1376
|
+
},
|
|
1377
|
+
// Doesn't exist in company plan other than "Enterprise"
|
|
1378
|
+
putMoveGroup: (body, objectId) => {
|
|
1379
|
+
return API$v.put(`/groups/${objectId}/move-group`, body);
|
|
1380
|
+
},
|
|
1381
|
+
// Doesn't exist in company plan other than "Enterprise"
|
|
1382
|
+
putEditBulkGroups: async (body) => {
|
|
1383
|
+
return API$v.put("/groups/bulk", body);
|
|
1384
|
+
},
|
|
1385
|
+
deleteGroupCategory: (type, body, objectId) => {
|
|
1386
|
+
return API$v.delete(`/${getEndpoint(type)}/${objectId}`, { data: body });
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
const API$u = createAxiosInstance({
|
|
1390
|
+
prefix: "/fam/settings-attribute/v2/alias-code"
|
|
1391
|
+
});
|
|
1392
|
+
const AliasCodeServices = {
|
|
1393
|
+
getAliasCode: () => {
|
|
1394
|
+
return API$u.get("/");
|
|
1395
|
+
},
|
|
1396
|
+
postAliasCode: (data) => {
|
|
1397
|
+
return API$u.post("/", data);
|
|
1398
|
+
},
|
|
1399
|
+
getAliasCodeList: (params) => {
|
|
1400
|
+
return API$u.get(`/${params.object}/code-list`, { params });
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
const API$t = createAxiosInstance({
|
|
1404
|
+
prefix: "/fam/settings-attribute/v2/general-settings"
|
|
1405
|
+
});
|
|
1406
|
+
const GeneralSettingsServices = {
|
|
1407
|
+
getGeneralSettings: () => {
|
|
1408
|
+
return API$t.get("/");
|
|
1409
|
+
},
|
|
1410
|
+
putUpdateGeneralSettings: (data) => {
|
|
1411
|
+
return API$t.put("/", data);
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
const API$s = createAxiosInstance({
|
|
1415
|
+
prefix: "/fam/settings-attribute/v2/custom-field"
|
|
1416
|
+
});
|
|
1417
|
+
const CustomFieldServices = {
|
|
1418
|
+
getCustomField: async (params) => {
|
|
1419
|
+
return API$s.get("/", { params });
|
|
1420
|
+
},
|
|
1421
|
+
getCustomFieldsByCategory: (category, params) => {
|
|
1422
|
+
return API$s.get(`/${category}`, { params });
|
|
1423
|
+
},
|
|
1424
|
+
getOptions: async (params) => {
|
|
1425
|
+
return API$s.get("/options", { params });
|
|
1426
|
+
},
|
|
1427
|
+
postCreateCustomField: async (params, data) => {
|
|
1428
|
+
return API$s.post("/", data, { params });
|
|
1429
|
+
},
|
|
1430
|
+
putEditCustomField: async (params, data, id) => {
|
|
1431
|
+
return API$s.put(`/${id}`, data, { params });
|
|
1432
|
+
},
|
|
1433
|
+
putChangeStatus: async (params, data) => {
|
|
1434
|
+
return API$s.put("/bulk", data, { params });
|
|
1435
|
+
},
|
|
1436
|
+
deleteCustomField: async (params) => {
|
|
1437
|
+
return API$s.delete("/bulk", { params });
|
|
1438
|
+
},
|
|
1439
|
+
getUsedCustomFields: async () => {
|
|
1440
|
+
return API$s.get("/used-by-assets");
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1443
|
+
const API$r = createAxiosInstance({
|
|
1444
|
+
prefix: "/fam/settings-attribute/v2/asset-name-policy"
|
|
1445
|
+
});
|
|
1446
|
+
const AssetPolicyServices = {
|
|
1447
|
+
getList: (params) => {
|
|
1448
|
+
return API$r.get("/", { params });
|
|
1449
|
+
},
|
|
1450
|
+
getListFilterOptions: (params) => {
|
|
1451
|
+
return API$r.get("/options");
|
|
1452
|
+
},
|
|
1453
|
+
putUpdatePolicy: (body) => {
|
|
1454
|
+
return API$r.put("/", body);
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
const API$q = createAxiosInstance({
|
|
1458
|
+
prefix: "/fam/settings-user-role/v2/auth"
|
|
1459
|
+
});
|
|
1460
|
+
const onRejected$1 = (error) => {
|
|
1461
|
+
var _a, _b, _c, _d;
|
|
1462
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 500 || ((_d = (_c = error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) === "jwt malformed") {
|
|
1463
|
+
window.onblur = void 0;
|
|
1464
|
+
window.onfocus = void 0;
|
|
1465
|
+
window.sessionExpired = true;
|
|
1466
|
+
return window.dispatchEvent(new CustomEvent("user:expired"));
|
|
1467
|
+
}
|
|
1468
|
+
return Promise.reject(error);
|
|
1469
|
+
};
|
|
1470
|
+
const AuthServices$1 = {
|
|
1471
|
+
reLogin: (body) => {
|
|
1472
|
+
API$q.interceptors.response.use((response) => {
|
|
1473
|
+
return response;
|
|
1474
|
+
}, onRejected$1);
|
|
1475
|
+
return API$q.post("/login", body);
|
|
1476
|
+
}
|
|
1477
|
+
};
|
|
1478
|
+
const DepreciationMethodAPI = createAxiosInstance({
|
|
1479
|
+
prefix: "/fam/settings-attribute/v2/depreciation-method"
|
|
1480
|
+
});
|
|
1481
|
+
const DepreciationGroupAPI = createAxiosInstance({
|
|
1482
|
+
prefix: "/fam/settings-attribute/v2/depreciation-group"
|
|
1483
|
+
});
|
|
1484
|
+
const AccountCodeAPI = createAxiosInstance({
|
|
1485
|
+
prefix: "/fam/settings-attribute/v2/account-code"
|
|
1486
|
+
});
|
|
1487
|
+
const AccountingServices = {
|
|
1488
|
+
getDepreciationGroupDropdown: () => {
|
|
1489
|
+
return DepreciationGroupAPI.get("/dropdown");
|
|
1490
|
+
},
|
|
1491
|
+
//https://dev-api.tagsamurai.com/settings-attribute-go/v2/account-code/dropdown
|
|
1492
|
+
getAccountDropdown: () => {
|
|
1493
|
+
return AccountCodeAPI.get("/dropdown");
|
|
1494
|
+
},
|
|
1495
|
+
// Depreciation Method API Services
|
|
1496
|
+
getDepreciationMethod: () => {
|
|
1497
|
+
return DepreciationMethodAPI.get("");
|
|
1498
|
+
},
|
|
1499
|
+
changeDepreciationMethod: (body) => {
|
|
1500
|
+
return DepreciationMethodAPI.put("", {
|
|
1501
|
+
depreciationMethod: body
|
|
1502
|
+
});
|
|
1503
|
+
},
|
|
1504
|
+
cancelChangeDepreciationMethod: () => {
|
|
1505
|
+
return DepreciationMethodAPI.put("/cancel");
|
|
1506
|
+
},
|
|
1507
|
+
// Depreciation Group API Services
|
|
1508
|
+
getDepreciationGroupList: (params) => {
|
|
1509
|
+
return DepreciationGroupAPI.get("", { params });
|
|
1510
|
+
},
|
|
1511
|
+
deleteDepreciationGroup: (id) => {
|
|
1512
|
+
return DepreciationGroupAPI.delete("", {
|
|
1513
|
+
data: { id }
|
|
1514
|
+
});
|
|
1515
|
+
},
|
|
1516
|
+
createNewDepreciationGroup: (body) => {
|
|
1517
|
+
return DepreciationGroupAPI.post("", body);
|
|
1518
|
+
},
|
|
1519
|
+
editDepreciationGroup: (body, id) => {
|
|
1520
|
+
return DepreciationGroupAPI.put(`/${id}`, body);
|
|
1521
|
+
},
|
|
1522
|
+
getFilterOptions: (params) => {
|
|
1523
|
+
return DepreciationGroupAPI.get("/options", { params });
|
|
1524
|
+
},
|
|
1525
|
+
// Account Code API Services
|
|
1526
|
+
getAccountCodeList: (params) => {
|
|
1527
|
+
return AccountCodeAPI.get("", { params });
|
|
1528
|
+
},
|
|
1529
|
+
deleteAccountCode: (id) => {
|
|
1530
|
+
return AccountCodeAPI.delete("", {
|
|
1531
|
+
data: { id }
|
|
1532
|
+
});
|
|
1533
|
+
},
|
|
1534
|
+
createNewAccountCode: (body) => {
|
|
1535
|
+
return AccountCodeAPI.post("", body);
|
|
1536
|
+
},
|
|
1537
|
+
editAccountCode: (body, id) => {
|
|
1538
|
+
return AccountCodeAPI.put(`/${id}`, body);
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
const API$p = createAxiosInstance({
|
|
1542
|
+
env: "APP_TAGSAMURAI_API",
|
|
1543
|
+
prefix: "/settings-attribute/v2/asset-name"
|
|
1544
|
+
});
|
|
1545
|
+
const AssetNameServices = {
|
|
1546
|
+
getDropdown: (params) => {
|
|
1547
|
+
return API$p.get("/dropdown", { params });
|
|
1548
|
+
},
|
|
1549
|
+
getAssetNameDetail: (id) => {
|
|
1550
|
+
return API$p.get(`/${id}`);
|
|
1551
|
+
},
|
|
1552
|
+
getAssetsByAssetName: (id, params) => {
|
|
1553
|
+
return API$p.get(`/${id}/list-asset`, { params });
|
|
1554
|
+
},
|
|
1555
|
+
getAssetNameList: (params) => {
|
|
1556
|
+
return API$p.get("/", { params });
|
|
1557
|
+
},
|
|
1558
|
+
getUnpairedAssetName: (params) => {
|
|
1559
|
+
return API$p.get("/unpaired", { params });
|
|
1560
|
+
},
|
|
1561
|
+
getOptions: (params) => {
|
|
1562
|
+
return API$p.get("/options", { params });
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
const API$o = createAxiosInstance({
|
|
1566
|
+
env: "APP_TAGSAMURAI_API",
|
|
1567
|
+
prefix: "/audit/v2"
|
|
1568
|
+
});
|
|
1569
|
+
const API_IOT = createAxiosInstance({
|
|
1570
|
+
env: "APP_TAGSAMURAI_API",
|
|
1571
|
+
prefix: "/iot/v2"
|
|
1572
|
+
});
|
|
1573
|
+
const TaskServices = {
|
|
1574
|
+
getTaskList: (params) => {
|
|
1575
|
+
return API$o.get("/audit/task", { params });
|
|
1576
|
+
},
|
|
1577
|
+
getTaskHistory: (params) => {
|
|
1578
|
+
return API$o.get("/audit/task/history", { params });
|
|
1579
|
+
},
|
|
1580
|
+
extendAuditDuration: (body, id) => {
|
|
1581
|
+
return API$o.put(`/audit/task/${id}/extend`, body);
|
|
1582
|
+
},
|
|
1583
|
+
stopAudit: (id, body) => {
|
|
1584
|
+
return API$o.put(`/audit/task/${id}/stop`, body);
|
|
1585
|
+
},
|
|
1586
|
+
cancelAuditTask: (id) => {
|
|
1587
|
+
return API$o.put(`/audit/task/${id}/cancel`);
|
|
1588
|
+
},
|
|
1589
|
+
getTaskDetail: (id) => {
|
|
1590
|
+
return API$o.get(`/audit/task/${id}`);
|
|
1591
|
+
},
|
|
1592
|
+
getInAuditTask: (params) => {
|
|
1593
|
+
return API$o.get("/audit/scheduled-asset/in-audit", { params });
|
|
1594
|
+
},
|
|
1595
|
+
getTaskDetailAssets: (params, taskId) => {
|
|
1596
|
+
return API$o.get(`/audit/task/${taskId}/view-asset-detail`, { params });
|
|
1597
|
+
},
|
|
1598
|
+
getAuditedTask: (params) => {
|
|
1599
|
+
return API$o.get("/audit/scheduled-asset/audited", { params });
|
|
1600
|
+
},
|
|
1601
|
+
getAuditLog: (id) => {
|
|
1602
|
+
return API$o.get(`/audit/scheduled-asset/${id}/log`);
|
|
1603
|
+
},
|
|
1604
|
+
getTaskEventLog: (params) => {
|
|
1605
|
+
return API$o.get("/audit/task/task-event-log", { params });
|
|
1606
|
+
},
|
|
1607
|
+
getTaskTimelineEventLog: (idTask) => {
|
|
1608
|
+
return API$o.get(`/audit/task/${idTask}/event-log`);
|
|
1609
|
+
},
|
|
1610
|
+
scanAssetTAG: (body, idTask) => {
|
|
1611
|
+
return API$o.put(`/audit/task/${idTask}/scan`, body);
|
|
1612
|
+
},
|
|
1613
|
+
submitAssetCondition: (body, idAsset) => {
|
|
1614
|
+
const headers = body.picture ? { "Content-Type": "multipart/form-data" } : { "Content-Type": "application/json" };
|
|
1615
|
+
return API$o.put(`/audit/scheduled-asset/${idAsset}/update/condition`, body, {
|
|
1616
|
+
headers
|
|
1617
|
+
});
|
|
1618
|
+
},
|
|
1619
|
+
submitAuditedAsset: (idTask) => {
|
|
1620
|
+
return API$o.put(`/audit/task/${idTask}/submit`);
|
|
1621
|
+
},
|
|
1622
|
+
reportTAGMissing: (note, idAsset) => {
|
|
1623
|
+
return API$o.put(`/audit/scheduled-asset/${idAsset}/report-missing`, {
|
|
1624
|
+
note
|
|
1625
|
+
});
|
|
1626
|
+
},
|
|
1627
|
+
reportTAG: (id, body) => {
|
|
1628
|
+
return API$o.put(`/audit/scheduled-asset/${id}/tag-reported`, body);
|
|
1629
|
+
},
|
|
1630
|
+
getTaskInitialState: (idTask) => {
|
|
1631
|
+
return API$o.get(`/audit/scheduled-asset/${idTask}`);
|
|
1632
|
+
},
|
|
1633
|
+
cancelTaskReport: (scheduledAssetId) => {
|
|
1634
|
+
return API$o.put(`/audit/scheduled-asset/${scheduledAssetId}/cancel-report`);
|
|
1635
|
+
}
|
|
1636
|
+
};
|
|
1637
|
+
const ScheduleServices = {
|
|
1638
|
+
getScheduleList: (params) => {
|
|
1639
|
+
return API$o.get("/audit/schedule", { params });
|
|
1640
|
+
},
|
|
1641
|
+
getScheduleDetail: (id) => {
|
|
1642
|
+
return API$o.get("/audit/schedule/" + id);
|
|
1643
|
+
},
|
|
1644
|
+
deleteSchedule: (scheduleId) => {
|
|
1645
|
+
return API$o.put("/audit/schedule/bulk-delete", {
|
|
1646
|
+
id: scheduleId
|
|
1647
|
+
});
|
|
1648
|
+
},
|
|
1649
|
+
inactivateSchedule: (id) => {
|
|
1650
|
+
return API$o.put("/audit/schedule/bulk-inactive", { id });
|
|
1651
|
+
},
|
|
1652
|
+
activateSchedule: (id) => {
|
|
1653
|
+
return API$o.put("/audit/schedule/bulk-active", { id });
|
|
1654
|
+
},
|
|
1655
|
+
createNewSchedule: (body) => {
|
|
1656
|
+
return API$o.post("/audit/schedule", body);
|
|
1657
|
+
},
|
|
1658
|
+
editSchedule: (body, id) => {
|
|
1659
|
+
return API$o.put("/audit/schedule/" + id, body);
|
|
1660
|
+
},
|
|
1661
|
+
getActiveAsset: (id, params) => {
|
|
1662
|
+
return API$o.get(`/audit/asset/schedule/${id}`, { params });
|
|
1663
|
+
},
|
|
1664
|
+
setAssetActivation: (body) => {
|
|
1665
|
+
return API$o.put("/audit/asset/activation", body);
|
|
1666
|
+
},
|
|
1667
|
+
getAuditableAssetAmount: (params) => {
|
|
1668
|
+
return API$o.get("/audit/asset/auditable/total-asset", { params });
|
|
1669
|
+
}
|
|
1670
|
+
};
|
|
1671
|
+
const IOTAuditServices = {
|
|
1672
|
+
getReaderList: (params) => {
|
|
1673
|
+
return API_IOT.get("/iot/antenna/available", { params });
|
|
1674
|
+
},
|
|
1675
|
+
putSetReaderParams: (body) => {
|
|
1676
|
+
return API_IOT.put("/iot/reader/set-scan-params", body);
|
|
1677
|
+
},
|
|
1678
|
+
putAuditUsingIOT: (auditId, body) => {
|
|
1679
|
+
return API_IOT.put(`/iot/audit/${auditId}`, body);
|
|
1680
|
+
},
|
|
1681
|
+
getReaderTotalAsset: (taskId, params) => {
|
|
1682
|
+
return API$o.get(`/audit/task/${taskId}/reader/total-assets`, {
|
|
1683
|
+
params
|
|
1684
|
+
});
|
|
1685
|
+
},
|
|
1686
|
+
getAssetList: (params) => {
|
|
1687
|
+
return API$o.get("/audit/scheduled-asset", { params });
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
const FilterServices = {
|
|
1691
|
+
getFilterOptions: (path, params) => {
|
|
1692
|
+
return API$o.get(`/${path}/options`, { params });
|
|
1693
|
+
},
|
|
1694
|
+
getIOTFilterOptions: (path, params) => {
|
|
1695
|
+
return API_IOT.get(`/${path}/options`, { params });
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
const AuditableAssetServices = {
|
|
1699
|
+
getAudiableAssetList: (params) => {
|
|
1700
|
+
return API$o.get("/audit/asset/auditable", { params });
|
|
1701
|
+
},
|
|
1702
|
+
getAuditableAssetDetail: (id) => {
|
|
1703
|
+
return API$o.get("/audit/asset/auditable/" + id);
|
|
1704
|
+
}
|
|
1705
|
+
};
|
|
1706
|
+
const ApprovalServices = {
|
|
1707
|
+
getApprovalList: (idTask, approvalRound) => {
|
|
1708
|
+
return API$o.get(`/audit/approval/task/${idTask}/transaction`, {
|
|
1709
|
+
params: {
|
|
1710
|
+
approvalRound
|
|
1711
|
+
}
|
|
1712
|
+
});
|
|
1713
|
+
},
|
|
1714
|
+
getActiveApprovalList: (params) => {
|
|
1715
|
+
return API$o.get("/audit/approval/active", { params });
|
|
1716
|
+
},
|
|
1717
|
+
getHisotryApprovalList: (params) => {
|
|
1718
|
+
return API$o.get("/audit/approval/history", { params });
|
|
1719
|
+
},
|
|
1720
|
+
getTaskDetail: (id) => {
|
|
1721
|
+
return API$o.get(`/audit/task/${id}`);
|
|
1722
|
+
},
|
|
1723
|
+
getApprovalHistoryDetail: (idApproval) => {
|
|
1724
|
+
return API$o.get(`/audit/approval/${idApproval}`);
|
|
1725
|
+
},
|
|
1726
|
+
getApprovalAssetList: (params) => {
|
|
1727
|
+
return API$o.get("/audit/scheduled-asset/audited", { params });
|
|
1728
|
+
},
|
|
1729
|
+
submitApprovalAction: (body) => {
|
|
1730
|
+
return API$o.put("/audit/approval/approve", body);
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1733
|
+
const AuditServices = {
|
|
1734
|
+
getAudit: (assetId, params) => {
|
|
1735
|
+
return API$o.get(`/audit/schedule/asset-detail/${assetId}`, { params });
|
|
1736
|
+
},
|
|
1737
|
+
getAuditOption: (assetId, params) => {
|
|
1738
|
+
return API$o.get(`/audit/schedule/asset-detail/${assetId}/options`, {
|
|
1739
|
+
params
|
|
1740
|
+
});
|
|
1741
|
+
},
|
|
1742
|
+
putSetActive: (body) => {
|
|
1743
|
+
return API$o.put("/audit/asset/activation", body);
|
|
1744
|
+
},
|
|
1745
|
+
...TaskServices,
|
|
1746
|
+
...ScheduleServices,
|
|
1747
|
+
...IOTAuditServices,
|
|
1748
|
+
...FilterServices,
|
|
1749
|
+
...AuditableAssetServices,
|
|
1750
|
+
...ApprovalServices
|
|
1751
|
+
};
|
|
1752
|
+
const API$n = createAxiosInstance({
|
|
1753
|
+
env: "APP_TAGSAMURAI_API",
|
|
1754
|
+
prefix: "/settings-attribute/v2/brands"
|
|
1755
|
+
});
|
|
1756
|
+
const BrandServices = {
|
|
1757
|
+
getDropdown: (params) => {
|
|
1758
|
+
return API$n.get("/dropdown", { params });
|
|
1759
|
+
}
|
|
1760
|
+
};
|
|
1761
|
+
const API$m = ({ headers = {}, params = {} } = {}) => {
|
|
1762
|
+
const BASE_URL = getBaseURL("APP_COUNTRY_STATE_API");
|
|
1763
|
+
const API_KEY = getBaseURL("APP_COUNTRY_STATE_API_KEY");
|
|
1764
|
+
const instance = axios.create({
|
|
1765
|
+
baseURL: `${BASE_URL}/v1`,
|
|
1766
|
+
headers: {
|
|
1767
|
+
"Content-type": "application/json",
|
|
1768
|
+
"X-CSCAPI-KEY": API_KEY,
|
|
1769
|
+
...headers
|
|
1770
|
+
},
|
|
1771
|
+
params
|
|
1772
|
+
});
|
|
1773
|
+
return instance;
|
|
1774
|
+
};
|
|
1775
|
+
const CountryStateServices = {
|
|
1776
|
+
getCountry: () => {
|
|
1777
|
+
return API$m().get("/countries");
|
|
1778
|
+
},
|
|
1779
|
+
getState: (country) => {
|
|
1780
|
+
return API$m().get(`/countries/${country}/states`);
|
|
1781
|
+
},
|
|
1782
|
+
getCity: (country, state) => {
|
|
1783
|
+
return API$m().get(`/countries/${country}/states/${state}/cities`);
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
const API$l = createAxiosInstance({
|
|
1787
|
+
env: "APP_TAGSAMURAI_API",
|
|
1788
|
+
prefix: "/dashboard/v2/dashboard"
|
|
1789
|
+
});
|
|
1790
|
+
const DashboardServices = {
|
|
1791
|
+
getLatestTask: (params) => {
|
|
1792
|
+
return API$l.get("/latest-task", { params });
|
|
1793
|
+
},
|
|
1794
|
+
getSummary: (params) => {
|
|
1795
|
+
return API$l.get("/summary", { params });
|
|
1796
|
+
}
|
|
1797
|
+
};
|
|
1798
|
+
const API$k = createAxiosInstance({
|
|
1799
|
+
prefix: "/global-settings/auth"
|
|
1800
|
+
});
|
|
1801
|
+
const onRejected = (error) => {
|
|
1802
|
+
var _a, _b, _c, _d;
|
|
1803
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 500 || ((_d = (_c = error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) === "jwt malformed") {
|
|
1804
|
+
window.onblur = void 0;
|
|
1805
|
+
window.onfocus = void 0;
|
|
1806
|
+
window.sessionExpired = true;
|
|
1807
|
+
return window.dispatchEvent(new CustomEvent("user:expired"));
|
|
1808
|
+
}
|
|
1809
|
+
return Promise.reject(error);
|
|
1810
|
+
};
|
|
1811
|
+
const AuthServices = {
|
|
1812
|
+
login: (form) => {
|
|
1813
|
+
const body = { ...form, isMobile: false };
|
|
1814
|
+
return API$k.post("/login", body);
|
|
1815
|
+
},
|
|
1816
|
+
reLogin: (body) => {
|
|
1817
|
+
API$k.interceptors.response.use((response) => {
|
|
1818
|
+
return response;
|
|
1819
|
+
}, onRejected);
|
|
1820
|
+
return API$k.post("/login", {
|
|
1821
|
+
...body,
|
|
1822
|
+
ignoreAccess: true
|
|
1823
|
+
// Allow users without access to Global Settings to hit relogin
|
|
1824
|
+
});
|
|
1825
|
+
},
|
|
1826
|
+
requestOTP: (email) => {
|
|
1827
|
+
const body = { email };
|
|
1828
|
+
return API$k.post("/request-otp", body);
|
|
1829
|
+
},
|
|
1830
|
+
requestResetPassLink: (email) => {
|
|
1831
|
+
const body = { email };
|
|
1832
|
+
return API$k.post("/request-reset-link", body);
|
|
1833
|
+
},
|
|
1834
|
+
setPassword: (body) => {
|
|
1835
|
+
return API$k.post("/set-password", body);
|
|
1836
|
+
},
|
|
1837
|
+
verifyToken: (token) => {
|
|
1838
|
+
return API$k.get(`/verify-token/${token}`);
|
|
1839
|
+
},
|
|
1840
|
+
confirmEmailChange: (token) => {
|
|
1841
|
+
const body = { token };
|
|
1842
|
+
return API$k.put("/confirm-email-change/confirm", body);
|
|
1843
|
+
},
|
|
1844
|
+
postLogout: () => {
|
|
1845
|
+
return API$k.post("/logout");
|
|
1846
|
+
}
|
|
1847
|
+
};
|
|
1848
|
+
const API$j = createAxiosInstance({
|
|
1849
|
+
env: "APP_ADMIN_API",
|
|
1850
|
+
prefix: "/settings-attribute/languages"
|
|
1851
|
+
});
|
|
1852
|
+
const I18nService = {
|
|
1853
|
+
/**
|
|
1854
|
+
* Fetch all translation messages for a specific locale.
|
|
1855
|
+
* @param locale The locale code (e.g., 'en', 'id').
|
|
1856
|
+
* @returns A promise resolving to a key-value record of messages.
|
|
1857
|
+
*/
|
|
1858
|
+
getMessages: (isoCode) => {
|
|
1859
|
+
return API$j.get(`/${isoCode}/translations`);
|
|
1860
|
+
},
|
|
1861
|
+
/**
|
|
1862
|
+
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
1863
|
+
*
|
|
1864
|
+
* @returns Promise Array of options
|
|
1865
|
+
*/
|
|
1866
|
+
getLanguageOptions: async () => {
|
|
1867
|
+
const { data } = await API$j.get("/dropdown");
|
|
1868
|
+
return data.data;
|
|
1869
|
+
},
|
|
1870
|
+
/**
|
|
1871
|
+
* Fetch single lang option meta data
|
|
1872
|
+
*
|
|
1873
|
+
* @param isoCode The locale code (e.g., 'en', 'id').
|
|
1874
|
+
* @returns Promise LanguageMeta
|
|
1875
|
+
*/
|
|
1876
|
+
getLanguageOptionMeta: async (isoCode) => {
|
|
1877
|
+
const { data } = await API$j.get(
|
|
1878
|
+
"/dropdown/" + isoCode
|
|
1879
|
+
);
|
|
1880
|
+
return data.data;
|
|
1881
|
+
},
|
|
1882
|
+
/**
|
|
1883
|
+
* Translate a specific text to the target locale.
|
|
1884
|
+
*
|
|
1885
|
+
* @param key Unique translation key.
|
|
1886
|
+
* @param locale Target locale code.
|
|
1887
|
+
*/
|
|
1888
|
+
translateText: async (key, locale) => {
|
|
1889
|
+
const { data } = await API$j.post("/translate", {
|
|
1890
|
+
q: key,
|
|
1891
|
+
target: locale
|
|
1892
|
+
});
|
|
1893
|
+
return data.data.translations[key];
|
|
1894
|
+
}
|
|
1895
|
+
};
|
|
1896
|
+
const API$i = createAxiosInstance({
|
|
1897
|
+
env: "APP_TAGSAMURAI_API",
|
|
1898
|
+
prefix: "/settings-attribute/v2/models"
|
|
1899
|
+
});
|
|
1900
|
+
const ModelTypeServices = {
|
|
1901
|
+
getDropdown: (params) => {
|
|
1902
|
+
return API$i.get("/dropdown", { params });
|
|
1903
|
+
}
|
|
1904
|
+
};
|
|
1905
|
+
const API$h = createAxiosInstance({
|
|
1906
|
+
prefix: "/v2",
|
|
1907
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
1908
|
+
});
|
|
1909
|
+
const NotificationApprovalServices = {
|
|
1910
|
+
getTotalApprovals: () => {
|
|
1911
|
+
return API$h.get("/approval/count");
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
const ReaderAPI$1 = createAxiosInstance({
|
|
1915
|
+
prefix: "/fam/iot/v2/reader"
|
|
1916
|
+
});
|
|
1917
|
+
const IOTAntennaAPI$1 = createAxiosInstance({
|
|
1918
|
+
prefix: "/fam/iot/v2/iot/antenna"
|
|
1919
|
+
});
|
|
1920
|
+
const IOTReaderAPI$1 = createAxiosInstance({
|
|
1921
|
+
prefix: "/fam/iot/v2/iot/reader"
|
|
1922
|
+
});
|
|
1923
|
+
const ReaderServices = {
|
|
1924
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader
|
|
1925
|
+
getIOTReaderList: (params) => {
|
|
1926
|
+
return IOTReaderAPI$1.get("", { params: queryParamsStringfy(params) });
|
|
1927
|
+
},
|
|
1928
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/options
|
|
1929
|
+
getIOTReaderListOptions: (params) => {
|
|
1930
|
+
return IOTReaderAPI$1.get("/options", { params });
|
|
1931
|
+
},
|
|
1932
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-alias-name
|
|
1933
|
+
setIOTAliasName: (body) => {
|
|
1934
|
+
return IOTReaderAPI$1.put("/set-alias-name", body);
|
|
1935
|
+
},
|
|
1936
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ping
|
|
1937
|
+
pingIOTSingle: (id) => {
|
|
1938
|
+
return IOTReaderAPI$1.put(`/${id}/ping`);
|
|
1939
|
+
},
|
|
1940
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/ping/bulk
|
|
1941
|
+
pingIOTBulk: (body) => {
|
|
1942
|
+
return IOTReaderAPI$1.put("/ping/bulk", body);
|
|
1943
|
+
},
|
|
1944
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/set-antenna-power
|
|
1945
|
+
setIOTAntennaPowerBulk: (id, body) => {
|
|
1946
|
+
return IOTReaderAPI$1.put(`/${id}/set-antenna-power`, body);
|
|
1947
|
+
},
|
|
1948
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ports
|
|
1949
|
+
getIOTPortList: (id, params) => {
|
|
1950
|
+
return IOTReaderAPI$1.get(`/${id}/ports`, { params });
|
|
1951
|
+
},
|
|
1952
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id
|
|
1953
|
+
getIOTDetail: (id) => {
|
|
1954
|
+
return IOTReaderAPI$1.get(`/${id}`);
|
|
1955
|
+
},
|
|
1956
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/check-manager
|
|
1957
|
+
getIOTCheckManager: () => {
|
|
1958
|
+
return IOTReaderAPI$1.get("/check-manager");
|
|
1959
|
+
},
|
|
1960
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/reader/:id
|
|
1961
|
+
updateReader: (id, body) => {
|
|
1962
|
+
return ReaderAPI$1.put(`/${id}`, body);
|
|
1963
|
+
},
|
|
1964
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-status
|
|
1965
|
+
updateReaderStatus: (body) => {
|
|
1966
|
+
return IOTReaderAPI$1.put("/set-status", body);
|
|
1967
|
+
},
|
|
1968
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna/set-status
|
|
1969
|
+
updateAntennaStatus: (body) => {
|
|
1970
|
+
return IOTAntennaAPI$1.put("/set-status", body);
|
|
1971
|
+
},
|
|
1972
|
+
setIOTPortGroup: (id, body) => {
|
|
1973
|
+
return IOTReaderAPI$1.put(`/${id}/set-port-group`, body);
|
|
1974
|
+
},
|
|
1975
|
+
setGroupIOT: (body) => {
|
|
1976
|
+
return IOTReaderAPI$1.put("/set-group", body);
|
|
1977
|
+
},
|
|
1978
|
+
getDataById: (id) => {
|
|
1979
|
+
return IOTReaderAPI$1.get(`/${id}`);
|
|
1980
|
+
},
|
|
1981
|
+
getChangeLog: (params) => {
|
|
1982
|
+
return IOTReaderAPI$1.get(`/${params.id}/change-log`, { params });
|
|
1983
|
+
},
|
|
1984
|
+
getChangeLogOptions: (params) => {
|
|
1985
|
+
return IOTReaderAPI$1.get(`/${params.id}/change-log/options`, { params });
|
|
1986
|
+
},
|
|
1987
|
+
putData: (id, body) => {
|
|
1988
|
+
return IOTReaderAPI$1.put(`/${id}`, body);
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
const API$g = createAxiosInstance({
|
|
1992
|
+
env: "APP_TAGSAMURAI_API",
|
|
1993
|
+
prefix: "/repair/v2"
|
|
1994
|
+
});
|
|
1995
|
+
const RepairServices = {
|
|
1996
|
+
getRepairList: (params) => {
|
|
1997
|
+
return API$g.get("/my-asset/repair", { params });
|
|
1998
|
+
},
|
|
1999
|
+
getFilterOptions: (params) => {
|
|
2000
|
+
return API$g.get("/my-asset/repair/options", { params });
|
|
2001
|
+
},
|
|
2002
|
+
getAssetRepairTicketing: (assetId, params) => {
|
|
2003
|
+
return API$g.get(`/repair/${assetId}/asset-repair-detail`, { params });
|
|
2004
|
+
},
|
|
2005
|
+
putConfirmRepair: (repairId) => {
|
|
2006
|
+
return API$g.put(`/repair/${repairId}/confirm-repair`);
|
|
2007
|
+
}
|
|
2008
|
+
};
|
|
2009
|
+
const API$f = createAxiosInstance({
|
|
2010
|
+
env: "APP_TAGSAMURAI_API",
|
|
2011
|
+
prefix: "/routine/v2"
|
|
2012
|
+
});
|
|
2013
|
+
const RoutineServices = {
|
|
2014
|
+
getMaintenance: (assetId, params) => {
|
|
2015
|
+
return API$f.get(`/routine-task/${assetId}`, { params });
|
|
2016
|
+
},
|
|
2017
|
+
getMaintenanceOption: (assetId, params) => {
|
|
2018
|
+
return API$f.get(`/routine-task/${assetId}/options`, { params });
|
|
2019
|
+
},
|
|
2020
|
+
putSetActive: (body) => {
|
|
2021
|
+
return API$f.put("/maintenable-asset/set-active", body);
|
|
2022
|
+
},
|
|
2023
|
+
getRoutineTask: (params) => {
|
|
2024
|
+
return API$f.get("/routine-task", { params });
|
|
2025
|
+
},
|
|
2026
|
+
getRoutineTaskOptions: (params) => {
|
|
2027
|
+
return API$f.get("/routine-task/options", { params });
|
|
2028
|
+
},
|
|
2029
|
+
getRoutineSchedule: (params) => {
|
|
2030
|
+
return API$f.get("/routine-schedule", { params });
|
|
2031
|
+
},
|
|
2032
|
+
getRoutineScheduleOptions: (params) => {
|
|
2033
|
+
return API$f.get("/routine-schedule/options", { params });
|
|
2034
|
+
},
|
|
2035
|
+
getRoutineTaskEventLog: (params) => {
|
|
2036
|
+
return API$f.get("/routine-task/event-log", { params });
|
|
2037
|
+
},
|
|
2038
|
+
getRoutineTaskEventLogOptions: (params) => {
|
|
2039
|
+
return API$f.get("/routine-task/event-log/options", { params });
|
|
2040
|
+
},
|
|
2041
|
+
getAssetName: (params) => {
|
|
2042
|
+
return API$f.get("/asset-name", { params });
|
|
2043
|
+
},
|
|
2044
|
+
getAssetNameOptions: (params) => {
|
|
2045
|
+
return API$f.get("/asset-name/options", { params });
|
|
2046
|
+
},
|
|
2047
|
+
postCreateRoutineSchedule: (data) => {
|
|
2048
|
+
return API$f.post("/routine-schedule", data);
|
|
2049
|
+
},
|
|
2050
|
+
postDuplicateRoutineSchedule: (id, data) => {
|
|
2051
|
+
return API$f.post(`/routine-schedule/duplicate/${id}`, data);
|
|
2052
|
+
},
|
|
2053
|
+
putEditRoutineSchedule: (id, data) => {
|
|
2054
|
+
return API$f.put(`/routine-schedule/${id}`, data);
|
|
2055
|
+
},
|
|
2056
|
+
getUserStaff: (params) => {
|
|
2057
|
+
return API$f.get("/user-transaction-role/maintenance-role/staff", { params });
|
|
2058
|
+
},
|
|
2059
|
+
getUserStaffOptions: (params) => {
|
|
2060
|
+
return API$f.get("/user-transaction-role/maintenance-role/staff/options", {
|
|
2061
|
+
params
|
|
2062
|
+
});
|
|
2063
|
+
},
|
|
2064
|
+
getRoutineScheduleDetail: (id) => {
|
|
2065
|
+
return API$f.get(`/routine-schedule/${id}`);
|
|
2066
|
+
},
|
|
2067
|
+
deleteRoutineSchedule: (id) => {
|
|
2068
|
+
return API$f.delete("/routine-schedule/bulk-delete", {
|
|
2069
|
+
params: {
|
|
2070
|
+
id: JSON.stringify(id)
|
|
2071
|
+
}
|
|
2072
|
+
});
|
|
2073
|
+
},
|
|
2074
|
+
putRoutineTaskCancel: (id) => {
|
|
2075
|
+
return API$f.put("/routine-task/cancel", { id });
|
|
2076
|
+
},
|
|
2077
|
+
getMaintainableAsset: (params) => {
|
|
2078
|
+
return API$f.get("/maintenable-asset", { params });
|
|
2079
|
+
},
|
|
2080
|
+
getMaintainableAssetOptions: (params) => {
|
|
2081
|
+
return API$f.get("/maintenable-asset/options", { params });
|
|
2082
|
+
},
|
|
2083
|
+
getMaintenanceHistory: (params) => {
|
|
2084
|
+
return API$f.get("/routine-task/history", { params });
|
|
2085
|
+
},
|
|
2086
|
+
getMaintenanceHistoryOptions: (params) => {
|
|
2087
|
+
return API$f.get("/routine-task/history/options", { params });
|
|
2088
|
+
},
|
|
2089
|
+
getActiveAsset: (id) => {
|
|
2090
|
+
return API$f.get(`/routine-schedule/${id}/assets`);
|
|
2091
|
+
},
|
|
2092
|
+
getActiveAssetOptions: (id, params) => {
|
|
2093
|
+
return API$f.get(`/routine-schedule/${id}/assets/options`, { params });
|
|
2094
|
+
},
|
|
2095
|
+
getRoutineTaskDetail: (id) => {
|
|
2096
|
+
return API$f.get(`/routine-task/${id}/detail`);
|
|
2097
|
+
},
|
|
2098
|
+
getApproverList: (id, approvalRound) => {
|
|
2099
|
+
return API$f.get(`/routine-task/${id}/approval-history`, {
|
|
2100
|
+
params: {
|
|
2101
|
+
approvalRound
|
|
2102
|
+
}
|
|
2103
|
+
});
|
|
2104
|
+
},
|
|
2105
|
+
getReviewerList: (id) => {
|
|
2106
|
+
return API$f.get(`/routine-task/${id}/review-history`);
|
|
2107
|
+
},
|
|
2108
|
+
getMaintainableAssetDetail: (id) => {
|
|
2109
|
+
return API$f.get(`/maintenable-asset/${id}`);
|
|
2110
|
+
},
|
|
2111
|
+
putSetActiveTasks: (id, isActive) => {
|
|
2112
|
+
return API$f.put(`/maintenable-asset/${id}/set-tasks-active`, {
|
|
2113
|
+
isActive
|
|
2114
|
+
});
|
|
2115
|
+
},
|
|
2116
|
+
putAssignStaff: (routineId, staffId) => {
|
|
2117
|
+
return API$f.put(`/routine-task/${routineId}/assign-staff`, {
|
|
2118
|
+
id: staffId
|
|
2119
|
+
});
|
|
2120
|
+
},
|
|
2121
|
+
getServiceCenter: () => {
|
|
2122
|
+
return API$f.get("/service-center/dropdown");
|
|
2123
|
+
},
|
|
2124
|
+
putCompleteRoutineTask: (id, data) => {
|
|
2125
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
2126
|
+
return API$f.put(`/routine-task/${id}/completion`, data, { headers });
|
|
2127
|
+
},
|
|
2128
|
+
getApprovalDetail: (id) => {
|
|
2129
|
+
return API$f.get(`/approval/${id}`);
|
|
2130
|
+
},
|
|
2131
|
+
putApprovalApprove: (id, data) => {
|
|
2132
|
+
return API$f.put(`/approval/${id}/approve`, data);
|
|
2133
|
+
},
|
|
2134
|
+
putReviewRoutine: (id, data) => {
|
|
2135
|
+
return API$f.put(`/routine-task/${id}/review`, data);
|
|
2136
|
+
},
|
|
2137
|
+
putUpdateRoutineTask: (id, data) => {
|
|
2138
|
+
return API$f.put(`/routine-task/${id}/handle-overdue`, data);
|
|
2139
|
+
},
|
|
2140
|
+
getApproval: (params) => {
|
|
2141
|
+
return API$f.get("/approval", { params });
|
|
2142
|
+
},
|
|
2143
|
+
getApprovalOptions: (params) => {
|
|
2144
|
+
return API$f.get("/approval/options", { params });
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2147
|
+
const API$e = createAxiosInstance({
|
|
2148
|
+
env: "APP_TAGSAMURAI_API",
|
|
2149
|
+
prefix: "/routine/v2"
|
|
2150
|
+
});
|
|
2151
|
+
const ServiceCenterServices = {
|
|
2152
|
+
getList: (params) => {
|
|
2153
|
+
return API$e.get("/service-center", { params });
|
|
2154
|
+
},
|
|
2155
|
+
postList: (body) => {
|
|
2156
|
+
return API$e.post("/service-center", body);
|
|
2157
|
+
},
|
|
2158
|
+
putList: (id, body) => {
|
|
2159
|
+
return API$e.put(`/service-center/${id}`, body);
|
|
2160
|
+
},
|
|
2161
|
+
putActivate: (body) => {
|
|
2162
|
+
return API$e.put("/service-center/bulk", body);
|
|
2163
|
+
},
|
|
2164
|
+
getDetailList: (id) => {
|
|
2165
|
+
return API$e.get(`/service-center/${id}`);
|
|
2166
|
+
},
|
|
2167
|
+
getListOptions: (params) => {
|
|
2168
|
+
return API$e.get("/service-center/options", { params });
|
|
2169
|
+
},
|
|
2170
|
+
deleteList: (params) => {
|
|
2171
|
+
return API$e.delete("/service-center", { params });
|
|
2172
|
+
},
|
|
2173
|
+
// Activities
|
|
2174
|
+
getActivities: (params) => {
|
|
2175
|
+
return API$e.get("/service-activities", { params });
|
|
2176
|
+
},
|
|
2177
|
+
getActivityOptions: (params) => {
|
|
2178
|
+
return API$e.get("/service-activities/options", { params });
|
|
2179
|
+
},
|
|
2180
|
+
getActivityDetail: (id) => {
|
|
2181
|
+
return API$e.get(`/service-activities/${id}`);
|
|
2182
|
+
},
|
|
2183
|
+
getActivityLog: (id) => {
|
|
2184
|
+
return API$e.get(`/service-activities/${id}/activity-log`);
|
|
2185
|
+
}
|
|
2186
|
+
};
|
|
2187
|
+
const API$d = createAxiosInstance({
|
|
2188
|
+
prefix: "/v2/session-log",
|
|
2189
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
2190
|
+
});
|
|
2191
|
+
const SessionLogServices = {
|
|
2192
|
+
postLogout: () => {
|
|
2193
|
+
return API$d.post("/logout");
|
|
2194
|
+
}
|
|
2195
|
+
};
|
|
2196
|
+
const API$c = createAxiosInstance({
|
|
2197
|
+
env: "APP_TAGSAMURAI_API",
|
|
2198
|
+
prefix: "/tag/v2"
|
|
2199
|
+
});
|
|
2200
|
+
const TAGServices = {
|
|
2201
|
+
getScanQR: (tag) => {
|
|
2202
|
+
return API$c.get("/qr", { params: { tag } });
|
|
2203
|
+
},
|
|
2204
|
+
getScanRFID: (tag) => {
|
|
2205
|
+
return API$c.get("/rfid", { params: { tag } });
|
|
2206
|
+
},
|
|
2207
|
+
getRFIDQRTAG: (params) => {
|
|
2208
|
+
return API$c.get("/rfid-qr/scan", { params });
|
|
2209
|
+
},
|
|
2210
|
+
getEventLog: (params) => {
|
|
2211
|
+
return API$c.get("/tag-transaction/event-log", { params });
|
|
2212
|
+
},
|
|
2213
|
+
// Tab All
|
|
2214
|
+
getRfidQrAll: (path, params) => {
|
|
2215
|
+
return API$c.get(`/${path}`, { params });
|
|
2216
|
+
},
|
|
2217
|
+
// Tab Paired
|
|
2218
|
+
getRfidQrPaired: (tagType, viewBy, params) => {
|
|
2219
|
+
return API$c.get(`/${tagType}/paired/${viewBy}`, { params });
|
|
2220
|
+
},
|
|
2221
|
+
postAddTAGtoPrelist: (body, destination) => {
|
|
2222
|
+
return API$c.post(`/prelist/${destination}/asset-name`, body);
|
|
2223
|
+
},
|
|
2224
|
+
postAddTAGtoReplacePrelist: (body) => {
|
|
2225
|
+
return API$c.post("/prelist/replace-tag", body);
|
|
2226
|
+
},
|
|
2227
|
+
postAddTAGToPrelistUnpair: (body) => {
|
|
2228
|
+
return API$c.post("/prelist/unpair-tag", body);
|
|
2229
|
+
},
|
|
2230
|
+
postAddTAGtoPending: (body) => {
|
|
2231
|
+
return API$c.post("/pending-changes", body);
|
|
2232
|
+
},
|
|
2233
|
+
// Available Tab
|
|
2234
|
+
getRFIDQrAvailable: (tagType, params) => {
|
|
2235
|
+
return API$c.get(`/${tagType}/available`, { params });
|
|
2236
|
+
},
|
|
2237
|
+
// Damaged TAB
|
|
2238
|
+
getRFIDQrDamaged: (tagType, params) => {
|
|
2239
|
+
return API$c.get(`/${tagType}/damaged`, { params });
|
|
2240
|
+
},
|
|
2241
|
+
// RFID and QR Module
|
|
2242
|
+
getRFIDandQRList: (params) => {
|
|
2243
|
+
return API$c.get("/rfid-qr", { params });
|
|
2244
|
+
},
|
|
2245
|
+
deleteUnpairTAG: (body) => {
|
|
2246
|
+
return API$c.delete("/rfid-qr", { data: { data: body } });
|
|
2247
|
+
},
|
|
2248
|
+
postPairTAG: (body) => {
|
|
2249
|
+
return API$c.post("/rfid-qr", { body: { data: body } });
|
|
2250
|
+
},
|
|
2251
|
+
// RFID To Be Returned
|
|
2252
|
+
getToBeReturnedTAGList: (params) => {
|
|
2253
|
+
return API$c.get("/rfid/to-be-returned", { params });
|
|
2254
|
+
},
|
|
2255
|
+
// Handover TAG
|
|
2256
|
+
putHandoverTAG: (body) => {
|
|
2257
|
+
return API$c.put("/rfid/handover", { body: { data: body } });
|
|
2258
|
+
},
|
|
2259
|
+
// Table Filter
|
|
2260
|
+
getFilterOptions: (path, params) => {
|
|
2261
|
+
return API$c.get(`/${path}/options`, { params });
|
|
2262
|
+
},
|
|
2263
|
+
getHolderListOptions: (params) => {
|
|
2264
|
+
return API$c.get("/rfid/holder-list/options", { params });
|
|
2265
|
+
},
|
|
2266
|
+
getHolderList: (params) => {
|
|
2267
|
+
return API$c.get("/rfid/holder-list", { params });
|
|
2268
|
+
},
|
|
2269
|
+
putAuditTAG: (body, tagType) => {
|
|
2270
|
+
return API$c.put(`/${tagType}/audit`, body);
|
|
2271
|
+
},
|
|
2272
|
+
postLogAudit: (body) => {
|
|
2273
|
+
return API$c.post("/tag-transaction/log-audit", body);
|
|
2274
|
+
},
|
|
2275
|
+
postCreateQr: (amount) => {
|
|
2276
|
+
const body = { amount };
|
|
2277
|
+
return API$c.post("/qr", body);
|
|
2278
|
+
},
|
|
2279
|
+
putReportTAG: (id, body) => {
|
|
2280
|
+
return API$c.put(`/tag-transaction/report/${id}`, body);
|
|
2281
|
+
},
|
|
2282
|
+
putReportTAGBulk: (body) => {
|
|
2283
|
+
return API$c.put("/tag-transaction/report/bulk", body);
|
|
2284
|
+
},
|
|
2285
|
+
putDeclineReport: (body, tagType) => {
|
|
2286
|
+
return API$c.put(`/report/decline-report/${tagType}`, body);
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
const API$b = createAxiosInstance({
|
|
2290
|
+
env: "APP_TAGSAMURAI_API",
|
|
2291
|
+
prefix: "/tracking/v2/tracking"
|
|
2292
|
+
});
|
|
2293
|
+
const API_APPROVAL = createAxiosInstance({
|
|
2294
|
+
env: "APP_TAGSAMURAI_API",
|
|
2295
|
+
prefix: "/tracking/v2/tracking-approval"
|
|
2296
|
+
});
|
|
2297
|
+
const TrackingServices = {
|
|
2298
|
+
getTrackingDetail: (trackingId) => {
|
|
2299
|
+
return API$b.get(`/${trackingId}`);
|
|
2300
|
+
},
|
|
2301
|
+
putFoundAsset: (tag, groupId, serialNumber, type) => {
|
|
2302
|
+
const params = {
|
|
2303
|
+
tag,
|
|
2304
|
+
group: groupId,
|
|
2305
|
+
serialNumber,
|
|
2306
|
+
type: type ?? "Global"
|
|
2307
|
+
};
|
|
2308
|
+
return API$b.put("/scan", void 0, { params });
|
|
2309
|
+
},
|
|
2310
|
+
putReportPermanentlyMissing: (trackingId, body) => {
|
|
2311
|
+
return API$b.put(`/report-permanently-missing/${trackingId}`, body);
|
|
2312
|
+
},
|
|
2313
|
+
putUpdateTrackingAsset: (id, body) => {
|
|
2314
|
+
const headers = { "Content-type": "multipart/form-data" };
|
|
2315
|
+
return API$b.put(`/update/${id}`, body, { headers });
|
|
2316
|
+
},
|
|
2317
|
+
putMoveBack: (body) => {
|
|
2318
|
+
return API$b.put("/tracking/move-back", body);
|
|
2319
|
+
},
|
|
2320
|
+
getTrackingList: (endpoint, params) => {
|
|
2321
|
+
return API$b.get(endpoint, { params });
|
|
2322
|
+
},
|
|
2323
|
+
getTrackingDetailByScan: (tag) => {
|
|
2324
|
+
return API$b.get("/scan", { params: { tag } });
|
|
2325
|
+
},
|
|
2326
|
+
getFilterOptions: (endPoint, params) => {
|
|
2327
|
+
return API$b.get(endPoint + "/options", { params });
|
|
2328
|
+
},
|
|
2329
|
+
getApproverList: (id) => {
|
|
2330
|
+
return API_APPROVAL.get(`/${id}/approval-history`);
|
|
2331
|
+
},
|
|
2332
|
+
getApprovalList: (params) => {
|
|
2333
|
+
return API_APPROVAL.get("", { params });
|
|
2334
|
+
},
|
|
2335
|
+
getApprovalFilterOptions: (params) => {
|
|
2336
|
+
return API_APPROVAL.get("/options", { params });
|
|
2337
|
+
},
|
|
2338
|
+
putApproval: (body) => {
|
|
2339
|
+
return API_APPROVAL.put("/approval", body);
|
|
2340
|
+
}
|
|
2341
|
+
};
|
|
2342
|
+
const API$a = createAxiosInstance({
|
|
2343
|
+
env: "APP_TAGSAMURAI_API",
|
|
2344
|
+
prefix: "/settings-attribute/v2/transaction-settings"
|
|
2345
|
+
});
|
|
2346
|
+
const TransactionSettingServices = {
|
|
2347
|
+
getData: () => {
|
|
2348
|
+
return API$a.get("/");
|
|
2349
|
+
},
|
|
2350
|
+
putData: (data) => {
|
|
2351
|
+
return API$a.put("/", data);
|
|
2352
|
+
}
|
|
2353
|
+
};
|
|
2354
|
+
const API$9 = createAxiosInstance({
|
|
2355
|
+
prefix: "/fam/settings-attribute/v2/asset-name"
|
|
2356
|
+
});
|
|
2357
|
+
const SettingAssetNameServiceGo = {
|
|
2358
|
+
getAssetNameList: (params) => {
|
|
2359
|
+
const body = buildBodyParams(params);
|
|
2360
|
+
return API$9.post("/list", body);
|
|
2361
|
+
},
|
|
2362
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/options
|
|
2363
|
+
getAssetNameListOptions: (params) => {
|
|
2364
|
+
const body = buildBodyParams(params);
|
|
2365
|
+
return API$9.post("/list/options", body);
|
|
2366
|
+
},
|
|
2367
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/dropdown
|
|
2368
|
+
getAssetNameDropdown: (params) => {
|
|
2369
|
+
return API$9.get("/dropdown", { params });
|
|
2370
|
+
},
|
|
2371
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/unpaired
|
|
2372
|
+
getAssetUnpairedNameList: (params) => {
|
|
2373
|
+
return API$9.get("/unpaired", { params });
|
|
2374
|
+
},
|
|
2375
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/unpaired/options
|
|
2376
|
+
getAssetUnpairedNameListOptions: (params) => {
|
|
2377
|
+
return API$9.get("/unpaired/options", { params });
|
|
2378
|
+
},
|
|
2379
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/:id
|
|
2380
|
+
getAssetNameDetail: (id) => {
|
|
2381
|
+
return API$9.get(`/${id}`);
|
|
2382
|
+
},
|
|
2383
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/:id/list-brand
|
|
2384
|
+
getAssetNameBrands: (id, params) => {
|
|
2385
|
+
return API$9.get(`/${id}/list-brand`, { params });
|
|
2386
|
+
},
|
|
2387
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/:id/list-asset
|
|
2388
|
+
getAssetNameAssets: (id, params) => {
|
|
2389
|
+
return API$9.get(`/${id}/list-asset`, { params });
|
|
2390
|
+
},
|
|
2391
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/:id/list-asset/options
|
|
2392
|
+
getAssetNameAssetsOptions: (id, params) => {
|
|
2393
|
+
return API$9.get(`/${id}/list-asset/options`, { params });
|
|
2394
|
+
},
|
|
2395
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/:id/list-brand/options
|
|
2396
|
+
getAssetNameBrandsOptions: (id, params) => {
|
|
2397
|
+
return API$9.get(`/${id}/list-brand/options`, { params });
|
|
2398
|
+
},
|
|
2399
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name
|
|
2400
|
+
createAssetName: (body) => {
|
|
2401
|
+
return API$9.post("", body);
|
|
2402
|
+
},
|
|
2403
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/depreciation-setting
|
|
2404
|
+
updateDepreciationSetting: (body) => {
|
|
2405
|
+
return API$9.put("/depreciation-setting", body);
|
|
2406
|
+
},
|
|
2407
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/set-tagtype
|
|
2408
|
+
setTagType: (body) => {
|
|
2409
|
+
return API$9.put("/set-tagtype", body);
|
|
2410
|
+
},
|
|
2411
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name/:id
|
|
2412
|
+
updateAssetName: (body, id) => {
|
|
2413
|
+
return API$9.put(`/${id}`, body);
|
|
2414
|
+
},
|
|
2415
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/asset-name
|
|
2416
|
+
deleteAssetName: (body) => {
|
|
2417
|
+
return API$9.delete("", {
|
|
2418
|
+
data: body
|
|
2419
|
+
});
|
|
2420
|
+
}
|
|
2421
|
+
};
|
|
2422
|
+
const API$8 = createAxiosInstance({
|
|
2423
|
+
prefix: "/fam/settings-attribute/v2/brands"
|
|
2424
|
+
});
|
|
2425
|
+
const SettingBrandServiceGo = {
|
|
2426
|
+
getBrandList: (params) => {
|
|
2427
|
+
const body = buildBodyParams(params);
|
|
2428
|
+
return API$8.post("/list", body);
|
|
2429
|
+
},
|
|
2430
|
+
getBrandListOptionsFA: (params) => {
|
|
2431
|
+
const body = buildBodyParams(params);
|
|
2432
|
+
return API$8.post("/list/options", body);
|
|
487
2433
|
},
|
|
488
|
-
|
|
489
|
-
return
|
|
2434
|
+
getBrandDropdown: (params) => {
|
|
2435
|
+
return API$8.get("/dropdown", { params });
|
|
490
2436
|
},
|
|
491
|
-
|
|
492
|
-
return
|
|
2437
|
+
getBrandDetail: (id) => {
|
|
2438
|
+
return API$8.get(`/${id}`);
|
|
493
2439
|
},
|
|
494
|
-
|
|
495
|
-
|
|
2440
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands/:id/list-category
|
|
2441
|
+
getBrandListCategory: (id, params) => {
|
|
2442
|
+
return API$8.get(`/${id}/list-category`, { params });
|
|
496
2443
|
},
|
|
497
|
-
|
|
498
|
-
|
|
2444
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands/:id/list-category/options
|
|
2445
|
+
getBrandListCategoryOptions: (id, params) => {
|
|
2446
|
+
return API$8.get(`/${id}/list-category/options`, { params });
|
|
499
2447
|
},
|
|
500
|
-
|
|
501
|
-
|
|
2448
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands/:id/list-asset
|
|
2449
|
+
getBrandListAsset: (id, params) => {
|
|
2450
|
+
return API$8.get(`/${id}/list-asset`, { params });
|
|
502
2451
|
},
|
|
503
|
-
|
|
504
|
-
|
|
2452
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands/:id/list-asset/options
|
|
2453
|
+
getBrandListAssetOptions: (id, params) => {
|
|
2454
|
+
return API$8.get(`/${id}/list-asset/options`, { params });
|
|
505
2455
|
},
|
|
506
|
-
|
|
507
|
-
|
|
2456
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands
|
|
2457
|
+
createBrand: (body) => {
|
|
2458
|
+
return API$8.post("", body);
|
|
508
2459
|
},
|
|
509
|
-
|
|
2460
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands/assign-category
|
|
2461
|
+
brandAssignCategory: (body) => {
|
|
2462
|
+
return API$8.put("/assign-category", body);
|
|
2463
|
+
},
|
|
2464
|
+
brandUnassignCategory: (body) => {
|
|
2465
|
+
return API$8.put("/unassign-category", body);
|
|
2466
|
+
},
|
|
2467
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands/:id
|
|
2468
|
+
updateBrand: (body, id) => {
|
|
2469
|
+
return API$8.put(`/${id}`, body);
|
|
2470
|
+
},
|
|
2471
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/brands
|
|
2472
|
+
deleteBrand: (body) => {
|
|
2473
|
+
return API$8.delete("", {
|
|
2474
|
+
data: body
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
};
|
|
2478
|
+
const API$7 = createAxiosInstance({
|
|
2479
|
+
prefix: "/fam/settings-attribute/v2/measurement"
|
|
2480
|
+
});
|
|
2481
|
+
const SettingMeasurementServiceGo = {
|
|
2482
|
+
getMeasurementList: (params) => {
|
|
2483
|
+
return API$7.get("", { params });
|
|
2484
|
+
},
|
|
2485
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/measurement/dropdown
|
|
2486
|
+
getMeasurementDropdown: () => {
|
|
2487
|
+
return API$7.get("/dropdown");
|
|
2488
|
+
},
|
|
2489
|
+
createMeasurement: (body) => {
|
|
2490
|
+
return API$7.post("", body);
|
|
2491
|
+
},
|
|
2492
|
+
updateMeasurement: (body, id) => {
|
|
2493
|
+
return API$7.put(`/${id}`, body);
|
|
2494
|
+
},
|
|
2495
|
+
//https://dev-api.supply.tagsamurai.com/settings-attribute-go/v2/measurement
|
|
2496
|
+
deleteMeasurement: (body) => {
|
|
2497
|
+
return API$7.delete("", {
|
|
2498
|
+
data: body
|
|
2499
|
+
});
|
|
2500
|
+
}
|
|
2501
|
+
};
|
|
2502
|
+
const API$6 = createAxiosInstance({
|
|
2503
|
+
env: "APP_TAGSAMURAI_API",
|
|
2504
|
+
prefix: "/iot/v2/iot"
|
|
2505
|
+
});
|
|
2506
|
+
const IOTServices = {
|
|
2507
|
+
getReaderList: () => {
|
|
2508
|
+
return API$6.get("/antenna/available");
|
|
2509
|
+
},
|
|
2510
|
+
getReaderOptions: (params) => {
|
|
2511
|
+
return API$6.get("/reader/options", { params });
|
|
2512
|
+
},
|
|
2513
|
+
putSetScanParams: (body) => {
|
|
2514
|
+
return API$6.put("/reader/set-scan-params", body);
|
|
2515
|
+
},
|
|
2516
|
+
putIOTTracking: (body) => {
|
|
2517
|
+
return API$6.put("/tracking", body);
|
|
2518
|
+
},
|
|
2519
|
+
getActivityLogData: (params) => {
|
|
2520
|
+
return API$6.get("/activity-log", { params });
|
|
2521
|
+
},
|
|
2522
|
+
getActivityLogOptions: (params) => {
|
|
2523
|
+
return API$6.get("/activity-log/options", { params });
|
|
2524
|
+
}
|
|
2525
|
+
};
|
|
2526
|
+
const ReaderAPI = createAxiosInstance({
|
|
2527
|
+
prefix: "/fam/iot/v2/reader"
|
|
2528
|
+
});
|
|
2529
|
+
const IOTAntennaAPI = createAxiosInstance({
|
|
2530
|
+
prefix: "/fam/iot/v2/iot/antenna"
|
|
2531
|
+
});
|
|
2532
|
+
const IOTReaderAPI = createAxiosInstance({
|
|
2533
|
+
prefix: "/fam/iot/v2/iot/reader"
|
|
2534
|
+
});
|
|
2535
|
+
const IOTActivityLogAPI = createAxiosInstance({
|
|
2536
|
+
prefix: "/fam/iot/v2/iot/activity-log"
|
|
2537
|
+
});
|
|
2538
|
+
const IOTService = {
|
|
2539
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna
|
|
2540
|
+
getIOTAntennaList: (params) => {
|
|
2541
|
+
return IOTAntennaAPI.get("", { params: queryParamsStringfy(params) });
|
|
2542
|
+
},
|
|
2543
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna/options
|
|
2544
|
+
getIOTAntennaListOptions: (params) => {
|
|
2545
|
+
return IOTAntennaAPI.get("/options", { params });
|
|
2546
|
+
},
|
|
2547
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/options
|
|
2548
|
+
getIOTReaderListOptions: (params) => {
|
|
2549
|
+
return IOTReaderAPI.get("/options", { params });
|
|
2550
|
+
},
|
|
2551
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader
|
|
2552
|
+
getIOTReaderList: (params) => {
|
|
2553
|
+
return IOTReaderAPI.get("", { params: queryParamsStringfy(params) });
|
|
2554
|
+
},
|
|
2555
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/activity-log
|
|
2556
|
+
getActivityLog: (params) => {
|
|
2557
|
+
return IOTActivityLogAPI.get("", { params });
|
|
2558
|
+
},
|
|
2559
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/activity-log/options
|
|
2560
|
+
getActivityLogOptions: (params) => {
|
|
2561
|
+
return IOTActivityLogAPI.get("/options", { params });
|
|
2562
|
+
},
|
|
2563
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-alias-name
|
|
2564
|
+
setIOTAliasName: (body) => {
|
|
2565
|
+
return IOTReaderAPI.put("/set-alias-name", body);
|
|
2566
|
+
},
|
|
2567
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ping
|
|
2568
|
+
pingIOTSingle: (id) => {
|
|
2569
|
+
return IOTReaderAPI.put(`/${id}/ping`);
|
|
2570
|
+
},
|
|
2571
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/ping/bulk
|
|
2572
|
+
pingIOTBulk: (body) => {
|
|
2573
|
+
return IOTReaderAPI.put("/ping/bulk", body);
|
|
2574
|
+
},
|
|
2575
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/set-antenna-power
|
|
2576
|
+
setIOTAntennaPowerBulk: (id, body) => {
|
|
2577
|
+
return IOTReaderAPI.put(`/${id}/set-antenna-power`, body);
|
|
2578
|
+
},
|
|
2579
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ports
|
|
2580
|
+
getIOTPortList: (id, params) => {
|
|
2581
|
+
return IOTReaderAPI.get(`/${id}/ports`, { params });
|
|
2582
|
+
},
|
|
2583
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id
|
|
2584
|
+
getIOTDetail: (id) => {
|
|
2585
|
+
return IOTReaderAPI.get(`/${id}`);
|
|
2586
|
+
},
|
|
2587
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/check-manager
|
|
2588
|
+
getIOTCheckManager: () => {
|
|
2589
|
+
return IOTReaderAPI.get("/check-manager");
|
|
2590
|
+
},
|
|
2591
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/reader/:id
|
|
2592
|
+
updateReader: (id, body) => {
|
|
2593
|
+
return ReaderAPI.put(`/${id}`, body);
|
|
2594
|
+
},
|
|
2595
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-status
|
|
2596
|
+
updateReaderStatus: (body) => {
|
|
2597
|
+
return IOTReaderAPI.put("/set-status", body);
|
|
2598
|
+
},
|
|
2599
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna/set-status
|
|
2600
|
+
updateAntennaStatus: (body) => {
|
|
2601
|
+
return IOTAntennaAPI.put("/set-status", body);
|
|
2602
|
+
},
|
|
2603
|
+
setIOTPortGroup: (id, body) => {
|
|
2604
|
+
return IOTReaderAPI.put(`/${id}/set-port-group`, body);
|
|
2605
|
+
},
|
|
2606
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/set-port-status
|
|
2607
|
+
setIOTPortStatus: (id, body) => {
|
|
2608
|
+
return IOTReaderAPI.put(`/${id}/set-port-status`, body);
|
|
2609
|
+
},
|
|
2610
|
+
setGroupIOT: (body) => {
|
|
2611
|
+
return IOTReaderAPI.put("/set-group", body);
|
|
2612
|
+
},
|
|
2613
|
+
getDataById: (id) => {
|
|
2614
|
+
return IOTReaderAPI.get(`/${id}`);
|
|
2615
|
+
},
|
|
2616
|
+
getChangeLog: (params) => {
|
|
2617
|
+
return IOTReaderAPI.get(`/${params.id}/change-log`, { params });
|
|
2618
|
+
},
|
|
2619
|
+
getChangeLogOptions: (params) => {
|
|
2620
|
+
return IOTReaderAPI.get(`/${params.id}/change-log/options`, { params });
|
|
2621
|
+
},
|
|
2622
|
+
putData: (id, body) => {
|
|
2623
|
+
return IOTReaderAPI.put(`/${id}`, body);
|
|
2624
|
+
}
|
|
2625
|
+
};
|
|
2626
|
+
const ReportAPI = createAxiosInstance({
|
|
2627
|
+
env: "APP_TAGSAMURAI_API",
|
|
2628
|
+
prefix: "/disposal/v2/report"
|
|
2629
|
+
});
|
|
2630
|
+
const DisposalAPI = createAxiosInstance({
|
|
2631
|
+
env: "APP_TAGSAMURAI_API",
|
|
2632
|
+
prefix: "/disposal/v2/disposal"
|
|
2633
|
+
});
|
|
2634
|
+
const ApprovalAPI = createAxiosInstance({
|
|
2635
|
+
env: "APP_TAGSAMURAI_API",
|
|
2636
|
+
prefix: "/disposal/v2/approval"
|
|
2637
|
+
});
|
|
2638
|
+
const DisposalServices = {
|
|
2639
|
+
getReportedDisposal: (params) => {
|
|
2640
|
+
return ReportAPI.get("", { params });
|
|
2641
|
+
},
|
|
2642
|
+
getReportedDisposalOptions: (params) => {
|
|
2643
|
+
return ReportAPI.get("/options", { params });
|
|
2644
|
+
},
|
|
2645
|
+
postReportDisposal: (body) => {
|
|
2646
|
+
return ReportAPI.post("", body);
|
|
2647
|
+
},
|
|
2648
|
+
deleteCancelReport: (params) => {
|
|
2649
|
+
params.isFromDisposal = "false";
|
|
2650
|
+
return ReportAPI.delete("/cancel-report", { params });
|
|
2651
|
+
},
|
|
2652
|
+
deleteDeclineReport: (params) => {
|
|
2653
|
+
params.isFromDisposal = "true";
|
|
2654
|
+
return ReportAPI.delete("/cancel-report", { params });
|
|
2655
|
+
},
|
|
2656
|
+
getPrelistDisposal: (params) => {
|
|
2657
|
+
return DisposalAPI.get("/prelist", { params });
|
|
2658
|
+
},
|
|
2659
|
+
getPrelistDisposalRequest: (params) => {
|
|
2660
|
+
return DisposalAPI.get("/prelist/request", { params });
|
|
2661
|
+
},
|
|
2662
|
+
postCreatePrelist: (body) => {
|
|
2663
|
+
return DisposalAPI.post("/prelist", body);
|
|
2664
|
+
},
|
|
2665
|
+
deletePrelistData: (params) => {
|
|
2666
|
+
return DisposalAPI.delete("/prelist", { params });
|
|
2667
|
+
},
|
|
2668
|
+
postCreateTransaction: (body) => {
|
|
2669
|
+
return DisposalAPI.post("/transaction", body);
|
|
2670
|
+
},
|
|
2671
|
+
putTransaction: (id, body) => {
|
|
2672
|
+
return DisposalAPI.put(`/disposal/${id}`, body);
|
|
2673
|
+
},
|
|
2674
|
+
getTransactionData: (params) => {
|
|
2675
|
+
return DisposalAPI.get("/transaction", { params });
|
|
2676
|
+
},
|
|
2677
|
+
getTransactionDetail: (transactionId, params) => {
|
|
2678
|
+
return DisposalAPI.get(`/transaction/${transactionId}`, { params });
|
|
2679
|
+
},
|
|
2680
|
+
getDisposalTransactionLog: (id) => {
|
|
2681
|
+
return DisposalAPI.get(`/request/${id}/disposal-log`);
|
|
2682
|
+
},
|
|
2683
|
+
getTransactionApprovalHistory: (transactionId) => {
|
|
2684
|
+
return ApprovalAPI.get(`/transaction/${transactionId}/approval-history`);
|
|
2685
|
+
},
|
|
2686
|
+
getTransactionOptions: (params) => {
|
|
2687
|
+
return DisposalAPI.get("/transaction/options", { params });
|
|
2688
|
+
},
|
|
2689
|
+
putCancelTransaction: (params) => {
|
|
2690
|
+
return DisposalAPI.put("/cancel", void 0, { params });
|
|
2691
|
+
},
|
|
2692
|
+
putCancelRequest: (body) => {
|
|
2693
|
+
return DisposalAPI.put("/request/cancel", body);
|
|
2694
|
+
},
|
|
2695
|
+
putDisposalVerification: (body, transactionId) => {
|
|
2696
|
+
return DisposalAPI.put(`/${transactionId}/verification`, body);
|
|
2697
|
+
},
|
|
2698
|
+
putDisposalCompletion: (body, transactionId) => {
|
|
510
2699
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
511
|
-
return
|
|
2700
|
+
return DisposalAPI.put(`/${transactionId}/completion`, body, { headers });
|
|
512
2701
|
},
|
|
513
|
-
|
|
2702
|
+
getDisposalRequest: (params) => {
|
|
2703
|
+
return DisposalAPI.get("/request", { params });
|
|
2704
|
+
},
|
|
2705
|
+
getDisposalRequestOptions: (params) => {
|
|
2706
|
+
return DisposalAPI.get("/request/options", { params });
|
|
2707
|
+
},
|
|
2708
|
+
getVerifyAsset: (params) => {
|
|
2709
|
+
return DisposalAPI.get("/request/scan", { params });
|
|
2710
|
+
},
|
|
2711
|
+
getDisposalHistory: (additionalPath, params) => {
|
|
2712
|
+
return DisposalAPI.get(`/history${additionalPath}`, { params });
|
|
2713
|
+
},
|
|
2714
|
+
getHistoryByTransactionOptions: (params) => {
|
|
2715
|
+
return DisposalAPI.get("/history/options", { params });
|
|
2716
|
+
},
|
|
2717
|
+
getHistoryByAssetOptions: (params) => {
|
|
2718
|
+
return DisposalAPI.get("/history/by-asset/options", { params });
|
|
2719
|
+
},
|
|
2720
|
+
getTransactionApproval: (params) => {
|
|
2721
|
+
return ApprovalAPI.get("", { params });
|
|
2722
|
+
},
|
|
2723
|
+
getApprovalOptions: (params) => {
|
|
2724
|
+
return ApprovalAPI.get("/options", { params });
|
|
2725
|
+
},
|
|
2726
|
+
getApprovalData: (transactionId, params) => {
|
|
2727
|
+
return ApprovalAPI.get(`/transaction/${transactionId}`, { params });
|
|
2728
|
+
},
|
|
2729
|
+
getApprovalTransactionOptions: (transactionId, params) => {
|
|
2730
|
+
return ApprovalAPI.get(`/transaction/${transactionId}/options`, {
|
|
2731
|
+
params
|
|
2732
|
+
});
|
|
2733
|
+
},
|
|
2734
|
+
putApproveApproval: (body) => {
|
|
2735
|
+
return ApprovalAPI.put("/approve", body);
|
|
2736
|
+
},
|
|
2737
|
+
putApproveCompletionApproval: (body, transactionId) => {
|
|
2738
|
+
return ApprovalAPI.put(`/approval-completion/${transactionId}`, body);
|
|
2739
|
+
}
|
|
2740
|
+
};
|
|
2741
|
+
const API$5 = createAxiosInstance({
|
|
2742
|
+
prefix: "/fam/planning-strategy/risk-register"
|
|
2743
|
+
});
|
|
2744
|
+
const RiskRegisterServices = {
|
|
2745
|
+
getActiveRisk: (params) => {
|
|
2746
|
+
return API$5.post("/active/list", params);
|
|
2747
|
+
},
|
|
2748
|
+
getActiveRiskOptions: (params) => {
|
|
2749
|
+
return API$5.post("/active/options", params);
|
|
2750
|
+
},
|
|
2751
|
+
getClosedRisk: (params) => {
|
|
2752
|
+
return API$5.post("/closed/list", params);
|
|
2753
|
+
},
|
|
2754
|
+
getClosedRiskOptions: (params) => {
|
|
2755
|
+
return API$5.post("/closed/options", params);
|
|
2756
|
+
},
|
|
2757
|
+
postRisk: (data) => {
|
|
2758
|
+
return API$5.post("", data);
|
|
2759
|
+
},
|
|
2760
|
+
editRisk: (id, data) => {
|
|
2761
|
+
return API$5.patch(`/${id}`, data);
|
|
2762
|
+
},
|
|
2763
|
+
cancelRisk: (id, data) => {
|
|
2764
|
+
return API$5.patch(`/${id}/cancel`, data);
|
|
2765
|
+
},
|
|
2766
|
+
reviewRisk: (id, data) => {
|
|
2767
|
+
return API$5.patch(`/${id}/review`, data);
|
|
2768
|
+
},
|
|
2769
|
+
completeRisk: (id, data) => {
|
|
2770
|
+
return API$5.patch(`/${id}/complete`, data);
|
|
2771
|
+
},
|
|
2772
|
+
getRiskLogs: (id) => {
|
|
2773
|
+
return API$5.get(`/${id}/log`);
|
|
2774
|
+
}
|
|
2775
|
+
};
|
|
2776
|
+
const API$4 = createAxiosInstance({
|
|
2777
|
+
prefix: "/fam/v2/documents"
|
|
2778
|
+
});
|
|
2779
|
+
const DocumentServices = {
|
|
2780
|
+
getAllDocuments: (params) => {
|
|
2781
|
+
return API$4.get("", { params });
|
|
2782
|
+
},
|
|
2783
|
+
getDocumentOptions: (params) => {
|
|
2784
|
+
return API$4.get("/options", { params });
|
|
2785
|
+
},
|
|
2786
|
+
addDocument: (data) => {
|
|
2787
|
+
return API$4.post("", data);
|
|
2788
|
+
},
|
|
2789
|
+
editDocument: (id, data) => {
|
|
2790
|
+
return API$4.put(`/${id}`, data);
|
|
2791
|
+
},
|
|
2792
|
+
deleteDocument: (id) => {
|
|
2793
|
+
return API$4.delete("/bulk", { data: { ids: id } });
|
|
2794
|
+
},
|
|
2795
|
+
getDocumentFilterOptions: (params) => {
|
|
2796
|
+
return API$4.get("/filter-options", { params });
|
|
2797
|
+
}
|
|
2798
|
+
};
|
|
2799
|
+
const API$3 = createAxiosInstance({
|
|
2800
|
+
prefix: "/fam/planning-strategy/opportunity-register"
|
|
2801
|
+
});
|
|
2802
|
+
const OpportunityRegisterServices = {
|
|
2803
|
+
getOpportunityRegisterActiveList: (params) => {
|
|
2804
|
+
return API$3.get("/active/list", { params: queryParamsStringfy(params) });
|
|
2805
|
+
},
|
|
2806
|
+
getOpportunityRegisterActiveListOptions: (params) => {
|
|
2807
|
+
return API$3.get("/active/options", { params });
|
|
2808
|
+
},
|
|
2809
|
+
getOpportunityRegisterClosedList: (params) => {
|
|
2810
|
+
return API$3.get("/closed/list", { params: queryParamsStringfy(params) });
|
|
2811
|
+
},
|
|
2812
|
+
getOpportunityRegisterClosedListOptions: (params) => {
|
|
2813
|
+
return API$3.get("/closed/options", { params });
|
|
2814
|
+
},
|
|
2815
|
+
getOpportunityLogData: (opportunityId) => {
|
|
2816
|
+
return API$3.get(`/${opportunityId}/log`);
|
|
2817
|
+
},
|
|
2818
|
+
editActiveOpportunity: (opportunityId, body) => {
|
|
2819
|
+
return API$3.patch(`/${opportunityId}`, body);
|
|
2820
|
+
},
|
|
2821
|
+
addActiveOpportunity: (body) => {
|
|
2822
|
+
return API$3.post("/active", body);
|
|
2823
|
+
},
|
|
2824
|
+
reviewOpportunityAction: (opportunityId, body) => {
|
|
2825
|
+
return API$3.post(`/${opportunityId}/review`, body);
|
|
2826
|
+
},
|
|
2827
|
+
cancelOpportunity: (opportunityId, body) => {
|
|
2828
|
+
return API$3.put(`/${opportunityId}/cancel`, body);
|
|
2829
|
+
}
|
|
2830
|
+
};
|
|
2831
|
+
const API$2 = createAxiosInstance({
|
|
2832
|
+
prefix: "/fam/planning-strategy/continuous-improvement"
|
|
2833
|
+
});
|
|
2834
|
+
const ContinuousImprovementServices = {
|
|
2835
|
+
getContinuousImprovementActive: (params) => {
|
|
2836
|
+
return API$2.post("/continuous-improvement-log/active/list", { params });
|
|
2837
|
+
},
|
|
2838
|
+
getContinuousImprovementActiveOptions: (params) => {
|
|
2839
|
+
return API$2.post("/continuous-improvement-log/active/options", { params });
|
|
2840
|
+
},
|
|
2841
|
+
getContinuousImprovementClosed: (params) => {
|
|
2842
|
+
return API$2.post("/continuous-improvement-log/closed/list", { params });
|
|
2843
|
+
},
|
|
2844
|
+
getContinuousImprovementClosedOptions: (params) => {
|
|
2845
|
+
return API$2.post("/continuous-improvement-log/closed/options", { params });
|
|
2846
|
+
},
|
|
2847
|
+
getContinuousImprovementLog: (id) => {
|
|
2848
|
+
return API$2.get(`/continuous-improvement-log/${id}/log`);
|
|
2849
|
+
},
|
|
2850
|
+
createContinuousImprovementLog: (data) => {
|
|
2851
|
+
return API$2.post("/continuous-improvement-log", data);
|
|
2852
|
+
},
|
|
2853
|
+
editContinuousImprovementLog: (id, data) => {
|
|
2854
|
+
return API$2.patch(`/continuous-improvement-log/${id}`, data);
|
|
2855
|
+
},
|
|
2856
|
+
cancelImprovement: (id, payload) => {
|
|
2857
|
+
return API$2.patch(`/continuous-improvement-log/${id}/cancel`, payload);
|
|
2858
|
+
},
|
|
2859
|
+
reviewImprovement: (id, payload) => {
|
|
2860
|
+
return API$2.patch(`/continuous-improvement-log/${id}/review`, payload);
|
|
2861
|
+
},
|
|
2862
|
+
completeImprovement: (id, payload) => {
|
|
514
2863
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
515
|
-
return
|
|
2864
|
+
return API$2.patch(`/continuous-improvement-log/${id}/complete`, { headers });
|
|
516
2865
|
},
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
2866
|
+
getLessonLearned: (params) => {
|
|
2867
|
+
return API$2.post("/lesson-learned/list", { params });
|
|
2868
|
+
},
|
|
2869
|
+
getLessonLearnedOptions: (params) => {
|
|
2870
|
+
return API$2.post("/lesson-learned/options", { params });
|
|
2871
|
+
},
|
|
2872
|
+
createLessonLearned: (data) => {
|
|
2873
|
+
return API$2.post("/lesson-learned", data);
|
|
2874
|
+
},
|
|
2875
|
+
editLessonLearned: (id, data) => {
|
|
2876
|
+
return API$2.patch(`/lesson-learned/${id}`, data);
|
|
2877
|
+
},
|
|
2878
|
+
archiveLessonLearned: (id, payload) => {
|
|
2879
|
+
return API$2.patch(`/lesson-learned/${id}/archive`, payload);
|
|
2880
|
+
},
|
|
2881
|
+
restoreLessonLearned: (id, payload) => {
|
|
2882
|
+
return API$2.patch(`/lesson-learned/${id}/restore`, payload);
|
|
2883
|
+
},
|
|
2884
|
+
getLessonLearnedLog: (id) => {
|
|
2885
|
+
return API$2.get(`/lesson-learned/${id}/log`);
|
|
2886
|
+
},
|
|
2887
|
+
getAuditFindingCorrectiveActionActive: (params) => {
|
|
2888
|
+
return API$2.post("/audit-finding-and-corrective-action/active/list", { params });
|
|
2889
|
+
},
|
|
2890
|
+
getAuditFindingActiveOptions: (params) => {
|
|
2891
|
+
return API$2.post("/audit-finding-and-corrective-action/active/options", {
|
|
2892
|
+
params
|
|
2893
|
+
});
|
|
2894
|
+
},
|
|
2895
|
+
getAuditFindingCorrectiveActionClosed: (params) => {
|
|
2896
|
+
return API$2.post("/audit-finding-and-corrective-action/closed/list", { params });
|
|
2897
|
+
},
|
|
2898
|
+
getAuditFindingClosedOptions: (params) => {
|
|
2899
|
+
return API$2.post("/audit-finding-and-corrective-action/closed/options", {
|
|
2900
|
+
params
|
|
2901
|
+
});
|
|
2902
|
+
},
|
|
2903
|
+
createAuditFindingCorrectiveAction: (data) => {
|
|
2904
|
+
return API$2.post("/audit-finding-and-corrective-action", data);
|
|
2905
|
+
},
|
|
2906
|
+
editAuditFindingCorrectiveAction: (id, data) => {
|
|
2907
|
+
return API$2.patch(`/audit-finding-and-corrective-action/${id}`, data);
|
|
2908
|
+
},
|
|
2909
|
+
cancelAuditFindingCorrectiveAction: (id) => {
|
|
2910
|
+
return API$2.patch(`/audit-finding-and-corrective-action/${id}/cancel`);
|
|
2911
|
+
},
|
|
2912
|
+
reviewAuditFindingCorrectiveAction: (id, payload) => {
|
|
2913
|
+
return API$2.patch(
|
|
2914
|
+
`/audit-finding-and-corrective-action/${id}/review`,
|
|
2915
|
+
payload
|
|
2916
|
+
);
|
|
2917
|
+
},
|
|
2918
|
+
completeAuditFindingCorrectiveAction: (id, payload) => {
|
|
2919
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
2920
|
+
return API$2.patch(
|
|
2921
|
+
`/audit-finding-and-corrective-action/${id}/complete`,
|
|
2922
|
+
payload,
|
|
2923
|
+
{ headers }
|
|
2924
|
+
);
|
|
2925
|
+
},
|
|
2926
|
+
getAuditFindingCorrectiveActionLog: (id) => {
|
|
2927
|
+
return API$2.get(`/audit-finding-and-corrective-action/${id}/log`);
|
|
2928
|
+
}
|
|
2929
|
+
};
|
|
2930
|
+
const API$1 = createAxiosInstance({ prefix: "/fam/planning-strategy/amp" });
|
|
2931
|
+
const AmpManagementServices = {
|
|
2932
|
+
getAmpActive(params) {
|
|
2933
|
+
return API$1.post(`/active/list`, { params });
|
|
2934
|
+
},
|
|
2935
|
+
getAmpActiveFilterOptions(params) {
|
|
2936
|
+
return API$1.post(`/active/options`, { params });
|
|
2937
|
+
},
|
|
2938
|
+
getAmpPrevious(params) {
|
|
2939
|
+
return API$1.post(`/previous-version/list`, { params });
|
|
2940
|
+
},
|
|
2941
|
+
getAmpPreviousFilterOptions(params) {
|
|
2942
|
+
return API$1.post(`/previous-version/options`, { params });
|
|
2943
|
+
},
|
|
2944
|
+
initAmp() {
|
|
2945
|
+
return API$1.post("");
|
|
2946
|
+
},
|
|
2947
|
+
cancelAmp(ampId) {
|
|
2948
|
+
return API$1.delete(`/${ampId}/cancel`);
|
|
2949
|
+
},
|
|
2950
|
+
submitAmp(ampId, payload) {
|
|
2951
|
+
return API$1.patch(`/${ampId}`, payload);
|
|
2952
|
+
},
|
|
2953
|
+
getAmpDetail(ampId) {
|
|
2954
|
+
return API$1.get(`/${ampId}`);
|
|
2955
|
+
},
|
|
2956
|
+
deleteAmp(params) {
|
|
2957
|
+
return API$1.delete("", { params });
|
|
2958
|
+
},
|
|
2959
|
+
getSampDropdown() {
|
|
2960
|
+
return API$1.get(`/samp/dropdown`);
|
|
2961
|
+
},
|
|
2962
|
+
getDemandPerformanceRequirement(ampId, params) {
|
|
2963
|
+
return API$1.post(`/${ampId}/demand-and-performance-requirements/list`, {
|
|
2964
|
+
params
|
|
2965
|
+
});
|
|
2966
|
+
},
|
|
2967
|
+
createDemandPerformanceRequirement(ampId, payload) {
|
|
2968
|
+
return API$1.post(`/${ampId}/demand-and-performance-requirements`, payload);
|
|
2969
|
+
},
|
|
2970
|
+
editDemandPerformanceRequirement(ampId, payload) {
|
|
2971
|
+
return API$1.patch(`/${ampId}/demand-and-performance-requirements`, payload);
|
|
2972
|
+
},
|
|
2973
|
+
deleteDemandPerformanceRequirement(ampId, params) {
|
|
2974
|
+
return API$1.delete(`/${ampId}/demand-and-performance-requirements`, {
|
|
2975
|
+
params
|
|
2976
|
+
});
|
|
2977
|
+
},
|
|
2978
|
+
getLifecycleManagementPlan(ampId, params) {
|
|
2979
|
+
return API$1.post(`/${ampId}/lifecycle-management-plan/list`, { params });
|
|
2980
|
+
},
|
|
2981
|
+
getLifecycleManagementPlanOptions(ampId, payload) {
|
|
2982
|
+
return API$1.post(`/${ampId}/lifecycle-management-plan/options`, payload);
|
|
2983
|
+
},
|
|
2984
|
+
createLifecycleManagementPlan(ampId, payload) {
|
|
2985
|
+
return API$1.post(`/${ampId}/lifecycle-management-plan`, payload);
|
|
2986
|
+
},
|
|
2987
|
+
editLifecycleManagementPlan(ampId, payload) {
|
|
2988
|
+
return API$1.patch(`/${ampId}/lifecycle-management-plan`, payload);
|
|
2989
|
+
},
|
|
2990
|
+
deleteLifecycleManagementPlan(ampId, params) {
|
|
2991
|
+
return API$1.delete(`${ampId}/lifecycle-management-plan`, { params });
|
|
2992
|
+
},
|
|
2993
|
+
getResourceBudgetPlan(ampId, params) {
|
|
2994
|
+
return API$1.post(`/${ampId}/resource-budget-plan/list`, { params });
|
|
2995
|
+
},
|
|
2996
|
+
createResourceBudgetPlan(ampId, payload) {
|
|
2997
|
+
return API$1.post(`/${ampId}/resource-budget-plan`, payload);
|
|
2998
|
+
},
|
|
2999
|
+
editResourceBudgetPlan(ampId, payload) {
|
|
3000
|
+
return API$1.patch(`/${ampId}/resource-budget-plan`, payload);
|
|
3001
|
+
},
|
|
3002
|
+
deleteResourceBudgetPlan(ampId, params) {
|
|
3003
|
+
return API$1.delete(`/${ampId}/resource-budget-plan`, { params });
|
|
524
3004
|
}
|
|
525
3005
|
};
|
|
526
3006
|
const API = createAxiosInstance({
|
|
527
|
-
prefix: "/fam/
|
|
3007
|
+
prefix: "/fam/planning-strategy/samp"
|
|
528
3008
|
});
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
return API.
|
|
3009
|
+
const SAMPServices = {
|
|
3010
|
+
getActiveSAMP: (params) => {
|
|
3011
|
+
return API.post("/active/list", params);
|
|
532
3012
|
},
|
|
533
|
-
|
|
534
|
-
return API.
|
|
3013
|
+
getActiveSAMPOptions: (params) => {
|
|
3014
|
+
return API.post("/active/options", params);
|
|
535
3015
|
},
|
|
536
|
-
|
|
537
|
-
return API.
|
|
3016
|
+
getPreviousVersionSAMP: (params) => {
|
|
3017
|
+
return API.post("/previous-version/list", params);
|
|
538
3018
|
},
|
|
539
|
-
|
|
540
|
-
return API.
|
|
3019
|
+
getPreviousSAMPOptions: (params) => {
|
|
3020
|
+
return API.post("/previous-version/options", params);
|
|
541
3021
|
},
|
|
542
|
-
|
|
543
|
-
return API.
|
|
3022
|
+
initSAMP: () => {
|
|
3023
|
+
return API.post("/init");
|
|
3024
|
+
},
|
|
3025
|
+
saveSubmitSAMP: (data, sampId) => {
|
|
3026
|
+
return API.patch(`/${sampId}`, data);
|
|
3027
|
+
},
|
|
3028
|
+
getDetailSAMP: (sampId) => {
|
|
3029
|
+
return API.get(`/${sampId}`);
|
|
3030
|
+
},
|
|
3031
|
+
deleteSAMP: (params) => {
|
|
3032
|
+
return API.delete("", { params });
|
|
3033
|
+
},
|
|
3034
|
+
cancelSAMPCreate: (sampId) => {
|
|
3035
|
+
return API.delete(`/${sampId}/cancel`);
|
|
3036
|
+
},
|
|
3037
|
+
getInternalContextData: (params, sampId) => {
|
|
3038
|
+
return API.post(`${sampId}/internal-context/list`, params);
|
|
3039
|
+
},
|
|
3040
|
+
postInternalContext: (data, sampId) => {
|
|
3041
|
+
return API.post(`${sampId}/internal-context`, data);
|
|
3042
|
+
},
|
|
3043
|
+
editInternalContext: (contextId, data, sampId) => {
|
|
3044
|
+
return API.patch(`${sampId}/internal-context/${contextId}`, data);
|
|
3045
|
+
},
|
|
3046
|
+
deleteInternalContext: (params, sampId) => {
|
|
3047
|
+
return API.delete(`${sampId}/internal-context`, { params });
|
|
3048
|
+
},
|
|
3049
|
+
getExternalContextData: (params, sampId) => {
|
|
3050
|
+
return API.post(`${sampId}/external-context/list`, params);
|
|
3051
|
+
},
|
|
3052
|
+
postExternalContext: (data, sampId) => {
|
|
3053
|
+
return API.post(`${sampId}/external-context`, data);
|
|
3054
|
+
},
|
|
3055
|
+
editExternalContext: (contextId, data, sampId) => {
|
|
3056
|
+
return API.patch(`${sampId}/external-context/${contextId}`, data);
|
|
3057
|
+
},
|
|
3058
|
+
deleteExternalContext: (params, sampId) => {
|
|
3059
|
+
return API.delete(`${sampId}/external-context`, { params });
|
|
3060
|
+
},
|
|
3061
|
+
getStakeholders: (params, sampId) => {
|
|
3062
|
+
return API.post(`${sampId}/stakeholders/list`, params);
|
|
3063
|
+
},
|
|
3064
|
+
postStakeholders: (data, sampId) => {
|
|
3065
|
+
return API.post(`${sampId}/stakeholders`, data);
|
|
3066
|
+
},
|
|
3067
|
+
editStakeholders: (stakeholderId, data, sampId) => {
|
|
3068
|
+
return API.patch(`${sampId}/stakeholders/${stakeholderId}`, data);
|
|
3069
|
+
},
|
|
3070
|
+
deleteStakeholders: (params, sampId) => {
|
|
3071
|
+
return API.delete(`${sampId}/stakeholders`, { params });
|
|
3072
|
+
},
|
|
3073
|
+
getRolesResponsibility: (params, sampId) => {
|
|
3074
|
+
return API.post(`${sampId}/roles-and-responsibility/list`, params);
|
|
3075
|
+
},
|
|
3076
|
+
postRolesResponsibility: (data, sampId) => {
|
|
3077
|
+
return API.post(`${sampId}/roles-and-responsibility`, data);
|
|
3078
|
+
},
|
|
3079
|
+
editRolesResponsibility: (rolesResId, data, sampId) => {
|
|
3080
|
+
return API.patch(`${sampId}/roles-and-responsibility/${rolesResId}`, data);
|
|
3081
|
+
},
|
|
3082
|
+
deleteRolesResponsibility: (params, sampId) => {
|
|
3083
|
+
return API.delete(`${sampId}/roles-and-responsibility`, { params });
|
|
3084
|
+
},
|
|
3085
|
+
getSupportingSystemTools: (params, sampId) => {
|
|
3086
|
+
return API.post(`${sampId}/supporting-system-tools/list`, params);
|
|
3087
|
+
},
|
|
3088
|
+
postSupportingSystemTools: (data, sampId) => {
|
|
3089
|
+
return API.post(`${sampId}/supporting-system-tools`, data);
|
|
3090
|
+
},
|
|
3091
|
+
editSupportingSystemTools: (toolsId, data, sampId) => {
|
|
3092
|
+
return API.patch(`${sampId}/supporting-system-tools/${toolsId}`, data);
|
|
3093
|
+
},
|
|
3094
|
+
deleteSupportingSystemTools: (params, sampId) => {
|
|
3095
|
+
return API.delete(`${sampId}/supporting-system-tools`, { params });
|
|
3096
|
+
},
|
|
3097
|
+
getAMObjectives: (params, sampId) => {
|
|
3098
|
+
return API.post(`${sampId}/am-objective/list`, params);
|
|
3099
|
+
},
|
|
3100
|
+
getAMObjectivesOptions: (params, sampId) => {
|
|
3101
|
+
return API.post(`${sampId}/am-objective/options`, params);
|
|
3102
|
+
},
|
|
3103
|
+
postAMObjectives: (data, sampId) => {
|
|
3104
|
+
return API.post(`${sampId}/am-objective`, data);
|
|
3105
|
+
},
|
|
3106
|
+
editAMObjectives: (objectiveId, data, sampId) => {
|
|
3107
|
+
return API.put(`${sampId}/am-objective/${objectiveId}`, data);
|
|
3108
|
+
},
|
|
3109
|
+
deleteAMObjectives: (params, sampId) => {
|
|
3110
|
+
return API.delete(`${sampId}/am-objective`, { params });
|
|
3111
|
+
},
|
|
3112
|
+
getRisk: (params, sampId) => {
|
|
3113
|
+
return API.post(`${sampId}/strategic-risk-register/list`, params);
|
|
3114
|
+
},
|
|
3115
|
+
getRiskOptions: (params, sampId) => {
|
|
3116
|
+
return API.post(`${sampId}/strategic-risk-register/options`, params);
|
|
3117
|
+
},
|
|
3118
|
+
postRisk: (data, sampId) => {
|
|
3119
|
+
return API.post(`${sampId}/strategic-risk-register`, data);
|
|
3120
|
+
},
|
|
3121
|
+
editRisk: (riskId, data, sampId) => {
|
|
3122
|
+
return API.put(`${sampId}/strategic-risk-register/${riskId}`, data);
|
|
3123
|
+
},
|
|
3124
|
+
deleteRisk: (params, sampId) => {
|
|
3125
|
+
return API.delete(`${sampId}/strategic-risk-register`, { params });
|
|
3126
|
+
},
|
|
3127
|
+
getOpportunity: (params, sampId) => {
|
|
3128
|
+
return API.post(`${sampId}/strategic-opportunity-register/list`, params);
|
|
3129
|
+
},
|
|
3130
|
+
getOpportunityOptions: (params, sampId) => {
|
|
3131
|
+
return API.post(`${sampId}/strategic-opportunity-register/options`, params);
|
|
3132
|
+
},
|
|
3133
|
+
postOpportunity: (data, sampId) => {
|
|
3134
|
+
return API.post(`${sampId}/strategic-opportunity-register`, data);
|
|
3135
|
+
},
|
|
3136
|
+
editOpportunity: (opportunityId, data, sampId) => {
|
|
3137
|
+
return API.put(
|
|
3138
|
+
`${sampId}/strategic-opportunity-register/${opportunityId}`,
|
|
3139
|
+
data
|
|
3140
|
+
);
|
|
3141
|
+
},
|
|
3142
|
+
deleteOpportunity: (params, sampId) => {
|
|
3143
|
+
return API.delete(`${sampId}/strategic-opportunity-register`, { params });
|
|
544
3144
|
}
|
|
545
3145
|
};
|
|
546
3146
|
export {
|
|
3147
|
+
AccountingServices,
|
|
3148
|
+
AliasCodeServices,
|
|
3149
|
+
AmpManagementServices,
|
|
3150
|
+
AssetNameServices,
|
|
3151
|
+
AssetPolicyServices,
|
|
547
3152
|
AssetServices,
|
|
548
|
-
|
|
3153
|
+
AssignmentServices,
|
|
3154
|
+
AuditServices,
|
|
3155
|
+
AuthServices$1 as AuthServices,
|
|
3156
|
+
BorrowServicesGo as BorrowServices,
|
|
3157
|
+
BrandServices,
|
|
549
3158
|
ChangelogServices,
|
|
3159
|
+
ContinuousImprovementServices,
|
|
3160
|
+
CountryStateServices,
|
|
550
3161
|
CustomFieldServices,
|
|
3162
|
+
DamageServices,
|
|
3163
|
+
DashboardServices,
|
|
3164
|
+
DisposalServices$1 as DisposalServices,
|
|
3165
|
+
DocumentServices,
|
|
3166
|
+
FileManagerServices,
|
|
3167
|
+
GeneralSettingsServices,
|
|
3168
|
+
AuthServices as GlobalAuthServices,
|
|
3169
|
+
GroupCategoryServices,
|
|
3170
|
+
I18nService,
|
|
3171
|
+
IOTServices,
|
|
3172
|
+
ImportServices,
|
|
3173
|
+
LicenseServices,
|
|
3174
|
+
ChangelogServices as LogServices,
|
|
551
3175
|
MissingServices,
|
|
3176
|
+
ModelTypeServices,
|
|
3177
|
+
MyAssetServices,
|
|
3178
|
+
ChangelogServices as NewChangelogServices,
|
|
3179
|
+
IOTService as NewIOTServices,
|
|
3180
|
+
NotificationApprovalServices,
|
|
3181
|
+
NotificationServices,
|
|
3182
|
+
DisposalServices as OldDisposalServices,
|
|
3183
|
+
OpenAPIServices,
|
|
3184
|
+
OpportunityRegisterServices,
|
|
3185
|
+
ReaderServices,
|
|
3186
|
+
RepairServices,
|
|
3187
|
+
ReportServices,
|
|
3188
|
+
RiskRegisterServices,
|
|
552
3189
|
RoleServices,
|
|
3190
|
+
RoutineServices,
|
|
3191
|
+
SAMPServices,
|
|
3192
|
+
ServiceCenterServices,
|
|
3193
|
+
SessionLogServices,
|
|
3194
|
+
SettingAssetNameServiceGo as SettingAssetNameService,
|
|
3195
|
+
SettingBrandServiceGo as SettingBrandService,
|
|
3196
|
+
SettingMeasurementServiceGo as SettingMeasurementService,
|
|
553
3197
|
SubUserServices,
|
|
3198
|
+
TAGServices,
|
|
3199
|
+
TrackingServices,
|
|
3200
|
+
TransactionSettingServices,
|
|
3201
|
+
TransferServicesGo as TransferServices,
|
|
554
3202
|
UserServices,
|
|
555
3203
|
buildFileURL,
|
|
556
3204
|
downloadFile,
|