tango-app-api-task 3.7.8 → 3.7.10
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.
|
|
3
|
+
"version": "3.7.10",
|
|
4
4
|
"description": "Task",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"mongodb": "^6.10.0",
|
|
26
26
|
"nodemon": "^3.1.7",
|
|
27
27
|
"npm": "^10.9.2",
|
|
28
|
-
"tango-api-schema": "^2.
|
|
28
|
+
"tango-api-schema": "^2.5.32",
|
|
29
29
|
"tango-app-api-middleware": "^3.6.8",
|
|
30
30
|
"winston": "^3.17.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
@@ -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:
|
|
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 = [];
|
|
@@ -4706,6 +4714,10 @@ export async function updateAssign( req, res ) {
|
|
|
4706
4714
|
},
|
|
4707
4715
|
];
|
|
4708
4716
|
let assignUserDetails = await userService.aggregate( query );
|
|
4717
|
+
if ( req.body.coverage == 'store' ) {
|
|
4718
|
+
let storeList = req.body.assignedList.map( ( ele ) => ele?.storeId );
|
|
4719
|
+
storeProfileDetails = await storeService.find( { storeId: { $in: storeList } }, { storeId: 1, city: '$storeProfile.city', country: '$storeProfile.country', state: '$storeProfile.state' } );
|
|
4720
|
+
}
|
|
4709
4721
|
for ( let assign of req.body.assignedList ) {
|
|
4710
4722
|
let userDetails = assignUserDetails.find( ( ele ) => ele.email.toLowerCase() == assign.userEmail.toLowerCase() );
|
|
4711
4723
|
if ( !userDetails ) {
|
|
@@ -4728,6 +4740,14 @@ export async function updateAssign( req, res ) {
|
|
|
4728
4740
|
userId: userDetails?._id,
|
|
4729
4741
|
checkListName: taskDetails.checkListName,
|
|
4730
4742
|
};
|
|
4743
|
+
if ( assign?.storeId ) {
|
|
4744
|
+
let findStore = storeProfileDetails.find( ( ele ) => ele.storeId == assign?.storeId )?.toObject();
|
|
4745
|
+
if ( findStore ) {
|
|
4746
|
+
data.city = findStore.city;
|
|
4747
|
+
data.country = findStore.country;
|
|
4748
|
+
data.state = findStore.state;
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4731
4751
|
delete data._id;
|
|
4732
4752
|
assignedUserList.push( data );
|
|
4733
4753
|
}
|
|
@@ -4880,6 +4900,8 @@ export async function commonAiTask( req, res ) {
|
|
|
4880
4900
|
return res.sendError( 'please enter Valid Options', 500 );
|
|
4881
4901
|
}
|
|
4882
4902
|
}
|
|
4903
|
+
let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
|
|
4904
|
+
data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
|
|
4883
4905
|
let response = await taskService.create( data );
|
|
4884
4906
|
if ( response?.approver.length ) {
|
|
4885
4907
|
let inputData = [];
|
|
@@ -5044,7 +5066,10 @@ export async function taskcreation( req, res ) {
|
|
|
5044
5066
|
locationCount: 1,
|
|
5045
5067
|
...( inputBody?.checkListId ) ? { referenceCheckListId: inputBody?.checkListId } : {},
|
|
5046
5068
|
};
|
|
5069
|
+
let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
|
|
5070
|
+
data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
|
|
5047
5071
|
data['approver'] = userAdmin;
|
|
5072
|
+
data['allowUploadFromGallery'] = true;
|
|
5048
5073
|
|
|
5049
5074
|
let response = await taskService.create( data );
|
|
5050
5075
|
if ( response?.approver.length ) {
|
|
@@ -5318,6 +5343,8 @@ export async function breachedTasks( req, res ) {
|
|
|
5318
5343
|
return res.sendError( 'please enter Valid Options', 500 );
|
|
5319
5344
|
}
|
|
5320
5345
|
}
|
|
5346
|
+
let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
|
|
5347
|
+
data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
|
|
5321
5348
|
let response = await taskService.create( data );
|
|
5322
5349
|
if ( response?.approver.length ) {
|
|
5323
5350
|
let inputData = [];
|
|
@@ -5597,7 +5624,8 @@ export async function StoreHygienetask( req, res ) {
|
|
|
5597
5624
|
return res.sendError( 'please enter Valid Options', 500 );
|
|
5598
5625
|
}
|
|
5599
5626
|
}
|
|
5600
|
-
|
|
5627
|
+
let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
|
|
5628
|
+
data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
|
|
5601
5629
|
let response = await taskService.create( data );
|
|
5602
5630
|
if ( response?.approver.length ) {
|
|
5603
5631
|
let inputData = [];
|
|
@@ -5820,7 +5848,8 @@ export async function eyeTesttaskNew( req, res ) {
|
|
|
5820
5848
|
return res.sendError( 'please enter Valid Options', 500 );
|
|
5821
5849
|
}
|
|
5822
5850
|
}
|
|
5823
|
-
|
|
5851
|
+
let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
|
|
5852
|
+
data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
|
|
5824
5853
|
let response = await taskService.create( data );
|
|
5825
5854
|
if ( response?.approver.length ) {
|
|
5826
5855
|
let inputData = [];
|
|
@@ -6350,7 +6379,8 @@ export async function createTaskGroup( req, res ) {
|
|
|
6350
6379
|
return res.sendError( 'please enter Valid Options', 500 );
|
|
6351
6380
|
}
|
|
6352
6381
|
}
|
|
6353
|
-
|
|
6382
|
+
let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
|
|
6383
|
+
data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
|
|
6354
6384
|
let response = await taskService.create( data );
|
|
6355
6385
|
if ( response?.approver.length ) {
|
|
6356
6386
|
let inputData = [];
|
|
@@ -6812,7 +6842,8 @@ export async function createAITaskGroup( req, res ) {
|
|
|
6812
6842
|
return res.sendError( 'please enter Valid Options', 500 );
|
|
6813
6843
|
}
|
|
6814
6844
|
}
|
|
6815
|
-
|
|
6845
|
+
let clientDetails = await clientService.findOne( { clientId: inputBody?.clientId }, { traxVideoUploadTimeLimit: 1 } );
|
|
6846
|
+
data['videoUploadTimeLimit'] = clientDetails?.traxVideoUploadTimeLimit || 0;
|
|
6816
6847
|
let response = await taskService.create( data );
|
|
6817
6848
|
if ( response?.approver.length ) {
|
|
6818
6849
|
let inputData = [];
|