IO-3239 QBO Logging and integration log schema changes.
This commit is contained in:
@@ -150,11 +150,11 @@ async function QueryVendorRecord(oauthClient, qbo_realmId, req, bill) {
|
||||
});
|
||||
logger.LogIntegrationCall({
|
||||
platform: "QBO",
|
||||
methodType: "POST",
|
||||
methodName: "QueryVendorRecord",
|
||||
method: "POST",
|
||||
name: "QueryVendorRecord",
|
||||
billid: bill.id,
|
||||
statusCode: result.status,
|
||||
bodyshopid: req.user.bodyshopid,
|
||||
status: result.response?.status,
|
||||
bodyshopid: bill.job.shopid,
|
||||
email: req.user.email
|
||||
})
|
||||
setNewRefreshToken(req.user.email, result);
|
||||
@@ -188,11 +188,11 @@ async function InsertVendorRecord(oauthClient, qbo_realmId, req, bill) {
|
||||
});
|
||||
logger.LogIntegrationCall({
|
||||
platform: "QBO",
|
||||
methodType: "POST",
|
||||
methodName: "InsertVendorRecord",
|
||||
method: "POST",
|
||||
name: "InsertVendorRecord",
|
||||
billid: bill.id,
|
||||
statusCode: result.status,
|
||||
bodyshopid: req.user.bodyshopid,
|
||||
status: result.response?.status,
|
||||
bodyshopid: bill.job.shopid,
|
||||
email: req.user.email
|
||||
})
|
||||
setNewRefreshToken(req.user.email, result);
|
||||
@@ -207,7 +207,7 @@ async function InsertVendorRecord(oauthClient, qbo_realmId, req, bill) {
|
||||
}
|
||||
|
||||
async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor, bodyshop) {
|
||||
const { accounts, taxCodes, classes } = await QueryMetaData(oauthClient, qbo_realmId, req);
|
||||
const { accounts, taxCodes, classes } = await QueryMetaData(oauthClient, qbo_realmId, req, bill.job.shopid);
|
||||
|
||||
const lines = bill.billlines.map((il) =>
|
||||
generateBillLine(
|
||||
@@ -299,11 +299,11 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor, bodyshop)
|
||||
});
|
||||
logger.LogIntegrationCall({
|
||||
platform: "QBO",
|
||||
methodType: "POST",
|
||||
methodName: "InsertBill",
|
||||
method: "POST",
|
||||
name: "InsertBill",
|
||||
billid: bill.id,
|
||||
statusCode: result.status,
|
||||
bodyshopid: req.user.bodyshopid,
|
||||
status: result.response?.status,
|
||||
bodyshopid: bill.job.shopid,
|
||||
email: req.user.email
|
||||
})
|
||||
setNewRefreshToken(req.user.email, result);
|
||||
@@ -368,7 +368,7 @@ const generateBillLine = (
|
||||
};
|
||||
};
|
||||
|
||||
async function QueryMetaData(oauthClient, qbo_realmId, req) {
|
||||
async function QueryMetaData(oauthClient, qbo_realmId, req, bodyshopid) {
|
||||
const accounts = await oauthClient.makeApiCall({
|
||||
url: urlBuilder(
|
||||
qbo_realmId,
|
||||
@@ -382,10 +382,10 @@ async function QueryMetaData(oauthClient, qbo_realmId, req) {
|
||||
});
|
||||
logger.LogIntegrationCall({
|
||||
platform: "QBO",
|
||||
methodType: "POST",
|
||||
methodName: "QueryAccountType",
|
||||
statusCode: accounts.status,
|
||||
bodyshopid: req.user.bodyshopid,
|
||||
method: "POST",
|
||||
name: "QueryAccountType",
|
||||
status: accounts.response?.status,
|
||||
bodyshopid,
|
||||
email: req.user.email
|
||||
})
|
||||
setNewRefreshToken(req.user.email, accounts);
|
||||
@@ -398,10 +398,10 @@ async function QueryMetaData(oauthClient, qbo_realmId, req) {
|
||||
});
|
||||
logger.LogIntegrationCall({
|
||||
platform: "QBO",
|
||||
methodType: "POST",
|
||||
methodName: "QueryTaxCode",
|
||||
statusCode: taxCodes.status,
|
||||
bodyshopid: req.user.bodyshopid,
|
||||
method: "POST",
|
||||
name: "QueryTaxCode",
|
||||
status: taxCodes.status,
|
||||
bodyshopid,
|
||||
email: req.user.email
|
||||
})
|
||||
const classes = await oauthClient.makeApiCall({
|
||||
@@ -413,10 +413,10 @@ async function QueryMetaData(oauthClient, qbo_realmId, req) {
|
||||
});
|
||||
logger.LogIntegrationCall({
|
||||
platform: "QBO",
|
||||
methodType: "POST",
|
||||
methodName: "QueryClasses",
|
||||
statusCode: classes.status,
|
||||
bodyshopid: req.user.bodyshopid,
|
||||
method: "POST",
|
||||
name: "QueryClasses",
|
||||
status: classes.status,
|
||||
bodyshopid,
|
||||
email: req.user.email
|
||||
})
|
||||
const taxCodeMapping = {};
|
||||
|
||||
Reference in New Issue
Block a user