tango-app-api-trax 3.8.22-nike → 3.8.23-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-trax",
3
- "version": "3.8.22-nike",
3
+ "version": "3.8.23-nike",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -543,7 +543,7 @@ export async function redoChecklist( req, res ) {
543
543
  let updateData = {
544
544
  checklistStatus: checklistDetails.checklistStatus != 'submit' ? checklistDetails.checklistStatus : 'open',
545
545
  redoStatus: true,
546
- reinitiateStatus: true,
546
+ ...( !checklistConfigDetails?.redoValidity && { reinitiateStatus: true } ),
547
547
  questionAnswers: question,
548
548
  ...( checklistDetails.checklistStatus != 'submit' && checklistDetails.redoStatus ) ? { redoEdit: true } : {},
549
549
  ...( ( checklistDetails.redoEdit === undefined && checklistConfigDetails.redoValidity ) && { scheduleEndTime_iso: dayjs( checklistDetails.scheduleEndTime_iso ).add( checklistConfigDetails.redoValidity, 'day' ).format() } ),
@@ -1177,7 +1177,7 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1177
1177
  for ( let j = 0; j < qaAnswers.length; j++ ) {
1178
1178
  if ( requestSection[i].qname == qaAnswers[j].oldQname || requestSection[i].qname == qaAnswers[j].qname ) {
1179
1179
  if ( qaAnswers[j].answerType == 'yes/no' ) {
1180
- let qaans = qaAnswers[j].answers;
1180
+ let qaans = JSON.stringify( JSON.parse( qaAnswers[j].answers ) );
1181
1181
  let yn = [];
1182
1182
  if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1183
1183
  for ( let k = 0; k < qaans.length; k++ ) {
@@ -1213,7 +1213,9 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1213
1213
  structure.runAI = qaAnswers[j].runAI;
1214
1214
  structure.runAIDescription = qaAnswers[j].runAIDescription;
1215
1215
  structure.allowUploadfromGallery = qaAnswers[j].allowUploadfromGallery;
1216
- structure.remarks = requestSection[i].remarks;
1216
+ if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1217
+ structure.remarks = requestSection[i].remarks;
1218
+ }
1217
1219
  structure.answers = qaAnswers[j].answers;
1218
1220
  structure.userAnswer = yn;
1219
1221
  structure.linkType = qaAnswers[j].linkType;
@@ -1239,7 +1241,7 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1239
1241
  };
1240
1242
  newArray.push( structure );
1241
1243
  } else if ( qaAnswers[j].answerType == 'multiplechoicesingle' || ( qaAnswers[j].answerType == 'dropdown' && !qaAnswers[j].allowMultiple ) ) {
1242
- let qaans = qaAnswers[j].answers;
1244
+ let qaans = JSON.stringify( JSON.parse( qaAnswers[j].answers ) );
1243
1245
  let ms = [];
1244
1246
  if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1245
1247
  for ( let k = 0; k < qaans.length; k++ ) {
@@ -1290,7 +1292,9 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1290
1292
  structure.runAI = qaAnswers[j].runAI;
1291
1293
  structure.runAIDescription = qaAnswers[j].runAIDescription;
1292
1294
  structure.allowUploadfromGallery = qaAnswers[j].allowUploadfromGallery;
1293
- structure.remarks = requestSection[i].remarks;
1295
+ if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1296
+ structure.remarks = requestSection[i].remarks;
1297
+ }
1294
1298
  structure.answers = qaAnswers[j].answers;
1295
1299
  structure.userAnswer = ms;
1296
1300
  structure.linkType = qaAnswers[j].linkType;
@@ -1317,7 +1321,7 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1317
1321
  };
1318
1322
  newArray.push( structure );
1319
1323
  } else if ( qaAnswers[j].answerType == 'multiplechoicemultiple' || ( qaAnswers[j].answerType == 'dropdown' && qaAnswers[j].allowMultiple ) ) {
1320
- let qaans = qaAnswers[j].answers;
1324
+ let qaans = JSON.stringify( JSON.parse( qaAnswers[j].answers ) );
1321
1325
  let mcmo = [];
1322
1326
  if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1323
1327
  for ( let k = 0; k < qaans.length; k++ ) {
@@ -1364,7 +1368,9 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1364
1368
  structure.runAI = qaAnswers[j].runAI;
1365
1369
  structure.runAIDescription = qaAnswers[j].runAIDescription;
1366
1370
  structure.allowUploadfromGallery = qaAnswers[j].allowUploadfromGallery;
1367
- structure.remarks = requestSection[i].remarks;
1371
+ if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1372
+ structure.remarks = requestSection[i].remarks;
1373
+ }
1368
1374
  structure.answers = qaAnswers[j].answers;
1369
1375
  structure.userAnswer = mcmo;
1370
1376
  structure.linkType = qaAnswers[j].linkType;
@@ -1441,7 +1447,9 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1441
1447
  structure.runAI = qaAnswers[j].runAI;
1442
1448
  structure.runAIDescription = qaAnswers[j].runAIDescription;
1443
1449
  structure.allowUploadfromGallery = qaAnswers[j].allowUploadfromGallery;
1444
- structure.remarks = requestSection[i].remarks;
1450
+ if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1451
+ structure.remarks = requestSection[i].remarks;
1452
+ }
1445
1453
  structure.answers = qaAnswers[j].answers;
1446
1454
  structure.userAnswer = mcmi;
1447
1455
  structure.linkType = qaAnswers[j].linkType;
@@ -1548,7 +1556,9 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
1548
1556
  structure.runAI = qaAnswers[j].runAI;
1549
1557
  structure.runAIDescription = qaAnswers[j].runAIDescription;
1550
1558
  structure.allowUploadfromGallery = qaAnswers[j].allowUploadfromGallery;
1551
- structure.remarks = requestSection[i].remarks;
1559
+ if ( ( getChecklistQA?.redoEdit && qaAnswers[j].redo == requestSection[i].redo ) || !getChecklistQA?.redoEdit ) {
1560
+ structure.remarks = requestSection[i].remarks;
1561
+ }
1552
1562
  structure.answers = qaAnswers[j].answers;
1553
1563
  structure.userAnswer = des;
1554
1564
  structure.linkType = qaAnswers[j].linkType;
@@ -3235,7 +3245,7 @@ export async function checklistv1( req, res ) {
3235
3245
  // eslint-disable-next-line camelcase
3236
3246
  // { store_id },
3237
3247
  { userId },
3238
- { $or: [ { date_string: date }, { $and: [ { redoStatus: true }, { scheduleEndTime_iso: { $gte: fromDate } } ] } ] },
3248
+ { $or: [ { date_string: date }, { $and: [ { redoStatus: true }, { scheduleStartTime_iso: { $lt: toDate } }, { scheduleEndTime_iso: { $gte: fromDate } } ] } ] },
3239
3249
  { timeFlagStatus: true },
3240
3250
  ...matchExtraConditions,
3241
3251
  clientId,