tango-app-api-audit 3.4.0-alpha.4 → 3.4.0-alpha.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.4.0-alpha.4",
3
+ "version": "3.4.0-alpha.5",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  import { checkFileExist, download, getDate, getDateWithCustomizeTime, getUTC, insertOpenSearchData, listFileByPath, logger, signedUrl, sqsReceive } from 'tango-app-api-middleware';
2
2
  import { aggregateBinaryAudit, createBinaryAudit, updateOneBinaryAuditModel } from '../service/binaryAudit.service.js';
3
- import { findOneStore } from '../service/store.service.js';
3
+ import { countDocumentsStore, findOneStore } from '../service/store.service.js';
4
4
  import { findOneUser } from '../service/user.service.js';
5
5
  import { aggregateUserEmpDetection, createUserEmpDetection } from '../service/userEmpDetection.service.js';
6
6
  import { aggregateTraxAuditData, findOneTraxAuditData } from '../service/traxAuditData.service.js';
@@ -1181,6 +1181,7 @@ export async function saveBinary( req, res ) {
1181
1181
  let leftupdate={
1182
1182
  auditStatus: 'completed',
1183
1183
  answer: inputData.answer,
1184
+ userCommands: inputData.userComments || '',
1184
1185
  };
1185
1186
  let updatDataleft= await updateOneBinaryAuditModel( leftquery, leftupdate );
1186
1187
  if ( updatDataleft.modifiedCount==0 ) {
@@ -1202,6 +1203,7 @@ export async function saveBinary( req, res ) {
1202
1203
  let cameraupdate={
1203
1204
  auditStatus: 'completed',
1204
1205
  answer: inputData.answer,
1206
+ userCommands: inputData.userComments || '',
1205
1207
  };
1206
1208
  let updatDatacamera= await updateOneBinaryAuditModel( cameraquery, cameraupdate );
1207
1209
  if ( updatDatacamera.modifiedCount==0 ) {
@@ -2541,7 +2543,7 @@ export async function overAllAuditSummary( req, res ) {
2541
2543
  },
2542
2544
  },
2543
2545
  ];
2544
- const auditClientData = await aggregateAuditStoreData( auditClientDataQuery );
2546
+ const auditClientData = await aggregateTraxAuditData( auditClientDataQuery );
2545
2547
  if ( auditClientData.length >0 ) {
2546
2548
  temp.auditStores = auditClientData[0].totalFilesCount;
2547
2549
  }
@@ -2593,7 +2595,7 @@ export async function overAllAuditSummary( req, res ) {
2593
2595
  },
2594
2596
  },
2595
2597
  ];
2596
- const storeAudit = await aggregateStoreAudit( storeAuditQuery );
2598
+ const storeAudit = inputData.moduleType.includes( [ 'uniform-detection', 'mobile-detection' ] )?await aggregateStoreEmpDetection( storeAuditQuery ) : await aggregateBinaryAudit( storeAuditQuery );
2597
2599
  if ( storeAudit.length > 0 ) {
2598
2600
  temp.inprogressStores= storeAudit[0].inprogressStores;
2599
2601
  temp.completedStores = storeAudit[0].completedStores;
@@ -2613,3 +2615,406 @@ export async function overAllAuditSummary( req, res ) {
2613
2615
  return res.sendError( err, 500 );
2614
2616
  }
2615
2617
  }
