tango-app-api-audit 3.4.3-alpha.16 → 3.4.3-alpha.17
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
|
@@ -1660,21 +1660,22 @@ export async function userAuditHistory( req, res ) {
|
|
|
1660
1660
|
chunk.forEach( ( element ) => {
|
|
1661
1661
|
exportData.push( {
|
|
1662
1662
|
'File Date': element.fileDate,
|
|
1663
|
-
'Brand ID': element.clientId,
|
|
1664
1663
|
'Brand Name': element.clientName,
|
|
1665
|
-
'
|
|
1664
|
+
'Brand ID': element.clientId,
|
|
1666
1665
|
'Store Name': element.storeName,
|
|
1666
|
+
'Store ID': element.storeId,
|
|
1667
1667
|
'Zone Name': element.moduleType == 'zone' ? element.zoneName : '',
|
|
1668
1668
|
'Audit Type': element.auditType,
|
|
1669
1669
|
'Product Type': element.moduleType,
|
|
1670
1670
|
'Before Count': element.beforeCount,
|
|
1671
1671
|
'After Count': element.afterCount || '',
|
|
1672
1672
|
'Accuracy': element.accuracy || '',
|
|
1673
|
+
'Audited Date': dayjs( element.createdAt ).format( 'YYYY,MMM D' ),
|
|
1673
1674
|
'Start Time': element.startTime,
|
|
1674
1675
|
'End Time': element.endTime || '',
|
|
1675
1676
|
'Time Spent': element.timeSpent,
|
|
1676
|
-
'
|
|
1677
|
-
|
|
1677
|
+
'Status': element.auditStatus,
|
|
1678
|
+
|
|
1678
1679
|
|
|
1679
1680
|
} );
|
|
1680
1681
|
} );
|
|
@@ -3811,7 +3812,7 @@ export async function auditImages( req, res ) {
|
|
|
3811
3812
|
export async function getUserAuditCount( req, res ) {
|
|
3812
3813
|
try {
|
|
3813
3814
|
const userWallet = JSON.parse( process.env.USER_WALLET );
|
|
3814
|
-
const previousDate = dayjs( new Date() ).subtract(
|
|
3815
|
+
const previousDate = dayjs( new Date() ).subtract( 16, 'days' );
|
|
3815
3816
|
const fileDate = dayjs( previousDate ).format( 'DD-MM-YYYY' );
|
|
3816
3817
|
const configTimeSpentSec = userWallet.minTimeSpentSec; // 18000;
|
|
3817
3818
|
const beforeCountX = userWallet.beforeCountCreditPerc; // 0.0335;
|
|
@@ -4040,16 +4041,16 @@ export async function getUserAuditCount( req, res ) {
|
|
|
4040
4041
|
totalTimeSpent: {
|
|
4041
4042
|
$cond: [ { $eq: [ '$hours', 0 ] },
|
|
4042
4043
|
{ $concat: [
|
|
4043
|
-
{ $toString: '$minutes' }, '
|
|
4044
|
+
'00:', { $toString: '$minutes' }, ':00',
|
|
4044
4045
|
] },
|
|
4045
4046
|
{ $cond: [ { $eq: [ '$minutes', 0 ] },
|
|
4046
4047
|
{ $concat: [
|
|
4047
|
-
{ $toString: '$hours' }, '
|
|
4048
|
+
{ $toString: '$hours' }, ':00:00',
|
|
4048
4049
|
] },
|
|
4049
4050
|
{
|
|
4050
4051
|
$concat: [
|
|
4051
|
-
{ $toString: '$hours' }, '
|
|
4052
|
-
{ $toString: '$minutes' }, '
|
|
4052
|
+
{ $toString: '$hours' }, ':',
|
|
4053
|
+
{ $toString: '$minutes' }, ':00',
|
|
4053
4054
|
],
|
|
4054
4055
|
},
|
|
4055
4056
|
] },
|
|
@@ -1714,18 +1714,17 @@ export async function userAuditHistory( req, res ) {
|
|
|
1714
1714
|
const temp ={
|
|
1715
1715
|
|
|
1716
1716
|
'File Date': element.fileDate,
|
|
1717
|
-
'Brand ID': element.clientId,
|
|
1718
1717
|
'Brand Name': element.clientName,
|
|
1719
|
-
'
|
|
1718
|
+
'Brand ID': element.clientId,
|
|
1720
1719
|
'Store Name': element.storeName,
|
|
1720
|
+
'Store ID': element.storeId,
|
|
1721
1721
|
'Audit Type': element.auditType,
|
|
1722
1722
|
'Product Type': element.value,
|
|
1723
|
+
'Audited Date': dayjs( element.createdAt ).format( 'YYYY,MMM D' ),
|
|
1723
1724
|
'Start Time': element.startTime,
|
|
1724
1725
|
'End Time': element.endTime || '',
|
|
1725
1726
|
'Time Spent': element.timeSpent,
|
|
1726
1727
|
'Status': toCamelCase( element.auditStatus ),
|
|
1727
|
-
'Audited Date': dayjs( element.createdAt ).format( 'YYYY,MMM D' ),
|
|
1728
|
-
'Result': element.answer,
|
|
1729
1728
|
|
|
1730
1729
|
|
|
1731
1730
|
};
|