tango-app-api-audit 3.4.3-alpha.3 → 3.4.3-alpha.6
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
|
@@ -16,7 +16,7 @@ import { findOneAuditLog, createAuditLog,
|
|
|
16
16
|
import {
|
|
17
17
|
findOneUserEmpDetection,
|
|
18
18
|
} from '../service/userEmpDetection.service.js';
|
|
19
|
-
import {
|
|
19
|
+
import { updateOneEmpDetectionOutput } from '../service/empDetectionOutput.service.js';
|
|
20
20
|
// export async function getDetectionAuditFile( req, res ) {
|
|
21
21
|
// try {
|
|
22
22
|
// const bucket = JSON.parse( process.env.BUCKET );
|
|
@@ -337,13 +337,13 @@ import { createempDetectionOutput } from '../service/auditUserWallet.service.js'
|
|
|
337
337
|
// const data = await signedUrl( fetchData );
|
|
338
338
|
// const mapimg = {
|
|
339
339
|
// img_path: data,
|
|
340
|
-
// img_name: image[0],
|
|
341
|
-
// img_id:
|
|
340
|
+
// img_name: inputData.moduleType=='mobile-detection'?`${indexes[0]}-${indexes[3]}` :image[0],
|
|
341
|
+
// img_id: img[3],
|
|
342
342
|
// };
|
|
343
343
|
// files.push( {
|
|
344
344
|
// img_path: data,
|
|
345
|
-
// img_name: image[0],
|
|
346
|
-
// img_id:
|
|
345
|
+
// img_name: inputData.moduleType=='mobile-detection'?`${indexes[0]}-${indexes[3]}` :image[0],
|
|
346
|
+
// img_id: img[3],
|
|
347
347
|
// selected: false,
|
|
348
348
|
// dropped: false,
|
|
349
349
|
// count: 1,
|
|
@@ -3815,13 +3815,13 @@ export async function getDetectionAuditFile( req, res ) {
|
|
|
3815
3815
|
const data = await signedUrl( fetchData );
|
|
3816
3816
|
const mapimg = {
|
|
3817
3817
|
img_path: data,
|
|
3818
|
-
img_name: image[0],
|
|
3819
|
-
img_id:
|
|
3818
|
+
img_name: inputData.moduleType=='mobile-detection'?`${indexes[0]}-${indexes[3]}` :image[0],
|
|
3819
|
+
img_id: img[3],
|
|
3820
3820
|
};
|
|
3821
3821
|
files.push( {
|
|
3822
3822
|
img_path: data,
|
|
3823
|
-
img_name: image[0],
|
|
3824
|
-
img_id:
|
|
3823
|
+
img_name: inputData.moduleType=='mobile-detection'?`${indexes[0]}-${indexes[3]}` :image[0],
|
|
3824
|
+
img_id: img[3],
|
|
3825
3825
|
selected: false,
|
|
3826
3826
|
dropped: false,
|
|
3827
3827
|
count: 1,
|
|
@@ -4050,8 +4050,11 @@ export async function getDraftedData( req, res ) {
|
|
|
4050
4050
|
export async function save( req, res ) {
|
|
4051
4051
|
try {
|
|
4052
4052
|
const inputData = req.body;
|
|
4053
|
-
const
|
|
4053
|
+
const query ={ storeId: inputData.storeId, moduleType: inputData.moduleType, fileDate: inputData.fileDate };
|
|
4054
|
+
const data = await updateOneEmpDetectionOutput( query, { $set: inputData }, { upsert: true } );
|
|
4054
4055
|
if ( data ) {
|
|
4056
|
+
await updateOneUserEmpDetection( { _id: inputData.auditId }, { auditStatus: 'completed', afterCount: inputData.employeeCount } );
|
|
4057
|
+
await updateOneStoreEmpDetection( query, { status: 'completed', afterCount: inputData.employeeCount } );
|
|
4055
4058
|
return res.sendSuccess( { result: 'Updated Successfully' } );
|
|
4056
4059
|
} else {
|
|
4057
4060
|
return res.sendError( 'something went wrong', 403 );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import empDetectionOutputModel from 'tango-api-schema/schema/empDetectionOutput.model.js';
|
|
3
|
-
export function
|
|
4
|
-
return empDetectionOutputModel.
|
|
3
|
+
export function updateOneEmpDetectionOutput( query, record, upsert ) {
|
|
4
|
+
return empDetectionOutputModel.updateOne( query, record, upsert );
|
|
5
5
|
}
|