Member Practice Summary Report and bugfixes

This commit is contained in:
Senad Uka
2019-08-08 04:56:46 +02:00
parent 55ddf76223
commit 23110d3c02
21 changed files with 13461 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
'use strict';
const { getMappingsFromDatabase, fetchOffices, fetchResources, saveNewMappingToDatabase } = require('../services/officeRnD/resources');
const { getAllIncidents } = require('../services/integration/reports');
const { getAllIncidents, getMemberPracticeSummaryReport } = require('../services/integration/reports');
const { getMembersFeesForDateRange } = require('../services/integration/invoiceIntegration');
const { deleteFeesFromORD, addFeesToORD } = require('../services/officeRnD/fees');
const { checkBookingChanges } = require('../services/integration/checkBookingChange');
@@ -126,6 +126,19 @@ const checkProcessingStatus = (req, res) => {
});
};
const getPracticeSummaryReport = (req, res) => {
getMemberPracticeSummaryReport()
.then((result) => {
const pathToDownloadFile = `${__dirname}/../${result.reportPath}`;
res.download(pathToDownloadFile);
})
.catch((error) => {
console.log('Error - Member Practice Summary Report');
console.log(error);
res.status(500).send(error);
});
};
module.exports = {
getKnownOfficeResourceMappings,
addNewMapping,
@@ -133,4 +146,5 @@ module.exports = {
getMemberIncidents,
addFees,
checkProcessingStatus,
getPracticeSummaryReport,
};