tango-app-api-trax 3.6.0-inditech-2 → 3.6.0-sec-2

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.6.0-inditech-2",
3
+ "version": "3.6.0-sec-2",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -280,6 +280,7 @@ export const create = async ( req, res ) => {
280
280
  checkListId: checkListId,
281
281
  question: section.questions,
282
282
  checkList: inputBody.checklistName,
283
+ sectionNumber: section.sectionNumber,
283
284
  };
284
285
  await questionService.create( sectionList ).then( async ( data ) => {
285
286
  if ( i == inputBody.sections.length - 1 ) {
@@ -429,6 +430,7 @@ export const getConfigDetails = async ( req, res ) => {
429
430
  name: item.section,
430
431
  oldName: item?.sectionOldName,
431
432
  questions: item.question,
433
+ sectionNumber: item.sectionNumber,
432
434
  } );
433
435
  } );
434
436
  sectionList = sections;
@@ -906,11 +908,13 @@ export const update = async ( req, res ) => {
906
908
  checkListId: checkListId,
907
909
  question: section.questions,
908
910
  checkList: inputBody.checklistName,
911
+ sectionNumber: section.sectionNumber,
909
912
  } );
910
913
  }
911
914
  }
912
915
  await questionService.deleteMany( { checkListId: checkListId, client_id: req.body.clientId } );
913
916
  if ( sectionList.length ) {
917
+ sectionList.sort( ( a, b ) => a.sectionNumber - b.sectionNumber );
914
918
  await questionService.insertMany( sectionList );
915
919
  }
916
920
 
@@ -1022,6 +1026,14 @@ export const update = async ( req, res ) => {
1022
1026
  userType: req.user.userType,
1023
1027
  };
1024
1028
  insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).traxActivityLog, insertLogData );
1029
+
1030
+ // / Teams Alert
1031
+ let teamsMsg;
1032
+ let teamsAlertUrls = process.env.teamsAlertURL ? JSON.parse( process.env.teamsAlertURL ) : '';
1033
+ teamsMsg = 'ClientId: '+ insertLogData.client_id + ', Type: Checklist, Action: Checklist Question Edited, ChecklistId: '+ insertLogData.sourceCheckList_id + ', Checklist Name: '+ insertLogData.checkListName +', UpDatedBy: '+ req.user.email;
1034
+ if ( teamsAlertUrls && teamsAlertUrls.questionEditAlert ) {
1035
+ sendTeamsNotification( teamsAlertUrls.questionEditAlert, teamsMsg );
1036
+ }
1025
1037
  }
1026
1038
 
1027
1039
  if ( inputBody.submitType == 'save' ) {
@@ -1670,6 +1682,7 @@ export const updateConfigurev1 =async ( req, res ) => {
1670
1682
  client_id: req.body.clientId,
1671
1683
  createdByEmail: req.user.email,
1672
1684
  approver: inputBody?.checkListDetails?.approver || [],
1685
+ sections: inputBody?.checkListDetails?.sections || [],
1673
1686
  };
1674
1687
  await checklistLogs.create( logInsertData );
1675
1688