tango-app-api-trax 3.8.26 → 3.8.27-nike
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 +2 -2
- package/src/controllers/download.controller.js +19 -19
- package/src/controllers/gallery.controller.js +92 -28
- package/src/controllers/handlebar-helper.js +1 -0
- package/src/controllers/internalTrax.controller.js +406 -165
- package/src/controllers/mobileTrax.controller.js +782 -170
- package/src/controllers/teaxFlag.controller.js +5 -5
- package/src/controllers/trax.controller.js +6 -2
- package/src/hbs/recurringFlag.hbs +2 -2
- package/src/hbs/template.hbs +6 -2
- package/src/hbs/visit-checklist.hbs +52 -14
- package/src/routes/mobileTrax.routes.js +1 -0
- package/src/utils/visitChecklistPdf.utils.js +1 -1
|
@@ -608,7 +608,7 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
608
608
|
{
|
|
609
609
|
client_id: clientId,
|
|
610
610
|
publish: true,
|
|
611
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] },
|
|
611
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'staffgrouping', 'boxalert', 'employeeCount', 'storehygienemonitoring' ] },
|
|
612
612
|
},
|
|
613
613
|
{ checkListType: 1 },
|
|
614
614
|
);
|
|
@@ -2743,7 +2743,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
2743
2743
|
$or: [
|
|
2744
2744
|
{ questionFlag: { $gte: 1 } },
|
|
2745
2745
|
{ timeFlag: { $gte: 1 } },
|
|
2746
|
-
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] } },
|
|
2746
|
+
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'staffgrouping', 'boxalert', 'employeeCount', 'storehygienemonitoring' ] } },
|
|
2747
2747
|
{
|
|
2748
2748
|
runAIQuestionCount: { $gte: 1 },
|
|
2749
2749
|
},
|
|
@@ -2945,7 +2945,7 @@ export const flagComparisonCardsV2 = async ( req, res ) => {
|
|
|
2945
2945
|
{
|
|
2946
2946
|
client_id: requestData.clientId,
|
|
2947
2947
|
publish: true,
|
|
2948
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] },
|
|
2948
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'staffgrouping', 'boxalert', 'employeeCount', 'storehygienemonitoring' ] },
|
|
2949
2949
|
},
|
|
2950
2950
|
{ checkListType: 1 },
|
|
2951
2951
|
);
|
|
@@ -3047,7 +3047,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3047
3047
|
}
|
|
3048
3048
|
|
|
3049
3049
|
if ( requestData?.filter === 'all' ) {
|
|
3050
|
-
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] } } ] } );
|
|
3050
|
+
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'staffgrouping', 'boxalert', 'employeeCount', 'storehygienemonitoring' ] } } ] } );
|
|
3051
3051
|
} else if ( requestData?.filter === 'question' ) {
|
|
3052
3052
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3053
3053
|
findAndQuery.push( { questionFlag: { $gte: 1 } } );
|
|
@@ -3055,7 +3055,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3055
3055
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3056
3056
|
findAndQuery.push( { timeFlag: { $gte: 1 } } );
|
|
3057
3057
|
} else if ( requestData?.filter === 'detection' ) {
|
|
3058
|
-
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] } } );
|
|
3058
|
+
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'staffgrouping', 'boxalert', 'employeeCount', 'storehygienemonitoring' ] } } );
|
|
3059
3059
|
} else if ( requestData?.filter === 'runAI' ) {
|
|
3060
3060
|
if ( req.body.runAIChecklistName ) {
|
|
3061
3061
|
findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
|
|
@@ -1729,6 +1729,7 @@ export const updateConfigure = async ( req, res ) => {
|
|
|
1729
1729
|
owner: inputBody?.checkListDetails?.owner || [],
|
|
1730
1730
|
restrictAttendance: inputBody?.checkListDetails?.restrictAttendance || false,
|
|
1731
1731
|
enableNewDeployedStore: inputBody?.checkListDetails?.enableNewDeployedStore || false,
|
|
1732
|
+
redoValidity: inputBody?.checkListDetails?.redoValidity || 7,
|
|
1732
1733
|
};
|
|
1733
1734
|
|
|
1734
1735
|
if ( inputBody?.checkListDetails?.approver.length ) {
|
|
@@ -3907,6 +3908,8 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
|
|
|
3907
3908
|
}
|
|
3908
3909
|
}
|
|
3909
3910
|
getsubmitDetails[0].questionAnswers = sectionList;
|
|
3911
|
+
getsubmitDetails[0].scheduleEndTime = getCLconfig.scheduleEndTime;
|
|
3912
|
+
getsubmitDetails[0].scheduleEndTime_iso = endTimeIso.format();
|
|
3910
3913
|
if ( modifiedCount ) {
|
|
3911
3914
|
getsubmitDetails[0].checklistStatus = 'inprogress';
|
|
3912
3915
|
getsubmitDetails[0].date_string = dayjs( currentdate ).format( 'YYYY-MM-DD' );
|
|
@@ -4030,6 +4033,7 @@ async function insertPCBulkV4( getCLconfig, checklistId, currentdate, updatedche
|
|
|
4030
4033
|
}, { userId: 1, store_id: 1 } );
|
|
4031
4034
|
|
|
4032
4035
|
if ( inprogressData.length ) {
|
|
4036
|
+
await processedchecklist.updateMany( { _id: { $in: inprogressData.map( ( ele ) => new ObjectId( ele._id ) ) } }, { scheduleEndTime: getCLconfig.scheduleEndTime, scheduleEndTime_iso: endTimeIso.format() } );
|
|
4033
4037
|
inprogressData.forEach( ( item ) => {
|
|
4034
4038
|
let checkData = assignUserList.find( ( ele ) => ele.userId.toString() == item.userId.toString() && ele.store_id == item.store_id );
|
|
4035
4039
|
if ( !checkData ) {
|
|
@@ -4127,7 +4131,7 @@ async function updateOpenSearch( user, data ) {
|
|
|
4127
4131
|
export const aiChecklist = async ( req, res ) => {
|
|
4128
4132
|
try {
|
|
4129
4133
|
let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
|
|
4130
|
-
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', '
|
|
4134
|
+
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'staffgrouping', 'boxalert', 'employeeCount' ];
|
|
4131
4135
|
let checklistDetails = [];
|
|
4132
4136
|
let publishList = [];
|
|
4133
4137
|
let unpublishList = [];
|
|
@@ -4140,7 +4144,7 @@ export const aiChecklist = async ( req, res ) => {
|
|
|
4140
4144
|
checklistDetails = [ ...publishList, ...unpublishList ];
|
|
4141
4145
|
|
|
4142
4146
|
checklistDetails.forEach( ( item ) => {
|
|
4143
|
-
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( item.checkListType ) ) {
|
|
4147
|
+
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'staffgrouping', 'boxalert', 'employeeCount' ].includes( item.checkListType ) ) {
|
|
4144
4148
|
item.storeCount = storeDetails;
|
|
4145
4149
|
}
|
|
4146
4150
|
} );
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
<table class="rfTable">
|
|
163
163
|
<thead>
|
|
164
164
|
<tr>
|
|
165
|
-
{{#if data.isMultiStore}}<th>{{data.subjectLabel}} Name</th>{{/if}}
|
|
165
|
+
{{#if data.isMultiStore}}{{#unless data.isUserCoverage}}<th>{{data.subjectLabel}} Name</th>{{/unless}}{{/if}}
|
|
166
166
|
{{#unless data.isMultiStoreSingleChecklist}}<th>Checklist Name</th>{{/unless}}
|
|
167
167
|
<th>Last Submitted By</th>
|
|
168
168
|
<th>Last Submission Date</th>
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
<tbody>
|
|
173
173
|
{{#each data.rows}}
|
|
174
174
|
<tr>
|
|
175
|
-
{{#if ../data.isMultiStore}}<td>{{this.subjectName}}</td>{{/if}}
|
|
175
|
+
{{#if ../data.isMultiStore}}{{#unless ../data.isUserCoverage}}<td>{{this.subjectName}}</td>{{/unless}}{{/if}}
|
|
176
176
|
{{#unless ../data.isMultiStoreSingleChecklist}}<td>{{this.checklistName}}</td>{{/unless}}
|
|
177
177
|
<td>{{this.lastSubmittedBy}}</td>
|
|
178
178
|
<td>{{this.lastSubmissionDate}}</td>
|
package/src/hbs/template.hbs
CHANGED
|
@@ -136,6 +136,10 @@
|
|
|
136
136
|
.headertitle.submittedText {
|
|
137
137
|
width:116px !important;
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
.flagged {
|
|
141
|
+
color:red
|
|
142
|
+
}
|
|
139
143
|
</style>
|
|
140
144
|
</head>
|
|
141
145
|
|
|
@@ -224,7 +228,7 @@
|
|
|
224
228
|
<div class="px-4 answer">
|
|
225
229
|
{{#if (includes ../../../data.validateType ../answerType)}}
|
|
226
230
|
{{#eq sopFlag true }}
|
|
227
|
-
<span id="agreed
|
|
231
|
+
<span id="agreed flagged">{{answer}}</span><br>
|
|
228
232
|
{{/eq}}
|
|
229
233
|
{{#eq sopFlag false }}
|
|
230
234
|
<span id="agreed">{{answer}}</span><br>
|
|
@@ -255,7 +259,7 @@
|
|
|
255
259
|
<a href="{{validationAnswer}}" target="_blank" style="text-decoration: underline;color:#0085D2" id="agreed">{{validationAnswer}}</a><br>
|
|
256
260
|
{{/eq}}
|
|
257
261
|
{{#eq validationType 'Descriptive Answer'}}
|
|
258
|
-
{{validationAnswer}}
|
|
262
|
+
<span class="{{#if this.sopFlag}}flagged{{/if}}">Validation Answer: {{validationAnswer}}</span>
|
|
259
263
|
{{/eq}}
|
|
260
264
|
{{#eq validationType 'Capture Multiple Image with description'}}
|
|
261
265
|
<div class="Reference"><span>Uploaded Image</span><br>
|
|
@@ -215,6 +215,17 @@
|
|
|
215
215
|
</div>
|
|
216
216
|
{{/if}}
|
|
217
217
|
{{/eq}}
|
|
218
|
+
{{#eq this.validationDisplayType 'text'}}
|
|
219
|
+
{{#if this.validationAnswer}}
|
|
220
|
+
<div class="q-answer-text {{#if this.sopFlag}}flagged{{/if}}">validation Answer: {{this.validationAnswer}}</div>
|
|
221
|
+
{{/if}}
|
|
222
|
+
{{/eq}}
|
|
223
|
+
{{#eq this.validationDisplayType 'video'}}
|
|
224
|
+
{{#if this.validationAnswer}}
|
|
225
|
+
<div class="q-answer-caption">Validation Video</div>
|
|
226
|
+
<a class="q-answer-link" href="{{this.validationAnswer}}" target="_blank">{{this.validationAnswer}}</a>
|
|
227
|
+
{{/if}}
|
|
228
|
+
{{/eq}}
|
|
218
229
|
|
|
219
230
|
<table style="width:100%;margin-top:8px;table-layout:fixed"><tr>
|
|
220
231
|
<td style="width:50%;vertical-align:top;padding-right:8px">
|
|
@@ -233,16 +244,54 @@
|
|
|
233
244
|
<div class="q-answer-caption">Reference Image</div>
|
|
234
245
|
<img src="{{this.referenceImage}}" alt="Reference Image" />
|
|
235
246
|
</div>
|
|
247
|
+
{{else}}
|
|
248
|
+
{{#eq this.answerType 'image'}}
|
|
249
|
+
{{#if this.answer}}
|
|
250
|
+
<div class="q-answer-media">
|
|
251
|
+
<div class="q-answer-caption">Uploaded Image</div>
|
|
252
|
+
<img src="{{this.answer}}" alt="Uploaded Image" />
|
|
253
|
+
</div>
|
|
254
|
+
{{/if}}
|
|
255
|
+
{{/eq}}
|
|
236
256
|
{{/if}}
|
|
237
257
|
{{/if}}
|
|
258
|
+
{{else}}
|
|
259
|
+
{{#eq this.answerType 'image'}}
|
|
260
|
+
{{#if this.answer}}
|
|
261
|
+
<div class="q-answer-media">
|
|
262
|
+
<div class="q-answer-caption">Uploaded Image</div>
|
|
263
|
+
<img src="{{this.answer}}" alt="Uploaded Image" />
|
|
264
|
+
</div>
|
|
265
|
+
{{/if}}
|
|
266
|
+
{{/eq}}
|
|
238
267
|
{{/neq}}
|
|
268
|
+
{{else}}
|
|
269
|
+
{{#eq this.answerType 'image'}}
|
|
270
|
+
{{#if this.answer}}
|
|
271
|
+
<div class="q-answer-media">
|
|
272
|
+
<div class="q-answer-caption">Uploaded Image</div>
|
|
273
|
+
<img src="{{this.answer}}" alt="Uploaded Image" />
|
|
274
|
+
</div>
|
|
275
|
+
{{/if}}
|
|
276
|
+
{{/eq}}
|
|
239
277
|
{{/neq}}
|
|
240
278
|
</td>
|
|
241
279
|
<td style="width:50%;vertical-align:top;padding-left:8px">
|
|
242
280
|
{{#eq this.answerType 'image'}}
|
|
243
281
|
{{#if this.answer}}
|
|
244
|
-
|
|
245
|
-
|
|
282
|
+
{{#neq ../answerType 'image/video'}}
|
|
283
|
+
{{#neq ../answerType 'multipleImage'}}
|
|
284
|
+
{{#if this.multiReferenceImage.length}}
|
|
285
|
+
<div class="q-answer-caption">Uploaded Image</div>
|
|
286
|
+
<img src="{{this.answer}}" alt="Uploaded Image" />
|
|
287
|
+
{{else}}
|
|
288
|
+
{{#if this.referenceImage}}
|
|
289
|
+
<div class="q-answer-caption">Uploaded Image</div>
|
|
290
|
+
<img src="{{this.answer}}" alt="Uploaded Image" />
|
|
291
|
+
{{/if}}
|
|
292
|
+
{{/if}}
|
|
293
|
+
{{/neq}}
|
|
294
|
+
{{/neq}}
|
|
246
295
|
{{/if}}
|
|
247
296
|
{{/eq}}
|
|
248
297
|
{{#if this.validation}}
|
|
@@ -251,18 +300,7 @@
|
|
|
251
300
|
<div class="q-answer-caption">Validation Image</div>
|
|
252
301
|
<img src="{{this.validationAnswer}}" alt="Validation Image" />
|
|
253
302
|
{{/if}}
|
|
254
|
-
{{/eq}}
|
|
255
|
-
{{#eq this.validationDisplayType 'video'}}
|
|
256
|
-
{{#if this.validationAnswer}}
|
|
257
|
-
<div class="q-answer-caption">Validation Video</div>
|
|
258
|
-
<a class="q-answer-link" href="{{this.validationAnswer}}" target="_blank">{{this.validationAnswer}}</a>
|
|
259
|
-
{{/if}}
|
|
260
|
-
{{/eq}}
|
|
261
|
-
{{#eq this.validationDisplayType 'text'}}
|
|
262
|
-
{{#if this.validationAnswer}}
|
|
263
|
-
<div class="q-answer-text">{{this.validationAnswer}}</div>
|
|
264
|
-
{{/if}}
|
|
265
|
-
{{/eq}}
|
|
303
|
+
{{/eq}}
|
|
266
304
|
{{#eq this.validationDisplayType 'multiImage'}}
|
|
267
305
|
{{#if this.validationImage.length}}
|
|
268
306
|
<div class="q-answer-caption">Validation Image</div>
|
|
@@ -12,6 +12,7 @@ mobileRouter
|
|
|
12
12
|
.post( '/startTask', isAllowedSessionHandler, validate( startValidation ), mobileController.startTask )
|
|
13
13
|
.post( '/submitCheckList', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidator, mobileController.sopMobilechecklistMultiSectionFormatter, mobileController.submitChecklist )
|
|
14
14
|
.post( '/submitCheckListv5', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidatorv1, mobileController.sopMobilechecklistMultiSectionFormatterv1, mobileController.submitChecklist )
|
|
15
|
+
.post( '/submitCheckListv6', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidatorv1, mobileController.sopMobilechecklistMultiSectionFormatterv2, mobileController.submitChecklist )
|
|
15
16
|
.post( '/submitTask', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobileTaskQuestionValidator, mobileController.sopMobileTaskMultiSectionFormatter, mobileController.submitTask )
|
|
16
17
|
.post( '/submiteyeTestTask', isAllowedSessionHandler, mobileController.submiteyeTestTask )
|
|
17
18
|
.get( '/dashboard', isAllowedSessionHandler, validate( dashboardValidation ), mobileController.dashboard )
|
|
@@ -444,7 +444,7 @@ export function buildVisitChecklistTemplateDataFromProcessed( processedDoc, bran
|
|
|
444
444
|
|
|
445
445
|
const checklistName = doc.checkListName || 'Visit Checklist';
|
|
446
446
|
|
|
447
|
-
const refFromId = doc._id && String( doc._id ).length > 8 ? String( doc._id ).slice( -8 ).toUpperCase() : ( doc._id ? String( doc._id ) : '--' );
|
|
447
|
+
// const refFromId = doc._id && String( doc._id ).length > 8 ? String( doc._id ).slice( -8 ).toUpperCase() : ( doc._id ? String( doc._id ) : '--' );
|
|
448
448
|
|
|
449
449
|
const { titleLine1, titleLine2 } = splitCoverTitle( checklistName );
|
|
450
450
|
|