tango-app-api-store-zone 3.0.18-dev → 3.0.20-dev

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-store-zone",
3
- "version": "3.0.18-dev",
3
+ "version": "3.0.20-dev",
4
4
  "description": "zone",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -136,7 +136,7 @@ export const tagging = async ( req, res ) => {
136
136
  insertOpenSearchData( JSON.parse( process.env.OPENSEARCH )?.activityLog, logObj );
137
137
  let response = await taggingService.create( InputData );
138
138
  await taggingService.deleteOne( { clientId: InputData.clientId, storeId: InputData.storeId, cameraId: { $exists: false }, tagName: InputData.tagName } );
139
- await axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingAdd`, [ response ], { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => logger.info( res?.data ) ).catch( ( error ) => logger.error( { error: error } ) );
139
+ axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingAdd`, [ response ], { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => logger.info( res?.data ) ).catch( ( error ) => logger.error( { error: error } ) );
140
140
  } else {
141
141
  const logObj = {
142
142
  clientId: InputData.clientId,
@@ -163,7 +163,7 @@ export const tagging = async ( req, res ) => {
163
163
  if ( InputData.coordinates[0].coor.length ) {
164
164
  taggingDetails.coordinates.push( InputData.coordinates[0] );
165
165
  taggingDetails.save();
166
- await axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingUpdate/${taggingDetails._id}`, taggingDetails, { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => {
166
+ axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingUpdate/${taggingDetails._id}`, taggingDetails, { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => {
167
167
  logger.info( res?.data );
168
168
  } ).catch( ( error ) => {
169
169
  logger.error( { error: error } );
@@ -173,6 +173,13 @@ export const tagging = async ( req, res ) => {
173
173
  }
174
174
  }
175
175
  }
176
+ let storeDetails = await storeService.findOne( { storeId: InputData.storeId }, { progress: 1 } );
177
+ if ( storeDetails ) {
178
+ if ( storeDetails.progress != 100 ) {
179
+ storeDetails.progress = 80;
180
+ storeDetails.save();
181
+ }
182
+ }
176
183
  await updatezoneTagging( req, res );
177
184
  } catch ( e ) {
178
185
  logger.error( { error: e, function: 'tagging' } );
@@ -182,7 +189,7 @@ export const tagging = async ( req, res ) => {
182
189
 
183
190
  export const getCameraList = async ( req, res ) => {
184
191
  try {
185
- let cameraDetails = await cameraService.find( { clientId: req.query.clientId, storeId: req.query.storeId }, { cameraNumber: 1, streamName: 1, isActivated: 1, isUp: 1 } );
192
+ let cameraDetails = await cameraService.find( { clientId: req.query.clientId, storeId: req.query.storeId }, { cameraNumber: 1, streamName: 1, isActivated: 1, isUp: 1, cameraName: 1 } );
186
193
  if ( !cameraDetails.length ) {
187
194
  return res.sendError( 'no data found', 204 );
188
195
  }
@@ -279,7 +286,7 @@ export const updateTag = async ( req, res ) => {
279
286
  } );
280
287
  }
281
288
  taggingCoordinates.forEach( async ( item ) => {
282
- await axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingUpdate/${item._id}`, item, { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => {
289
+ axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingUpdate/${item._id}`, item, { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => {
283
290
  logger.info( res?.data );
284
291
  } ).catch( ( error ) => {
285
292
  logger.error( { error: error } );
@@ -343,7 +350,7 @@ export const deleteTag = async ( req, res ) => {
343
350
  }
344
351
  }
345
352
  taggingDetails.forEach( async ( item ) => {
346
- await axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingDelete/${item._id}`, '', { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => {
353
+ axios.post( `${JSON.parse( process.env.URL ).oldapidomain}/tagging/oldTaggingDelete/${item._id}`, '', { headers: { Authorization: 'Bearer d47433f8-9a33-47c7-ba43-1a0fbac28f66' } } ).then( ( res ) => {
347
354
  logger.info( res?.data );
348
355
  } ).catch( ( error ) => {
349
356
  logger.error( { error: error } );