tango-app-api-trax 3.4.1-beta-2 → 3.5.0-alpha-0

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.
@@ -1251,8 +1251,8 @@ export const checklistInfo = async ( req, res ) => {
1251
1251
  coverage: { $first: '$coverage' },
1252
1252
  createdByName: { $first: '$createdByName' },
1253
1253
  userName: { $first: '$userName' },
1254
- userEmail: { $first: '$userEmail' },
1255
1254
  checklistStatus: { $last: '$checklistStatus' },
1255
+ userEmail: { $first: '$userEmail' },
1256
1256
  submitTime_string: { $push: '$submitTime_string' },
1257
1257
  storeName: { $first: '$storeName' },
1258
1258
  checkListType: { $first: '$checkListType' },
@@ -1272,6 +1272,8 @@ export const checklistInfo = async ( req, res ) => {
1272
1272
  else: 0,
1273
1273
  },
1274
1274
  } },
1275
+ approvalByEmail: { $first: '$approvalByEmail' },
1276
+ approvalTime_string: { $push: '$approvalTime_string' },
1275
1277
  idList: { $push: '$_id' },
1276
1278
  },
1277
1279
  } );
@@ -1284,8 +1286,8 @@ export const checklistInfo = async ( req, res ) => {
1284
1286
  coverage: 1,
1285
1287
  createdByName: 1,
1286
1288
  userName: 1,
1287
- userEmail: '$_id.email',
1288
1289
  checklistStatus: 1,
1290
+ userEmail: '$_id.email',
1289
1291
  submitTime_string: { $arrayElemAt: [ '$submitTime_string', 0 ] },
1290
1292
  storeName: 1,
1291
1293
  checkListType: 1,
@@ -1300,6 +1302,8 @@ export const checklistInfo = async ( req, res ) => {
1300
1302
  reinitiateStatus: 1,
1301
1303
  redoStatus: 1,
1302
1304
  submitCount: 1,
1305
+ approvalByEmail: 1,
1306
+ approvalTime_string: { $arrayElemAt: [ '$approvalTime_string', 0 ] },
1303
1307
  },
1304
1308
  } );
1305
1309
 
@@ -1311,7 +1315,6 @@ export const checklistInfo = async ( req, res ) => {
1311
1315
  checkListChar: { $substr: [ '$checkListName', 0, 2 ] },
1312
1316
  createdByName: 1,
1313
1317
  userName: 1,
1314
- userEmail: 1,
1315
1318
  checklistStatus: {
1316
1319
  $cond: {
1317
1320
  if: { $eq: [ '$checklistStatus', 'submit' ] },
@@ -1325,6 +1328,7 @@ export const checklistInfo = async ( req, res ) => {
1325
1328
  },
1326
1329
  },
1327
1330
  },
1331
+ userEmail: 1,
1328
1332
  // submitTime_string: 1,
1329
1333
  submitTime_string: {
1330
1334
  $cond: {
@@ -1348,6 +1352,8 @@ export const checklistInfo = async ( req, res ) => {
1348
1352
  reinitiateStatus: 1,
1349
1353
  redoStatus: 1,
1350
1354
  submitCount: 1,
1355
+ approvalByEmail: 1,
1356
+ approvalTime_string: 1,
1351
1357
  },
1352
1358
  } );
1353
1359
 
@@ -1396,19 +1402,24 @@ export const checklistInfo = async ( req, res ) => {
1396
1402
  'Date': element.date_string || '--',
1397
1403
  'Store Name': element.storeName || '--',
1398
1404
  'Checklist Owner': element.userName || '--',
1399
- 'Submitted By': element.userName || '--',
1400
1405
  'Status': element.checklistStatus || '--',
1406
+ 'Submitted By': element.userName || '--',
1401
1407
  'Submitted On': element.submitTime_string || '--',
1402
1408
  'Flags': element.flaggedChecklist || '--',
1409
+ 'Approval By': element.approvalByEmail || '--',
1410
+ 'Approval On': element.approvalTime_string || '--',
1403
1411
  } );
