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