2618
+
2619
+ export async function overViewCard( req, res ) {
2620
+ try {
2621
+ const inputData = req.body;
2622
+ const temp = {
2623
+ totalCount: 0,
2624
+ auditFileCount: 0,
2625
+ ReAuditFileCount: 0,
2626
+ inprogressCount: 0,
2627
+ completedCount: 0,
2628
+ pendingCount: 0,
2629
+ };
2630
+
2631
+ const dateRange = await getUTC( new Date( inputData.fromDate ), new Date( inputData.toDate ) );
2632
+ let filters =[
2633
+ { fileDateISO: { $gte: dateRange.start } },
2634
+ { fileDateISO: { $lte: dateRange.end } },
2635
+ ];
2636
+ if ( inputData.clientId.length > 0 ) {
2637
+ filters.push( { clientId: { $in: inputData.clientId } } );
2638
+ }
2639
+ const query =[
2640
+ {
2641
+ $match: {
2642
+ $and: filters,
2643
+ },
2644
+
2645
+ },
2646
+ {
2647
+ $project: {
2648
+ auditFileCount: {
2649
+ $cond: [
2650
+ { $eq: [ '$auditType', 'Audit' ] }, 1, 0,
2651
+ ],
2652
+ },
2653
+ ReAuditFileCount: {
2654
+ $cond: [
2655
+ { $eq: [ '$auditType', 'ReAudit' ] }, 1, 0,
2656
+ ],
2657
+ },
2658
+ inprogressCount: {
2659
+ $cond: [
2660
+ { $ne: [ '$status', 'completed' ] }, 1, 0,
2661
+ ],
2662
+ },
2663
+ completedCount: {
2664
+ $cond: [
2665
+ { $eq: [ '$status', 'completed' ] }, 1, 0,
2666
+ ],
2667
+ },
2668
+ },
2669
+ },
2670
+ {
2671
+ $group: {
2672
+ _id: { fileDate: '$fileDate', clientId: '$clientId' },
2673
+ totalCount: { $sum: 1 },
2674
+ auditFileCount: { $sum: '$auditFileCount' },
2675
+ ReAuditFileCount: { $sum: '$ReAuditFileCount' },
2676
+ inprogressCount: { $sum: '$inprogressCount' },
2677
+ completedCount: { $sum: '$completedCount' },
2678
+
2679
+ },
2680
+ },
2681
+ {
2682
+ $project: {
2683
+ _id: 0,
2684
+ totalCount: 1,
2685
+ auditFileCount: 1,
2686
+ ReAuditFileCount: 1,
2687
+ inprogressCount: 1,
2688
+ completedCount: 1,
2689
+ notAssigned: { $subtract: [ '$totalCount', { $add: [ '$inprogressCount', '$completedCount' ] } ] },
2690
+ },
2691
+ },
2692
+ ];
2693
+ const result = inputData.moduleType.includes( [ 'uniform-detection', 'mobile-detection' ] )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( query );
2694
+ logger.info( { result: result } );
2695
+ return res.sendSuccess( { result: result.length> 0? result[0]: temp } );
2696
+ } catch ( error ) {
2697
+ const err = error.message || 'Internal Server Error';
2698
+ logger.error( { error: error, message: req.body, function: 'overViewCard' } );
2699
+ return res.sendError( err, 500 );
2700
+ }
2701
+ }
2702
+
2703
+ export async function summarySplit( req, res ) {
2704
+ try {
2705
+ const inputData = req.body;
2706
+ const temp = {
2707
+ total: 0,
2708
+ auditInprogress: 0,
2709
+ reAuditInprogress: 0,
2710
+ draft: 0,
2711
+ assigned: 0,
2712
+ auditCompleted: 0,
2713
+ reAuditCompleted: 0,
2714
+ };
2715
+
2716
+ const dateRange = await getUTC( new Date( inputData.fromDate ), new Date( inputData.toDate ) );
2717
+ let filters =[
2718
+ { fileDateISO: { $gte: dateRange.start } },
2719
+ { fileDateISO: { $lte: dateRange.end } },
2720
+ { moduleType: { $eq: inputData.moduleType } },
2721
+ ];
2722
+ if ( inputData.clientId.length > 0 ) {
2723
+ filters.push( { clientId: { $in: inputData.clientId } } );
2724
+ }
2725
+ const query =[
2726
+ {
2727
+ $match: {
2728
+ $and: filters,
2729
+ },
2730
+
2731
+ },
2732
+ {
2733
+ $project: {
2734
+ auditInprogress: {
2735
+ $cond: [
2736
+ { $and: [ { $eq: [ '$auditType', 'Audit' ] }, { $eq: [ '$status', 'inprogress' ] } ] }, 1, 0,
2737
+ ],
2738
+ },
2739
+ reAuditInprogress: {
2740
+ $cond: [
2741
+ { $and: [ { $eq: [ '$auditType', 'ReAudit' ] }, { $eq: [ '$status', 'inprogress' ] } ] }, 1, 0,
2742
+ ],
2743
+ },
2744
+ draft: {
2745
+ $cond: [
2746
+ { $eq: [ '$status', 'drafted' ] }, 1, 0,
2747
+ ],
2748
+ },
2749
+ assigned: {
2750
+ $cond: [
2751
+ { $eq: [ '$status', 'assigned' ] }, 1, 0,
2752
+ ],
2753
+ },
2754
+
2755
+ reAuditCompleted: {
2756
+ $cond: [
2757
+ { $and: [ { $eq: [ '$auditType', 'ReAudit' ] }, { $eq: [ '$status', 'completed' ] } ] }, 1, 0,
2758
+ ],
2759
+ },
2760
+ auditCompleted: {
2761
+ $cond: [
2762
+ { $and: [ { $eq: [ '$auditType', 'Audit' ] }, { $eq: [ '$status', 'completed' ] } ] }, 1, 0,
2763
+ ],
2764
+ },
2765
+ },
2766
+ },
2767
+ {
2768
+ $group: {
2769
+ _id: null,
2770
+ auditInprogress: { $sum: '$auditInprogress' },
2771
+ reAuditInprogress: { $sum: '$reAuditInprogress' },
2772
+ draft: { $sum: '$draft' },
2773
+ assigned: { $sum: '$assigned' },
2774
+ reAuditCompleted: { $sum: '$reAuditCompleted' },
2775
+ auditCompleted: { $sum: '$auditCompleted' },
2776
+
2777
+ },
2778
+ },
2779
+ {
2780
+ $project: {
2781
+ _id: 0,
2782
+ totalInprogress: 1,
2783
+ auditInprogress: 1,
2784
+ reAuditInprogress: 1,
2785
+ draft: 1,
2786
+ assigned: 1,
2787
+ reAuditCompleted: 1,
2788
+ auditCompleted: 1,
2789
+ totalCount: { $ifNull: [ 0, 0 ] },
2790
+
2791
+ },
2792
+ },
2793
+ ];
2794
+ const totalQuery = [
2795
+ {
2796
+ $match: {
2797
+ $and: filters,
2798
+ },
2799
+
2800
+ },
2801
+ {
2802
+ $group: {
2803
+ _id: null,
2804
+ total: { $sum: 1 },
2805
+ },
2806
+ },
2807
+ {
2808
+ $project: {
2809
+ _id: 0,
2810
+ total: 1,
2811
+ },
2812
+ },
2813
+ ];
2814
+ const result = inputData.moduleType.includes( [ 'uniform-detection', 'mobile-detection' ] )? await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
2815
+ const totalCount = await aggregateTraxAuditData( totalQuery );
2816
+ result[0].totalCount = totalCount[0]?.total;
2817
+ return res.sendSuccess( { result: result.length> 0? result[0]: temp } );
2818
+ } catch ( error ) {
2819
+ const err = error.message || 'Internal Server Error';
2820
+ logger.error( { error: error, message: req.body, function: 'summarySplit' } );
2821
+ return res.sendError( err, 500 );
2822
+ }
2823
+ }
2824
+
2825
+ export async function overviewTable( req, res ) {
2826
+ try {
2827
+ const inputData = req.body;
2828
+ const limit = inputData.limit || 10;
2829
+ const offset = inputData.offset ? ( inputData.offset - 1 ) * limit : 0;
2830
+ const dateRange = await getUTC( new Date( inputData.fromDate ), new Date( inputData.toDate ) );
2831
+ let filters =[
2832
+ { fileDateISO: { $gte: dateRange.start } },
2833
+ { fileDateISO: { $lte: dateRange.end } },
2834
+ { moduleType: { $eq: inputData.moduleType } },
2835
+
2836
+ ];
2837
+
2838
+ if ( inputData.clientId.length > 0 ) {
2839
+ filters.push( { clientId: { $in: inputData.clientId } } );
2840
+ }
2841
+
2842
+ if ( inputData.filterByAuditType.length > 0 ) {
2843
+ filters.push( { auditType: { $in: inputData.filterByAuditType } } );
2844
+ }
2845
+
2846
+ if ( inputData.filterByStatus.length > 0 ) {
2847
+ filters.push( { status: { $in: inputData.filterByStatus } } );
2848
+ }
2849
+
2850
+ const query =[
2851
+ {
2852
+ $match: {
2853
+ $and: filters,
2854
+ },
2855
+
2856
+ },
2857
+ {
2858
+ $project: {
2859
+ _id: 0,
2860
+ storeId: 1,
2861
+ clientId: 1,
2862
+ streamName: 1,
2863
+ tempId: 1,
2864
+ question: 1,
2865
+ answer: 1,
2866
+ userCommands: 1,
2867
+ fileDate: 1,
2868
+ moduleType: 1,
2869
+ beforeCount: 1,
2870
+ afterCount: 1,
2871
+ auditType: 1,
2872
+ status: 1,
2873
+ // userId: 1,
2874
+ },
2875
+ },
2876
+ // {
2877
+ // $lookup: {
2878
+ // from: 'users',
2879
+ // let: { userId: '$userId' },
2880
+ // pipeline: [
2881
+ // {
2882
+ // $match: {
2883
+ // $expr: {
2884
+ // $eq: [ '$_id', '$$userId' ],
2885
+ // },
2886
+ // },
2887
+ // },
2888
+ // {
2889
+ // $project: {
2890
+ // userName: 1,
2891
+ // userEmail: '$email',
2892
+ // },
2893
+ // },
2894
+ // ], as: 'user',
2895
+ // },
2896
+ // },
2897
+ // {
2898
+ // $unwind: {
2899
+ // path: '$user',
2900
+ // preserveNullAndEmptyArrays: true,
2901
+ // },
2902
+ // },
2903
+ {
2904
+ $project: {
2905
+ storeId: 1,
2906
+ clientId: 1,
2907
+ streamName: 1,
2908
+ tempId: 1,
2909
+ question: 1,
2910
+ answer: 1,
2911
+ userCommands: 1,
2912
+ fileDate: 1,
2913
+ moduleType: 1,
2914
+ beforeCount: 1,
2915
+ afterCount: 1,
2916
+ auditType: 1,
2917
+ status: 1,
2918
+ // userName: '$user.userName',
2919
+ // userEmail: '$user.userEmail',
2920
+
2921
+ },
2922
+ },
2923
+ ];
2924
+ if ( inputData.searchValue && inputData.searchValue!== '' ) {
2925
+ query.push( {
2926
+ $match: {
2927
+ $or: [
2928
+ { storeId: { $regex: inputData.searchValue, $options: 'i' } },
2929
+ { clientId: { $regex: inputData.searchValue, $options: 'i' } },
2930
+ { fileDate: { $regex: inputData.searchValue, $options: 'i' } },
2931
+ { auditType: { $regex: inputData.searchValue, $options: 'i' } },
2932
+ { status: { $regex: inputData.searchValue, $options: 'i' } },
2933
+ { moduleType: { $regex: inputData.searchValue, $options: 'i' } },
2934
+ { streamName: { $regex: inputData.searchValue, $options: 'i' } },
2935
+ { tempId: { $regex: inputData.searchValue, $options: 'i' } },
2936
+ { question: { $regex: inputData.searchValue, $options: 'i' } },
2937
+ { answer: { $regex: inputData.searchValue, $options: 'i' } },
2938
+ { userCommands: { $regex: inputData.searchValue, $options: 'i' } },
2939
+ // { userName: { $regex: inputData.searchValue, $options: 'i' } },
2940
+ // { userEmail: { $regex: inputData.searchValue, $options: 'i' } },
2941
+ ],
2942
+
2943
+ },
2944
+ } );
2945
+ }
2946
+ if ( inputData.sortColumnName ) {
2947
+ const sortBy = inputData.sortBy || -1;
2948
+ const sortColumn = inputData.sortColumnName;
2949
+ query.push( {
2950
+ $sort: { [sortColumn]: sortBy },
2951
+ },
2952
+ );
2953
+ }
2954
+ const count = inputData.moduleType.includes( [ 'uniform-detection', 'mobile-detection' ] )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( query );
2955
+ if ( count.length == 0 ) {
2956
+ return res.sendError( 'No Data Found', 204 );
2957
+ }
2958
+
2959
+ if ( inputData.isExport ) {
2960
+ query.push( { $limit: 10000 } );
2961
+ } else {
2962
+ query.push( {
2963
+ $skip: offset,
2964
+ },
2965
+ {
2966
+ $limit: limit,
2967
+ } );
2968
+ }
2969
+ const result = inputData.moduleType.includes( [ 'uniform-detection', 'mobile-detection' ] )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( query );
2970
+ if ( inputData.isExport ) {
2971
+ const exportdata = [];
2972
+ result.forEach( ( element ) => {
2973
+ if ( element.moduleType == 'zone' ) {
2974
+ exportdata.push( {
2975
+ 'Store ID': element.storeId,
2976
+ 'Brand ID': element.clientId,
2977
+ 'Stream Name': element.streamName,
2978
+ 'Customer ID': element.tempId,
2979
+ 'Question': element.question,
2980
+ 'Answer': element.answer,
2981
+ 'User Comments': element.userCommands,
2982
+ 'File Date': element.fileDate,
2983
+ 'Product Type': element.moduleType,
2984
+ 'Audit Type': element.auditType,
2985
+ 'Before Count': element.beforeCount,
2986
+ 'After Count': element.afterCount,
2987
+ // 'User Name': element.userName,
2988
+ // 'User Email': element.userEmail,
2989
+ 'Status': element.status,
2990
+ } );
2991
+ } else {
2992
+ exportdata.push( {
2993
+ 'Store ID': element.storeId,
2994
+ 'Brand ID': element.clientId,
2995
+ 'File Date': element.fileDate,
2996
+ 'Stream Name': element.streamName,
2997
+ 'Customer ID': element.tempId,
2998
+ 'Question': element.question,
2999
+ 'Answer': element.answer,
3000
+ 'User Comments': element.userCommands,
3001
+ 'Product Type': element.moduleType,
3002
+ 'Audit Type': element.auditType,
3003
+ 'Before Count': element.beforeCount,
3004
+ 'After Count': element.afterCount,
3005
+ // 'User Name': element.userName,
3006
+ // 'User Email': element.userEmail,
3007
+ 'Status': element.status,
3008
+ } );
3009
+ }
3010
+ } );
3011
+ await download( exportdata, res );
3012
+ return;
3013
+ }
3014
+ return res.sendSuccess( { result: result, count: count.length } );
3015
+ } catch ( error ) {
3016
+ const err = error.message || 'Internal Server Error';
3017
+ logger.error( { error: error, message: req.body, function: 'overviewTable' } );
3018
+ return res.sendError( err, 500 );
3019
+ }
3020
+ }
@@ -1,5 +1,5 @@
1
1
  import j2s from 'joi-to-swagger';
