tango-app-api-report 3.0.10-dev → 3.0.11-dev
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-report",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11-dev",
|
|
4
4
|
"description": "report",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"nodemailer": "^6.9.13",
|
|
25
25
|
"nodemon": "^3.1.0",
|
|
26
26
|
"swagger-ui-express": "^5.0.0",
|
|
27
|
-
"tango-api-schema": "^2.0.
|
|
28
|
-
"tango-app-api-middleware": "^1.0.
|
|
27
|
+
"tango-api-schema": "^2.0.103",
|
|
28
|
+
"tango-app-api-middleware": "^1.0.81-dev",
|
|
29
29
|
"winston": "^3.12.0",
|
|
30
30
|
"winston-daily-rotate-file": "^5.0.0"
|
|
31
31
|
},
|
|
@@ -26,10 +26,9 @@ export async function createReport( req, res ) {
|
|
|
26
26
|
logSubType: 'reportConfig',
|
|
27
27
|
changes: [ `${req.body?.fileName}` ],
|
|
28
28
|
eventType: 'create',
|
|
29
|
-
showTo: [ 'tango' ],
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
await insertOpenSearchData(
|
|
31
|
+
await insertOpenSearchData( 'tango-retail-activity-logs', logObj );
|
|
33
32
|
if ( createReport ) {
|
|
34
33
|
res.sendSuccess( { result: 'Created Successfully' } );
|
|
35
34
|
}
|
|
@@ -69,9 +68,6 @@ export async function getSingleReport( req, res ) {
|
|
|
69
68
|
|
|
70
69
|
export async function updateReport( req, res ) {
|
|
71
70
|
try {
|
|
72
|
-
const previousReport = await reportGetSingle( {
|
|
73
|
-
_id: req.params?.id,
|
|
74
|
-
} );
|
|
75
71
|
const updateAck = await reportUpdate( {
|
|
76
72
|
_id: req.params?.id, fileType: req.body?.fileType, email: req.body?.email, clientId: req.body?.clientId,
|
|
77
73
|
} );
|
|
@@ -87,13 +83,9 @@ export async function updateReport( req, res ) {
|
|
|
87
83
|
logSubType: 'reportConfig',
|
|
88
84
|
changes: [ `Report id ${req.params?.id}` ],
|
|
89
85
|
eventType: 'update',
|
|
90
|
-
showTo: [ 'tango' ],
|
|
91
|
-
current: req.body,
|
|
92
|
-
previous: previousReport,
|
|
93
|
-
|
|
94
86
|
};
|
|
95
87
|
|
|
96
|
-
await insertOpenSearchData(
|
|
88
|
+
await insertOpenSearchData( 'tango-retail-activity-logs', logObj );
|
|
97
89
|
if ( updateAck ) {
|
|
98
90
|
res.sendSuccess( { result: 'Updated Successfully' } );
|
|
99
91
|
}
|
|
@@ -269,11 +261,11 @@ export async function uploadManualReport( req, res ) {
|
|
|
269
261
|
Bucket: appConfig.cloud.aws.bucket.reportBucket,
|
|
270
262
|
Key: `reports/${inputData.fileDate}/${data.reportName}/`,
|
|
271
263
|
fileName: inputData.fileName,
|
|
272
|
-
|
|
264
|
+
body: req.files.files.data,
|
|
273
265
|
};
|
|
274
266
|
const result = await fileUpload( uploadDataParams );
|
|
275
267
|
logger.info( { result: result, value: 'file upload response' } );
|
|
276
|
-
if (
|
|
268
|
+
if ( result.Error ) {
|
|
277
269
|
return res.sendError( 'File Upload Failed', 500 );
|
|
278
270
|
}
|
|
279
271
|
let user = await findOneUser( { _id: req.user._id, isActive: true } );
|