tango-app-api-client 3.1.12 → 3.1.14

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,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-client",
3
- "version": "3.1.12",
3
+ "version": "3.1.14",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "nodemon": "^3.0.3",
27
27
  "swagger-ui-express": "^5.0.0",
28
28
  "tango-api-schema": "^2.0.93",
29
- "tango-app-api-middleware": "^3.1.8",
29
+ "tango-app-api-middleware": "^3.1.9",
30
30
  "winston": "^3.11.0",
31
31
  "winston-daily-rotate-file": "^5.0.0"
32
32
  },
@@ -382,9 +382,18 @@ export async function detailedAllClientCount( req, res ) {
382
382
  {
383
383
  $project: {
384
384
  activeClient: { $cond: [ { $eq: [ '$status', 'active' ] }, 1, 0 ] },
385
- paidClient: { $cond: [ { $in: [ '$planDetails.paymentStatus', [ 'paid', 'unbilled', 'due' ] ] }, 1, 0 ] },
386
- trialClient: { $cond: [ { $eq: [ '$planDetails.paymentStatus', 'trial' ] }, 1, 0 ] },
387
- freeClient: { $cond: [ { $eq: [ '$planDetails.paymentStatus', 'free' ] }, 1, 0 ] },
385
+ paidClient: { $cond: [ { $and: [
386
+ { $eq: [ '$status', 'active' ] },
387
+ { $in: [ '$planDetails.paymentStatus', [ 'paid', 'unbilled', 'due' ] ] },
388
+ ] }, 1, 0 ] },
389
+ trialClient: { $cond: [ { $and: [
390
+ { $eq: [ '$status', 'active' ] },
391
+ { $eq: [ '$planDetails.paymentStatus', 'trial' ] },
392
+ ] }, 1, 0 ] },
393
+
394
+ freeClient: { $cond: [ { $and: [
395
+ { $eq: [ '$status', 'active' ] }, { $eq: [ '$planDetails.paymentStatus', 'free' ] },
396
+ ] }, 1, 0 ] },
388
397
  holdClient: { $cond: [ { $eq: [ '$status', 'hold' ] }, 1, 0 ] },
389
398
  suspendClient: { $cond: [ { $eq: [ '$status', 'suspended' ] }, 1, 0 ] },
390
399
  deactiveClient: { $cond: [ { $eq: [ '$status', 'deactive' ] }, 1, 0 ] },
@@ -28,12 +28,10 @@ export function findClient( query, field ) {
28
28
  export async function createAuditQueue( queueName ) {
29
29
  try {
30
30
  const isExist = await getQueueUrl( `${queueName}${appConfig.cloud.aws.sqs.queueType}` );
31
- logger.info({message: isExist, function: 'createAuditQueue-isExist'})
32
- if(isExist == false){
33
- return res.sendError(`Queue Doesn't create`, 500)
34
- }
31
+ logger.info( { message: isExist, function: 'createAuditQueue-isExist' } );
35
32
  if ( isExist.statusCode ) {
36
33
  const addQueue = await createQueue( `${queueName}${appConfig.cloud.aws.sqs.queueType}` );
34
+ logger.info( { message: addQueue.QueueUrl, function: 'addQueue.QueueUrl' } );
37
35
  if ( addQueue.QueueUrl ) {
38
36
  logger.info(
39
37
  'Queueue Created'
@@ -48,7 +46,7 @@ export async function createAuditQueue( queueName ) {
48
46
  return true;
49
47
  } catch ( error ) {
50
48
  logger.error( { error: error, message: queueName, function: 'createAuditQueue' } );
51
- return false;
49
+ return res.sendError( `Queue Doesn't create`, 500 );
52
50
  }
53
51
  }
54
52