tango-app-api-client 3.3.2-beta.3 → 3.3.2-beta.4

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.3.2-beta.3",
3
+ "version": "3.3.2-beta.4",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -15,7 +15,7 @@ import { countDocumentsGroup, createGroupModel, findOneGroup } from '../service/
15
15
  import { createBilling } from '../service/billing.service.js';
16
16
  import { createPaymentAccount } from '../service/paymentAccount.service.js';
17
17
  import { countDocumentsClusters } from '../service/cluster.service.js';
18
-
18
+ import { countDocumentsTeams } from '../service/teams.service.js';
19
19
 
20
20
  export async function create( req, res ) {
21
21
  try {
@@ -81,17 +81,16 @@ export async function create( req, res ) {
81
81
  'auditConfigs.traxQueueName.cameraAngleChange': `${generatedName}-cameraAngleChange`,
82
82
  };
83
83
 
84
-
84
+ record.featureConfigs = {};
85
85
  if ( product && product.length > 0 ) {
86
86
  for ( let data of product ) {
87
- console.log( data.productName );
88
- record.featureConfigs = {};
87
+ record.featureConfigs.isNewDashboard = true;
88
+
89
89
  if ( data.productName === 'tangoTraffic' ) {
90
- record.featureConfigs.isNewDashboard = true;
91
90
  record.featureConfigs.isNewTraffic = true;
92
91
  record.featureConfigs.isNewReports = true;
93
92
  }
94
- if ( data.productName === 'tangozone' ) {
93
+ if ( data.productName === 'tangoZone' ) {
95
94
  record.featureConfigs.isNewZone = true;
96
95
  }
97
96
  if ( data.productName === 'tangoTrax' ) {
@@ -99,6 +98,8 @@ export async function create( req, res ) {
99
98
  }
100
99
  }
101
100
  }
101
+
102
+
102
103
  const insertClient = await insert( record );
103
104
 
104
105
  const insertedClientRecord = await findOneClient( { clientId: record.clientId }, {} );
@@ -1967,6 +1968,7 @@ export async function detailedClientCount( req, res ) {
1967
1968
  result['totalStoreCount'] = await countDocumentsStore( { clientId: inputData.clientId } );
1968
1969
  result['totalGroupCount'] = await countDocumentsGroup( { clientId: inputData.clientId, isActive: true } );
1969
1970
  result['totalclusterCount'] = await countDocumentsClusters( { clientId: inputData.clientId } );
1971
+ result['totalTeamsCount'] = await countDocumentsTeams( { clientId: inputData.clientId } );
1970
1972
  result['totalCameraCount'] = await countDocumentsCamera( { clientId: inputData.clientId } );
1971
1973
  result['totalUserCount'] = await countDocumentsUser( { clientId: inputData.clientId, userType: 'client' } );
1972
1974
 
@@ -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
+ }