1404
1412
  } else if ( requestData.groupByType==='Store' ) {
1405
1413
  exportdata.push( {
1406
1414
  'CheckList Name': element.checkListName || '--',
1407
1415
  'Checklist Owner': element.userName || '--',
1408
- 'Submitted By': element.userName || '--',
1409
1416
  'Status': element.checklistStatus || '--',
1417
+ 'Submitted By': element.userName || '--',
1410
1418
  'Submitted On': element.submitTime_string || '--',
1411
1419
  'Flags': element.flaggedChecklist || '--',
1420
+ 'Approval By': element.approvalByEmail || '--',
1421
+ 'Approval On': element.approvalTime_string || '--',
1422
+
1412
1423
  } );
1413
1424
  } else {
1414
1425
  exportdata.push( {
@@ -1419,6 +1430,8 @@ export const checklistInfo = async ( req, res ) => {
1419
1430
  'Status': element.checklistStatus || '--',
1420
1431
  'Submitted On': element.submitTime_string || '--',
1421
1432
  'Flags': element.flaggedChecklist || '--',
1433
+ 'Approval By': element.approvalByEmail || '--',
1434
+ 'Approval On': element.approvalTime_string || '--',
1422
1435
  } );
1423
1436
  }
1424
1437
  } );
@@ -26,6 +26,7 @@ export const validateDownloadInsertSchema = joi.object( {
26
26
  filter: joi.string().optional().allow( '' ),
27
27
  filtertype: joi.string().optional().allow( '' ),
28
28
  checkListType: joi.string().required(),
29
+ approveFilter: joi.string().optional().allow( '' ),
29
30
  } );
30
31
 
31
32
  export const validateDownloadInsertParams = {
@@ -0,0 +1,18 @@
1
+ import express from 'express';
2
+ import { isAllowedInternalAPIHandler, isAllowedSessionHandler } from 'tango-app-api-middleware';
3
+
4
+ export const traxActivityLogRouter = express.Router();
5
+
6
+ import {
7
+ insertLog,
8
+ updateLog,
9
+ listLog,
10
+ } from '../controllers/activityLog.controller.js';
11
+
12
+ traxActivityLogRouter
13
+ .post( '/insertLog', isAllowedInternalAPIHandler, insertLog )
14
+ .post( '/updateLog', isAllowedInternalAPIHandler, updateLog )
15
+ .post( '/listLog', isAllowedSessionHandler, listLog );
16
+
17
+
18
+ export default traxActivityLogRouter;
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- import { getchecklist, viewchecklist, getMobileUseagelist, storeOpencloselist, getcustomerunattendedlist, storesList, checklistDropdown, redoChecklist, approveChecklist, approvalstatus, getLogs, headerStoresV2, teamsList, userList } from '../controllers/gallery.controller.js';
3
+ import { getchecklist, viewchecklist, getMobileUseagelist, storeOpencloselist, getcustomerunattendedlist, storesList, checklistDropdown, redoChecklist, redomultiChecklist, approveChecklist, approvalstatus, getLogs, headerStoresV2, teamsList, userList } from '../controllers/gallery.controller.js';
4
4
  import express from 'express';
5
5
  export const galleryRouter = express.Router();
6
6
  import { validate, isAllowedSessionHandler, isAllowedClient, getAssinedStore } from 'tango-app-api-middleware';
@@ -24,6 +24,7 @@ galleryRouter
24
24
  galleryRouter
25
25
  .post( '/updateApprove', isAllowedSessionHandler, approveChecklist )
26
26
  .post( '/redo', isAllowedSessionHandler, redoChecklist )
27
+ .post( '/multiredo', isAllowedSessionHandler, redomultiChecklist )
27
28
  .post( '/approvalstatus', isAllowedSessionHandler, approvalstatus )
28
29
  .post( '/getLogs', isAllowedSessionHandler, getLogs );
29
30
  galleryRouter
@@ -13,6 +13,7 @@ mobileRouter
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
15
  .post( '/submitTask', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobileTaskQuestionValidator, mobileController.sopMobileTaskMultiSectionFormatter, mobileController.submitTask )
16
+ .post( '/submiteyeTestTask', isAllowedSessionHandler, mobileController.submiteyeTestTask )
16
17
  .get( '/dashboard', isAllowedSessionHandler, validate( dashboardValidation ), mobileController.dashboard )
17
18
  .get( '/dashboardv1', isAllowedSessionHandler, validate( dashboardValidation ), mobileController.dashboardv1 )
18
19
  .get( '/checklist', isAllowedSessionHandler, validate( mobileChecklistValidation ), mobileController.checklist )
@@ -0,0 +1,14 @@
1
+ import model from 'tango-api-schema';
2
+
3
+ export const aggregate = async ( query ={} ) => {
4
+ return model.cameraModel.aggregate( query );
5
+ };
6
+
7
+ export const updateOne = async ( query, record ) => {
8
+ return model.cameraModel.updateOne( query, { $set: record }, { upsert: true } );
9
+ };
10
+
11
+ export const findOne = async ( query ={}, field={} ) => {
12
+ return model.cameraModel.findOne( query, field );
13
+ };
14
+