tango-app-api-trax 3.2.1 → 3.3.1-airtalai-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.
@@ -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 } from '../controllers/gallery.controller.js';
3
+ import { getchecklist, viewchecklist, getMobileUseagelist, storeOpencloselist, getcustomerunattendedlist, storesList, checklistDropdown, redoChecklist, 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';
@@ -28,3 +28,7 @@ galleryRouter
28
28
  .post( '/getLogs', isAllowedSessionHandler, getLogs );
29
29
  galleryRouter
30
30
  .post( '/headerStores_v2', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateHeaderParamsv2 ), getAssinedStore, headerStoresV2 );
31
+ galleryRouter
32
+ .get( '/teamsList', isAllowedSessionHandler, isAllowedClient, teamsList );
33
+ galleryRouter
34
+ .post( '/userList', isAllowedSessionHandler, isAllowedClient, userList );
@@ -16,9 +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
- .get( '/getDownloads', isAllowedInternalAPIHandler, internalController.getDownloads );
23
+ .get( '/getDownloads', isAllowedInternalAPIHandler, internalController.getDownloads )
24
+ .post( '/sendPushNotification', isAllowedInternalAPIHandler, internalController.internalSendPushNotification )
25
+ .post( '/sendAiPushNotification', isAllowedInternalAPIHandler, internalController.internalAISendPushNotification );
23
26
 
24
27
 
@@ -24,5 +24,7 @@ mobileRouter
24
24
  .post( '/appVersion', mobileController.updateappVersion )
25
25
  .post( '/verifylocation', isAllowedSessionHandler, mobileController.getStoreLocation, mobileController.location )
26
26
  .post( '/login', mobileController.login )
27
- .post( '/checkUpdateVersion', mobileController.checkVersion );
27
+ .post( '/checkUpdateVersion', mobileController.checkVersion )
28
+ .post( '/checkClientConfig', isAllowedSessionHandler, mobileController.clientConfig )
29
+ .post( '/updatePlanoStatus', isAllowedSessionHandler, mobileController.updatePlanoStatus );
28
30
 
@@ -1,6 +1,6 @@
1
1
  import express from 'express';
2
2
  import { isAllowedSessionHandler, validate, accessVerification, isAllowedClient } from 'tango-app-api-middleware';
3
- import { checklistValidation, checklistDetailsValidation, runaiValidation, checklistPageSchema, duplicateValidation, updateChecklistValidation, uploadUserValidation, aichecklistValidation, publishValidation } from '../dtos/validation.dtos.js';
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
 
6
6
  export const traxRouter = express.Router();
@@ -14,11 +14,23 @@ traxRouter
14
14
  .get( '/duplicateChecklist/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.duplicateChecklist )
15
15
  .put( '/checklist/update/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( updateChecklistValidation ), traxController.update )
16
16
  .post( '/validateUser', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUser )
17
+ .post( '/validateUserv1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUserv1 )
17
18
  .get( '/userDetails/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetails )
19
+ .get( '/userDetailsv1/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetailsv1 )
18
20
  .post( '/checklistConfigure', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigure )
21
+ .post( '/checklistConfigurev1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigurev1 )
19
22
  .delete( '/deleteChecklist/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.deleteChecklist )
20
23
  .put( '/publish', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( publishValidation ), traxController.updatePublish )
21
24
  .get( '/userList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.userlist )
22
25
  .get( '/zoneList', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), traxController.zoneList )
23
26
  .get( '/aichecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.aiChecklist )
24
- .get( '/predefinedChecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist );
27
+ .get( '/predefinedChecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( aichecklistValidation ), traxController.preDefinedChecklist )
28
+ .post( '/selectAssign', validate( selectAssign ), traxController.selectAssign )
29
+ .post( '/assign', isAllowedSessionHandler, traxController.checklistAssign )
30
+ // .post( '/assignUpload', isAllowedSessionHandler, traxController.assignChecklistUser )
31
+ .post( '/updateAssign', isAllowedSessionHandler, traxController.updateAssign )
32
+ .post( '/updateAiConfigure', isAllowedSessionHandler, traxController.updateAiConfigure )
33
+ .get( '/getAiDetails', isAllowedSessionHandler, traxController.getAiDetails );
34
+ ;
35
+
36
+ // isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),
@@ -29,6 +29,7 @@ import {
29
29
  reportChecklistTableV1,
30
30
  reinitiatechecklist,
31
31
  sendAlert,
32
+ getUserEmails,
32
33
  } from '../controllers/traxDashboard.controllers.js';
33
34
 
34
35
  traxDashboardRouter
@@ -56,6 +57,7 @@ traxDashboardRouter
56
57
  .post( '/reportChecklistData', reportChecklistTable )
57
58
  .post( '/reportChecklistDataV1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [] } ] } ), validate( dashboardValidationDtos.validateReportChecklistTableParams ), reportChecklistTableV1 )
58
59
  .post( '/reinitiatechecklist', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isAdd', 'isEdit' ] } ] } ), reinitiatechecklist )
59
- .post( '/sendAlert', isAllowedSessionHandler, sendAlert );
60
+ .post( '/sendAlert', isAllowedSessionHandler, sendAlert )
61
+ .post( '/getUserEmails', isAllowedSessionHandler, getUserEmails );
60
62
 
61
63
  export default traxDashboardRouter;
@@ -24,8 +24,16 @@ export const updateMany = async ( query = {}, record={} ) => {
24
24
  return model.checklistassignconfigModel.updateMany( query, { $set: record } );
25
25
  };
26
26
 
27
+ export const updateOne = async ( query = {}, record={} ) => {
28
+ return model.checklistassignconfigModel.updateOne( query, { $set: record }, { upsert: true } );
29
+ };
30
+
27
31
  export const aggregate = async ( query = {} ) => {
28
32
  return model.checklistassignconfigModel.aggregate( query );
29
33
  };
30
34
 
35
+ export const count = async ( query = {} ) => {
36
+ return model.checklistassignconfigModel.countDocuments( query );
37
+ };
38
+
31
39
 
@@ -0,0 +1,5 @@
1
+ import model from 'tango-api-schema';
2
+
3
+ export const findOne = async ( query ={}, field={} ) => {
4
+ return model.planogramModel.findOne( query, field );
5
+ };
@@ -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 = {} ) => {
@@ -0,0 +1,30 @@
1
+ import teamsModel from 'tango-api-schema/schema/teams.model.js';
2
+
3
+
4
+ export async function createTeamsModel( data ) {
5
+ return await teamsModel.create( data );
6
+ };
7
+ export async function updateOneTeams( query, record ) {
8
+ return await teamsModel.updateOne( query, { $set: record }, { upsert: true } );
9
+ };
10
+
11
+ export async function aggregateTeams( query ) {
12
+ return await teamsModel.aggregate( query );
13
+ };
14
+ export async function deleteTeams( query ={} ) {
15
+ return await teamsModel.deleteOne( query );
16
+ };
17
+
18
+ export async function findOneTeams( query ={}, field={} ) {
19
+ return await teamsModel.findOne( query, field );
20
+ };
21
+ export async function findteams( query ={}, field={} ) {
22
+ return await teamsModel.find( query, field );
23
+ };
24
+
25
+ export async function updateOneTeamModel( query, record ) {
26
+ return await teamsModel.updateOne( query, record );
27
+ }
28
+ export function countDocumentsTeams( query ) {
29
+ return teamsModel.countDocuments( query );
30
+ }