IO-3239 QBO Logging and integration log schema changes.

This commit is contained in:
Patrick Fic
2025-05-22 11:54:17 -07:00
parent 16a91c772a
commit 2c508cf1a1
9 changed files with 202 additions and 66 deletions

View File

@@ -195,21 +195,37 @@ const createLogger = () => {
winstonLogger.log(logEntry);
};
const LogIntegrationCall = async ({ platform, methodType, methodName, jobid, paymentid, billid, statusCode, bodyshopid, email }) => {
const LogIntegrationCall = async ({ platform, method, name, jobid, paymentid, billid, status, bodyshopid, email }) => {
try {
//Insert the record.
await client.request(queries.INSERT_INTEGRATION_LOG, {
platform,
methodType,
methodName, jobid, paymentid, billid,
statusCode,
bodyshopid,
email
log: {
platform,
method,
name,
jobid,
paymentid,
billid,
status: status.toString() ?? "0",
bodyshopid,
email
}
});
} catch (error) {
console.trace("Stack", error?.stack);
log("integration-log-error", "ERROR", email, null, {
error
message: error?.message,
stack: error?.stack,
platform,
method,
name,
jobid,
paymentid,
billid,
status,
bodyshopid,
email
});
}
};