tango-app-api-audit 3.6.36 → 3.6.38
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
|
@@ -924,16 +924,24 @@ export async function save( req, res ) {
|
|
|
924
924
|
updatedAt: new Date(),
|
|
925
925
|
|
|
926
926
|
};
|
|
927
|
+
const reference1 ={
|
|
928
|
+
storeCode: inputUpdatedData?._source?.storeName,
|
|
929
|
+
OptomId: inputUpdatedData?._source?.optumId,
|
|
930
|
+
feedBackIssuedBy: req?.user?.email,
|
|
931
|
+
RMName: inputData.RMEmail,
|
|
932
|
+
clusterName: inputData.cluster,
|
|
933
|
+
};
|
|
927
934
|
await insertWithId( openSearch.eyeTestEmailAlert, id, record1 );
|
|
928
935
|
sendComplianceEmail( {
|
|
929
936
|
toEmail: inputUpdatedData?._source?.salesmanEmailId,
|
|
930
937
|
fromEmail: ses.eyeTestAlertEmail,
|
|
931
|
-
userName: '
|
|
938
|
+
userName: 'Optom',
|
|
932
939
|
storeName: inputUpdatedData?._source?.storeName,
|
|
933
940
|
startTime: `${inputUpdatedData?._source?.fileDate}T${inputUpdatedData?._source.testEndTime}`,
|
|
934
941
|
compliancePercentage: humanScore,
|
|
935
942
|
steps: steps,
|
|
936
943
|
videoUrl: `${url.physical}${inputUpdatedData?._source?.filePath}`,
|
|
944
|
+
ref: reference1,
|
|
937
945
|
} );
|
|
938
946
|
}
|
|
939
947
|
break;
|
|
@@ -955,16 +963,24 @@ export async function save( req, res ) {
|
|
|
955
963
|
updatedAt: new Date(),
|
|
956
964
|
|
|
957
965
|
};
|
|
966
|
+
const reference2 ={
|
|
967
|
+
storeCode: inputUpdatedData?._source?.storeName,
|
|
968
|
+
OptomId: inputUpdatedData?._source?.optumId,
|
|
969
|
+
feedBackIssuedBy: req?.user?.email,
|
|
970
|
+
RMName: inputData.RMEmail,
|
|
971
|
+
clusterName: inputData.cluster,
|
|
972
|
+
};
|
|
958
973
|
await insertWithId( openSearch.eyeTestEmailAlert, id, record2 );
|
|
959
974
|
sendComplianceEmail( {
|
|
960
975
|
toEmail: inputUpdatedData?._source?.salesmanEmailId,
|
|
961
976
|
fromEmail: ses.eyeTestAlertEmail,
|
|
962
|
-
userName: '
|
|
977
|
+
userName: 'Optom',
|
|
963
978
|
storeName: inputUpdatedData?._source?.storeName,
|
|
964
979
|
startTime: `${inputUpdatedData?._source?.fileDate}T${inputUpdatedData?._source.testEndTime}`,
|
|
965
980
|
compliancePercentage: humanScore,
|
|
966
981
|
steps: steps,
|
|
967
982
|
videoUrl: `${url.physical}${inputUpdatedData?._source?.filePath}`,
|
|
983
|
+
ref: reference2,
|
|
968
984
|
} );
|
|
969
985
|
};
|
|
970
986
|
break;
|
|
@@ -986,16 +1002,24 @@ export async function save( req, res ) {
|
|
|
986
1002
|
updatedAt: new Date(),
|
|
987
1003
|
|
|
988
1004
|
};
|
|
1005
|
+
const reference3 ={
|
|
1006
|
+
storeCode: inputUpdatedData?._source?.storeName,
|
|
1007
|
+
OptomId: inputUpdatedData?._source?.optumId,
|
|
1008
|
+
feedBackIssuedBy: req?.user?.email,
|
|
1009
|
+
RMName: inputData.RMEmail,
|
|
1010
|
+
clusterName: inputData.cluster,
|
|
1011
|
+
};
|
|
989
1012
|
await insertWithId( openSearch.eyeTestEmailAlert, id, record3 );
|
|
990
1013
|
sendComplianceEmail( {
|
|
991
1014
|
toEmail: inputUpdatedData?._source?.salesmanEmailId,
|
|
992
1015
|
fromEmail: ses.eyeTestAlertEmail,
|
|
993
|
-
userName: '
|
|
1016
|
+
userName: 'Optom',
|
|
994
1017
|
storeName: inputUpdatedData?._source?.storeName,
|
|
995
1018
|
startTime: `${inputUpdatedData?._source?.fileDate}T${inputUpdatedData?._source.testEndTime}`,
|
|
996
1019
|
compliancePercentage: humanScore,
|
|
997
1020
|
steps: steps,
|
|
998
1021
|
videoUrl: `${url.physical}${inputUpdatedData?._source?.filePath}`,
|
|
1022
|
+
ref: reference3,
|
|
999
1023
|
} );
|
|
1000
1024
|
}
|
|
1001
1025
|
break;
|
|
@@ -1017,16 +1041,24 @@ export async function save( req, res ) {
|
|
|
1017
1041
|
updatedAt: new Date(),
|
|
1018
1042
|
|
|
1019
1043
|
};
|
|
1044
|
+
const reference4 ={
|
|
1045
|
+
storeCode: inputUpdatedData?._source?.storeName,
|
|
1046
|
+
OptomId: inputUpdatedData?._source?.optumId,
|
|
1047
|
+
feedBackIssuedBy: req?.user?.email,
|
|
1048
|
+
RMName: inputData.RMEmail,
|
|
1049
|
+
clusterName: inputData.cluster,
|
|
1050
|
+
};
|
|
1020
1051
|
await insertWithId( openSearch.eyeTestEmailAlert, id, record4 );
|
|
1021
1052
|
sendComplianceEmail( {
|
|
1022
1053
|
toEmail: inputUpdatedData?._source?.salesmanEmailId,
|
|
1023
1054
|
fromEmail: ses.eyeTestAlertEmail,
|
|
1024
|
-
userName: '
|
|
1055
|
+
userName: 'Optom',
|
|
1025
1056
|
storeName: inputUpdatedData?._source?.storeName,
|
|
1026
1057
|
startTime: `${inputUpdatedData?._source?.fileDate}T${inputUpdatedData?._source.testEndTime}`,
|
|
1027
1058
|
compliancePercentage: humanScore,
|
|
1028
1059
|
steps: steps,
|
|
1029
1060
|
videoUrl: `${url.physical}${inputUpdatedData?._source?.filePath}`,
|
|
1061
|
+
ref: reference4,
|
|
1030
1062
|
} );
|
|
1031
1063
|
}
|
|
1032
1064
|
break;
|
|
@@ -1049,16 +1081,24 @@ export async function save( req, res ) {
|
|
|
1049
1081
|
updatedAt: new Date(),
|
|
1050
1082
|
|
|
1051
1083
|
};
|
|
1084
|
+
const reference5 ={
|
|
1085
|
+
storeCode: inputUpdatedData?._source?.storeName,
|
|
1086
|
+
OptomId: inputUpdatedData?._source?.optumId,
|
|
1087
|
+
feedBackIssuedBy: req?.user?.email,
|
|
1088
|
+
RMName: inputData.RMEmail,
|
|
1089
|
+
clusterName: inputData.cluster,
|
|
1090
|
+
};
|
|
1052
1091
|
await insertWithId( openSearch.eyeTestEmailAlert, id, record5 );
|
|
1053
1092
|
sendComplianceEmail( {
|
|
1054
1093
|
toEmail: inputUpdatedData?._source?.salesmanEmailId,
|
|
1055
1094
|
fromEmail: ses.eyeTestAlertEmail,
|
|
1056
|
-
userName: '
|
|
1095
|
+
userName: 'Optom',
|
|
1057
1096
|
storeName: inputUpdatedData?._source?.storeName,
|
|
1058
1097
|
startTime: `${inputUpdatedData?._source?.fileDate}T${inputUpdatedData?._source.testEndTime}`,
|
|
1059
1098
|
compliancePercentage: humanScore,
|
|
1060
1099
|
steps: steps,
|
|
1061
1100
|
videoUrl: `${url.physical}${inputUpdatedData?._source?.filePath}`,
|
|
1101
|
+
ref: reference5,
|
|
1062
1102
|
} );
|
|
1063
1103
|
}
|
|
1064
1104
|
break;
|
|
@@ -1079,16 +1119,24 @@ export async function save( req, res ) {
|
|
|
1079
1119
|
createdAt: new Date(),
|
|
1080
1120
|
updatedAt: new Date(),
|
|
1081
1121
|
};
|
|
1122
|
+
const reference6 ={
|
|
1123
|
+
storeCode: inputUpdatedData?._source?.storeName,
|
|
1124
|
+
OptomId: inputUpdatedData?._source?.optumId,
|
|
1125
|
+
feedBackIssuedBy: req?.user?.email,
|
|
1126
|
+
RMName: inputData.RMEmail,
|
|
1127
|
+
clusterName: inputData.cluster,
|
|
1128
|
+
};
|
|
1082
1129
|
await insertWithId( openSearch.eyeTestEmailAlert, id, record6 );
|
|
1083
1130
|
sendComplianceEmail( {
|
|
1084
1131
|
toEmail: inputUpdatedData?._source?.salesmanEmailId,
|
|
1085
1132
|
fromEmail: ses.eyeTestAlertEmail,
|
|
1086
|
-
userName: '
|
|
1133
|
+
userName: 'Optom',
|
|
1087
1134
|
storeName: inputUpdatedData?._source?.storeName,
|
|
1088
1135
|
startTime: `${inputUpdatedData?._source?.fileDate}T${inputUpdatedData?._source.testEndTime}`,
|
|
1089
1136
|
compliancePercentage: humanScore,
|
|
1090
1137
|
steps: steps,
|
|
1091
1138
|
videoUrl: `${url.physical}${inputUpdatedData?._source?.filePath}`,
|
|
1139
|
+
ref: reference6,
|
|
1092
1140
|
} );
|
|
1093
1141
|
}
|
|
1094
1142
|
break;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { isAuditDocumentExist, isAuditInputFolderExist, isAuditUser, isExistsQueue, isFeatureRunning, validateUserAudit
|
|
2
|
+
import { isAuditDocumentExist, isAuditInputFolderExist, isAuditUser, isExistsQueue, isFeatureRunning, validateUserAudit } from '../validation/audit.validation.js';
|
|
3
3
|
import { accessVerification, isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
4
4
|
import { auditImages, auditStoreList, auditUserList, clientMetrics, clients, getAuditFile, getDraftedData, overAllAuditSummary, overViewCard, overviewTable, pendingSummaryTable, reTrigger, save, saveDraft, storeMetrics, summarySplit, totalNotAssignedCount, userAuditHistory, userMetrics, workSpace, getUserAuditCount, getUserAuditCountMTD, auditViewLogs, getUserCredit, rePushAuditStores } from '../controllers/audit.controllers.js';
|
|
5
5
|
import { auditStoreValid, clientMetricsValid, clientValid, getDraftedDataValid, getFileValid, overAllAuditSummaryValid, overViewCardValid, pendingSummaryTableValid, reTriggerValid, saveDraftValid, saveValid, storeMetricsValid, summarySplitValid, userAuditHistoryValid, userMetricsValid, workSpaceValid, auditImageValid, overviewTableValid, auditViewLogValid, rePushAuditStoresValid } from '../dtos/audit.dtos.js';
|
|
@@ -73,6 +73,7 @@ export async function sendComplianceEmail( {
|
|
|
73
73
|
compliancePercentage,
|
|
74
74
|
steps,
|
|
75
75
|
videoUrl, // S3 cdn video URL
|
|
76
|
+
ref,
|
|
76
77
|
} ) {
|
|
77
78
|
// Initialize AWS SES client
|
|
78
79
|
const sesClient = new SESClient( {
|
|
@@ -109,6 +110,9 @@ export async function sendComplianceEmail( {
|
|
|
109
110
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
110
111
|
<title>Non Compliance Report</title>
|
|
111
112
|
<style>
|
|
113
|
+
thead {
|
|
114
|
+
background-color: #EAF8FF;
|
|
115
|
+
}
|
|
112
116
|
body { font-family: 'Inter', sans-serif; margin: 0; padding: 0; background: #f9fafb; color: #121a26; }
|
|
113
117
|
.container { max-width: 700px; margin: 24px auto; background: #fff; padding: 24px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
|
|
114
118
|
.header { display: flex; align-items: center; gap: 10px; }
|
|
@@ -149,7 +153,7 @@ export async function sendComplianceEmail( {
|
|
|
149
153
|
font-weight: 600;
|
|
150
154
|
}
|
|
151
155
|
.footer { margin-top: 24px; color: #555; font-size: 16px; text-align: left; }
|
|
152
|
-
.attachment { margin-top: 24px; color: #555; font-size:
|
|
156
|
+
.attachment { margin-top: 24px; color: #555; font-size: 16px; text-align: left; }
|
|
153
157
|
.copy-rights { margin-top: 24px; color: #555; font-size: 12px; text-align: left; }
|
|
154
158
|
</style>
|
|
155
159
|
</head>
|
|
@@ -164,15 +168,45 @@ export async function sendComplianceEmail( {
|
|
|
164
168
|
|
|
165
169
|
<p class="subtitle">
|
|
166
170
|
Dear ${userName},<br><br>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
We’d like to share some feedback regarding certain areas where expectations haven’t been fully met. This is simply intended as a
|
|
172
|
+
constructive step forward to help you gain clarity and to ensure you feel supported as you grow in your role.<br><br>
|
|
173
|
+
|
|
174
|
+
We value the effort you’ve put in, and this feedback is part of our commitment to help every team member succeed. We will be discussing
|
|
175
|
+
this in person to clearly outline the next steps and ensure you are equipped to succeed in your role.<br><br>
|
|
176
|
+
|
|
177
|
+
Looking forward to working together on this, Below is a copy of your submitted responses for your reference:
|
|
170
178
|
</p>
|
|
171
179
|
|
|
180
|
+
<table class="table">
|
|
181
|
+
<tbody>
|
|
182
|
+
<tr>
|
|
183
|
+
<td>Store Code</td>
|
|
184
|
+
<td>${ref.storeCode ?? '--'}</td>
|
|
185
|
+
</tr>
|
|
186
|
+
<tr>
|
|
187
|
+
<td>Optom ID</td>
|
|
188
|
+
<td>${ref.OptomId ?? '--'}</td>
|
|
189
|
+
</tr>
|
|
190
|
+
<tr>
|
|
191
|
+
<td>Feedback Issued By</td>
|
|
192
|
+
<td>${ref.feedBackIssuedBy ?? '--'}</td>
|
|
193
|
+
</tr>
|
|
194
|
+
<tr>
|
|
195
|
+
<td>RM Name</td>
|
|
196
|
+
<td>${ref.RMName ?? '--'}</td>
|
|
197
|
+
</tr>
|
|
198
|
+
<tr>
|
|
199
|
+
<td>Cluster Name</td>
|
|
200
|
+
<td>${ref.clusterName ?? '--'}</td>
|
|
201
|
+
</tr>
|
|
202
|
+
</tbody>
|
|
203
|
+
</table>
|
|
204
|
+
|
|
205
|
+
|
|
172
206
|
<table class="table">
|
|
173
207
|
<thead>
|
|
174
208
|
<tr>
|
|
175
|
-
<th>
|
|
209
|
+
<th>Steps Violated</th>
|
|
176
210
|
<th>Comments</th>
|
|
177
211
|
</tr>
|
|
178
212
|
</thead>
|
|
@@ -183,7 +217,7 @@ export async function sendComplianceEmail( {
|
|
|
183
217
|
|
|
184
218
|
<div class="compliance-box">Compliance Percentage: ${compliancePercentage}%</div>
|
|
185
219
|
|
|
186
|
-
<p class="attachment">
|
|
220
|
+
<p class="attachment">Here’s the Eye test compliance video for your review</p>
|
|
187
221
|
<!-- Video Embed (only if provided) -->
|
|
188
222
|
${
|
|
189
223
|
videoUrl ?
|