Editing of the fees before sending / bugfixes

This commit is contained in:
Senad Uka
2020-01-13 07:56:00 +01:00
parent 404f27e208
commit 3d8e9c987f
6 changed files with 281 additions and 22 deletions

View File

@@ -13,7 +13,8 @@ const {
addFees,
checkProcessingStatus,
getPracticeSummaryReport,
deleteFees
deleteFees,
updateFees
} = require('../controllers/integration');
const { calculateDoorLockCharges } = require('../services/integration/doorLockCharges');
@@ -36,6 +37,7 @@ router.get('/officeRnD/membersList', fetchMembersList);
router.post('/integration/addFees', addFees);
router.delete('/integration/fees', deleteFees);
router.patch('/integration/fees', updateFees);
router.get('/integration/processing', checkProcessingStatus);
@@ -44,6 +46,14 @@ router.get('/integration/report/practiceSummary/:year', getPracticeSummaryReport
// temporary route, manually trigger door lock charge calculations
router.get('/calculate', (req, res) => { calculateDoorLockCharges(); res.send();});
router.get('/calculate', (req, res) => {
calculateDoorLockCharges()
.then(() => {
res.send('Done');
})
.catch((err) => {
res.send(`Error \r\n ${err}`);
});
});
module.exports = router;