2
- import { getFileSchema, userAuditHistorySchema, workSpaceSchema, saveSchema, clientMetricsSchema, storeMetricsSchema, userMetricsSchema, pendingSummaryTableSchema } from '../dtos/traxAudit.dtos.js';
2
+ import { getFileSchema, userAuditHistorySchema, workSpaceSchema, saveSchema, clientMetricsSchema, storeMetricsSchema, userMetricsSchema, pendingSummaryTableSchema, overAllAuditSummarySchema, overviewTableSchema, summarySplitSchema, overViewCardSchema } from '../dtos/traxAudit.dtos.js';
3
3
 
4
4
  export const traxAuditDocs = {
5
5
 
@@ -200,4 +200,94 @@ export const traxAuditDocs = {
200
200
  },
201
201
  },
202
202
  },
203
+ '/v3/trax-audit/metrics/overall-audit-summary': {
204
+ post: {
205
+ tags: [ 'Trax Audit' ],
206
+ description: `Get overall user taken data with some filters `,
207
+ operationId: 'metrics/overall-audit-summary',
208
+ parameters: {},
209
+ requestBody: {
210
+ content: {
211
+ 'application/json': {
212
+ schema: j2s( overAllAuditSummarySchema ).swagger,
213
+ },
214
+ },
215
+ },
216
+ responses: {
217
+ 200: { description: 'Successful' },
218
+ 401: { description: 'Unauthorized User' },
219
+ 422: { description: 'Field Error' },
220
+ 500: { description: 'Server Error' },
221
+ 204: { description: 'Not Found' },
222
+ },
223
+ },
224
+ },
225
+ '/v3/trax-audit/metrics/overview-card': {
226
+ post: {
227
+ tags: [ 'Trax Audit' ],
228
+ description: `Get overall high level audited files count`,
229
+ operationId: 'metrics/overview-card',
230
+ parameters: {},
231
+ requestBody: {
232
+ content: {
233
+ 'application/json': {
234
+ schema: j2s( overViewCardSchema ).swagger,
235
+ },
236
+ },
237
+ },
238
+ responses: {
239
+ 200: { description: 'Successful' },
240
+ 401: { description: 'Unauthorized User' },
241
+ 422: { description: 'Field Error' },
242
+ 500: { description: 'Server Error' },
243
+ 204: { description: 'Not Found' },
244
+ },
245
+ },
246
+ },
247
+
248
+ '/v3/trax-audit/metrics/summary-split-up': {
249
+ post: {
250
+ tags: [ 'Trax Audit' ],
251
+ description: `Get overall high level audited files count splitup`,
252
+ operationId: 'metrics/summary-split-up',
253
+ parameters: {},
254
+ requestBody: {
255
+ content: {
256
+ 'application/json': {
257
+ schema: j2s( summarySplitSchema ).swagger,
258
+ },
259
+ },
260
+ },
261
+ responses: {
262
+ 200: { description: 'Successful' },
263
+ 401: { description: 'Unauthorized User' },
264
+ 422: { description: 'Field Error' },
265
+ 500: { description: 'Server Error' },
266
+ 204: { description: 'Not Found' },
267
+ },
268
+ },
269
+ },
270
+
271
+ '/v3/trax-audit/metrics/overview-table': {
272
+ post: {
273
+ tags: [ 'Trax Audit' ],
274
+ description: `Get overall user taken data with some filters `,
275
+ operationId: 'metrics/overview-table',
276
+ parameters: {},
277
+ requestBody: {
278
+ content: {
279
+ 'application/json': {
280
+ schema: j2s( overviewTableSchema ).swagger,
281
+ },
282
+ },
283
+ },
284
+ responses: {
285
+ 200: { description: 'Successful' },
286
+ 401: { description: 'Unauthorized User' },
287
+ 422: { description: 'Field Error' },
288
+ 500: { description: 'Server Error' },
289
+ 204: { description: 'Not Found' },
290
+ },
291
+ },
292
+ },
203
293
  };
