tango-app-api-audit 3.4.11-alpha.13 → 3.4.11-alpha.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
|
@@ -1384,10 +1384,10 @@ export async function saveBinary( req, res ) {
|
|
|
1384
1384
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
1385
1385
|
const sqs = JSON.parse( process.env.SQS );
|
|
1386
1386
|
const inputData = req.body;
|
|
1387
|
-
const isoDate = req.userAudit?.startTime;
|
|
1388
|
-
const currentTime = dayjs();
|
|
1389
|
-
const isoDateTime = dayjs( isoDate );
|
|
1390
|
-
const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
|
|
1387
|
+
// const isoDate = req.userAudit?.startTime;
|
|
1388
|
+
// const currentTime = dayjs();
|
|
1389
|
+
// const isoDateTime = dayjs( isoDate );
|
|
1390
|
+
// const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
|
|
1391
1391
|
const value = inputData.moduleType? inputData.moduleType.replace( /-/g, ' ' ) : '';
|
|
1392
1392
|
switch ( inputData.moduleType ) {
|
|
1393
1393
|
case 'unattended-customer':
|
|
@@ -1404,7 +1404,7 @@ export async function saveBinary( req, res ) {
|
|
|
1404
1404
|
answer: inputData.answer,
|
|
1405
1405
|
userComments: inputData.userComments || '',
|
|
1406
1406
|
endTime: new Date(),
|
|
1407
|
-
timeSpent:
|
|
1407
|
+
timeSpent: inputData.timeSpent,
|
|
1408
1408
|
};
|
|
1409
1409
|
let updatDataunattended= await updateOneBinaryAuditModel( unattendedquery, update );
|
|
1410
1410
|
if ( updatDataunattended.modifiedCount==0 ) {
|
|
@@ -1430,7 +1430,7 @@ export async function saveBinary( req, res ) {
|
|
|
1430
1430
|
question: req.userAudit?.question,
|
|
1431
1431
|
result: req.userAudit?.answer,
|
|
1432
1432
|
endTime: Date.now(),
|
|
1433
|
-
timeSpent:
|
|
1433
|
+
timeSpent: inputData.timeSpent,
|
|
1434
1434
|
auditId: new mongoose.Types.ObjectId( inputData.auditId ),
|
|
1435
1435
|
},
|
|
1436
1436
|
createdAt: Date.now(),
|
|
@@ -1454,7 +1454,7 @@ export async function saveBinary( req, res ) {
|
|
|
1454
1454
|
answer: inputData.answer,
|
|
1455
1455
|
userComments: inputData.userComments || '',
|
|
1456
1456
|
endTime: new Date(),
|
|
1457
|
-
timeSpent:
|
|
1457
|
+
timeSpent: inputData.timeSpent,
|
|
1458
1458
|
};
|
|
1459
1459
|
let updatDataUniform= await updateOneBinaryAuditModel( uniformDetectionQuery, updateUniform );
|
|
1460
1460
|
if ( updatDataUniform.modifiedCount==0 ) {
|
|
@@ -1515,7 +1515,7 @@ export async function saveBinary( req, res ) {
|
|
|
1515
1515
|
question: req.userAudit?.question,
|
|
1516
1516
|
result: req.userAudit?.answer,
|
|
1517
1517
|
endTime: Date.now(),
|
|
1518
|
-
timeSpent:
|
|
1518
|
+
timeSpent: inputData.timeSpent,
|
|
1519
1519
|
auditId: new mongoose.Types.ObjectId( inputData.auditId ),
|
|
1520
1520
|
},
|
|
1521
1521
|
createdAt: Date.now(),
|
|
@@ -1537,7 +1537,7 @@ export async function saveBinary( req, res ) {
|
|
|
1537
1537
|
answer: inputData.answer,
|
|
1538
1538
|
userComments: inputData.userComments || '',
|
|
1539
1539
|
endTime: new Date(),
|
|
1540
|
-
timeSpent:
|
|
1540
|
+
timeSpent: inputData.timeSpent,
|
|
1541
1541
|
};
|
|
1542
1542
|
let updatDataleft= await updateOneBinaryAuditModel( leftquery, leftupdate );
|
|
1543
1543
|
if ( updatDataleft.modifiedCount==0 ) {
|
|
@@ -1563,7 +1563,7 @@ export async function saveBinary( req, res ) {
|
|
|
1563
1563
|
question: req.userAudit?.question,
|
|
1564
1564
|
result: req.userAudit?.answer,
|
|
1565
1565
|
endTime: Date.now(),
|
|
1566
|
-
timeSpent:
|
|
1566
|
+
timeSpent: inputData.timeSpent,
|
|
1567
1567
|
auditId: new mongoose.Types.ObjectId( inputData.auditId ),
|
|
1568
1568
|
},
|
|
1569
1569
|
createdAt: Date.now(),
|
|
@@ -1586,7 +1586,7 @@ export async function saveBinary( req, res ) {
|
|
|
1586
1586
|
answer: inputData.answer,
|
|
1587
1587
|
userComments: inputData.userComments || '',
|
|
1588
1588
|
endTime: new Date(),
|
|
1589
|
-
timeSpent:
|
|
1589
|
+
timeSpent: inputData.timeSpent,
|
|
1590
1590
|
};
|
|
1591
1591
|
let updatDatacamera= await updateOneBinaryAuditModel( cameraquery, cameraupdate );
|
|
1592
1592
|
if ( updatDatacamera.modifiedCount==0 ) {
|
|
@@ -1613,7 +1613,7 @@ export async function saveBinary( req, res ) {
|
|
|
1613
1613
|
question: req.userAudit?.question,
|
|
1614
1614
|
result: req.userAudit?.answer,
|
|
1615
1615
|
endTime: Date.now(),
|
|
1616
|
-
timeSpent:
|
|
1616
|
+
timeSpent: inputData.timeSpent,
|
|
1617
1617
|
auditId: new mongoose.Types.ObjectId( inputData.auditId ),
|
|
1618
1618
|
},
|
|
1619
1619
|
createdAt: Date.now(),
|
|
@@ -4420,14 +4420,14 @@ export async function saveDraft( req, res ) {
|
|
|
4420
4420
|
};
|
|
4421
4421
|
|
|
4422
4422
|
if ( getUserAuditData?.startTime ) {
|
|
4423
|
-
const isoDate = getUserAuditData.startTime;
|
|
4424
|
-
const currentTime = dayjs();
|
|
4425
|
-
const isoDateTime = dayjs( isoDate );
|
|
4426
|
-
const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
|
|
4423
|
+
// const isoDate = getUserAuditData.startTime;
|
|
4424
|
+
// const currentTime = dayjs();
|
|
4425
|
+
// const isoDateTime = dayjs( isoDate );
|
|
4426
|
+
// const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
|
|
4427
4427
|
|
|
4428
|
-
userRecord.timeSpent =
|
|
4428
|
+
userRecord.timeSpent = inputData.timeSpent;
|
|
4429
4429
|
|
|
4430
|
-
storeRecord.timeSpent =
|
|
4430
|
+
storeRecord.timeSpent = inputData.timeSpent;
|
|
4431
4431
|
}
|
|
4432
4432
|
|
|
4433
4433
|
if ( inputData.userCommands ) {
|
|
@@ -4500,10 +4500,10 @@ export async function save( req, res ) {
|
|
|
4500
4500
|
const openSearch = JSON.parse( process.env.OPENSEARCH );
|
|
4501
4501
|
const sqs = JSON.parse( process.env.SQS );
|
|
4502
4502
|
const inputData = req.body;
|
|
4503
|
-
const isoDate = req.userAudit?.startTime;
|
|
4504
|
-
const currentTime = dayjs();
|
|
4505
|
-
const isoDateTime = dayjs( isoDate );
|
|
4506
|
-
const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
|
|
4503
|
+
// const isoDate = req.userAudit?.startTime;
|
|
4504
|
+
// const currentTime = dayjs();
|
|
4505
|
+
// const isoDateTime = dayjs( isoDate );
|
|
4506
|
+
// const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
|
|
4507
4507
|
const getUserAuditData = await findOneUserEmpDetection( { _id: inputData.auditId } );
|
|
4508
4508
|
inputData.clientId = getUserAuditData.clientId;
|
|
4509
4509
|
const query ={ storeId: inputData.storeId, moduleType: inputData.moduleType, fileDate: inputData.fileDate };
|
|
@@ -4514,12 +4514,12 @@ export async function save( req, res ) {
|
|
|
4514
4514
|
afterCount: inputData.employeeCount,
|
|
4515
4515
|
endTime: Date.now(),
|
|
4516
4516
|
isDraft: false,
|
|
4517
|
-
timeSpent:
|
|
4517
|
+
timeSpent: inputData.timeSpent,
|
|
4518
4518
|
};
|
|
4519
4519
|
const storeUpdated ={
|
|
4520
4520
|
status: 'completed',
|
|
4521
4521
|
afterCount: inputData.employeeCount,
|
|
4522
|
-
timeSpent:
|
|
4522
|
+
timeSpent: inputData.timeSpent,
|
|
4523
4523
|
};
|
|
4524
4524
|
logger.info( { query: query, function: 'saveQuery' } );
|
|
4525
4525
|
const [ userUpdate, storeUpdate ] = await Promise.all( [ updateOneUserEmpDetection( { _id: inputData.auditId }, userUpdated ), updateOneStoreEmpDetection( query, storeUpdated ) ] );
|
|
@@ -4584,7 +4584,7 @@ export async function save( req, res ) {
|
|
|
4584
4584
|
afterCount: inputData.employeeCount,
|
|
4585
4585
|
startTime: req.userAudit?.startTime,
|
|
4586
4586
|
endTime: Date.now(),
|
|
4587
|
-
timeSpent:
|
|
4587
|
+
timeSpent: inputData.timeSpent,
|
|
4588
4588
|
auditId: new mongoose.Types.ObjectId( inputData.auditId ),
|
|
4589
4589
|
},
|
|
4590
4590
|
createdAt: Date.now(),
|
|
@@ -47,6 +47,7 @@ export const saveDraftSchema = joi.object(
|
|
|
47
47
|
moduleType: joi.string().required(),
|
|
48
48
|
auditType: joi.string().required(),
|
|
49
49
|
fileDate: joi.string().required(),
|
|
50
|
+
timeSpent: joi.number().required(),
|
|
50
51
|
queueName: joi.string().required(),
|
|
51
52
|
totalCount: joi.number().required(),
|
|
52
53
|
junkCount: joi.number().optional(),
|
|
@@ -272,6 +273,7 @@ export const saveSchema = joi.object( {
|
|
|
272
273
|
fileDate: joi.string().required(),
|
|
273
274
|
auditType: joi.string().required(),
|
|
274
275
|
moduleType: joi.string().required(),
|
|
276
|
+
timeSpent: joi.number().required(),
|
|
275
277
|
beforeCount: joi.number().required(),
|
|
276
278
|
employeeCount: joi.number().required(),
|
|
277
279
|
employee: joi.array().required(),
|