tango-app-api-audit 1.0.58 → 1.0.60
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
|
@@ -1277,12 +1277,12 @@ export async function save( req, res ) {
|
|
|
1277
1277
|
return res.sendError( mappingUpload, 500 );
|
|
1278
1278
|
}
|
|
1279
1279
|
|
|
1280
|
-
let getUserAuditData = await findOneUserAudit( {
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
} );
|
|
1285
|
-
const isoDate =
|
|
1280
|
+
// let getUserAuditData = await findOneUserAudit( {
|
|
1281
|
+
// _id: new mongoose.Types.ObjectId( inputData.auditId ),
|
|
1282
|
+
// // moduleType: inputData.moduleType,
|
|
1283
|
+
// // zoneName: inputData.zoneName,
|
|
1284
|
+
// } );
|
|
1285
|
+
const isoDate = userAudit?.startTime;
|
|
1286
1286
|
const currentTime = dayjs();
|
|
1287
1287
|
const isoDateTime = dayjs( isoDate );
|
|
1288
1288
|
const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
|
|
@@ -1307,7 +1307,7 @@ export async function save( req, res ) {
|
|
|
1307
1307
|
|
|
1308
1308
|
let storeConfig = await findOneStore(
|
|
1309
1309
|
{
|
|
1310
|
-
storeId:
|
|
1310
|
+
storeId: userAudit?.storeId,
|
|
1311
1311
|
},
|
|
1312
1312
|
{
|
|
1313
1313
|
auditConfigs: 1,
|
|
@@ -1316,11 +1316,8 @@ export async function save( req, res ) {
|
|
|
1316
1316
|
);
|
|
1317
1317
|
|
|
1318
1318
|
let clientData = await findClient( { clientId: storeConfig.clientId } );
|
|
1319
|
-
|
|
1320
|
-
if (
|
|
1321
|
-
( storeAuditData.beforeCount - inputData.customerCount ) /
|
|
1322
|
-
storeAuditData.beforeCount <
|
|
1323
|
-
storeConfig.auditConfigs.ratio &&
|
|
1319
|
+
const ratio = ( ( storeAuditData.beforeCount - inputData.customerCount ) / storeAuditData.beforeCount ) * 100;
|
|
1320
|
+
if ( ratio < storeConfig.auditConfigs.ratio &&
|
|
1324
1321
|
inputData.auditType == 'Audit' &&
|
|
1325
1322
|
inputData.moduleType == 'traffic'
|
|
1326
1323
|
) {
|
|
@@ -1377,7 +1374,7 @@ export async function save( req, res ) {
|
|
|
1377
1374
|
fileDate: inputData.fileDate,
|
|
1378
1375
|
moduleType: inputData.moduleType,
|
|
1379
1376
|
zoneName: inputData.zoneName,
|
|
1380
|
-
auditType: inputData.auditType,
|
|
1377
|
+
// auditType: inputData.auditType,
|
|
1381
1378
|
},
|
|
1382
1379
|
{
|
|
1383
1380
|
status: 'completed',
|
|
@@ -2756,7 +2753,7 @@ export async function reTrigger( req, res ) {
|
|
|
2756
2753
|
}
|
|
2757
2754
|
|
|
2758
2755
|
const storeRecord ={
|
|
2759
|
-
status:
|
|
2756
|
+
status: 'not_assign',
|
|
2760
2757
|
};
|
|
2761
2758
|
|
|
2762
2759
|
await updateOneStoreAudit( query, storeRecord );
|
|
@@ -2816,7 +2813,7 @@ export async function reTrigger( req, res ) {
|
|
|
2816
2813
|
}
|
|
2817
2814
|
|
|
2818
2815
|
const storeRecord ={
|
|
2819
|
-
status:
|
|
2816
|
+
status: 'assigned',
|
|
2820
2817
|
};
|
|
2821
2818
|
|
|
2822
2819
|
await updateOneStoreAudit( query, storeRecord );
|