@@ -218,3 +218,51 @@ export const overAllAuditSummarySchema = joi.object(
218
218
  export const overAllAuditSummaryValid = {
219
219
  body: overAllAuditSummarySchema,
220
220
  };
221
+
222
+
223
+ export const overViewCardSchema = joi.object(
224
+ {
225
+ fromDate: joi.string().required(),
226
+ toDate: joi.string().required(),
227
+ clientId: joi.array().optional(),
228
+ moduleType: joi.string().required(),
229
+ },
230
+ );
231
+
232
+ export const overViewCardValid = {
233
+ body: overViewCardSchema,
234
+ };
235
+
236
+ export const summarySplitSchema = joi.object(
237
+ {
238
+ fromDate: joi.string().required(),
239
+ toDate: joi.string().required(),
240
+ clientId: joi.array().optional(),
241
+ moduleType: joi.string().optional(),
242
+ },
243
+ );
244
+
245
+ export const summarySplitValid = {
246
+ body: summarySplitSchema,
247
+ };
248
+
249
+ export const overviewTableSchema = joi.object(
250
+ {
251
+ fromDate: joi.string().required(),
252
+ toDate: joi.string().required(),
253
+ clientId: joi.array().optional(),
254
+ limit: joi.number().optional(),
255
+ offset: joi.number().optional(),
256
+ searchValue: joi.string().optional().allow( '' ),
257
+ filterByStatus: joi.array().optional(),
258
+ moduleType: joi.string().optional(),
259
+ filterByAuditType: joi.array().optional(),
260
+ sortColumnName: joi.string().optional(),
261
+ sortBy: joi.number().optional(),
262
+ isExport: joi.boolean().optional(),
263
+ },
264
+ );
265
+
266
+ export const overviewTableValid= {
267
+ body: overviewTableSchema,
268
+ };
@@ -1,8 +1,8 @@
1
1
  import { Router } from 'express';
2
2
  import { isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
3
- import { getDetectionFileValid, getFileValid, userAuditHistoryValid, workSpaceValid, saveValid, clientMetricsValid, storeMetricsValid, userMetricsValid, pendingSummaryTableValid, overAllAuditSummaryValid } from '../dtos/traxAudit.dtos.js';
3
+ import { getDetectionFileValid, getFileValid, userAuditHistoryValid, workSpaceValid, saveValid, clientMetricsValid, storeMetricsValid, userMetricsValid, pendingSummaryTableValid, overAllAuditSummaryValid, summarySplitValid, overviewTableValid, overViewCardValid } from '../dtos/traxAudit.dtos.js';
4
4
  import { isExistsQueue } from '../validation/audit.validation.js';
5
- import { clientMetrics, getAuditFile, getDetectionAuditFile, overAllAuditSummary, pendingSummaryTable, saveBinary, storeMetrics, userAuditHistory, userMetrics, workSpace } from '../controllers/traxAudit.controllers.js';
5
+ import { clientMetrics, getAuditFile, getDetectionAuditFile, overAllAuditSummary, overViewCard, overviewTable, pendingSummaryTable, saveBinary, storeMetrics, summarySplit, userAuditHistory, userMetrics, workSpace } from '../controllers/traxAudit.controllers.js';
6
6
  import { validateBinaryAudit } from '../validation/traxAuditValidation.js';
7
7
 
8
8
  export const traxAuditRouter = Router();
@@ -28,4 +28,10 @@ traxAuditRouter.post( '/metrics/user-metrics', isAllowedSessionHandler, validate
28
28
  traxAuditRouter.post( '/metrics/pending-summary-table', isAllowedSessionHandler, validate( pendingSummaryTableValid ), pendingSummaryTable );
29
29
  traxAuditRouter.post( '/metrics/overall-audit-summary', isAllowedSessionHandler, validate( overAllAuditSummaryValid ), overAllAuditSummary );
30
30
 
31
+ // summary
32
+
33
+ traxAuditRouter.post( '/metrics/overview-card', isAllowedSessionHandler, validate( overViewCardValid ), overViewCard );
34
+ traxAuditRouter.post( '/metrics/summary-split-up', isAllowedSessionHandler, validate( summarySplitValid ), summarySplit );
35
+ traxAuditRouter.post( '/metrics/overview-table', isAllowedSessionHandler, validate( overviewTableValid ), overviewTable );
36
+
31
37
  export default traxAuditRouter;