tango-app-api-trax 3.5.0-alpha-1 → 3.5.0-alpha-3

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-trax",
3
- "version": "3.5.0-alpha-1",
3
+ "version": "3.5.0-alpha-3",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -43,7 +43,7 @@ export const downloadInsert = async ( req, res ) => {
43
43
  }
44
44
  }
45
45
  }
46
- console.log( requestData );
46
+ // console.log( requestData );
47
47
 
48
48
  if ( requestData.sourceCheckList_id && requestData.sourceCheckList_id != '' ) {
49
49
  let getChecklistQuery = [];
@@ -64,7 +64,7 @@ export const downloadInsert = async ( req, res ) => {
64
64
  },
65
65
  } );
66
66
  } else {
67
- console.log( requestData );
67
+ // console.log( requestData );
68
68
  getChecklistQuery.push( {
69
69
  $match: {
70
70
  $and: [
@@ -82,7 +82,7 @@ export const downloadInsert = async ( req, res ) => {
82
82
  getChecklistQuery.push( { $count: 'totalCount' } );
83
83
 
84
84
  let getChecklistCount = await processedchecklistService.aggregate( getChecklistQuery );
85
- console.log( getChecklistCount );
85
+ // console.log( getChecklistCount );
86
86
  if ( requestData.insertType === 'task' ) {
87
87
  getChecklistCount = await processedTaskService.aggregate( getChecklistQuery );
88
88
  }
@@ -146,7 +146,7 @@ export const downloadInsert = async ( req, res ) => {
146
146
  'filtertype': requestData.filtertype || 'Clusters',
147
147
  'checkListType': requestData.checkListType,
148
148
  };
149
- console.log( insertData );
149
+ // console.log( insertData );
150
150
  let resultData = await downloadService.insert( insertData );
151
151
  if ( resultData ) {
152
152
  let sqsMessageRequestData = {
@@ -201,7 +201,7 @@ export const downloadInsertAI = async ( req, res ) => {
201
201
  name = requestData?.checklistName;
202
202
  }
203
203
  let findchecklist = await processedcheklistconfigService.findOne( { 'checkListType': requestData.checkListType, 'client_id': requestData.clientId } ).sort( { _id: -1 } );
204
- console.log( findchecklist );
204
+ // console.log( findchecklist );
205
205
  name = name + '-' + requestData.fileType;
206
206
  let insertData = {
207
207
  'date_string': requestData.fromDate || '',
@@ -232,10 +232,10 @@ export const downloadInsertAI = async ( req, res ) => {
232
232
  'checkListName': findchecklist.checkListName,
233
233
  'checkListDescription': findchecklist.checkListDescription,
234
234
  };
235
- console.log( requestData );
236
- console.log( insertData );
235
+ // console.log( requestData );
236
+ // console.log( insertData );
237
237
  let resultData = await downloadService.insert( insertData );
238
- console.log( resultData );
238
+ // console.log( resultData );
239
239
  if ( resultData ) {
240
240
  let sqsMessageRequestData = {
241
241
  'zipId': resultData._id,
@@ -588,7 +588,7 @@ export const getAiChecklistDataFromZipId = async ( req, res ) => {
588
588
  brandInfo.brandLogo = getzipdata.client_id + '/logo/' + getClientData.profileDetails.logo;
589
589
  }
590
590
  getzipdata.brandInfo = brandInfo;
591
- console.log( getzipdata );
591
+ // console.log( getzipdata );
592
592
  return res.sendSuccess( getzipdata );
593
593
  } else {
594
594
  return res.sendError( { error: 'No Data Found' }, 204 );
@@ -302,7 +302,7 @@ export async function approveChecklist( req, res ) {
302
302
  approvalByName: req.user.userName,
303
303
  approvalByEmail: req.user.email,
304
304
  };
305
- let updateResponse = await processedChecklist.updateMany( { _id: { $in: idList } }, approvalUpdateData );
305
+ let updateResponse = await processedChecklist.updateMany( { _id: { $in: idList }, approvalStatus: false }, approvalUpdateData );
306
306
  if ( updateResponse.modifiedCount || updateResponse.matchedCount ) {
307
307
  let inputstores = checklistDetails.filter( ( data ) => data.checklistStatus == 'submit' );
308
308
  let storeNames = inputstores.map( ( data ) => data.storeName );
@@ -355,7 +355,7 @@ export async function approveChecklist( req, res ) {
355
355
  console.log( 'logData', logData );
356
356
  let urlopensearch = JSON.parse( process.env.OPENSEARCH );
357
357
  insertOpenSearchData( urlopensearch.traxActivityLog, logData );
358
- console.log( searchResponse.ok );
358
+ // console.log( searchResponse.ok );
359
359
  if ( searchResponse.ok ) {
360
360
  let pendingstores = checklistDetails.filter( ( data ) => data.checklistStatus != 'submit' );
361
361
  if ( pendingstores && pendingstores.length > 0 ) {
@@ -439,7 +439,7 @@ export async function redoChecklist( req, res ) {
439
439
  };
440
440
 
441
441
  let response = await processedChecklist.updateOne( { _id: req.body.payload._id }, updateData );
442
- console.log( response );
442
+ // console.log( response );
443
443
  if ( response.modifiedCount || response.matchedCount ) {
444
444
  let storeTimeZone = await storeService.findOne( { storeName: checklistDetails.storeName }, { 'storeProfile.timeZone': 1 } );
445
445
  let currentDateTime;
@@ -479,7 +479,7 @@ export async function redoChecklist( req, res ) {
479
479
  };
480
480
  let url = JSON.parse( process.env.LAMBDAURL );
481
481
  let searchResponse = await fetch( url.redoChecklist, requestOptions );
482
- console.log( searchResponse.ok );
482
+ // console.log( searchResponse.ok );
483
483
  let logData= {
484
484
  'client_id': checklistDetails.client_id,
485
485
  'createAt': new Date(),
@@ -581,7 +581,7 @@ export async function redomultiChecklist( req, res ) {
581
581
  };
582
582
 
583
583
  let response = await processedChecklist.updateOne( { _id: originalData.checklistId }, updateData );
584
- console.log( response );
584
+ // console.log( response );
585
585
  if ( response.modifiedCount || response.matchedCount ) {
586
586
  let storeTimeZone = await storeService.findOne( { storeName: checklistDetails.storeName }, { 'storeProfile.timeZone': 1 } );
587
587
  let currentDateTime;
@@ -616,7 +616,7 @@ export async function redomultiChecklist( req, res ) {
616
616
  req.body.payload._id=originalData.checklistId;
617
617
  req.body.payload.section_id=originalData.section_id;
618
618
  req.body.payload.uniqueNo=originalData.uniqueNo;
619
- console.log( req.body );
619
+ // console.log( req.body );
620
620
 
621
621
 
622
622
  const requestOptions = {
@@ -2013,15 +2013,15 @@ export async function getPDFCSVChecklistDetails( req, res ) {
2013
2013
 
2014
2014
  export async function AiPushNotificationAlert( req, res ) {
2015
2015
  try {
2016
- console.log( req.body );
2016
+ // console.log( req.body );
2017
2017
  let findAichecklist = await PCLconfig.findOne( { checkListType: req.body.checkListType, client_id: req.body.clientId, date_string: req.body.Date }, { aiConfig: 1 } );
2018
2018
  if ( findAichecklist.aiConfig&&findAichecklist.aiConfig.alerts&&findAichecklist.aiConfig.alerts.users&&findAichecklist.aiConfig.alerts.users.length>0 ) {
2019
- console.log( findAichecklist.aiConfig.alerts.users );
2019
+ // console.log( findAichecklist.aiConfig.alerts.users );
2020
2020
  for ( let user of findAichecklist.aiConfig.alerts.users ) {
2021
2021
  let findOneUser = await userService.findOne( { email: user }, { fcmToken: 1 } );
2022
- console.log( findOneUser );
2022
+ // console.log( findOneUser );
2023
2023
  if ( findOneUser&&findOneUser.fcmToken&&findOneUser.fcmToken!='' ) {
2024
- console.log( findOneUser.fcmToken );
2024
+ // console.log( findOneUser.fcmToken );
2025
2025
  try {
2026
2026
  await sendPushNotification( req.body.title, req.body.description, findOneUser.fcmToken );
2027
2027
  } catch ( e ) {
@@ -2493,7 +2493,7 @@ export const flagChecklistTableV1 = async ( req, res ) => {
2493
2493
  if ( resultData ) {
2494
2494
  if ( resultData.status_code == '200' ) {
2495
2495
  const exportdata = [];
2496
- console.log( resultData );
2496
+ // console.log( resultData );
2497
2497
  if ( reqestData.ChecklistType==='scrum'||reqestData.ChecklistType==='cleaning' ) {
2498
2498
  reqestData.ChecklistType = 'scrumdetection';
2499
2499
  }
@@ -2515,7 +2515,7 @@ export const flagChecklistTableV1 = async ( req, res ) => {
2515
2515
  return res.sendError( 'No Content', 204 );
2516
2516
  }
2517
2517
  }
2518
- console.log( reqestData );
2518
+ // console.log( reqestData );
2519
2519
 
2520
2520
  let LamdaURL = 'https://bnauly42yuztzrgtttodzt3bcm0oqrsi.lambda-url.ap-south-1.on.aws/';
2521
2521
  let resultData = await LamdaServiceCall( LamdaURL, reqestData );