tango-app-api-audit 1.0.53 → 1.0.55
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/index.js +1 -3
- package/package.json +1 -1
- package/src/controllers/audit.controllers.js +1004 -1
- package/src/controllers/auditMetrics.controllers.js +3 -982
- package/src/docs/audit.docs.js +137 -3
- package/src/docs/auditMetrics.docs.js +1 -133
- package/src/dtos/audit.dtos.js +102 -0
- package/src/dtos/auditMetrics.dtos.js +0 -101
- package/src/routes/audit.routes.js +10 -2
- package/src/routes/auditMetrics.routes.js +2 -9
package/src/docs/audit.docs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { auditStoreSchema, clientMetricsSchema, clientSchema, getDraftedDataSchema, getFileSchema, saveDraftSchema, saveSchema, userAuditHistorySchema, userSchema, workSpaceSchema } from '../dtos/audit.dtos.js';
|
|
1
|
+
import { auditStoreSchema, clientMetricsSchema, clientSchema, getDraftedDataSchema, getFileSchema, overAllAuditSummarySchema, overViewCardSchema, overViewTableSchema, saveDraftSchema, saveSchema, storeMetricsSchema, summarySplitSchema, userAuditHistorySchema, userMetricsSchema, userSchema, workSpaceSchema } from '../dtos/audit.dtos.js';
|
|
2
2
|
import j2s from 'joi-to-swagger';
|
|
3
3
|
|
|
4
4
|
export const auditDocs = {
|
|
@@ -268,7 +268,7 @@ export const auditDocs = {
|
|
|
268
268
|
post: {
|
|
269
269
|
tags: [ 'Audit Metrics' ],
|
|
270
270
|
description: `Get list of user wise audit user details with date range`,
|
|
271
|
-
operationId: 'user-audit-history',
|
|
271
|
+
operationId: 'metrics/user-audit-history',
|
|
272
272
|
parameters: {},
|
|
273
273
|
requestBody: {
|
|
274
274
|
content: {
|
|
@@ -290,7 +290,7 @@ export const auditDocs = {
|
|
|
290
290
|
post: {
|
|
291
291
|
tags: [ 'Audit Metrics' ],
|
|
292
292
|
description: `Get list of client wise details with date range`,
|
|
293
|
-
operationId: 'client-metrics',
|
|
293
|
+
operationId: 'metrics/client-metrics',
|
|
294
294
|
parameters: {},
|
|
295
295
|
requestBody: {
|
|
296
296
|
content: {
|
|
@@ -308,5 +308,139 @@ export const auditDocs = {
|
|
|
308
308
|
},
|
|
309
309
|
},
|
|
310
310
|
},
|
|
311
|
+
'/v3/audit/metrics/store-metrics': {
|
|
312
|
+
post: {
|
|
313
|
+
tags: [ 'Audit Metrics' ],
|
|
314
|
+
description: `Get list of store wise details with date range and client Id`,
|
|
315
|
+
operationId: 'metrics/store-metrics',
|
|
316
|
+
parameters: {},
|
|
317
|
+
requestBody: {
|
|
318
|
+
content: {
|
|
319
|
+
'application/json': {
|
|
320
|
+
schema: j2s( storeMetricsSchema ).swagger,
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
responses: {
|
|
325
|
+
200: { description: 'Successful' },
|
|
326
|
+
401: { description: 'Unauthorized User' },
|
|
327
|
+
422: { description: 'Field Error' },
|
|
328
|
+
500: { description: 'Server Error' },
|
|
329
|
+
204: { description: 'Not Found' },
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
|
|
334
|
+
'/v3/audit/metrics/user-metrics': {
|
|
335
|
+
post: {
|
|
336
|
+
tags: [ 'Audit Metrics' ],
|
|
337
|
+
description: `Get list of file wise details with date range and users`,
|
|
338
|
+
operationId: 'metrics/user-metrics',
|
|
339
|
+
parameters: {},
|
|
340
|
+
requestBody: {
|
|
341
|
+
content: {
|
|
342
|
+
'application/json': {
|
|
343
|
+
schema: j2s( userMetricsSchema ).swagger,
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
responses: {
|
|
348
|
+
200: { description: 'Successful' },
|
|
349
|
+
401: { description: 'Unauthorized User' },
|
|
350
|
+
422: { description: 'Field Error' },
|
|
351
|
+
500: { description: 'Server Error' },
|
|
352
|
+
204: { description: 'Not Found' },
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
'/v3/audit/metrics/overview-table': {
|
|
357
|
+
post: {
|
|
358
|
+
tags: [ 'Audit Metrics' ],
|
|
359
|
+
description: `Get overall user taken data with some filters `,
|
|
360
|
+
operationId: 'metrics/overview-table',
|
|
361
|
+
parameters: {},
|
|
362
|
+
requestBody: {
|
|
363
|
+
content: {
|
|
364
|
+
'application/json': {
|
|
365
|
+
schema: j2s( overViewTableSchema ).swagger,
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
responses: {
|
|
370
|
+
200: { description: 'Successful' },
|
|
371
|
+
401: { description: 'Unauthorized User' },
|
|
372
|
+
422: { description: 'Field Error' },
|
|
373
|
+
500: { description: 'Server Error' },
|
|
374
|
+
204: { description: 'Not Found' },
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
'/v3/audit/metrics/overall-audit-summary': {
|
|
379
|
+
post: {
|
|
380
|
+
tags: [ 'Audit Metrics' ],
|
|
381
|
+
description: `Get overall user taken data with some filters `,
|
|
382
|
+
operationId: 'metrics/overall-audit-summary',
|
|
383
|
+
parameters: {},
|
|
384
|
+
requestBody: {
|
|
385
|
+
content: {
|
|
386
|
+
'application/json': {
|
|
387
|
+
schema: j2s( overAllAuditSummarySchema ).swagger,
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
responses: {
|
|
392
|
+
200: { description: 'Successful' },
|
|
393
|
+
401: { description: 'Unauthorized User' },
|
|
394
|
+
422: { description: 'Field Error' },
|
|
395
|
+
500: { description: 'Server Error' },
|
|
396
|
+
204: { description: 'Not Found' },
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
},
|
|
311
400
|
|
|
401
|
+
'/v3/audit/metrics/overview-card': {
|
|
402
|
+
post: {
|
|
403
|
+
tags: [ 'Audit Metrics' ],
|
|
404
|
+
description: `Get overall high level audited files count`,
|
|
405
|
+
operationId: 'metrics/overview-card',
|
|
406
|
+
parameters: {},
|
|
407
|
+
requestBody: {
|
|
408
|
+
content: {
|
|
409
|
+
'application/json': {
|
|
410
|
+
schema: j2s( overViewCardSchema ).swagger,
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
responses: {
|
|
415
|
+
200: { description: 'Successful' },
|
|
416
|
+
401: { description: 'Unauthorized User' },
|
|
417
|
+
422: { description: 'Field Error' },
|
|
418
|
+
500: { description: 'Server Error' },
|
|
419
|
+
204: { description: 'Not Found' },
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
|
|
424
|
+
'/v3/audit/metrics/summary-split-up': {
|
|
425
|
+
post: {
|
|
426
|
+
tags: [ 'Audit Metrics' ],
|
|
427
|
+
description: `Get overall high level audited files count splitup`,
|
|
428
|
+
operationId: 'metrics/summary-split-up',
|
|
429
|
+
parameters: {},
|
|
430
|
+
requestBody: {
|
|
431
|
+
content: {
|
|
432
|
+
'application/json': {
|
|
433
|
+
schema: j2s( summarySplitSchema ).swagger,
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
responses: {
|
|
438
|
+
200: { description: 'Successful' },
|
|
439
|
+
401: { description: 'Unauthorized User' },
|
|
440
|
+
422: { description: 'Field Error' },
|
|
441
|
+
500: { description: 'Server Error' },
|
|
442
|
+
204: { description: 'Not Found' },
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
},
|
|
312
446
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import j2s from 'joi-to-swagger';
|
|
2
|
-
import { auditImageValidSchema, getAuditImagesSchema,
|
|
2
|
+
import { auditImageValidSchema, getAuditImagesSchema, reTriggerValidSchema } from '../dtos/auditMetrics.dtos.js';
|
|
3
3
|
|
|
4
4
|
export const auditMetricsDocs = {
|
|
5
5
|
|
|
@@ -27,138 +27,6 @@ export const auditMetricsDocs = {
|
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
'/v3/audit-metrics/store-metrics': {
|
|
31
|
-
post: {
|
|
32
|
-
tags: [ 'Audit Metrics' ],
|
|
33
|
-
description: `Get list of store wise details with date range and client Id`,
|
|
34
|
-
operationId: 'store-metrics',
|
|
35
|
-
parameters: {},
|
|
36
|
-
requestBody: {
|
|
37
|
-
content: {
|
|
38
|
-
'application/json': {
|
|
39
|
-
schema: j2s( storeMetricsSchema ).swagger,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
responses: {
|
|
44
|
-
200: { description: 'Successful' },
|
|
45
|
-
401: { description: 'Unauthorized User' },
|
|
46
|
-
422: { description: 'Field Error' },
|
|
47
|
-
500: { description: 'Server Error' },
|
|
48
|
-
204: { description: 'Not Found' },
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
'/v3/audit-metrics/user-metrics': {
|
|
53
|
-
post: {
|
|
54
|
-
tags: [ 'Audit Metrics' ],
|
|
55
|
-
description: `Get list of file wise details with date range and users`,
|
|
56
|
-
operationId: 'user-metrics',
|
|
57
|
-
parameters: {},
|
|
58
|
-
requestBody: {
|
|
59
|
-
content: {
|
|
60
|
-
'application/json': {
|
|
61
|
-
schema: j2s( userMetricsSchema ).swagger,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
responses: {
|
|
66
|
-
200: { description: 'Successful' },
|
|
67
|
-
401: { description: 'Unauthorized User' },
|
|
68
|
-
422: { description: 'Field Error' },
|
|
69
|
-
500: { description: 'Server Error' },
|
|
70
|
-
204: { description: 'Not Found' },
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
'/v3/audit-metrics/overview-card': {
|
|
75
|
-
post: {
|
|
76
|
-
tags: [ 'Audit Metrics' ],
|
|
77
|
-
description: `Get overall high level audited files count`,
|
|
78
|
-
operationId: 'overview-card',
|
|
79
|
-
parameters: {},
|
|
80
|
-
requestBody: {
|
|
81
|
-
content: {
|
|
82
|
-
'application/json': {
|
|
83
|
-
schema: j2s( overViewCardSchema ).swagger,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
responses: {
|
|
88
|
-
200: { description: 'Successful' },
|
|
89
|
-
401: { description: 'Unauthorized User' },
|
|
90
|
-
422: { description: 'Field Error' },
|
|
91
|
-
500: { description: 'Server Error' },
|
|
92
|
-
204: { description: 'Not Found' },
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
'/v3/audit-metrics/summary-split-up': {
|
|
97
|
-
post: {
|
|
98
|
-
tags: [ 'Audit Metrics' ],
|
|
99
|
-
description: `Get overall high level audited files count splitup`,
|
|
100
|
-
operationId: 'summary-split-up',
|
|
101
|
-
parameters: {},
|
|
102
|
-
requestBody: {
|
|
103
|
-
content: {
|
|
104
|
-
'application/json': {
|
|
105
|
-
schema: j2s( summarySplitSchema ).swagger,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
responses: {
|
|
110
|
-
200: { description: 'Successful' },
|
|
111
|
-
401: { description: 'Unauthorized User' },
|
|
112
|
-
422: { description: 'Field Error' },
|
|
113
|
-
500: { description: 'Server Error' },
|
|
114
|
-
204: { description: 'Not Found' },
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
'/v3/audit-metrics/overview-table': {
|
|
119
|
-
post: {
|
|
120
|
-
tags: [ 'Audit Metrics' ],
|
|
121
|
-
description: `Get overall user taken data with some filters `,
|
|
122
|
-
operationId: 'overview-table',
|
|
123
|
-
parameters: {},
|
|
124
|
-
requestBody: {
|
|
125
|
-
content: {
|
|
126
|
-
'application/json': {
|
|
127
|
-
schema: j2s( overViewTableSchema ).swagger,
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
responses: {
|
|
132
|
-
200: { description: 'Successful' },
|
|
133
|
-
401: { description: 'Unauthorized User' },
|
|
134
|
-
422: { description: 'Field Error' },
|
|
135
|
-
500: { description: 'Server Error' },
|
|
136
|
-
204: { description: 'Not Found' },
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
'/v3/audit-metrics/overall-audit-summary': {
|
|
141
|
-
post: {
|
|
142
|
-
tags: [ 'Audit Metrics' ],
|
|
143
|
-
description: `Get overall user taken data with some filters `,
|
|
144
|
-
operationId: 'overall-audit-summary',
|
|
145
|
-
parameters: {},
|
|
146
|
-
requestBody: {
|
|
147
|
-
content: {
|
|
148
|
-
'application/json': {
|
|
149
|
-
schema: j2s( overAllAuditSummarySchema ).swagger,
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
responses: {
|
|
154
|
-
200: { description: 'Successful' },
|
|
155
|
-
401: { description: 'Unauthorized User' },
|
|
156
|
-
422: { description: 'Field Error' },
|
|
157
|
-
500: { description: 'Server Error' },
|
|
158
|
-
204: { description: 'Not Found' },
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
30
|
'/v3/audit-metrics/re-trigger': {
|
|
163
31
|
post: {
|
|
164
32
|
tags: [ 'Audit Metrics' ],
|
package/src/dtos/audit.dtos.js
CHANGED
|
@@ -182,3 +182,105 @@ export const clientMetricsSchema = joi.object(
|
|
|
182
182
|
export const clientMetricsValid = {
|
|
183
183
|
body: clientMetricsSchema,
|
|
184
184
|
};
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
export const storeMetricsSchema = joi.object(
|
|
188
|
+
{
|
|
189
|
+
fromDate: joi.string().required(),
|
|
190
|
+
toDate: joi.string().required(),
|
|
191
|
+
searchValue: joi.string().optional().allow( '' ),
|
|
192
|
+
filterByClientId: joi.array().required(),
|
|
193
|
+
filterByStoreId: joi.array().optional(),
|
|
194
|
+
filterByStatus: joi.array().optional(),
|
|
195
|
+
filterByAuditType: joi.array().optional(),
|
|
196
|
+
filterByModuleType: joi.array().optional(),
|
|
197
|
+
sortColumnName: joi.string().optional(),
|
|
198
|
+
sortBy: joi.number().optional(),
|
|
199
|
+
limit: joi.number().optional(),
|
|
200
|
+
offset: joi.number().optional(),
|
|
201
|
+
isExport: joi.boolean().optional(),
|
|
202
|
+
},
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
export const storeMetricsValid = {
|
|
206
|
+
body: storeMetricsSchema,
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export const userMetricsSchema = joi.object(
|
|
210
|
+
{
|
|
211
|
+
fromDate: joi.string().required(),
|
|
212
|
+
toDate: joi.string().required(),
|
|
213
|
+
dateType: joi.string().required(),
|
|
214
|
+
searchValue: joi.string().optional().allow( '' ),
|
|
215
|
+
filterByUser: joi.array().optional(),
|
|
216
|
+
filterByModuleType: joi.array().optional(),
|
|
217
|
+
filterByStatus: joi.array().optional(),
|
|
218
|
+
sortColumnName: joi.string().optional(),
|
|
219
|
+
sortBy: joi.number().optional(),
|
|
220
|
+
limit: joi.number().optional(),
|
|
221
|
+
offset: joi.number().optional(),
|
|
222
|
+
isExport: joi.boolean().optional(),
|
|
223
|
+
},
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
export const userMetricsValid = {
|
|
227
|
+
body: userMetricsSchema,
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const overViewTableSchema = joi.object(
|
|
231
|
+
{
|
|
232
|
+
fromDate: joi.string().required(),
|
|
233
|
+
toDate: joi.string().required(),
|
|
234
|
+
clientId: joi.array().optional(),
|
|
235
|
+
limit: joi.number().optional(),
|
|
236
|
+
offset: joi.number().optional(),
|
|
237
|
+
searchValue: joi.string().optional().allow( '' ),
|
|
238
|
+
filterByStatus: joi.array().required(),
|
|
239
|
+
filterByModuleType: joi.array().optional(),
|
|
240
|
+
filterByAuditType: joi.array().optional(),
|
|
241
|
+
sortColumnName: joi.string().optional(),
|
|
242
|
+
sortBy: joi.number().optional(),
|
|
243
|
+
isExport: joi.boolean().optional(),
|
|
244
|
+
},
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
export const overViewTableValid = {
|
|
248
|
+
body: overViewTableSchema,
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export const overAllAuditSummarySchema = joi.object(
|
|
252
|
+
{
|
|
253
|
+
fromDate: joi.string().required(),
|
|
254
|
+
toDate: joi.string().required(),
|
|
255
|
+
clientId: joi.array().optional(),
|
|
256
|
+
moduleType: joi.array().required(),
|
|
257
|
+
},
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
export const overAllAuditSummaryValid = {
|
|
261
|
+
body: overAllAuditSummarySchema,
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export const overViewCardSchema = joi.object(
|
|
265
|
+
{
|
|
266
|
+
fromDate: joi.string().required(),
|
|
267
|
+
toDate: joi.string().required(),
|
|
268
|
+
clientId: joi.array().optional(),
|
|
269
|
+
},
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
export const overViewCardValid = {
|
|
273
|
+
body: overViewCardSchema,
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export const summarySplitSchema = joi.object(
|
|
277
|
+
{
|
|
278
|
+
fromDate: joi.string().required(),
|
|
279
|
+
toDate: joi.string().required(),
|
|
280
|
+
clientId: joi.array().optional(),
|
|
281
|
+
},
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
export const summarySplitValid = {
|
|
285
|
+
body: summarySplitSchema,
|
|
286
|
+
};
|
|
@@ -14,107 +14,6 @@ export const getAuditImagesValid = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
export const storeMetricsSchema = joi.object(
|
|
18
|
-
{
|
|
19
|
-
fromDate: joi.string().required(),
|
|
20
|
-
toDate: joi.string().required(),
|
|
21
|
-
searchValue: joi.string().optional().allow( '' ),
|
|
22
|
-
filterByClientId: joi.array().required(),
|
|
23
|
-
filterByStoreId: joi.array().optional(),
|
|
24
|
-
filterByStatus: joi.array().optional(),
|
|
25
|
-
filterByType: joi.array().optional(),
|
|
26
|
-
sortColumnName: joi.string().optional(),
|
|
27
|
-
sortBy: joi.number().optional(),
|
|
28
|
-
limit: joi.number().optional(),
|
|
29
|
-
offset: joi.number().optional(),
|
|
30
|
-
isExport: joi.boolean().optional(),
|
|
31
|
-
},
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
export const storeMetricsValid = {
|
|
35
|
-
body: storeMetricsSchema,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export const userMetricsSchema = joi.object(
|
|
40
|
-
{
|
|
41
|
-
fromDate: joi.string().required(),
|
|
42
|
-
toDate: joi.string().required(),
|
|
43
|
-
fileType: joi.string().required(),
|
|
44
|
-
searchValue: joi.string().optional().allow( '' ),
|
|
45
|
-
filterByUser: joi.array().optional(),
|
|
46
|
-
filterByAuditType: joi.array().optional(),
|
|
47
|
-
filterByStatus: joi.array().optional(),
|
|
48
|
-
sortColumnName: joi.string().optional(),
|
|
49
|
-
sortBy: joi.number().optional(),
|
|
50
|
-
limit: joi.number().optional(),
|
|
51
|
-
offset: joi.number().optional(),
|
|
52
|
-
isExport: joi.boolean().optional(),
|
|
53
|
-
},
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
export const userMetricsValid = {
|
|
57
|
-
body: userMetricsSchema,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const overViewCardSchema = joi.object(
|
|
61
|
-
{
|
|
62
|
-
fromDate: joi.string().required(),
|
|
63
|
-
toDate: joi.string().required(),
|
|
64
|
-
clientId: joi.array().optional(),
|
|
65
|
-
},
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
export const overViewCardValid = {
|
|
69
|
-
body: overViewCardSchema,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const summarySplitSchema = joi.object(
|
|
73
|
-
{
|
|
74
|
-
fromDate: joi.string().required(),
|
|
75
|
-
toDate: joi.string().required(),
|
|
76
|
-
clientId: joi.array().optional(),
|
|
77
|
-
},
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
export const summarySplitValid = {
|
|
81
|
-
body: summarySplitSchema,
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const overViewTableSchema = joi.object(
|
|
85
|
-
{
|
|
86
|
-
fromDate: joi.string().required(),
|
|
87
|
-
toDate: joi.string().required(),
|
|
88
|
-
clientId: joi.array().optional(),
|
|
89
|
-
limit: joi.number().optional(),
|
|
90
|
-
offset: joi.number().optional(),
|
|
91
|
-
searchValue: joi.string().optional().allow( '' ),
|
|
92
|
-
filterByStatus: joi.array().required(),
|
|
93
|
-
filterByType: joi.array().optional(),
|
|
94
|
-
filterByAuditType: joi.array().required(),
|
|
95
|
-
sortColumnName: joi.string().optional(),
|
|
96
|
-
sortBy: joi.number().optional(),
|
|
97
|
-
isExport: joi.boolean().optional(),
|
|
98
|
-
},
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
export const overViewTableValid = {
|
|
102
|
-
body: overViewTableSchema,
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const overAllAuditSummarySchema = joi.object(
|
|
106
|
-
{
|
|
107
|
-
fromDate: joi.string().required(),
|
|
108
|
-
toDate: joi.string().required(),
|
|
109
|
-
clientId: joi.array().optional(),
|
|
110
|
-
moduleType: joi.string().required(),
|
|
111
|
-
},
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
export const overAllAuditSummaryValid = {
|
|
115
|
-
body: overAllAuditSummarySchema,
|
|
116
|
-
};
|
|
117
|
-
|
|
118
17
|
export const reTriggerValidSchema = joi.object(
|
|
119
18
|
{
|
|
120
19
|
fileDate: joi.string().required(),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { isExistsQueue, validateUserAudit } from '../validation/audit.validation.js';
|
|
3
3
|
import { isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
4
|
-
import { auditStoreList, auditUserList, clientMetrics, clients, getAuditFile, getDraftedData, save, saveDraft, userAuditHistory, workSpace } from '../controllers/audit.controllers.js';
|
|
5
|
-
import { auditStoreValid, clientMetricsValid, clientValid, getDraftedDataValid, getFileValid, saveDraftValid, saveValid, userAuditHistoryValid, workSpaceValid } from '../dtos/audit.dtos.js';
|
|
4
|
+
import { auditStoreList, auditUserList, clientMetrics, clients, getAuditFile, getDraftedData, overAllAuditSummary, overViewCard, overViewTable, save, saveDraft, storeMetrics, summarySplit, userAuditHistory, userMetrics, workSpace } from '../controllers/audit.controllers.js';
|
|
5
|
+
import { auditStoreValid, clientMetricsValid, clientValid, getDraftedDataValid, getFileValid, overAllAuditSummaryValid, overViewCardValid, overViewTableValid, saveDraftValid, saveValid, storeMetricsValid, summarySplitValid, userAuditHistoryValid, userMetricsValid, workSpaceValid } from '../dtos/audit.dtos.js';
|
|
6
6
|
|
|
7
7
|
export const auditRouter = express.Router();
|
|
8
8
|
|
|
@@ -22,6 +22,14 @@ auditRouter.get( '/work-space', isAllowedSessionHandler, validate( workSpaceVali
|
|
|
22
22
|
// Audit Metrics
|
|
23
23
|
auditRouter.post( '/metrics/user-audit-history', isAllowedSessionHandler, validate( userAuditHistoryValid ), userAuditHistory );
|
|
24
24
|
auditRouter.post( '/metrics/client-metrics', isAllowedSessionHandler, validate( clientMetricsValid ), clientMetrics );
|
|
25
|
+
auditRouter.post( '/metrics/store-metrics', isAllowedSessionHandler, validate( storeMetricsValid ), storeMetrics );
|
|
26
|
+
auditRouter.post( '/metrics/user-metrics', isAllowedSessionHandler, validate( userMetricsValid ), userMetrics );
|
|
27
|
+
auditRouter.post( '/metrics/overview-table', isAllowedSessionHandler, validate( overViewTableValid ), overViewTable );
|
|
28
|
+
auditRouter.post( '/metrics/overall-audit-summary', isAllowedSessionHandler, validate( overAllAuditSummaryValid ), overAllAuditSummary );
|
|
25
29
|
|
|
26
30
|
|
|
31
|
+
// hold
|
|
32
|
+
auditRouter.post( '/metrics/overview-card', isAllowedSessionHandler, validate( overViewCardValid ), overViewCard );
|
|
33
|
+
auditRouter.post( '/metrics/summary-split-up', isAllowedSessionHandler, validate( summarySplitValid ), summarySplit );
|
|
34
|
+
|
|
27
35
|
export default auditRouter;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import { isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
4
|
-
import { auditImages,
|
|
5
|
-
import { auditImageValid,
|
|
4
|
+
import { auditImages, reTrigger } from '../controllers/auditMetrics.controllers.js';
|
|
5
|
+
import { auditImageValid, reTriggerValid, viewLogValid } from '../dtos/auditMetrics.dtos.js';
|
|
6
6
|
import { isAuditDocumentExist, isAuditInputFolderExist } from '../validation/audit.validation.js';
|
|
7
7
|
|
|
8
8
|
export const auditMetricsRouter = express.Router();
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
auditMetricsRouter.post( '/store-metrics', isAllowedSessionHandler, validate( storeMetricsValid ), storeMetrics );
|
|
12
|
-
|
|
13
|
-
auditMetricsRouter.post( '/user-metrics', isAllowedSessionHandler, validate( userMetricsValid ), userMetrics );
|
|
14
|
-
auditMetricsRouter.post( '/overview-card', isAllowedSessionHandler, validate( overViewCardValid ), overViewCard );
|
|
15
|
-
auditMetricsRouter.post( '/summary-split-up', isAllowedSessionHandler, validate( summarySplitValid ), summarySplit );
|
|
16
|
-
auditMetricsRouter.post( '/overview-table', isAllowedSessionHandler, validate( overViewTableValid ), overViewTable );
|
|
17
|
-
auditMetricsRouter.post( '/overall-audit-summary', isAllowedSessionHandler, validate( overAllAuditSummaryValid ), overAllAuditSummary );
|
|
18
11
|
auditMetricsRouter.post( '/re-trigger', isAllowedSessionHandler, validate( reTriggerValid ), isAuditDocumentExist, isAuditInputFolderExist, reTrigger );
|
|
19
12
|
auditMetricsRouter.get( '/audit-images', isAllowedSessionHandler, validate( auditImageValid ), isAuditInputFolderExist, auditImages );
|
|
20
13
|
auditMetricsRouter.post( '/view-log', isAllowedSessionHandler, validate( viewLogValid ), isAuditInputFolderExist, auditImages );
|