tango-app-api-trax 1.0.0-beta-task.11 → 1.0.0-beta-task.14
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": "1.0.0-beta-task.
|
|
3
|
+
"version": "1.0.0-beta-task.14",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
"mongodb": "^6.8.0",
|
|
27
27
|
"nodemon": "^3.1.4",
|
|
28
28
|
"path": "^0.12.7",
|
|
29
|
-
"tango-api-schema": "^2.2.
|
|
29
|
+
"tango-api-schema": "^2.2.5",
|
|
30
30
|
"tango-app-api-middleware": "3.1.43-alpha.10",
|
|
31
|
-
"tango-app-api-trax": "^1.0.0-beta-task.7",
|
|
32
31
|
"url": "^0.11.4",
|
|
33
32
|
"winston": "^3.13.1",
|
|
34
33
|
"winston-daily-rotate-file": "^5.0.0"
|
|
@@ -594,9 +594,9 @@ export async function sopMobilechecklistMultiSectionFormatter( req, res, next )
|
|
|
594
594
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
595
595
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
596
596
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
597
|
-
if ( qaAnswers[j]?.redo ) {
|
|
597
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
598
598
|
structure.redo = false;
|
|
599
|
-
}
|
|
599
|
+
}
|
|
600
600
|
if ( qaAnswers[j]?.redoComment ) {
|
|
601
601
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
602
602
|
};
|
|
@@ -639,9 +639,9 @@ export async function sopMobilechecklistMultiSectionFormatter( req, res, next )
|
|
|
639
639
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
640
640
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
641
641
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
642
|
-
if ( qaAnswers[j]?.redo ) {
|
|
642
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
643
643
|
structure.redo = false;
|
|
644
|
-
}
|
|
644
|
+
}
|
|
645
645
|
if ( qaAnswers[j]?.redoComment ) {
|
|
646
646
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
647
647
|
};
|
|
@@ -688,9 +688,9 @@ export async function sopMobilechecklistMultiSectionFormatter( req, res, next )
|
|
|
688
688
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
689
689
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
690
690
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
691
|
-
if ( qaAnswers[j]?.redo ) {
|
|
691
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
692
692
|
structure.redo = false;
|
|
693
|
-
}
|
|
693
|
+
}
|
|
694
694
|
if ( qaAnswers[j]?.redoComment ) {
|
|
695
695
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
696
696
|
};
|
|
@@ -742,9 +742,9 @@ export async function sopMobilechecklistMultiSectionFormatter( req, res, next )
|
|
|
742
742
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
743
743
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
744
744
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
745
|
-
if ( qaAnswers[j]?.redo ) {
|
|
745
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
746
746
|
structure.redo = false;
|
|
747
|
-
}
|
|
747
|
+
}
|
|
748
748
|
if ( qaAnswers[j]?.redoComment ) {
|
|
749
749
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
750
750
|
};
|
|
@@ -791,9 +791,9 @@ export async function sopMobilechecklistMultiSectionFormatter( req, res, next )
|
|
|
791
791
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
792
792
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
793
793
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
794
|
-
if ( qaAnswers[j]?.redo ) {
|
|
794
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
795
795
|
structure.redo = false;
|
|
796
|
-
}
|
|
796
|
+
}
|
|
797
797
|
if ( qaAnswers[j]?.redoComment ) {
|
|
798
798
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
799
799
|
};
|
|
@@ -894,9 +894,10 @@ export async function sopMobileTaskMultiSectionFormatter( req, res, next ) {
|
|
|
894
894
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
895
895
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
896
896
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
897
|
-
|
|
897
|
+
|
|
898
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
898
899
|
structure.redo = false;
|
|
899
|
-
}
|
|
900
|
+
}
|
|
900
901
|
if ( qaAnswers[j]?.redoComment ) {
|
|
901
902
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
902
903
|
};
|
|
@@ -939,9 +940,9 @@ export async function sopMobileTaskMultiSectionFormatter( req, res, next ) {
|
|
|
939
940
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
940
941
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
941
942
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
942
|
-
if ( qaAnswers[j]?.redo ) {
|
|
943
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
943
944
|
structure.redo = false;
|
|
944
|
-
}
|
|
945
|
+
}
|
|
945
946
|
if ( qaAnswers[j]?.redoComment ) {
|
|
946
947
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
947
948
|
};
|
|
@@ -988,9 +989,9 @@ export async function sopMobileTaskMultiSectionFormatter( req, res, next ) {
|
|
|
988
989
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
989
990
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
990
991
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
991
|
-
if ( qaAnswers[j]?.redo ) {
|
|
992
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
992
993
|
structure.redo = false;
|
|
993
|
-
}
|
|
994
|
+
}
|
|
994
995
|
if ( qaAnswers[j]?.redoComment ) {
|
|
995
996
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
996
997
|
};
|
|
@@ -1042,9 +1043,9 @@ export async function sopMobileTaskMultiSectionFormatter( req, res, next ) {
|
|
|
1042
1043
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
1043
1044
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
1044
1045
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
1045
|
-
if ( qaAnswers[j]?.redo ) {
|
|
1046
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
1046
1047
|
structure.redo = false;
|
|
1047
|
-
}
|
|
1048
|
+
}
|
|
1048
1049
|
if ( qaAnswers[j]?.redoComment ) {
|
|
1049
1050
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
1050
1051
|
};
|
|
@@ -1094,9 +1095,9 @@ export async function sopMobileTaskMultiSectionFormatter( req, res, next ) {
|
|
|
1094
1095
|
structure.parentanswer = requestSection[i].parentanswer;
|
|
1095
1096
|
structure.questionReferenceImage = qaAnswers[j].questionReferenceImage;
|
|
1096
1097
|
structure.descriptivetype = qaAnswers[j].descriptivetype;
|
|
1097
|
-
if ( qaAnswers[j]?.redo ) {
|
|
1098
|
+
if ( typeof qaAnswers[j]?.redo === 'boolean' ) {
|
|
1098
1099
|
structure.redo = false;
|
|
1099
|
-
}
|
|
1100
|
+
}
|
|
1100
1101
|
if ( qaAnswers[j]?.redoComment ) {
|
|
1101
1102
|
structure.redoComment = qaAnswers[j]?.redoComment;
|
|
1102
1103
|
};
|
|
@@ -3536,9 +3536,8 @@ export async function sendAlert( req, res ) {
|
|
|
3536
3536
|
let query = {
|
|
3537
3537
|
date_iso: new Date( dayjs().format( 'YYYY-MM-DD' ) ),
|
|
3538
3538
|
...( inputBody?.sourceCheckList_id ) ? { sourceCheckList_id: new mongoose.Types.ObjectId( inputBody.sourceCheckList_id ) } : { _id: { $in: inputBody.id } },
|
|
3539
|
-
checklistStatus: { $ne: 'submit' },
|
|
3540
3539
|
timeFlag: 0,
|
|
3541
|
-
...( inputBody?.checklistStatus && inputBody?.checklistStatus != 'all' ) ? { checklistStatus: inputBody.status } : {},
|
|
3540
|
+
...( inputBody?.checklistStatus && inputBody?.checklistStatus != 'all' ) ? { checklistStatus: inputBody.status } : { checklistStatus: { $ne: 'submit' } },
|
|
3542
3541
|
};
|
|
3543
3542
|
|
|
3544
3543
|
query = [ { $match: query } ];
|
|
@@ -3558,7 +3557,11 @@ export async function sendAlert( req, res ) {
|
|
|
3558
3557
|
},
|
|
3559
3558
|
} );
|
|
3560
3559
|
|
|
3560
|
+
console.log( JSON.stringify( query ) );
|
|
3561
|
+
|
|
3561
3562
|
let checkList = await processedchecklistService.aggregate( query );
|
|
3563
|
+
console.log( checkList );
|
|
3564
|
+
|
|
3562
3565
|
if ( !checkList.length ) {
|
|
3563
3566
|
return res.sendError( 'no data', 204 );
|
|
3564
3567
|
}
|