tango-app-api-trax 3.8.4 → 3.8.6
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
|
@@ -122,6 +122,19 @@ export async function storeOpencloselist( req, res ) {
|
|
|
122
122
|
|
|
123
123
|
export async function getcustomerunattendedlist( req, res ) {
|
|
124
124
|
try {
|
|
125
|
+
let config = [];
|
|
126
|
+
if ( req.body.ChecklistType == 'storeopenandclose' ) {
|
|
127
|
+
config = await processedchecklistconfigService.find( { date_string: { $gte: req.body.fromDate, $lte: req.body.toDate }, checkListType: req.body.ChecklistType }, { date_string: 1, aiConfig: 1 } );
|
|
128
|
+
req.body.liveDate = [];
|
|
129
|
+
req.body.eodDate = [];
|
|
130
|
+
config.forEach( ( data ) => {
|
|
131
|
+
if ( data?.aiConfig?.advancedConfig?.dataProcessing == 'live' ) {
|
|
132
|
+
req.body.liveDate.push( data.date_string );
|
|
133
|
+
} else {
|
|
134
|
+
req.body.eodDate.push( data.date_string );
|
|
135
|
+
}
|
|
136
|
+
} );
|
|
137
|
+
}
|
|
125
138
|
let url = JSON.parse( process.env.LAMBDAURL );
|
|
126
139
|
let resultData = await LamdaServiceCall( url.customerUnattended, req.body );
|
|
127
140
|
if ( resultData ) {
|
|
@@ -4054,13 +4054,13 @@ export async function sendAIEmailList( req, res ) {
|
|
|
4054
4054
|
}
|
|
4055
4055
|
}
|
|
4056
4056
|
if ( getChecklistDetails?.aiConfig?.alertConfig?.alertSendTo?.email?.type.includes( 'teams' ) ) {
|
|
4057
|
-
let teamDetails = await teamsServices.findteams( { teamName: { $in: getChecklistDetails?.aiConfig?.alertConfig?.alertSendTo?.email?.teams
|
|
4057
|
+
let teamDetails = await teamsServices.findteams( { teamName: { $in: getChecklistDetails?.aiConfig?.alertConfig?.alertSendTo?.email?.teams?.map( ( ele ) => ele.name ) } } );
|
|
4058
4058
|
if ( teamDetails.length ) {
|
|
4059
|
-
userList.push( teamDetails.flatMap( ( team ) => team.users.map( ( user ) => user.email ) ) );
|
|
4059
|
+
userList.push( ...teamDetails.flatMap( ( team ) => team.users.map( ( user ) => user.email ) ) );
|
|
4060
4060
|
}
|
|
4061
4061
|
}
|
|
4062
4062
|
if ( getChecklistDetails?.aiConfig?.alertConfig?.alertSendTo?.email?.type.includes( 'users' ) ) {
|
|
4063
|
-
userList.push( getChecklistDetails?.aiConfig?.alertConfig?.alertSendTo?.email.users.map( ( team ) => team.value ) );
|
|
4063
|
+
userList.push( ...getChecklistDetails?.aiConfig?.alertConfig?.alertSendTo?.email.users.map( ( team ) => team.value ) );
|
|
4064
4064
|
}
|
|
4065
4065
|
|
|
4066
4066
|
|
|
@@ -4140,12 +4140,12 @@ export async function sendAIEmailList( req, res ) {
|
|
|
4140
4140
|
spocList.forEach( ( ele ) => {
|
|
4141
4141
|
let findIndex = result.findIndex( ( element ) => element.email == ele.email );
|
|
4142
4142
|
if ( findIndex != -1 ) {
|
|
4143
|
-
result[findIndex].stores
|
|
4143
|
+
result[findIndex].stores.push( ele.store );
|
|
4144
4144
|
} else {
|
|
4145
4145
|
result.push( {
|
|
4146
4146
|
id: getChecklistDetails?._id,
|
|
4147
4147
|
email: ele.email,
|
|
4148
|
-
stores: ele.store,
|
|
4148
|
+
stores: [ ele.store ],
|
|
4149
4149
|
role: 'admin',
|
|
4150
4150
|
} );
|
|
4151
4151
|
}
|