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

@@ -820,7 +820,7 @@ exports.default = async (req, res) => {
job: JSON.stringify({ id: job.id, ro_number: job.ro_number }),
error: error.message || JSON.stringify(error)
});
console.log(error);
//console.log(error);
}
} catch (error) {
logger.log("arms-failed-job", "ERROR", "api", job.shopid, {
@@ -886,7 +886,10 @@ exports.default = async (req, res) => {
const [result, rawResponse, , rawRequest] = entegralResponse;
} catch (error) {
fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
console.log(error);
//console.log(error);
logger.log("arms-error-shop", "ERROR", "api", bodyshop.id, {
error
});
}
} catch (error) {
//Error at the shop level.

View File

@@ -206,9 +206,6 @@ const CreateRepairOrderTag = (job, errorCallback) => {
const repairCosts = CreateCosts(job);
if (job.ro_number === "QBD209") {
console.log("Stop here");
}
//Calculate detail only lines.
const detailAdjustments = job.joblines
.filter((jl) => jl.ah_detail_line && jl.mod_lbr_ty)