tango-app-api-client 3.1.14 → 3.1.16
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 +3 -3
- package/src/controllers/client.controllers.js +668 -85
- package/src/docs/client.docs.js +0 -16
- package/src/dtos/client.dtos.js +22 -0
- package/src/routes/client.routes.js +12 -4
- package/src/service/client.service.js +16 -4
- package/src/service/group.service.js +8 -0
- package/src/service/store.service.js +7 -0
- package/src/service/userAssignedStore.service.js +13 -0
package/src/docs/client.docs.js
CHANGED
|
@@ -40,14 +40,6 @@ export const clientDocs = {
|
|
|
40
40
|
description: 'Get list of clients',
|
|
41
41
|
operationId: 'get-clients',
|
|
42
42
|
parameters: [
|
|
43
|
-
{
|
|
44
|
-
in: 'path',
|
|
45
|
-
name: 'id',
|
|
46
|
-
required: true,
|
|
47
|
-
schema: {
|
|
48
|
-
type: 'string',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
43
|
],
|
|
52
44
|
responses: {
|
|
53
45
|
200: { description: 'Success' },
|
|
@@ -455,14 +447,6 @@ export const clientDocs = {
|
|
|
455
447
|
description: 'Get toatal info about overall clients',
|
|
456
448
|
operationId: 'detailed-all-client-count',
|
|
457
449
|
parameters: [
|
|
458
|
-
{
|
|
459
|
-
in: 'path',
|
|
460
|
-
name: 'id',
|
|
461
|
-
required: true,
|
|
462
|
-
schema: {
|
|
463
|
-
type: 'string',
|
|
464
|
-
},
|
|
465
|
-
},
|
|
466
450
|
],
|
|
467
451
|
responses: {
|
|
468
452
|
200: { description: 'Success' },
|
package/src/dtos/client.dtos.js
CHANGED
|
@@ -108,6 +108,7 @@ export const featureConfigurationSchemaBody = joi.object(
|
|
|
108
108
|
isNormalized: joi.boolean().optional(),
|
|
109
109
|
isPasserByData: joi.boolean().optional(),
|
|
110
110
|
isFootfallDirectory: joi.boolean().optional(),
|
|
111
|
+
isExcludedArea: joi.boolean().optional(),
|
|
111
112
|
},
|
|
112
113
|
);
|
|
113
114
|
|
|
@@ -261,3 +262,24 @@ export const activityLogSchema = joi.object( {
|
|
|
261
262
|
export const activityLogValid = {
|
|
262
263
|
body: activityLogSchema,
|
|
263
264
|
};
|
|
265
|
+
|
|
266
|
+
export const getAssignedClientSchama = joi.object( {
|
|
267
|
+
clientId: joi.string().required(),
|
|
268
|
+
} );
|
|
269
|
+
|
|
270
|
+
export const getAssignedClientValid = {
|
|
271
|
+
query: getAssignedClientSchama,
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export const postClientCamApprovalSchamaQuery = joi.object( {
|
|
275
|
+
clientId: joi.string().required(),
|
|
276
|
+
} );
|
|
277
|
+
|
|
278
|
+
export const postClientCamApprovalSchamaBody = joi.object( {
|
|
279
|
+
action: joi.string().required(),
|
|
280
|
+
} );
|
|
281
|
+
|
|
282
|
+
export const postClientCamApprovalValid = {
|
|
283
|
+
query: postClientCamApprovalSchamaQuery,
|
|
284
|
+
body: postClientCamApprovalSchamaBody,
|
|
285
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import express from 'express';
|
|
3
|
-
import { activityLogValid, auditConfigValid, billingDetailsValid, brandInfoValid, clientCreationValid, clientDetailsValid, documentsValid, domainDetailsValid, featureConfigurationValid, getAuditConfigValid, signatoryDetailsValid, ticketConfigurationValid, userConfigurationValid } from '../dtos/client.dtos.js';
|
|
4
|
-
import { auditConfiguration, changeStatus, clientDetails, create, 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, 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';
|
|
5
5
|
import { authorize, isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
6
6
|
import { clientListValid, detailedClientCountValid } from '../dtos/client.dtos.js';
|
|
7
7
|
import { isclientIdExists, isclientNameExists } from '../validations/client.validations.js';
|
|
8
|
-
import { detailedAllClientCount, detailedClientCount, clientList } from '../controllers/client.controllers.js';
|
|
8
|
+
import { detailedAllClientCount, detailedClientCount, clientList, clientListV1 } from '../controllers/client.controllers.js';
|
|
9
9
|
|
|
10
10
|
export const clientRouter = express.Router();
|
|
11
11
|
|
|
@@ -83,7 +83,9 @@ clientRouter.get( '/detailed-all-client-count', isAllowedSessionHandler,
|
|
|
83
83
|
clientRouter.post( '/client-list', isAllowedSessionHandler,
|
|
84
84
|
authorize( { userType: [ 'tango' ], access: [ { featureName: 'manage', name: 'brands', permissions: [ 'isView' ] } ] } ),
|
|
85
85
|
validate( clientListValid ), clientList );
|
|
86
|
-
|
|
86
|
+
clientRouter.post( '/client-list_v1', isAllowedSessionHandler,
|
|
87
|
+
authorize( { userType: [ 'tango' ], access: [ { featureName: 'manage', name: 'brands', permissions: [ 'isView' ] } ] } ),
|
|
88
|
+
validate( clientListValid ), clientListV1 );
|
|
87
89
|
clientRouter.get( '/detailed-client-count', isAllowedSessionHandler,
|
|
88
90
|
authorize( { userType: [ 'tango', 'client' ] } ),
|
|
89
91
|
validate( detailedClientCountValid ), isclientIdExists, detailedClientCount );
|
|
@@ -93,4 +95,10 @@ clientRouter.post( '/activity-log', isAllowedSessionHandler, authorize(
|
|
|
93
95
|
{ featureName: 'settings', name: 'activityLog', permissions: [ 'isView' ] } ] } ),
|
|
94
96
|
validate( activityLogValid ), getActivityLogs );
|
|
95
97
|
|
|
98
|
+
clientRouter.get( '/show-csm-assign-confirmation', isAllowedSessionHandler,
|
|
99
|
+
validate( getAssignedClientValid ), csmAssignConfirmation );
|
|
100
|
+
|
|
101
|
+
clientRouter.post( '/client-csm-assign-action', isAllowedSessionHandler,
|
|
102
|
+
validate( postClientCamApprovalValid ), clientCsmAssignAction );
|
|
103
|
+
|
|
96
104
|
|
|
@@ -2,7 +2,7 @@ import clientModel from 'tango-api-schema/schema/client.model.js';
|
|
|
2
2
|
import leadModel from 'tango-api-schema/schema/lead.model.js';
|
|
3
3
|
import storeModel from 'tango-api-schema/schema/store.model.js';
|
|
4
4
|
import userModel from 'tango-api-schema/schema/user.model.js';
|
|
5
|
-
import { createQueue, getQueueUrl,
|
|
5
|
+
import { createQueue, getQueueUrl, logger } from 'tango-app-api-middleware';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export function update( query, record ) {
|
|
@@ -27,10 +27,11 @@ export function findClient( query, field ) {
|
|
|
27
27
|
|
|
28
28
|
export async function createAuditQueue( queueName ) {
|
|
29
29
|
try {
|
|
30
|
-
const
|
|
30
|
+
const sqs = JSON.parse( process.env.SQS );
|
|
31
|
+
const isExist = await getQueueUrl( `${queueName}${sqs.queueType}` );
|
|
31
32
|
logger.info( { message: isExist, function: 'createAuditQueue-isExist' } );
|
|
32
33
|
if ( isExist.statusCode ) {
|
|
33
|
-
const addQueue = await createQueue( `${queueName}${
|
|
34
|
+
const addQueue = await createQueue( `${queueName}${sqs.queueType}` );
|
|
34
35
|
logger.info( { message: addQueue.QueueUrl, function: 'addQueue.QueueUrl' } );
|
|
35
36
|
if ( addQueue.QueueUrl ) {
|
|
36
37
|
logger.info(
|
|
@@ -131,7 +132,7 @@ export function featureConfigurationUpdate( {
|
|
|
131
132
|
clientId, billableCalculation, bouncedLimitCondition, bouncedLimitValue,
|
|
132
133
|
close, conversionCalculation, conversionCondition,
|
|
133
134
|
conversionValue, infraAlertCondition, infraAlertValue, isFootfallDirectory,
|
|
134
|
-
isNormalized, isPasserByData, missedOpportunityCalculation, open,
|
|
135
|
+
isNormalized, isPasserByData, missedOpportunityCalculation, open, isExcludedArea,
|
|
135
136
|
} ) {
|
|
136
137
|
return clientModel.updateOne( { clientId: clientId },
|
|
137
138
|
{
|
|
@@ -150,6 +151,8 @@ export function featureConfigurationUpdate( {
|
|
|
150
151
|
'featureConfigs.isNormalized': isNormalized,
|
|
151
152
|
'featureConfigs.isPasserByData': isPasserByData,
|
|
152
153
|
'featureConfigs.isFootfallDirectory': isFootfallDirectory,
|
|
154
|
+
'featureConfigs.isExcludedArea': isExcludedArea,
|
|
155
|
+
'featureConfigs.updateFeatureConfig': false,
|
|
153
156
|
},
|
|
154
157
|
} );
|
|
155
158
|
}
|
|
@@ -285,3 +288,12 @@ export function findOneClient( query, field ) {
|
|
|
285
288
|
return clientModel.findOne( query, field );
|
|
286
289
|
}
|
|
287
290
|
|
|
291
|
+
export async function updateOneClient( query, record ) {
|
|
292
|
+
return clientModel.updateOne(
|
|
293
|
+
query,
|
|
294
|
+
{
|
|
295
|
+
$set: record,
|
|
296
|
+
},
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
@@ -3,3 +3,11 @@ import groupModel from 'tango-api-schema/schema/group.model.js';
|
|
|
3
3
|
export function countDocumentsGroup( query ) {
|
|
4
4
|
return groupModel.countDocuments( query );
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
export async function createGroupModel( query ={}, field={} ) {
|
|
8
|
+
return await groupModel.create( query, field );
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export async function findOneGroup( query ={}, field={} ) {
|
|
12
|
+
return await groupModel.findOne( query, field );
|
|
13
|
+
};
|
|
@@ -3,6 +3,9 @@ import storeModel from 'tango-api-schema/schema/store.model.js';
|
|
|
3
3
|
export function countDocumentsStore( query ) {
|
|
4
4
|
return storeModel.countDocuments( query );
|
|
5
5
|
}
|
|
6
|
+
export function findStore( query ) {
|
|
7
|
+
return storeModel.find( query );
|
|
8
|
+
}
|
|
6
9
|
|
|
7
10
|
export function aggregateStore( query ) {
|
|
8
11
|
return storeModel.aggregate( query );
|
|
@@ -11,3 +14,7 @@ export function aggregateStore( query ) {
|
|
|
11
14
|
export function updateManyStore( query, record ) {
|
|
12
15
|
return storeModel.updateMany( query, { $set: record } );
|
|
13
16
|
}
|
|
17
|
+
|
|
18
|
+
export function findOneStore( query, field ) {
|
|
19
|
+
return storeModel.findOne( query, field );
|
|
20
|
+
}
|
|
@@ -4,3 +4,16 @@ import userAssignedStoreModel from 'tango-api-schema/schema/userAssignedStore.mo
|
|
|
4
4
|
export async function aggregateUserAssignedStore( query ) {
|
|
5
5
|
return await userAssignedStoreModel.aggregate( query );
|
|
6
6
|
};
|
|
7
|
+
|
|
8
|
+
export async function updateOneUserAssignedStore( query, record ) {
|
|
9
|
+
return userAssignedStoreModel.updateOne(
|
|
10
|
+
query,
|
|
11
|
+
{
|
|
12
|
+
$set: record,
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function deleteOneAssignedStore( query ) {
|
|
18
|
+
return userAssignedStoreModel.deleteOne( query );
|
|
19
|
+
}
|