tango-app-api-audit 3.4.68-beta.4 → 3.4.68-beta.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/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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.4.68-beta.4",
3
+ "version": "3.4.68-beta.5",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -147,7 +147,7 @@ export async function getList( req, res ) {
147
147
  'bool': search,
148
148
  },
149
149
  'sort': [
150
- { createdAt: { order: 'desc' } },
150
+ { 'storeName.keyword': { order: 'desc' } },
151
151
  ],
152
152
  };
153
153
  }
@@ -164,7 +164,7 @@ export async function getList( req, res ) {
164
164
  const chunkedMappingData = await chunkArray( searchValue, 10 );
165
165
  const promises = chunkedMappingData.map( async ( chunk ) => {
166
166
  const exportData = [];
167
- chunk.forEach( async ( element ) => {
167
+ for ( const element of chunk ) {
168
168
  const testDuration = element?._source?.testDuration;
169
169
  const minutes = Math.floor( testDuration / 60 );
170
170
  const seconds = testDuration % 60;
@@ -200,11 +200,11 @@ export async function getList( req, res ) {
200
200
  'Visitor Type': element?._source?.visitorsType,
201
201
  'Test Duration': duration || '',
202
202
  'Audit Status': element?._source?.auditStatus || '',
203
- 'Audited By': userName.userName || '',
203
+ 'Audited By': userName?.userName || '',
204
204
 
205
205
  } );
206
206
  }
207
- } );
207
+ }
208
208
  return exportData;
209
209
  } );
210
210
  const mappedArrays = await Promise.all( promises );
@@ -694,7 +694,11 @@ export async function getFileHistory( req, res ) {
694
694
  'queueId.keyword': inputData.id,
695
695
  },
696
696
  },
697
-
697
+ {
698
+ 'terms': {
699
+ 'auditStatus.keyword': [ 'Audited', 'Re-Audited' ],
700
+ },
701
+ },
698
702
  ],
699
703
  },
700
704
  },
@@ -710,7 +714,11 @@ export async function getFileHistory( req, res ) {
710
714
  'engagementId.keyword': inputData.id,
711
715
  },
712
716
  },
713
-
717
+ {
718
+ 'terms': {
719
+ 'auditStatus.keyword': [ 'Audited', 'Re-Audited' ],
720
+ },
721
+ },
714
722
  ],
715
723
  },
716
724
  },
@@ -722,13 +730,14 @@ export async function getFileHistory( req, res ) {
722
730
  let sourcesArray = resposnse.body.hits.hits.map( ( hit ) => hit );
723
731
  let outputData=[];
724
732
  for ( let data of sourcesArray ) {
733
+ // console.log( data._source.endTime );
725
734
  let findUser= await findOneUser( { _id: new mongoose.Types.ObjectId( data._source.userId ) } );
726
735
  outputData.push( {
727
736
  _id: data._id,
728
737
  userId: data._source.userId,
729
738
  userName: findUser.userName,
730
739
  Date: dayjs( data._source.endTime ).format( 'DD/MM/YYYY' ),
731
- Time: dayjs( data._source.endTime ).format( 'HH:MM:ss' ),
740
+ Time: data._source.endTime?new Date( data._source.endTime ).toLocaleTimeString( 'en-IN', { hour12: false } ):'-',
732
741
  } );
733
742
  }
734
743