Name in the fee / bugfixes
This commit is contained in:
@@ -6,6 +6,7 @@ const { getMappingsFromDatabase, fetchOffices, fetchResources, saveNewMappingToD
|
||||
const { getAllIncidents, getMemberPracticeSummaryReport } = require('../services/integration/reports');
|
||||
const { getMembersFeesForDateRange } = require('../services/integration/invoiceIntegration');
|
||||
const { deleteFeesFromORD, addFeesToORD } = require('../services/officeRnD/fees');
|
||||
const { reformatMembershipsName } = require('../services/officeRnD/memberships');
|
||||
const { checkBookingChanges } = require('../services/integration/checkBookingChange');
|
||||
const { checkIfProcessing } = require('../services/integration/processingStatus');
|
||||
|
||||
@@ -85,13 +86,21 @@ const addFees = (req, res) => {
|
||||
.then(() => {
|
||||
// TODO: Change this to parallel execution
|
||||
getMembersFeesForDateRange(dateRange, memberIds)
|
||||
.then((allFees) => {
|
||||
.then(({allFees, memberships}) => {
|
||||
addFeesToORD(allFees)
|
||||
.then((numberOfInsertedFees) => {
|
||||
res.send({
|
||||
status: 'ok',
|
||||
numberOfInsertedFees
|
||||
});
|
||||
reformatMembershipsName(memberships)
|
||||
.then(() => {
|
||||
res.send({
|
||||
status: 'ok',
|
||||
numberOfInsertedFees
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('Error reformatting memberships name');
|
||||
console.log(error);
|
||||
res.status(500).send(error);
|
||||
})
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('Error adding fees');
|
||||
|
||||
Reference in New Issue
Block a user