tango-app-api-trax 3.4.1-alpha-20 → 3.4.1-approvecheck-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.
@@ -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;
@@ -11,13 +11,17 @@ import {
11
11
  getChecklistFromZipId,
12
12
  getPDFCSVChecklistDetails,
13
13
  cancelDownload,
14
+ downloadInsertAI,
15
+ getAiChecklistDataFromZipId,
14
16
  } from '../controllers/download.controller.js';
15
17
 
16
18
  downloadRouter
17
19
  .post( '/downloadInsert', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), validate( downloadValidationDtos.validateDownloadInsertParams ), downloadInsert )
20
+ .post( '/downloadInsertAI', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), validate( downloadValidationDtos.validateDownloadInsertParams ), downloadInsertAI )
18
21
  .post( '/downloadList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), validate( downloadValidationDtos.validateDownloadListParams ), downloadList )
19
22
  .post( '/downloadUpdate', downloadUpdate ) // isAllowedInternalAPIHandler,
20
23
  .get( '/getChecklistFromZipId', getChecklistFromZipId ) // isAllowedInternalAPIHandler,
24
+ .get( '/getAiChecklistDataFromZipId', getAiChecklistDataFromZipId ) // isAllowedInternalAPIHandler,
21
25
  .post( '/getChecklistDetails', getPDFCSVChecklistDetails )
22
26
  .put( '/cancelDownload/:id', isAllowedSessionHandler, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), cancelDownload );
23
27
 
@@ -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
@@ -16,10 +16,12 @@ internalTraxRouter
16
16
  .get( '/profile', isAllowedMobileSessionHandler, internalController.getUserStoreList )
17
17
  .post( '/pushNotification', isAllowedInternalAPIHandler, internalController.pushNotification )
18
18
  .post( '/taskPushNotification', isAllowedInternalAPIHandler, internalController.taskPushNotification )
19
+ .post( '/AiPushNotificationAlert', isAllowedInternalAPIHandler, internalController.AiPushNotificationAlert )
19
20
  .get( '/checklist', isAllowedInternalAPIHandler, internalController.internalAPIChecklist )
20
21
  .post( '/getPDFCSVChecklistDetails', isAllowedInternalAPIHandler, internalController.getPDFCSVChecklistDetails )
21
22
  .get( '/getOTP', isAllowedInternalAPIHandler, internalController.getOTP )
22
23
  .get( '/getDownloads', isAllowedInternalAPIHandler, internalController.getDownloads )
23
- .post( '/sendPushNotification', isAllowedInternalAPIHandler, internalController.internalSendPushNotification );
24
+ .post( '/sendPushNotification', isAllowedInternalAPIHandler, internalController.internalSendPushNotification )
25
+ .post( '/sendAiPushNotification', isAllowedInternalAPIHandler, internalController.internalAISendPushNotification );
24
26
 
25
27
 
@@ -9,18 +9,16 @@ mobileRouter
9
9
  .get( '/storeList', isAllowedSessionHandler, mobileController.storeList )
10
10
  .get( '/storeListv1', isAllowedSessionHandler, mobileController.storeListv1 )
11
11
  .post( '/startCheckList', isAllowedSessionHandler, validate( startValidation ), mobileController.startChecklist )
12
- .post( '/startCheckListv1', isAllowedSessionHandler, validate( startValidation ), mobileController.startChecklistv1 )
13
12
  .post( '/startTask', isAllowedSessionHandler, validate( startValidation ), mobileController.startTask )
14
13
  .post( '/submitCheckList', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidator, mobileController.sopMobilechecklistMultiSectionFormatter, mobileController.submitChecklist )
15
14
  .post( '/submitCheckListv5', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidatorv1, mobileController.sopMobilechecklistMultiSectionFormatterv1, mobileController.submitChecklist )
16
- .post( '/submitCheckListv6', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobilechecklistQuestionValidatorv1, mobileController.sopMobilechecklistMultiSectionFormatterv2, mobileController.submitChecklist )
17
15
  .post( '/submitTask', isAllowedSessionHandler, mobileController.sopMobilechecklistValidater, mobileController.sopMobileTaskQuestionValidator, mobileController.sopMobileTaskMultiSectionFormatter, mobileController.submitTask )
16
+ .post( '/submiteyeTestTask', isAllowedSessionHandler, mobileController.submiteyeTestTask )
18
17
  .get( '/dashboard', isAllowedSessionHandler, validate( dashboardValidation ), mobileController.dashboard )
