IO-2998 Add winston and replace logger.js

This commit is contained in:
Patrick Fic
2024-10-24 11:50:54 -07:00
parent 5b81912bd3
commit 2d3c13c587
15 changed files with 242 additions and 74 deletions

View File

@@ -22,7 +22,7 @@ exports.defaultRoute = async function (req, res) {
const jobData = await QueryJobData(req, req.BearerToken, req.body.jobid);
return res.status(200).json({ data: calculateAllocations(req, jobData) });
} catch (error) {
console.log(error);
////console.log(error);
CdkBase.createLogEvent(req, "ERROR", `Error encountered in CdkCalculateAllocations. ${error}`);
res.status(500).json({ error: `Error encountered in CdkCalculateAllocations. ${error}` });
}
@@ -33,7 +33,7 @@ exports.default = async function (socket, jobid) {
const jobData = await QueryJobData(socket, "Bearer " + socket.handshake.auth.token, jobid);
return calculateAllocations(socket, jobData);
} catch (error) {
console.log(error);
////console.log(error);
CdkBase.createLogEvent(socket, "ERROR", `Error encountered in CdkCalculateAllocations. ${error}`);
}
};
@@ -212,7 +212,7 @@ function calculateAllocations(connectionData, job) {
});
if (!hasMapaLine && job.job_totals.rates.mapa.total.amount > 0) {
// console.log("Adding MAPA Line Manually.");
// //console.log("Adding MAPA Line Manually.");
const mapaAccountName = selectedDmsAllocationConfig.profits.MAPA;
const mapaAccount = bodyshop.md_responsibility_centers.profits.find((c) => c.name === mapaAccountName);
@@ -224,7 +224,7 @@ function calculateAllocations(connectionData, job) {
Dinero(job.job_totals.rates.mapa.total)
);
} else {
//console.log("NO MAPA ACCOUNT FOUND!!");
////console.log("NO MAPA ACCOUNT FOUND!!");
}
}