tango-app-api-audit 3.4.68-beta.11 → 3.4.68-beta.13
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/.eslintrc.cjs +1 -1
- package/README.md +28 -28
- package/package.json +1 -1
- package/src/controllers/eyeTestAudit.controllers.js +45 -5
package/.eslintrc.cjs
CHANGED
package/README.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# README #
|
|
2
|
-
|
|
3
|
-
This README would normally document whatever steps are necessary to get your application up and running.
|
|
4
|
-
|
|
5
|
-
### What is this repository for? ###
|
|
6
|
-
|
|
7
|
-
* Quick summary
|
|
8
|
-
* Version
|
|
9
|
-
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
|
|
10
|
-
|
|
11
|
-
### How do I get set up? ###
|
|
12
|
-
|
|
13
|
-
* Summary of set up
|
|
14
|
-
* Configuration
|
|
15
|
-
* Dependencies
|
|
16
|
-
* Database configuration
|
|
17
|
-
* How to run tests
|
|
18
|
-
* Deployment instructions
|
|
19
|
-
|
|
20
|
-
### Contribution guidelines ###
|
|
21
|
-
|
|
22
|
-
* Writing tests
|
|
23
|
-
* Code review
|
|
24
|
-
* Other guidelines
|
|
25
|
-
|
|
26
|
-
### Who do I talk to? ###
|
|
27
|
-
|
|
28
|
-
* Repo owner or admin
|
|
1
|
+
# README #
|
|
2
|
+
|
|
3
|
+
This README would normally document whatever steps are necessary to get your application up and running.
|
|
4
|
+
|
|
5
|
+
### What is this repository for? ###
|
|
6
|
+
|
|
7
|
+
* Quick summary
|
|
8
|
+
* Version
|
|
9
|
+
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
|
|
10
|
+
|
|
11
|
+
### How do I get set up? ###
|
|
12
|
+
|
|
13
|
+
* Summary of set up
|
|
14
|
+
* Configuration
|
|
15
|
+
* Dependencies
|
|
16
|
+
* Database configuration
|
|
17
|
+
* How to run tests
|
|
18
|
+
* Deployment instructions
|
|
19
|
+
|
|
20
|
+
### Contribution guidelines ###
|
|
21
|
+
|
|
22
|
+
* Writing tests
|
|
23
|
+
* Code review
|
|
24
|
+
* Other guidelines
|
|
25
|
+
|
|
26
|
+
### Who do I talk to? ###
|
|
27
|
+
|
|
28
|
+
* Repo owner or admin
|
|
29
29
|
* Other community or team contact
|
package/package.json
CHANGED
|
@@ -298,7 +298,7 @@ export async function viewFile( req, res ) {
|
|
|
298
298
|
const searchData = temp?
|
|
299
299
|
getData['lastAuditedDetails']= {
|
|
300
300
|
'auditedBy': getUserName?.userName || '',
|
|
301
|
-
'completionTime': temp?._source?.startTime? dayjs.utc( temp?._source?.startTime ).tz( 'Asia/Kolkata' ).format( 'HH:ss
|
|
301
|
+
'completionTime': temp?._source?.startTime? dayjs.utc( temp?._source?.startTime ).tz( 'Asia/Kolkata' ).format( 'HH:mm:ss' ): '',
|
|
302
302
|
'timeZone': temp?.timeZone || '',
|
|
303
303
|
} : null;
|
|
304
304
|
getData['complianceScore'] = getData.complianceScore || getData?.totalSteps>0 ? Math.round( ( getData?.coveredStepsAI/ getData?.totalSteps )*100 ): 0;
|
|
@@ -597,7 +597,20 @@ export async function cancel( req, res ) {
|
|
|
597
597
|
try {
|
|
598
598
|
const inputData = req.body;
|
|
599
599
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
600
|
+
let searchFilterhistory=[
|
|
601
|
+
{
|
|
602
|
+
'term': {
|
|
603
|
+
'queueId.keyword': inputData?.fileId,
|
|
604
|
+
},
|
|
605
|
+
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
'term': {
|
|
609
|
+
'type.keyword': inputData?.type,
|
|
610
|
+
},
|
|
600
611
|
|
|
612
|
+
},
|
|
613
|
+
];
|
|
601
614
|
let searchFilter =[
|
|
602
615
|
{
|
|
603
616
|
'term': {
|
|
@@ -643,6 +656,20 @@ export async function cancel( req, res ) {
|
|
|
643
656
|
},
|
|
644
657
|
},
|
|
645
658
|
];
|
|
659
|
+
searchFilterhistory=[
|
|
660
|
+
{
|
|
661
|
+
'term': {
|
|
662
|
+
'engagementId.keyword': inputData?.fileId,
|
|
663
|
+
},
|
|
664
|
+
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
'term': {
|
|
668
|
+
'type.keyword': inputData?.type,
|
|
669
|
+
},
|
|
670
|
+
|
|
671
|
+
},
|
|
672
|
+
];
|
|
646
673
|
}
|
|
647
674
|
|
|
648
675
|
let searchQuery={
|
|
@@ -653,21 +680,34 @@ export async function cancel( req, res ) {
|
|
|
653
680
|
},
|
|
654
681
|
},
|
|
655
682
|
};
|
|
683
|
+
let searchQueryHistory={
|
|
684
|
+
'size': 100,
|
|
685
|
+
'query': {
|
|
686
|
+
'bool': {
|
|
687
|
+
'must': searchFilterhistory,
|
|
688
|
+
},
|
|
689
|
+
},
|
|
690
|
+
};
|
|
656
691
|
const getOutput = await getOpenSearchData( openSearch.EyeTestOutput, searchQuery );
|
|
692
|
+
const getOutputHistory = await getOpenSearchData( openSearch.EyeTestOutput, searchQueryHistory );
|
|
657
693
|
logger.info( { getOutput: getOutput } );
|
|
658
694
|
const output = getOutput?.body?.hits?.hits?.length > 0 ? getOutput?.body?.hits?.hits[0] : null;
|
|
695
|
+
let checkReaudited = getOutput?.body?.hits?.hits?.length > 0 ? getOutputHistory?.body?.hits?.hits.filter( ( data ) => data._source.auditType==='Re-Audit'&&data._source.auditStatus==='Re-Audited' ).length:0;
|
|
696
|
+
let checkaudited = getOutput?.body?.hits?.hits?.length > 0 ? getOutputHistory?.body?.hits?.hits.filter( ( data ) => data._source.auditType==='Audit'&&data._source.auditStatus==='Audited' ).length:0;
|
|
697
|
+
|
|
659
698
|
if ( !output ) {
|
|
660
699
|
return res.sendError( 'No saved records found', 400 );
|
|
661
700
|
}
|
|
662
701
|
const record1 ={
|
|
663
702
|
|
|
664
|
-
auditStatus: '
|
|
703
|
+
auditStatus: checkReaudited>0?'Re-Audited':checkaudited>0?'Audited':'Yet-to-Audit',
|
|
704
|
+
auditType: checkReaudited>0?'Re-Audit':'Audit',
|
|
665
705
|
endTime: dayjs().tz( 'Asia/Kolkata' ),
|
|
666
706
|
|
|
667
707
|
};
|
|
668
708
|
const record2 ={
|
|
669
|
-
|
|
670
|
-
|
|
709
|
+
auditStatus: checkReaudited>0?'Re-Audited':checkaudited>0?'Audited':'Yet-to-Audit',
|
|
710
|
+
auditType: checkReaudited>0?'Re-Audit':'Audit',
|
|
671
711
|
endTime: dayjs().tz( 'Asia/Kolkata' ),
|
|
672
712
|
|
|
673
713
|
};
|
|
@@ -740,7 +780,7 @@ export async function getFileHistory( req, res ) {
|
|
|
740
780
|
userId: data._source.userId,
|
|
741
781
|
userName: findUser.userName,
|
|
742
782
|
Date: dayjs( data._source.endTime ).format( 'DD/MM/YYYY' ),
|
|
743
|
-
Time: dayjs.utc( data._source.endTime ).tz( 'Asia/Kolkata' ).format( 'HH:ss
|
|
783
|
+
Time: dayjs.utc( data._source.endTime ).tz( 'Asia/Kolkata' ).format( 'HH:mm:ss' ),
|
|
744
784
|
} );
|
|
745
785
|
}
|
|
746
786
|
|