Add logging in addFees steps
This commit is contained in:
@@ -68,13 +68,13 @@ const deleteFeesFromORD = (dateRange, memberIds) => {
|
||||
resolve(feesToSkip);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error : ', error);
|
||||
reject(error);
|
||||
console.log('[Delete Fees From ORD] Error deleting fees from ORD : ', error);
|
||||
reject(officeRnDAPIErrors.FAILED_TO_DELETE_FEES);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
reject(`${officeRnDAPIErrors.FAILED_TO_FETCH_FEES} or ${officeRnDAPIErrors.FAILED_TO_FETCH_PLANS}`);
|
||||
console.log("[Delete Fees From ORD] Error fetching fees and plans from ORD : ", error);
|
||||
reject(`${officeRnDAPIErrors.FAILED_TO_FETCH_FEES} and ${officeRnDAPIErrors.FAILED_TO_FETCH_PLANS}`);
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -96,11 +96,13 @@ const addFeesToORD = (allFees, invoicedFees) => {
|
||||
const nonInvoicedFees = allFees.filter(isFeeNonInvoiced);
|
||||
|
||||
API.post('/fees', nonInvoicedFees)
|
||||
.then(() => {
|
||||
resolve(nonInvoicedFees.length);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('==== ERROR ====');
|
||||
console.log(error);
|
||||
console.log('[Add Fees To ORD] Failed to send fees to ORD', error);
|
||||
reject(officeRnDAPIErrors.FAILED_TO_ADD_FEES);
|
||||
});
|
||||
resolve(nonInvoicedFees.length);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ const fetchAllMembershipsForMemberIds = (memberIds) => {
|
||||
resolve(memberships);
|
||||
}
|
||||
}else{
|
||||
console.log('[Fetch All Memberships For Member Ids] Error fetching memberships - expected member IDs array');
|
||||
reject(integrationServiceErrors.EXPECTED_MEMBER_IDS_ARRAY);
|
||||
}
|
||||
})
|
||||
@@ -48,7 +49,10 @@ const reformatMembershipsName = (memberships) => {
|
||||
.then(() => {
|
||||
resolve(true);
|
||||
})
|
||||
.catch((error) => reject(error));
|
||||
.catch((error) => {
|
||||
console.log('[Reformat Memberships Name] Failed to update memberships : ', error);
|
||||
reject(officeRnDAPIErrors.FAILED_TO_UPDATE_MEMBERSHIP);
|
||||
});
|
||||
}else{
|
||||
reject(officeRnDAPIErrors.MEMBERSHIPS_ARE_NOT_LOADED_CORRECTLY);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
const { API } = require('../../helpers/api');
|
||||
const { officeRnDAPIErrors } = require('../../constants/constants');
|
||||
|
||||
const fetchRates = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -16,7 +17,8 @@ const fetchRates = () => {
|
||||
resolve(cleanedRates);
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
console.log("[Fetch Rates] Failed to fetch rates : ", error);
|
||||
reject(officeRnDAPIErrors.FAILED_TO_FETCH_RATES);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user