tango-app-api-audit 3.4.38 → 3.4.39
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
|
@@ -972,30 +972,30 @@ export async function workSpace( req, res ) {
|
|
|
972
972
|
},
|
|
973
973
|
];
|
|
974
974
|
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
975
|
+
const userDrafted = [
|
|
976
|
+
{
|
|
977
|
+
$match: {
|
|
978
|
+
$and: [
|
|
979
|
+
// { clientId: { $in: clientList } },
|
|
980
|
+
{ userId: { $eq: req.user._id } },
|
|
981
|
+
{ auditStatus: { $in: [ 'inprogress', 'drafted' ] } },
|
|
982
|
+
{ moduleType: { $eq: inputData.moduleType } },
|
|
983
|
+
{ createdAt: { $gte: new Date( dayjs( fileDate ).format( 'YYYY-MM-DD' ) ) } },
|
|
984
|
+
{ createdAt: { $lte: dateRange.end } },
|
|
985
|
+
],
|
|
986
|
+
},
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
$limit: 1,
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
$project: {
|
|
993
|
+
clienId: 1,
|
|
994
|
+
auditStatus: 1,
|
|
995
|
+
},
|
|
996
|
+
},
|
|
997
997
|
|
|
998
|
-
|
|
998
|
+
];
|
|
999
999
|
|
|
1000
1000
|
const userAsignAudit = [
|
|
1001
1001
|
{
|
|
@@ -1053,9 +1053,9 @@ export async function workSpace( req, res ) {
|
|
|
1053
1053
|
const userIncompleteFilesCount = await aggregateUserAudit(
|
|
1054
1054
|
userIncompleteFiles,
|
|
1055
1055
|
);
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1056
|
+
const userDraftedCount = await aggregateUserAudit(
|
|
1057
|
+
userDrafted,
|
|
1058
|
+
);
|
|
1059
1059
|
const userAsignAuditCount = await aggregateAssignAudit( userAsignAudit );
|
|
1060
1060
|
const completedStoresCount = await aggregateStoreAudit( completedStores );
|
|
1061
1061
|
const clientAssignedCount = await aggregateAssignAudit( clientAssign );
|
|
@@ -1103,7 +1103,7 @@ export async function workSpace( req, res ) {
|
|
|
1103
1103
|
queueName: merge[i].queueName,
|
|
1104
1104
|
isDraft: merge[i]?.isDrafted || false,
|
|
1105
1105
|
isEnable:
|
|
1106
|
-
|
|
1106
|
+
userDraftedCount.length > 0 && !merge[i].isDrafted && ( !merge[i]?.userInprogressCount || merge[i]?.userInprogressCount == 0 ) ? 0:
|
|
1107
1107
|
Number( pending ) > 0 ||
|
|
1108
1108
|
merge[i].isDrafted ||
|
|
1109
1109
|
( merge[i].userAsignedCount && merge[i].userAsignedCount > 0 ) ||
|