tango-app-api-client 3.6.4 → 3.6.5-vms.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.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "tango-app-api-client",
3
- "version": "3.6.4",
3
+ "version": "3.6.5-vms.0",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "start": "nodemon --exec \"eslint --fix . && node index.js\"",
8
+ "start": "nodemon --exec \"eslint --fix . && node app.js\"",
9
9
  "build:patch": "node build.js patch && npm publish",
10
10
  "build:minor": "node build.js minor && npm publish",
11
11
  "build:major": "node build.js major && npm publish"
@@ -30,7 +30,7 @@
30
30
  "npm": "^10.9.1",
31
31
  "sharp": "^0.34.3",
32
32
  "swagger-ui-express": "^5.0.0",
33
- "tango-api-schema": "^2.4.12",
33
+ "tango-api-schema": "^2.4.19",
34
34
  "tango-app-api-middleware": "^3.6.0",
35
35
  "winston": "^3.11.0",
36
36
  "winston-daily-rotate-file": "^5.0.0"
@@ -2941,3 +2941,39 @@ export async function getrevopconfig( req, res ) {
2941
2941
  }
2942
2942
 
2943
2943
 
2944
+ export async function updateFDConfig( req, res ) {
2945
+ try {
2946
+ const inputData = req.body;
2947
+ const inputQuery = req.query;
2948
+ const query ={
2949
+ clientId: inputQuery.clientId,
2950
+ };
2951
+ // update the footfall directory configuration data
2952
+ let result = await updateOneClient( query, { footfallDirectoryConfigs: inputData } );
2953
+ if ( result?.acknowledged === true ) {
2954
+ return res.sendSuccess( result );
2955
+ } else {
2956
+ return res.sendError( 'no data', 204 );
2957
+ }
2958
+ } catch ( error ) {
2959
+ const err = error?.message || 'Internal Server Error';
2960
+ logger.error( { error: error, message: req.body, function: 'updateFDConfig' } );
2961
+ return res.sendError( err, 500 );
2962
+ }
2963
+ }
2964
+
2965
+ export async function getFDConfig( req, res ) {
2966
+ try {
2967
+ const inputData = req.query;
2968
+ let result = await findOneClient( { clientId: inputData.clientId }, { footfallDirectoryConfigs: 1 } );
2969
+ if ( result===null ) {
2970
+ return res.sendError( 'no data found', 204 );
2971
+ }
2972
+ return res.sendSuccess( result );
2973
+ } catch ( error ) {
2974
+ const err = error.message || 'Internal Server Error';
2975
+ logger.error( { error: error, message: req.query, function: 'getFDConfig' } );
2976
+ return res.sendError( err, 500 );
2977
+ }
2978
+ }
2979
+
@@ -345,3 +345,42 @@ export const revopconfigValid = {
345
345
  export const revopconfiggetValid = {
346
346
  query: revopconfiggetBody,
347
347
  };
348
+
349
+
350
+ export const updateFDConfigBodySchema = joi.object( {
351
+ accuracyBreach: joi.object( {
352
+ ticketCount: joi.number().optional(),
353
+ days: joi.string().optional(),
354
+ accuracy: joi.string().optional(),
355
+ } ).optional(),
356
+ allowTicketCreation: joi.number().optional(),
357
+ isAutoCloseEnable: joi.boolean().optional(),
358
+ autoCloseAccuracy: joi.string().optional(),
359
+ tangoReview: joi.string().optional(),
360
+ revision: joi.array().items( joi.object( {
361
+ actionType: joi.string().required(),
362
+ isChecked: joi.boolean().required(),
363
+ } ) ).optional(),
364
+ taggingLimitation: joi.array().items( joi.object( {
365
+ type: joi.string().required(),
366
+ value: joi.number().required(),
367
+ unit: joi.string().required(),
368
+ } ) ).optional(),
369
+
370
+ } );
371
+
372
+ export const updateFDConfigQuerySchema = joi.object( {
373
+ clientId: joi.string().required(),
374
+ } );
375
+
376
+ export const getFDConfigSchema = joi.object( {
377
+ clientId: joi.string().required(),
378
+ } );
379
+
380
+ export const updateFDConfigValid = {
381
+ body: updateFDConfigBodySchema,
382
+ query: updateFDConfigQuerySchema,
383
+ };
384
+ export const getFDConfigValid = {
385
+ query: getFDConfigSchema,
386
+ };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import express from 'express';
3
- import { activityLogValid, auditConfigValid, billingDetailsValid, brandInfoValid, clientCreationValid, clientDetailsValid, documentsValid, domainDetailsValid, featureConfigurationValid, getAssignedClientValid, getAuditConfigValid, postClientCamApprovalValid, signatoryDetailsValid, ticketConfigurationValid, userConfigurationValid } from '../dtos/client.dtos.js';
4
- import { auditConfiguration, changeStatus, clientCsmAssignAction, clientDetails, create, csmAssignConfirmation, domainDetailsConfiguration, getActivityLogs, getAuditConfiguration, getClients, getCsmUsers, getOpsUsers, updateBillingDetails, updateBrandInfo, updateDocuments, updateFeatureConfiguration, updateSignatoryDetails, updateTicketConfiguration, userConfiguration } from '../controllers/client.controllers.js';
3
+ import { activityLogValid, auditConfigValid, billingDetailsValid, brandInfoValid, clientCreationValid, clientDetailsValid, documentsValid, domainDetailsValid, featureConfigurationValid, getAssignedClientValid, getAuditConfigValid, getFDConfigValid, postClientCamApprovalValid, signatoryDetailsValid, ticketConfigurationValid, updateFDConfigValid, userConfigurationValid } from '../dtos/client.dtos.js';
4
+ import { auditConfiguration, changeStatus, clientCsmAssignAction, clientDetails, create, csmAssignConfirmation, domainDetailsConfiguration, getActivityLogs, getAuditConfiguration, getClients, getCsmUsers, getFDConfig, getOpsUsers, updateBillingDetails, updateBrandInfo, updateDocuments, updateFDConfig, updateFeatureConfiguration, updateSignatoryDetails, updateTicketConfiguration, userConfiguration } from '../controllers/client.controllers.js';
5
5
  import { accessVerification, isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
6
6
  import { clientListValid, detailedClientCountValid, createAuditConfigValid, AuditConfiglistValid, revopconfigValid, revopconfiggetValid } from '../dtos/client.dtos.js';
7
7
  import { isclientIdExists, isclientNameExists, roleVerification } from '../validations/client.validations.js';
@@ -112,4 +112,7 @@ clientRouter.post( '/revopconfig', isAllowedSessionHandler,
112
112
  clientRouter.get( '/revopconfig', isAllowedSessionHandler,
113
113
  validate( revopconfiggetValid ), getrevopconfig );
114
114
 
115
+ // footfall directory configurations
116
+ clientRouter.put( '/update-footfall-directory-config', isAllowedSessionHandler, validate( updateFDConfigValid ), updateFDConfig );
117
+ clientRouter.get( '/get-footfall-directory-config', isAllowedSessionHandler, validate( getFDConfigValid ), getFDConfig );
115
118