tango-app-api-task 3.7.8 → 3.7.9

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-task",
3
- "version": "3.7.8",
3
+ "version": "3.7.9",
4
4
  "description": "Task",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1048,7 +1048,7 @@ export async function taskConfig( req, res ) {
1048
1048
  let endDate = dayjs.utc( configDetails?.scheduleDate ).format( 'YYYY-MM-DD' ) + ' ' + configDetails.scheduleEndTime;
1049
1049
  configDetails.scheduleEndTimeISO = dayjs.utc( endDate, 'YYYY-MM-DD hh:mm A' ).format();
1050
1050
  configDetails.publishDate = dayjs.utc( dayjs().format( 'hh:mm A' ), 'hh:mm A' ).format();
1051
- let clientDetails = await clientService.findOne( { clientId: req.body?.clientId }, { traxVideoUploadTimeLimit: 1 } );
1051
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
1052
1052
  configDetails = { ...configDetails, videoUploadTimeLimit: clientDetails?.traxVideoUploadTimeLimit };
1053
1053
  let response = await taskService.updateOne( { _id: inputBody._id }, configDetails );
1054
1054
  if ( inputBody?.approver.length ) {
@@ -1943,7 +1943,8 @@ export async function createChecklistTask( req, res ) {
1943
1943
  } else {
1944
1944
  data['approver'] = { name: req.user.userName, value: req.user.email };
1945
1945
  }
1946
-
1946
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
1947
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
1947
1948
  let response = await taskService.create( data );
1948
1949
  if ( response?.approver.length ) {
1949
1950
  let data = [];
@@ -2173,7 +2174,8 @@ export async function createChecklistMultiTask( req, res ) {
2173
2174
  } else {
2174
2175
  data['approver'] = { name: req.user.userName, value: req.user.email };
2175
2176
  }
2176
-
2177
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
2178
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
2177
2179
  let response = await taskService.create( data );
2178
2180
  let newquestion = {
2179
2181
  'qno': 1,
@@ -3090,7 +3092,8 @@ export const updatePublish = async ( req, res ) => {
3090
3092
  logger.info( { function: 'updatePublish', query: { date_string: { $gt: currentDate.format( 'YYYY-MM-DD' ) }, date_iso: { $gt: currentDate.format( '' ) }, sourceCheckList_id: req.body.checklistId, checklistStatus: { $ne: 'submit' } } } );
3091
3093
  }
3092
3094
 
3093
-
3095
+ let clientDetails = await clientService.findOne( { clientId: req.body?.clientId }, { traxVideoUploadTimeLimit: 1 } );
3096
+ getCheckDetails.videoUploadTimeLimit = clientDetails?.traxVideoUploadTimeLimit || 0;
3094
3097
  await taskService.updateOne( query, getCheckDetails );
3095
3098
  if ( true ) {
3096
3099
  let currentDate = dayjs.utc().format();
@@ -3207,6 +3210,7 @@ export const duplicateChecklist = async ( req, res ) => {
3207
3210
  } else {
3208
3211
  dupDetails.checkListName = dupDetails.checkListName + '(1)';
3209
3212
  }
3213
+ let clientDetails = await clientService.findOne( { clientId: req.query.clientId }, { traxVideoUploadTimeLimit: 1 } );
3210
3214
  dupDetails.publish = false;
3211
3215
  dupDetails.reinitiate = false;
3212
3216
  dupDetails.createdAt = new Date();
@@ -3214,7 +3218,7 @@ export const duplicateChecklist = async ( req, res ) => {
3214
3218
  dupDetails.publishDate = '';
3215
3219
  dupDetails.rawImageUpload = false;
3216
3220
  dupDetails.rawVideoUpload = false;
3217
- dupDetails.videoUploadTimeLimit = 0;
3221
+ dupDetails.videoUploadTimeLimit = clientDetails?.traxVideoUploadTimeLimit || 0;
3218
3222
  delete dupDetails._id;
3219
3223
  let logInsertData = {
3220
3224
  action: 'duplicateTask',
@@ -3448,7 +3452,8 @@ export async function createAiChecklist( req, res ) {
3448
3452
 
3449
3453
 
3450
3454
  data['approver'] = { name: userAdmin.userName, value: userAdmin.email };
3451
-
3455
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
3456
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
3452
3457
 
3453
3458
  let response = await taskService.create( data );
3454
3459
  if ( response?.approver.length ) {
@@ -3676,7 +3681,8 @@ export async function StoreHygienetaskOld( req, res ) {
3676
3681
  }
3677
3682
  }
3678
3683
 
3679
-
3684
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
3685
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
3680
3686
  let response = await taskService.create( data );
3681
3687
  if ( response?.approver.length ) {
3682
3688
  let inputData = [];
@@ -3902,7 +3908,8 @@ export async function eyeTesttask( req, res ) {
3902
3908
  }
3903
3909
  }
3904
3910
 
3905
-
3911
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
3912
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
3906
3913
  let response = await taskService.create( data );
3907
3914
  if ( response?.approver.length ) {
3908
3915
  let inputData = [];
@@ -4114,7 +4121,8 @@ export async function createAiTask( req, res ) {
4114
4121
  }
4115
4122
  }
4116
4123
 
4117
-
4124
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
4125
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
4118
4126
  let response = await taskService.create( data );
4119
4127
  if ( response?.approver.length ) {
4120
4128
  let inputData = [];
@@ -4880,6 +4888,8 @@ export async function commonAiTask( req, res ) {
4880
4888
  return res.sendError( 'please enter Valid Options', 500 );
4881
4889
  }
4882
4890
  }
4891
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
4892
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
4883
4893
  let response = await taskService.create( data );
4884
4894
  if ( response?.approver.length ) {
4885
4895
  let inputData = [];
@@ -5044,6 +5054,8 @@ export async function taskcreation( req, res ) {
5044
5054
  locationCount: 1,
5045
5055
  ...( inputBody?.checkListId ) ? { referenceCheckListId: inputBody?.checkListId } : {},
5046
5056
  };
5057
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
5058
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
5047
5059
  data['approver'] = userAdmin;
5048
5060
 
5049
5061
  let response = await taskService.create( data );
@@ -5318,6 +5330,8 @@ export async function breachedTasks( req, res ) {
5318
5330
  return res.sendError( 'please enter Valid Options', 500 );
5319
5331
  }
5320
5332
  }
5333
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
5334
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
5321
5335
  let response = await taskService.create( data );
5322
5336
  if ( response?.approver.length ) {
5323
5337
  let inputData = [];
@@ -5597,7 +5611,8 @@ export async function StoreHygienetask( req, res ) {
5597
5611
  return res.sendError( 'please enter Valid Options', 500 );
5598
5612
  }
5599
5613
  }
5600
-
5614
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
5615
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
5601
5616
  let response = await taskService.create( data );
5602
5617
  if ( response?.approver.length ) {
5603
5618
  let inputData = [];
@@ -5820,7 +5835,8 @@ export async function eyeTesttaskNew( req, res ) {
5820
5835
  return res.sendError( 'please enter Valid Options', 500 );
5821
5836
  }
5822
5837
  }
5823
-
5838
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
5839
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
5824
5840
  let response = await taskService.create( data );
5825
5841
  if ( response?.approver.length ) {
5826
5842
  let inputData = [];
@@ -6350,7 +6366,8 @@ export async function createTaskGroup( req, res ) {
6350
6366
  return res.sendError( 'please enter Valid Options', 500 );
6351
6367
  }
6352
6368
  }
6353
-
6369
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
6370
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
6354
6371
  let response = await taskService.create( data );
6355
6372
  if ( response?.approver.length ) {
6356
6373
  let inputData = [];
@@ -6812,7 +6829,8 @@ export async function createAITaskGroup( req, res ) {
6812
6829
  return res.sendError( 'please enter Valid Options', 500 );
6813
6830
  }
6814
6831
  }
6815
-
6832
+ let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
6833
+ data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
6816
6834
  let response = await taskService.create( data );
6817
6835
  if ( response?.approver.length ) {
6818
6836
  let inputData = [];