tango-app-api-audit 3.4.68-beta.10 → 3.4.68-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.4.68-beta.10",
3
+ "version": "3.4.68-beta.12",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -26,8 +26,8 @@
26
26
  "mongodb": "^6.7.0",
27
27
  "nodemon": "^3.1.3",
28
28
  "swagger-ui-express": "^5.0.1",
29
- "tango-api-schema": "^2.2.95",
30
- "tango-app-api-middleware": "^3.1.71",
29
+ "tango-api-schema": "^2.2.98",
30
+ "tango-app-api-middleware": "^3.1.73",
31
31
  "winston": "^3.13.0",
32
32
  "winston-daily-rotate-file": "^5.0.0"
33
33
  },
@@ -16,7 +16,7 @@ export async function getList( req, res ) {
16
16
  const limit = inputData.limit || 10;
17
17
  const offset = inputData.offset ? ( inputData.offset - 1 ) * limit : 0;
18
18
 
19
- const sortBy = inputData?.sortBy ? `${inputData.sortBy}.keyword` : 'storeName.keyword';
19
+ const sortBy = inputData?.sortBy ? inputData.sortBy === 'coveredStepsAI' ? inputData.sortBy :`${inputData.sortBy}.keyword` : 'storeName.keyword';
20
20
  const order = inputData?.sortOrder || -1;
21
21
  let filter= [
22
22
  {
@@ -174,7 +174,7 @@ export async function getList( req, res ) {
174
174
  const userName = await findOneUser( { _id: element?._source?.userId }, { _id: 0, userName: 1 } );
175
175
  if ( element?._source?.type == 'physical' ) {
176
176
  exportData.push( {
177
- 'Date': dayjs( element?._source?.date ).format( 'YYYY,MMM D' ),
177
+ 'Date': dayjs( element?._source?.date ).format( 'D MMM, YYYY' ),
178
178
  'Store Name': element?._source?.storeName,
179
179
  'Store ID': element?._source?.storeId || 'Un Assigned',
180
180
  'Store Name': element?._source?.storeName ||'Un Assigned',
@@ -190,7 +190,7 @@ export async function getList( req, res ) {
190
190
  } );
191
191
  } else {
192
192
  exportData.push( {
193
- 'Date': dayjs( element?._source?.date ).format( 'YYYY,MMM D' ),
193
+ 'Date': dayjs( element?._source?.date ).format( 'D MMM, YYYY' ),
194
194
  'Store Name': element?._source?.storeName,
195
195
  'Store ID': element?._source?.storeId || 'Un Assigned',
196
196
  'Store Name': element?._source?.storeName ||'Un Assigned',
@@ -221,6 +221,7 @@ export async function getList( req, res ) {
221
221
  searchValue[i]._source.min = minutes;
222
222
  searchValue[i]._source.sec = seconds;
223
223
  searchValue[i]._source.auditedBy = userName?.userName || '';
224
+ searchValue[i]._source.date = dayjs( searchValue[i]?._source?.date ).format( 'D MMM, YYYY' );
224
225
  }
225
226
  }
226
227
 
@@ -297,7 +298,7 @@ export async function viewFile( req, res ) {
297
298
  const searchData = temp?
298
299
  getData['lastAuditedDetails']= {
299
300
  'auditedBy': getUserName?.userName || '',
300
- 'completionTime': temp?._source?.startTime? dayjs.utc( temp?._source?.startTime ).tz( 'Asia/Kolkata' ).format( 'HH:ss:mm' ): '',
301
+ 'completionTime': temp?._source?.startTime? dayjs.utc( temp?._source?.startTime ).tz( 'Asia/Kolkata' ).format( 'HH:mm:ss' ): '',
301
302
  'timeZone': temp?.timeZone || '',
302
303
  } : null;
303
304
  getData['complianceScore'] = getData.complianceScore || getData?.totalSteps>0 ? Math.round( ( getData?.coveredStepsAI/ getData?.totalSteps )*100 ): 0;
@@ -739,7 +740,7 @@ export async function getFileHistory( req, res ) {
739
740
  userId: data._source.userId,
740
741
  userName: findUser.userName,
741
742
  Date: dayjs( data._source.endTime ).format( 'DD/MM/YYYY' ),
742
- Time: dayjs.utc( data._source.endTime ).tz( 'Asia/Kolkata' ).format( 'HH:ss:mm' ),
743
+ Time: dayjs.utc( data._source.endTime ).tz( 'Asia/Kolkata' ).format( 'HH:mm:ss' ),
743
744
  } );
744
745
  }
745
746