tango-app-api-trax 3.7.94 → 3.7.96

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.7.94",
3
+ "version": "3.7.96",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -29,7 +29,7 @@
29
29
  "nodemon": "^3.1.4",
30
30
  "path": "^0.12.7",
31
31
  "puppeteer": "^24.39.1",
32
- "tango-api-schema": "^2.5.68",
32
+ "tango-api-schema": "^2.5.70",
33
33
  "tango-app-api-middleware": "^3.5.2",
34
34
  "url": "^0.11.4",
35
35
  "winston": "^3.13.1",
@@ -3585,9 +3585,16 @@ export const downloadInsertPdf = async ( req, res ) => {
3585
3585
  pdfBuffer :
3586
3586
  Buffer.from( pdfBuffer );
3587
3587
 
3588
- const pdfName = `${safeName(
3589
- doc.store_id + '_' + ( doc.storeName || 'store' ),
3590
- )}.pdf`;
3588
+ let pdfName;
3589
+ if ( doc.store_id ) {
3590
+ pdfName = `${safeName(
3591
+ doc.store_id + '_' + ( doc.storeName || 'store' ),
3592
+ )}.pdf`;
3593
+ } else {
3594
+ pdfName = `${safeName(
3595
+ doc.userName + '_' + ( doc.sourceCheckList_id || 'store' ),
3596
+ )}.pdf`;
3597
+ }
3591
3598
 
3592
3599
  res.set( {
3593
3600
  'Content-Type': 'application/pdf',
@@ -3613,12 +3620,14 @@ export async function checklistAutoMailList( req, res ) {
3613
3620
  '$expr': {
3614
3621
  $gt: [ { $size: { $ifNull: [ '$autoEmail.type', [] ] } }, 0 ],
3615
3622
  },
3616
- }, { _id: 1, autoEmail: 1 } );
3623
+ }, { _id: 1, autoEmail: 1, approver: 1, coverage: 1 } );
3617
3624
 
3618
3625
  let result = [];
3619
3626
 
3620
3627
  await Promise.all( checklistInfoList.map( async ( ele ) => {
3621
- for ( let email of ele?.autoEmail?.users ) {
3628
+ let emailList = ele?.autoEmail?.type?.includes( 'approver' ) ? ele?.approver: [];
3629
+ emailList = [ ...emailList, ...ele?.autoEmail?.users ];
3630
+ for ( let email of emailList ) {
3622
3631
  let stores = [];
3623
3632
  let userDetails = await userService.findOne( { email: email.value } );
3624
3633
  if ( userDetails ) {
@@ -3687,6 +3696,7 @@ export async function checklistAutoMailList( req, res ) {
3687
3696
  email: email?.value,
3688
3697
  stores,
3689
3698
  role: userDetails.role,
3699
+ type: ele.coverage,
3690
3700
  };
3691
3701
  result.push( data );
3692
3702
  }
@@ -3190,7 +3190,7 @@ export async function checklistv1( req, res ) {
3190
3190
 
3191
3191
  const [ checklistResult, taskResult ] = await Promise.allSettled( [
3192
3192
  processedchecklist.aggregate( buildPipeline( [ { checkListType: 'custom' } ], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1 } ) ),
3193
- processedTask.aggregate( taskBuildPipeline( [], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1, refTaskId: 1, store_id: 1, fixtureNewUI: 1 } ) ),
3193
+ processedTask.aggregate( taskBuildPipeline( [], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1, refTaskId: 1, store_id: 1, fixtureNewUI: 1, aiType: 1 } ) ),
3194
3194
  ] );
3195
3195
 
3196
3196
  const checklistData = checklistResult.status === 'fulfilled' ? checklistResult.value : [];
@@ -608,6 +608,8 @@ export const zoneList = async ( req, res ) => {
608
608
  'Mobile usage detection',
609
609
  'Store TV Compliance',
610
610
  'Queue Wait Time Breach',
611
+ 'Uniform detection',
612
+ 'Store Hygiene Monitoring',
611
613
  ];
612
614
  const allowedChecklistsStreams = [
613
615
  'Camera Angle Change Compliance',
@@ -5163,3 +5165,14 @@ export async function downloadQuestionTemplate( req, res ) {
5163
5165
  return res.sendError( e, 500 );
5164
5166
  }
5165
5167
  }
5168
+
5169
+
5170
+ export async function getTeamList( req, res ) {
5171
+ try {
5172
+ let teamsDetails = await teamsServices.findteams( { clientId: req.query.clientId, status: 'active' } );
5173
+ return res.sendSuccess( teamsDetails );
5174
+ } catch ( e ) {
5175
+ logger.error( { functionName: 'getTeamList', error: e } );
5176
+ return res.sendError( e, 500 );
5177
+ }
5178
+ }
@@ -14,7 +14,7 @@
14
14
  .cover-deco{position:absolute;top:0;right:0;bottom:0;left:auto;width:450px;pointer-events:none;z-index:0;}
15
15
  .cover-brand{position:absolute;top:48px;left:48px;display:flex;align-items:center;gap:10px;z-index:1}
16
16
  .cover-brand-name{font-size:22px;font-weight:600;color:#1a1a1a;letter-spacing:.02em;text-transform:lowercase}
17
- .cover-title-block{position:absolute;top:188px;left:48px;max-width:440px;z-index:1}
17
+ .cover-title-block{position:absolute;top:188px;left:48px;max-width:400px;z-index:1}
18
18
  .cover-title-line1,.cover-title-line2{font-size:40px;font-weight:600;color:#00AEEF;line-height:1.15;letter-spacing:-.5px;word-wrap:break-word;overflow-wrap:break-word}
19
19
  .cover-meta-block{position:absolute;top:418px;left:48px;z-index:1}
20
20
  .cover-ref{font-size:22px;font-weight:700;color:#1a1a1a;letter-spacing:.02em}
@@ -36,6 +36,8 @@ traxRouter
36
36
  .post( '/updateRunAIRequest', isAllowedSessionHandler, validate( runAIRequestValidation ), traxController.updateRunAIRequest )
37
37
  .post( '/createChecklistName', isAllowedSessionHandler, validate( createChecklistNameValidation ), traxController.createChecklistName )
38
38
  .post( '/updateOSProcessedData', isAllowedInternalAPIHandler, validate( updateOSDataValidation ), traxController.updateOSProcessedData )
39
- .post( '/exportQuestions', isAllowedSessionHandler, traxController.downloadQuestionTemplate );
39
+ .post( '/exportQuestions', isAllowedSessionHandler, traxController.downloadQuestionTemplate )
40
+ .get( '/getTeamList', isAllowedSessionHandler, traxController.getTeamList )
41
+ ;
40
42
 
41
43
  // isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),
@@ -445,6 +445,7 @@ export function buildVisitChecklistTemplateDataFromProcessed( processedDoc, bran
445
445
  } );
446
446
  }
447
447
 
448
+ let referenceId = doc.coverage == 'store' ? doc?.storeName : doc?.userName;
448
449
 
449
450
  return {
450
451
 
@@ -461,7 +462,7 @@ export function buildVisitChecklistTemplateDataFromProcessed( processedDoc, bran
461
462
 
462
463
  titleLine2,
463
464
 
464
- referenceId: doc?.storeName ?? doc?.userEmail,
465
+ referenceId: referenceId,
465
466
 
466
467
  date: formattedDate,
467
468