tango-app-api-trax 3.3.1-beta-49 → 3.3.1-beta-50
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.3.1-beta-
|
|
3
|
+
"version": "3.3.1-beta-50",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
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.61",
|
|
30
30
|
"tango-app-api-middleware": "^3.1.55",
|
|
31
31
|
"url": "^0.11.4",
|
|
32
32
|
"winston": "^3.13.1",
|
|
@@ -227,6 +227,9 @@ export async function startChecklist( req, res ) {
|
|
|
227
227
|
checkListName: getBeforeChecklist[0].checkListName,
|
|
228
228
|
type: getBeforeChecklist[0].checkListType,
|
|
229
229
|
client_id: req.user.clientId,
|
|
230
|
+
userEmail: getBeforeChecklist[0].userEmail || '',
|
|
231
|
+
userName: getBeforeChecklist[0].userName || '',
|
|
232
|
+
coverage: getBeforeChecklist[0].coverage || '',
|
|
230
233
|
};
|
|
231
234
|
await checklistLogs.create( logInsertData );
|
|
232
235
|
let getchecklist = getupdatedchecklist;
|
|
@@ -1825,8 +1828,11 @@ export async function submitChecklist( req, res ) {
|
|
|
1825
1828
|
type: getchecklist[0].checkListType,
|
|
1826
1829
|
client_id: req.user.clientId,
|
|
1827
1830
|
redoStatus: requestData?.redoStatus ? true : false,
|
|
1831
|
+
userEmail: getchecklist[0].userEmail || '',
|
|
1832
|
+
userName: getchecklist[0].userName | '',
|
|
1833
|
+
coverage: getchecklist[0].coverage || '',
|
|
1828
1834
|
};
|
|
1829
|
-
console.log( 'logInsertData=>', logInsertData );
|
|
1835
|
+
// console.log( 'logInsertData=>', logInsertData );
|
|
1830
1836
|
await checklistLogs.create( logInsertData );
|
|
1831
1837
|
// let time = dayjs().format( 'HH:mm:ss' );
|
|
1832
1838
|
// let [ hours, minutes ] = time.split( ':' ).map( Number );
|
|
@@ -2062,6 +2068,9 @@ async function updateOpenSearch( user, data ) {
|
|
|
2062
2068
|
checkListName: getchecklist[0].checkListName,
|
|
2063
2069
|
type: getchecklist[0].checkListType,
|
|
2064
2070
|
client_id: user.clientId,
|
|
2071
|
+
userEmail: getchecklist[0].userEmail || '',
|
|
2072
|
+
userName: getchecklist[0].userName || '',
|
|
2073
|
+
coverage: getchecklist[0].coverage || '',
|
|
2065
2074
|
};
|
|
2066
2075
|
await checklistLogs.create( logInsertData );
|
|
2067
2076
|
const requestOptions = {
|
|
@@ -2083,6 +2092,9 @@ async function updateOpenSearch( user, data ) {
|
|
|
2083
2092
|
checkListName: getchecklist[0].checkListName,
|
|
2084
2093
|
type: getchecklist[0].checkListType,
|
|
2085
2094
|
client_id: user.clientId,
|
|
2095
|
+
userEmail: getchecklist[0].userEmail || '',
|
|
2096
|
+
userName: getchecklist[0].userName || '',
|
|
2097
|
+
coverage: getchecklist[0].coverage || '',
|
|
2086
2098
|
};
|
|
2087
2099
|
await checklistLogs.create( logInsertData );
|
|
2088
2100
|
}
|
|
@@ -2111,6 +2123,9 @@ async function updateOpenSearchTask( user, data ) {
|
|
|
2111
2123
|
checkListName: getchecklist[0].checkListName,
|
|
2112
2124
|
type: getchecklist[0].checkListType,
|
|
2113
2125
|
client_id: user.clientId,
|
|
2126
|
+
userEmail: getchecklist[0].userEmail || '',
|
|
2127
|
+
userName: getchecklist[0].userName || '',
|
|
2128
|
+
coverage: getchecklist[0].coverage || '',
|
|
2114
2129
|
};
|
|
2115
2130
|
await checklistLogs.create( logInsertData );
|
|
2116
2131
|
const requestOptions = {
|
|
@@ -2132,6 +2147,9 @@ async function updateOpenSearchTask( user, data ) {
|
|
|
2132
2147
|
checkListName: getchecklist[0].checkListName,
|
|
2133
2148
|
type: getchecklist[0].checkListType,
|
|
2134
2149
|
client_id: user.clientId,
|
|
2150
|
+
userEmail: getchecklist[0].userEmail || '',
|
|
2151
|
+
userName: getchecklist[0].userName || '',
|
|
2152
|
+
coverage: getchecklist[0].coverage || '',
|
|
2135
2153
|
};
|
|
2136
2154
|
await checklistLogs.create( logInsertData );
|
|
2137
2155
|
}
|
|
@@ -402,11 +402,19 @@ export const getConfigDetails = async ( req, res ) => {
|
|
|
402
402
|
let singleAssign;
|
|
403
403
|
let groupAssign;
|
|
404
404
|
if ( storechecklistdetails.coverage == 'store' ) {
|
|
405
|
-
singleAssign = assignList.filter( ( item ) => typeof item?.store_id != 'undefined' && item?.store_id != '' ).map( ( item ) =>
|
|
406
|
-
|
|
405
|
+
singleAssign = assignList.filter( ( item ) => typeof item?.store_id != 'undefined' && item?.store_id != '' ).map( ( item ) => {
|
|
406
|
+
return { id: item.assignId, type: 'store' };
|
|
407
|
+
} );
|
|
408
|
+
groupAssign = assignList.filter( ( item ) => typeof item?.clusterName != 'undefined' && item?.clusterName != '' ).map( ( item ) => {
|
|
409
|
+
return { id: item.assignId, type: 'cluster' };
|
|
410
|
+
} );
|
|
407
411
|
} else {
|
|
408
|
-
singleAssign = assignList.filter( ( item ) => typeof item?.userEmail != 'undefined' && item?.userEmail !='' ).map( ( item ) =>
|
|
409
|
-
|
|
412
|
+
singleAssign = assignList.filter( ( item ) => typeof item?.userEmail != 'undefined' && item?.userEmail !='' ).map( ( item ) => {
|
|
413
|
+
return { id: item.assignId, type: 'user' };
|
|
414
|
+
} );
|
|
415
|
+
groupAssign = assignList.filter( ( item ) => typeof item?.teamName != 'undefined' && item?.teamName != '' ).map( ( item ) => {
|
|
416
|
+
return { id: item.assignId, type: 'teams' };
|
|
417
|
+
} );
|
|
410
418
|
}
|
|
411
419
|
result.checkListDetails = { ...result.checkListDetails, ...{ sections: sectionList }, singleAssign, groupAssign };
|
|
412
420
|
}
|
|
@@ -2096,7 +2104,9 @@ export async function assignChecklistUser( req, res ) {
|
|
|
2096
2104
|
}
|
|
2097
2105
|
}
|
|
2098
2106
|
} ) );
|
|
2099
|
-
return res.sendSuccess( { idList: [ ...new Set( assignData.map( ( item ) =>
|
|
2107
|
+
return res.sendSuccess( { idList: [ ...new Set( assignData.map( ( item ) => {
|
|
2108
|
+
return { id: item?.assignId?.toString(), type: inputBody.coverage == 'store' ? typeof item.clusterName == 'undefined' ? 'store' : 'cluster' : typeof item.teamsName == 'undefined' ? 'user' : 'teams' };
|
|
2109
|
+
} ) ) ], assignData } );
|
|
2100
2110
|
} catch ( e ) {
|
|
2101
2111
|
logger.error( { functionName: 'assignUser', error: e } );
|
|
2102
2112
|
return res.sendError( e, 500 );
|