19
18
  .get( '/dashboardv1', isAllowedSessionHandler, validate( dashboardValidation ), mobileController.dashboardv1 )
20
19
  .get( '/checklist', isAllowedSessionHandler, validate( mobileChecklistValidation ), mobileController.checklist )
21
20
  .get( '/checklistv1', isAllowedSessionHandler, validate( mobileChecklistValidation ), mobileController.checklistv1 )
22
21
  .get( '/checklistQuestionList', isAllowedSessionHandler, mobileController.questionList )
23
- .get( '/checklistQuestionListv1', isAllowedSessionHandler, mobileController.questionListv1 )
24
22
  .get( '/taskQuestionList', isAllowedSessionHandler, mobileController.taskQuestionList )
25
23
  .post( '/uploadAnswerImage', isAllowedSessionHandler, mobileController.uploadAnswerImage )
26
24
  .get( '/appVersion', mobileController.appVersion )
@@ -1,5 +1,5 @@
1
1
  import express from 'express';
2
- import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient, getAssinedStore } from 'tango-app-api-middleware';
2
+ import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
3
3
  import { checklistValidation, checklistDetailsValidation, runaiValidation, checklistPageSchema, duplicateValidation, updateChecklistValidation, uploadUserValidation, aichecklistValidation, publishValidation, selectAssign } from '../dtos/validation.dtos.js';
4
4
  import * as traxController from '../controllers/trax.controller.js';
5
5
 
@@ -25,10 +25,12 @@ traxRouter
25
25
  .get( '/zoneList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.zoneList )
26
26
  .get( '/aichecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.aiChecklist )
27
27
  .get( '/predefinedChecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist )
28
- .post( '/selectAssign', isAllowedSessionHandler, validate( selectAssign ), getAssinedStore, traxController.selectAssign )
28
+ .post( '/selectAssign', validate( selectAssign ), traxController.selectAssign )
29
29
  .post( '/assign', isAllowedSessionHandler, traxController.checklistAssign )
30
30
  // .post( '/assignUpload', isAllowedSessionHandler, traxController.assignChecklistUser )
31
- .post( '/updateAssign', isAllowedSessionHandler, traxController.updateAssign );
31
+ .post( '/updateAssign', isAllowedSessionHandler, traxController.updateAssign )
32
+ .post( '/updateAiConfigure', isAllowedSessionHandler, traxController.updateAiConfigure )
33
+ .get( '/getAiDetails', isAllowedSessionHandler, traxController.getAiDetails );
32
34
  ;
33
35
 
34
36
  // isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),
@@ -18,6 +18,9 @@ import {
18
18
  flagComparisonCardsV1,
19
19
  flagTablesV1,
20
20
  checklistDropdownV1,
21
+ flagTablesV2,
22
+ flagComparisonCardsV2,
23
+ checklistCountByType,
21
24
  } from '../controllers/teaxFlag.controller.js';
22
25
  import { isAllowedSessionHandler } from 'tango-app-api-middleware';
23
26
  import { accessVerification } from 'tango-app-api-middleware';
@@ -68,7 +71,16 @@ traxFlagRouter
68
71
  flagComparisonCardsV1 )
69
72
  .post( '/flagTablesV1', isAllowedSessionHandler,
70
73
  accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
71
- flagTablesV1 );
74
+ flagTablesV1 )
75
+ .post( '/flagComparisonCardsV2', isAllowedSessionHandler,
76
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
77
+ flagComparisonCardsV2 )
78
+ .post( '/flagTablesV2', isAllowedSessionHandler,
79
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
80
+ flagTablesV2 )
81
+ .post( '/checklistCountByType', isAllowedSessionHandler,
82
+ accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ),
83
+ checklistCountByType );
72
84
 
73
85
 
74
86
  export default traxFlagRouter;
@@ -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
+
@@ -9,7 +9,7 @@ export const findOne = ( query = {}, record = {} ) => {
9
9
  };
10
10
 
11
11
  export const updateOne = ( query = {}, record = {} ) => {
12
- return model.processedchecklistconfigModel.updateOne( query, { $set: record } );
12
+ return model.processedchecklistconfigModel.updateOne( query, { $set: record }, { upsert: true } );
13
13
  };
14
14
 
15
15
  export const updateMany = ( query = {}, record = {} ) => {