tango-app-api-audit 3.4.11-alpha.2 → 3.4.11-alpha.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-audit",
3
- "version": "3.4.11-alpha.2",
3
+ "version": "3.4.11-alpha.4",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1167,14 +1167,14 @@ export async function saveDraft( req, res ) {
1167
1167
  };
1168
1168
 
1169
1169
  if ( getUserAuditData?.startTime ) {
1170
- const isoDate = getUserAuditData.startTime;
1171
- const currentTime = dayjs();
1172
- const isoDateTime = dayjs( isoDate );
1173
- const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
1170
+ // const isoDate = getUserAuditData.startTime;
1171
+ // const currentTime = dayjs();
1172
+ // const isoDateTime = dayjs( isoDate );
1173
+ // const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
1174
1174
 
1175
- userRecord.timeSpent = timeDifferenceInMinutes;
1175
+ userRecord.timeSpent = inputData.timeSpent;
1176
1176
 
1177
- storeRecord.timeSpent = timeDifferenceInMinutes;
1177
+ storeRecord.timeSpent = inputData.timeSpent;
1178
1178
  }
1179
1179
 
1180
1180
  if ( inputData.userCommands ) {
@@ -1191,6 +1191,7 @@ export async function saveDraft( req, res ) {
1191
1191
  clientName: inputData.queueName,
1192
1192
  beforeCount: inputData.totalCount,
1193
1193
  afterCount: inputData.customerCount,
1194
+ timeSpent: inputData.timeSpent,
1194
1195
  auditId: inputData.auditId,
1195
1196
  moduleType: inputData.moduleType,
1196
1197
  zoneName: inputData.zoneName,
@@ -1321,10 +1322,10 @@ export async function save( req, res ) {
1321
1322
  // // moduleType: inputData.moduleType,
1322
1323
  // // zoneName: inputData.zoneName,
1323
1324
  // } );
1324
- const isoDate = req.userAudit?.startTime;
1325
- const currentTime = dayjs();
1326
- const isoDateTime = dayjs( isoDate );
1327
- const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
1325
+ // const isoDate = req.userAudit?.startTime;
1326
+ // const currentTime = dayjs();
1327
+ // const isoDateTime = dayjs( isoDate );
1328
+ // const timeDifferenceInMinutes = currentTime.diff( isoDateTime, 'seconds' );
1328
1329
 
1329
1330
  await updateOneUserAudit(
1330
1331
  { _id: new mongoose.Types.ObjectId( inputData.auditId ) },
@@ -1333,7 +1334,7 @@ export async function save( req, res ) {
1333
1334
  endTime: Date.now(),
1334
1335
  isDraft: false,
1335
1336
  afterCount: inputData.customerCount,
1336
- timeSpent: timeDifferenceInMinutes,
1337
+ timeSpent: inputData.timeSpent,
1337
1338
  },
1338
1339
  );
1339
1340
 
@@ -1354,7 +1355,7 @@ export async function save( req, res ) {
1354
1355
  afterCount: inputData.customerCount,
1355
1356
  startTime: req.userAudit?.startTime,
1356
1357
  endTime: Date.now(),
1357
- timeSpent: timeDifferenceInMinutes,
1358
+ timeSpent: inputData.timeSpent,
1358
1359
  auditId: new mongoose.Types.ObjectId( inputData.auditId ),
1359
1360
  },
1360
1361
  createdAt: Date.now(),
@@ -1421,7 +1422,7 @@ export async function save( req, res ) {
1421
1422
  status: 'not_assign',
1422
1423
  afterCount: inputData.customerCount,
1423
1424
  auditType: 'ReAudit',
1424
- timeSpent: timeDifferenceInMinutes,
1425
+ timeSpent: inputData.timeSpent,
1425
1426
  },
1426
1427
  );
1427
1428
 
@@ -1442,7 +1443,7 @@ export async function save( req, res ) {
1442
1443
  afterCount: inputData.customerCount,
1443
1444
  startTime: req.userAudit?.startTime,
1444
1445
  endTime: Date.now(),
1445
- timeSpent: timeDifferenceInMinutes,
1446
+ timeSpent: inputData.timeSpent,
1446
1447
  auditId: new mongoose.Types.ObjectId( inputData.auditId ),
1447
1448
  },
1448
1449
  createdAt: Date.now(),
@@ -1464,7 +1465,7 @@ export async function save( req, res ) {
1464
1465
  {
1465
1466
  status: 'completed',
1466
1467
  afterCount: inputData.customerCount,
1467
- timeSpent: timeDifferenceInMinutes,
1468
+ timeSpent: inputData.timeSpent,
1468
1469
  },
1469
1470
  );
1470
1471
  const sqsProduceQueue = {
@@ -52,6 +52,7 @@ export const saveDraftSchema = joi.object( {
52
52
  auditId: joi.string().required(),
53
53
  moduleType: joi.string().required(),
54
54
  zoneName: joi.string().required(),
55
+ timeSpent: joi.number().required(),
55
56
  auditType: joi.string().required(),
56
57
  fileDate: joi.string().required(),
57
58
  queueName: joi.string().required(),
@@ -88,6 +89,7 @@ export const saveSchema = joi.object( {
88
89
  storeId: joi.string().required(),
89
90
  fileDate: joi.string().required(),
90
91
  auditType: joi.string().required(),
92
+ timeSpent: joi.number().required(),
91
93
  moduleType: joi.string().required(),
92
94
  zoneName: joi.string().required(),
93
95
  beforeCount: joi.number().required(),