From 19421039858dd6ebc5b63708961c2156f8908dd6 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 15 Sep 2021 16:14:01 -0700 Subject: [PATCH 01/21] IO-256 Start add QBO Payables --- server.js | 1 + server/accounting/qbo/qbo-payables.js | 549 +++++++++++++++++++++++ server/accounting/qbo/qbo-payments.js | 0 server/accounting/qbo/qbo-receivables.js | 9 +- server/accounting/qbo/qbo.js | 1 + 5 files changed, 554 insertions(+), 6 deletions(-) create mode 100644 server/accounting/qbo/qbo-payables.js create mode 100644 server/accounting/qbo/qbo-payments.js diff --git a/server.js b/server.js index efe533182..368fdf632 100644 --- a/server.js +++ b/server.js @@ -149,6 +149,7 @@ var qbo = require("./server/accounting/qbo/qbo"); app.post("/qbo/authorize", fb.validateFirebaseIdToken, qbo.authorize); app.get("/qbo/callback", qbo.callback); app.post("/qbo/receivables", fb.validateFirebaseIdToken, qbo.receivables); +app.post("/qbo/payables", fb.validateFirebaseIdToken, qbo.payables); var data = require("./server/data/data"); app.post("/data/ah", data.autohouse); diff --git a/server/accounting/qbo/qbo-payables.js b/server/accounting/qbo/qbo-payables.js new file mode 100644 index 000000000..4a42c9e87 --- /dev/null +++ b/server/accounting/qbo/qbo-payables.js @@ -0,0 +1,549 @@ +const urlBuilder = require("./qbo").urlBuilder; +const path = require("path"); +require("dotenv").config({ + path: path.resolve( + process.cwd(), + `.env.${process.env.NODE_ENV || "development"}` + ), +}); +const logger = require("../../utils/logger"); +const Dinero = require("dinero.js"); +const DineroQbFormat = require("../accounting-constants").DineroQbFormat; +const apiGqlClient = require("../../graphql-client/graphql-client").client; +const queries = require("../../graphql-client/queries"); +const { + refresh: refreshOauthToken, + setNewRefreshToken, +} = require("./qbo-callback"); +const OAuthClient = require("intuit-oauth"); + +const GraphQLClient = require("graphql-request").GraphQLClient; +const { generateOwnerTier } = require("../qbxml/qbxml-utils"); + +exports.default = async (req, res) => { + const oauthClient = new OAuthClient({ + clientId: process.env.QBO_CLIENT_ID, + clientSecret: process.env.QBO_SECRET, + environment: + process.env.NODE_ENV === "production" ? "production" : "sandbox", + redirectUri: process.env.QBO_REDIRECT_URI, + logging: true, + }); + try { + //Fetch the API Access Tokens & Set them for the session. + const response = await apiGqlClient.request(queries.GET_QBO_AUTH, { + email: req.user.email, + }); + + oauthClient.setToken(response.associations[0].qbo_auth); + + await refreshOauthToken(oauthClient, req); + + const BearerToken = req.headers.authorization; + const { bills: billsToQuery } = req.body; + //Query Job Info + const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, { + headers: { + Authorization: BearerToken, + }, + }); + logger.log("qbo-payable-create", "DEBUG", req.user.email, billsToQuery); + const result = await client + .setHeaders({ Authorization: BearerToken }) + .request(queries.QUERY_BILLS_FOR_PAYABLES_EXPORT, { + bills: billsToQuery, + }); + const { bills } = result; + + for (const bill of bills) { + let vendorRecord; + vendorRecord = await QueryVendorRecord(oauthClient, req, bill); + + if (!vendorRecord) { + vendorRecord = await InsertVendorRecord(oauthClient, req, bill); + } + + const insertResults = await InsertBill(oauthClient, req, bill); + } + + res.json({}); + } catch (error) { + console.log(error); + logger.log("qbo-payable-create-error", "ERROR", req.user.email, { error }); + res.status(400).json(error); + } +}; + +async function QueryVendorRecord(oauthClient, req, bill) { + try { + const result = await oauthClient.makeApiCall({ + url: urlBuilder( + req.cookies.qbo_realmId, + "query", + `select * From vendor where DisplayName = '${bill.vendor.name}'` + ), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + }); + setNewRefreshToken(req.user.email, result); + return ( + result.json && + result.json.QueryResponse && + result.json.QueryResponse.Vendor && + result.json.QueryResponse.Vendor[0] + ); + } catch (error) { + logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, { + error, + method: "QueryVendorRecord", + }); + throw error; + } +} +async function InsertVendorRecord(oauthClient, req, bill) { + const Vendor = { + DisplayName: bill.vendor.name, + }; + try { + const result = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "vendor"), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(Vendor), + }); + setNewRefreshToken(req.user.email, result); + return result && result.Vendor; + } catch (error) { + logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, { + error, + method: "InsertVendorRecord", + }); + throw error; + } +} + +async function InsertBill(oauthClient, req, bill) { + const vendor = { + DisplayName: job.ro_number, + BillAddr: { + City: job.ownr_city, + Line1: job.ownr_addr1, + Line2: job.ownr_addr2, + PostalCode: job.ownr_zip, + CountrySubDivisionCode: job.ownr_st, + }, + ...(isThreeTier + ? { + Job: true, + ParentRef: { + value: parentTierRef.Id, + }, + } + : {}), + }; + try { + const result = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "vendor"), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(vendor), + }); + setNewRefreshToken(req.user.email, result); + return result && result.Customer; + } catch (error) { + logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, { + error, + method: "InsertOwner", + }); + throw error; + } +} + +async function QueryMetaData(oauthClient, req) { + const items = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From Item`), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + }); + setNewRefreshToken(req.user.email, items); + const taxCodes = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From TaxCode`), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + }); + + const taxCodeMapping = {}; + + const accounts = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From Account`), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + }); + + taxCodes.json && + taxCodes.json.QueryResponse && + taxCodes.json.QueryResponse.TaxCode.forEach((t) => { + taxCodeMapping[t.Name] = t.Id; + }); + + const itemMapping = {}; + + items.json && + items.json.QueryResponse && + items.json.QueryResponse.Item.forEach((t) => { + itemMapping[t.Name] = t.Id; + }); + + return { + items: itemMapping, + taxCodes: taxCodeMapping, + }; +} + +async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) { + const { items, taxCodes } = await QueryMetaData(oauthClient, req); + const InvoiceLineAdd = []; + const responsibilityCenters = bodyshop.md_responsibility_centers; + + const invoiceLineHash = {}; //The hash of cost and profit centers based on the center name. + + //Determine if there are MAPA and MASH lines already on the estimate. + //If there are, don't do anything extra (mitchell estimate) + //Otherwise, calculate them and add them to the default MAPA and MASH centers. + let hasMapaLine = false; + let hasMashLine = false; + + //Create the invoice lines mapping. + job.joblines.map((jobline) => { + //Parts Lines + if (jobline.db_ref === "936008") { + //If either of these DB REFs change, they also need to change in job-totals/job-costing calculations. + hasMapaLine = true; + } + if (jobline.db_ref === "936007") { + hasMashLine = true; + } + + if (jobline.profitcenter_part && jobline.act_price) { + let DineroAmount = Dinero({ + amount: Math.round(jobline.act_price * 100), + }).multiply(jobline.part_qty || 1); + + if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) { + // console.log("Have a part discount", jobline); + DineroAmount = DineroAmount.add( + DineroAmount.percentage(jobline.prt_dsmk_p || 0) + ); + } + const account = responsibilityCenters.profits.find( + (i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase() + ); + + if (!account) { + logger.log("qbxml-payables-no-account", "warn", null, jobline.id, null); + throw new Error( + `A matching account does not exist for the part allocation. Center: ${jobline.profitcenter_part}` + ); + } + if (!invoiceLineHash[account.name]) { + invoiceLineHash[account.name] = { + ItemRef: { FullName: account.accountitem }, + Desc: account.accountdesc, + Quantity: 1, //jobline.part_qty, + Amount: DineroAmount, //.toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }; + } else { + invoiceLineHash[account.name].Amount = + invoiceLineHash[account.name].Amount.add(DineroAmount); + } + } + // Labor Lines + if (jobline.profitcenter_labor && jobline.mod_lb_hrs) { + const DineroAmount = Dinero({ + amount: Math.round( + job[`rate_${jobline.mod_lbr_ty.toLowerCase()}`] * 100 + ), + }).multiply(jobline.mod_lb_hrs); + const account = responsibilityCenters.profits.find( + (i) => jobline.profitcenter_labor.toLowerCase() === i.name.toLowerCase() + ); + + if (!account) { + throw new Error( + `A matching account does not exist for the labor allocation. Center: ${jobline.profitcenter_labor}` + ); + } + if (!invoiceLineHash[account.name]) { + invoiceLineHash[account.name] = { + ItemRef: { FullName: account.accountitem }, + Desc: account.accountdesc, + Quantity: 1, // jobline.mod_lb_hrs, + Amount: DineroAmount, + //Amount: DineroAmount.toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }; + } else { + invoiceLineHash[account.name].Amount = + invoiceLineHash[account.name].Amount.add(DineroAmount); + } + } + }); + // console.log("Done creating hash", JSON.stringify(invoiceLineHash)); + + if (!hasMapaLine && job.job_totals.rates.mapa.total.amount > 0) { + // console.log("Adding MAPA Line Manually."); + const mapaAccountName = responsibilityCenters.defaults.profits.MAPA; + + const mapaAccount = responsibilityCenters.profits.find( + (c) => c.name === mapaAccountName + ); + + if (mapaAccount) { + InvoiceLineAdd.push({ + ItemRef: { FullName: mapaAccount.accountitem }, + Desc: mapaAccount.accountdesc, + Quantity: 1, + Amount: Dinero(job.job_totals.rates.mapa.total).toFormat( + DineroQbFormat + ), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } else { + //console.log("NO MAPA ACCOUNT FOUND!!"); + } + } + + if (!hasMashLine && job.job_totals.rates.mash.total.amount > 0) { + // console.log("Adding MASH Line Manually."); + + const mashAccountName = responsibilityCenters.defaults.profits.MASH; + + const mashAccount = responsibilityCenters.profits.find( + (c) => c.name === mashAccountName + ); + + if (mashAccount) { + InvoiceLineAdd.push({ + ItemRef: { FullName: mashAccount.accountitem }, + Desc: mashAccount.accountdesc, + Quantity: 1, + Amount: Dinero(job.job_totals.rates.mash.total).toFormat( + DineroQbFormat + ), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } else { + // console.log("NO MASH ACCOUNT FOUND!!"); + } + } + + //Convert the hash to an array. + Object.keys(invoiceLineHash).forEach((key) => { + InvoiceLineAdd.push({ + ...invoiceLineHash[key], + Amount: invoiceLineHash[key].Amount.toFormat(DineroQbFormat), + }); + }); + + //Add Towing, storage and adjustment lines. + + if (job.towing_payable && job.towing_payable !== 0) { + InvoiceLineAdd.push({ + ItemRef: { + FullName: responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["TOW"] + ).accountitem, + }, + Desc: "Towing", + Quantity: 1, + Amount: Dinero({ + amount: Math.round((job.towing_payable || 0) * 100), + }).toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + if (job.storage_payable && job.storage_payable !== 0) { + InvoiceLineAdd.push({ + ItemRef: { + FullName: responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["TOW"] + ).accountitem, + }, + Desc: "Storage", + Quantity: 1, + Amount: Dinero({ + amount: Math.round((job.storage_payable || 0) * 100), + }).toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + if (job.adjustment_bottom_line && job.adjustment_bottom_line !== 0) { + InvoiceLineAdd.push({ + ItemRef: { + FullName: responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["PAO"] + ).accountitem, + }, + Desc: "Adjustment", + Quantity: 1, + Amount: Dinero({ + amount: Math.round((job.adjustment_bottom_line || 0) * 100), + }).toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + + //Add tax lines + const job_totals = job.job_totals; + + const federal_tax = Dinero(job_totals.totals.federal_tax); + const state_tax = Dinero(job_totals.totals.state_tax); + const local_tax = Dinero(job_totals.totals.local_tax); + + if (federal_tax.getAmount() > 0) { + InvoiceLineAdd.push({ + ItemRef: { + FullName: bodyshop.md_responsibility_centers.taxes.federal.accountitem, + }, + Desc: bodyshop.md_responsibility_centers.taxes.federal.accountdesc, + Amount: federal_tax.toFormat(DineroQbFormat), + }); + } + + if (state_tax.getAmount() > 0) { + InvoiceLineAdd.push({ + ItemRef: { + FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, + }, + Desc: bodyshop.md_responsibility_centers.taxes.state.accountdesc, + Amount: state_tax.toFormat(DineroQbFormat), + }); + } + + if (local_tax.getAmount() > 0) { + InvoiceLineAdd.push({ + ItemRef: { + FullName: bodyshop.md_responsibility_centers.taxes.local.accountitem, + }, + Desc: bodyshop.md_responsibility_centers.taxes.local.accountdesc, + Amount: local_tax.toFormat(DineroQbFormat), + }); + } + + //Region Specific + const { ca_bc_pvrt } = job; + if (ca_bc_pvrt) { + InvoiceLineAdd.push({ + ItemRef: { + FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, + }, + Desc: "PVRT", + Amount: Dinero({ amount: (ca_bc_pvrt || 0) * 100 }).toFormat( + DineroQbFormat + ), + }); + } + + //map each invoice line to the correct style for QBO. + + const invoiceObj = { + Line: [ + { + DetailType: "SalesItemLineDetail", + Amount: 100, + SalesItemLineDetail: { + // ItemRef: { + // // name: "Services", + // value: "16", + // }, + TaxCodeRef: { + value: "2", + }, + Qty: 1, + UnitPrice: 100, + }, + }, + ], + // Line: InvoiceLineAdd.map((i) => { + // return { + // DetailType: "SalesItemLineDetail", + // Amount: i.Amount, + // SalesItemLineDetail: { + // ItemRef: { + // //name: "Services", + // value: items[i.ItemRef.FullName], + // }, + // // TaxCodeRef: { + // // value: "2", + // // }, + // Qty: 1, + // }, + // }; + // }), + TxnTaxDetail: { + TaxLine: [ + { + DetailType: "TaxLineDetail", + + TaxLineDetail: { + NetAmountTaxable: 100, + TaxPercent: 7, + TaxRateRef: { + value: "16", + }, + PercentBased: true, + }, + }, + ], + }, + CustomerRef: { + value: parentTierRef.Id, + }, + }; + + try { + const result = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "invoice"), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(invoiceObj), + }); + setNewRefreshToken(req.user.email, result); + return result && result.Invoice; + } catch (error) { + logger.log("qbo-payables-error", "DEBUG", req.user.email, job.id, { + error, + method: "InsertOwner", + }); + throw error; + } +} diff --git a/server/accounting/qbo/qbo-payments.js b/server/accounting/qbo/qbo-payments.js new file mode 100644 index 000000000..e69de29bb diff --git a/server/accounting/qbo/qbo-receivables.js b/server/accounting/qbo/qbo-receivables.js index d2e105393..04b3853f0 100644 --- a/server/accounting/qbo/qbo-receivables.js +++ b/server/accounting/qbo/qbo-receivables.js @@ -36,7 +36,6 @@ exports.default = async (req, res) => { }); oauthClient.setToken(response.associations[0].qbo_auth); - const getToken = oauthClient.getToken(); await refreshOauthToken(oauthClient, req); @@ -48,6 +47,7 @@ exports.default = async (req, res) => { Authorization: BearerToken, }, }); + logger.log("qbo-payable-create", "DEBUG", req.user.email, jobIds); const result = await client .setHeaders({ Authorization: BearerToken }) .request(queries.QUERY_JOBS_FOR_RECEIVABLES_EXPORT, { @@ -111,6 +111,7 @@ exports.default = async (req, res) => { res.sendStatus(200); } catch (error) { console.log(error); + logger.log("qbo-payable-create-error", "ERROR", req.user.email, { error }); res.status(400).json(error); } }; @@ -412,11 +413,7 @@ async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) { } } // Labor Lines - if ( - jobline.profitcenter_labor && - jobline.mod_lb_hrs && - jobline.mod_lb_hrs > 0 - ) { + if (jobline.profitcenter_labor && jobline.mod_lb_hrs) { const DineroAmount = Dinero({ amount: Math.round( job[`rate_${jobline.mod_lbr_ty.toLowerCase()}`] * 100 diff --git a/server/accounting/qbo/qbo.js b/server/accounting/qbo/qbo.js index ab785a9fc..190e5aa07 100644 --- a/server/accounting/qbo/qbo.js +++ b/server/accounting/qbo/qbo.js @@ -21,3 +21,4 @@ exports.callback = require("./qbo-callback").default; exports.authorize = require("./qbo-authorize").default; exports.refresh = require("./qbo-callback").refresh; exports.receivables = require("./qbo-receivables").default; +exports.payables = require("./qbo-payables").default; From 186f6101ff090e0c3a74a2615f1116767daa0b0c Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 23 Sep 2021 16:22:59 -0700 Subject: [PATCH 02/21] IO-256 Begin QBO Changes for Individual code mapping on receivables. --- client/package.json | 18 +- client/yarn.lock | 328 ++++++++-------- server/accounting/qb-receivables-lines.js | 378 +++++++++++++++++++ server/accounting/qbo/qbo-receivables.js | 324 +--------------- server/accounting/qbxml/qbxml-receivables.js | 268 +------------ server/graphql-client/queries.js | 1 + 6 files changed, 573 insertions(+), 744 deletions(-) create mode 100644 server/accounting/qb-receivables-lines.js diff --git a/client/package.json b/client/package.json index 3ec7c8907..9dcddf8ef 100644 --- a/client/package.json +++ b/client/package.json @@ -12,10 +12,10 @@ "@openreplay/tracker-assist": "^3.1.1", "@openreplay/tracker-graphql": "^3.0.0", "@openreplay/tracker-redux": "^3.0.0", - "@sentry/react": "^6.13.0", - "@sentry/tracing": "^6.13.0", - "@stripe/react-stripe-js": "^1.4.0", - "@stripe/stripe-js": "^1.17.1", + "@sentry/react": "^6.13.2", + "@sentry/tracing": "^6.13.2", + "@stripe/react-stripe-js": "^1.5.0", + "@stripe/stripe-js": "^1.18.0", "@tanem/react-nprogress": "^3.0.79", "antd": "^4.16.13", "apollo-link-logger": "^2.0.0", @@ -27,10 +27,10 @@ "env-cmd": "^10.1.0", "exifr": "^7.1.3", "firebase": "^9.0.2", - "graphql": "^15.5.3", - "i18next": "^21.0.0", + "graphql": "^15.6.0", + "i18next": "^21.0.2", "i18next-browser-languagedetector": "^6.1.2", - "jsoneditor": "^9.5.4", + "jsoneditor": "^9.5.6", "jsreport-browser-client-dist": "^1.3.0", "libphonenumber-js": "^1.9.34", "logrocket": "^2.0.0", @@ -59,13 +59,13 @@ "react-scripts": "^4.0.3", "react-sublime-video": "^0.2.5", "react-virtualized": "^9.22.3", - "recharts": "^2.1.3", + "recharts": "^2.1.4", "redux": "^4.1.1", "redux-persist": "^6.0.0", "redux-saga": "^1.1.3", "redux-state-sync": "^3.1.2", "reselect": "^4.0.0", - "sass": "^1.41.1", + "sass": "^1.42.1", "socket.io-client": "^4.2.0", "styled-components": "^5.3.1", "subscriptions-transport-ws": "^0.9.18", diff --git a/client/yarn.lock b/client/yarn.lock index 4d60fc2b2..3f4067a21 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -2178,14 +2178,14 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@sentry/browser@6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.13.0.tgz#fddcf1997d47c166a86494a6ea594f4cc60e773d" - integrity sha512-Eh0k2qYhqWiEP3N04AwSrpl4VRD0pzt6SRgJxgiGzSvBT43EOjyNQ3xzMylAechfjSCTWmzZMvwcgT5fNM9cuw== +"@sentry/browser@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.13.2.tgz#8b731ecf8c3cdd92a4b6893a26f975fd5844056d" + integrity sha512-bkFXK4vAp2UX/4rQY0pj2Iky55Gnwr79CtveoeeMshoLy5iDgZ8gvnLNAz7om4B9OQk1u7NzLEa4IXAmHTUyag== dependencies: - "@sentry/core" "6.13.0" - "@sentry/types" "6.13.0" - "@sentry/utils" "6.13.0" + "@sentry/core" "6.13.2" + "@sentry/types" "6.13.2" + "@sentry/utils" "6.13.2" tslib "^1.9.3" "@sentry/cli@^1.68.0": @@ -2200,69 +2200,69 @@ progress "^2.0.3" proxy-from-env "^1.1.0" -"@sentry/core@6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.13.0.tgz#35df709bb5c1979cc05a4dd0bbe8b15fb973ad6f" - integrity sha512-Aw0ljRJx5tq4w6ZXxvcu2Lr9NwD+MJ1SLL5+oB1hh4OlcOJ7OLwDjtJ3+ZOwp75GCAp7phh4+s/Sql6roX3Lpw== +"@sentry/core@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.13.2.tgz#2ce164f81667aa89cd116f807d772b4718434583" + integrity sha512-snXNNFLwlS7yYxKTX4DBXebvJK+6ikBWN6noQ1CHowvM3ReFBlrdrs0Z0SsSFEzXm2S4q7f6HHbm66GSQZ/8FQ== dependencies: - "@sentry/hub" "6.13.0" - "@sentry/minimal" "6.13.0" - "@sentry/types" "6.13.0" - "@sentry/utils" "6.13.0" + "@sentry/hub" "6.13.2" + "@sentry/minimal" "6.13.2" + "@sentry/types" "6.13.2" + "@sentry/utils" "6.13.2" tslib "^1.9.3" -"@sentry/hub@6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.13.0.tgz#076a5f9b6d0efb8c1832820e3eecd5e24b5e1706" - integrity sha512-BmKgrTyotF008KPfFt1ySyFg0AAMf/ha9Bz9Rmi+usSJjnOLsObzBJQNAozp4Cu6i1kGvj1/R+ymPCD61Gqozw== +"@sentry/hub@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.13.2.tgz#ebc66fd55c96c7686a53ffd3521b6a63f883bb79" + integrity sha512-sppSuJdNMiMC/vFm/dQowCBh11uTrmvks00fc190YWgxHshodJwXMdpc+pN61VSOmy2QA4MbQ5aMAgHzPzel3A== dependencies: - "@sentry/types" "6.13.0" - "@sentry/utils" "6.13.0" + "@sentry/types" "6.13.2" + "@sentry/utils" "6.13.2" tslib "^1.9.3" -"@sentry/minimal@6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.13.0.tgz#276fc0ee5355954c2a9d9292d914988391f8a1e1" - integrity sha512-eJQs44sGY2wFuVDznHMDeShR+ZbnM/KS+T5753nJ4QtMqCNTiG9WDlNXAxwFJ6Q3DORtaxcWHyFZdOMUusJiZQ== +"@sentry/minimal@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.13.2.tgz#de3ecc62b9463bf56ccdbcf4c75f7ea1aeeebc11" + integrity sha512-6iJfEvHzzpGBHDfLxSHcGObh73XU1OSQKWjuhDOe7UQDyI4BQmTfcXAC+Fr8sm8C/tIsmpVi/XJhs8cubFdSMw== dependencies: - "@sentry/hub" "6.13.0" - "@sentry/types" "6.13.0" + "@sentry/hub" "6.13.2" + "@sentry/types" "6.13.2" tslib "^1.9.3" -"@sentry/react@^6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/react/-/react-6.13.0.tgz#110aada56a5f952b63f8ce94ce0c71792bcffd4a" - integrity sha512-Pkkq2YQn7uvqHX+OvoGrd9Nq0ixrQyixm2SI0BjptDXkZ6AqlI+fhhP8Mm+ezBgPT9WqO2+BUW/YivyTjVYwHg== +"@sentry/react@^6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-6.13.2.tgz#481f1549b1509b4d94eb943934ebeba6430a1a8f" + integrity sha512-aLkWyn697LTcmK1PPnUg5UJcyBUPoI68motqgBY53SIYDAwOeYNUQt2aanDuOTY5aE2PdnJwU48klA8vuYkoRQ== dependencies: - "@sentry/browser" "6.13.0" - "@sentry/minimal" "6.13.0" - "@sentry/types" "6.13.0" - "@sentry/utils" "6.13.0" + "@sentry/browser" "6.13.2" + "@sentry/minimal" "6.13.2" + "@sentry/types" "6.13.2" + "@sentry/utils" "6.13.2" hoist-non-react-statics "^3.3.2" tslib "^1.9.3" -"@sentry/tracing@^6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.13.0.tgz#3d9fac18c2d6829ba14178729d4a7ac770462e3e" - integrity sha512-nTY8UnVK6OUh4ocONtphoaK3WXBZqw0HOFyFpBSzhldo4O1jLad1OEkz8vAxrIE9sXPmLWta5CtKq6PIaFwQSg== +"@sentry/tracing@^6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.13.2.tgz#512389ba459f48ae75e14f1528ab062dc46e4956" + integrity sha512-bHJz+C/nd6biWTNcYAu91JeRilsvVgaye4POkdzWSmD0XoLWHVMrpCQobGpXe7onkp2noU3YQjhqgtBqPHtnpw== dependencies: - "@sentry/hub" "6.13.0" - "@sentry/minimal" "6.13.0" - "@sentry/types" "6.13.0" - "@sentry/utils" "6.13.0" + "@sentry/hub" "6.13.2" + "@sentry/minimal" "6.13.2" + "@sentry/types" "6.13.2" + "@sentry/utils" "6.13.2" tslib "^1.9.3" -"@sentry/types@6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.13.0.tgz#a8ad870c6ecb407cbe9ca883b0688bacb30daacf" - integrity sha512-04ZVmz4txuI3w1KS81eByppvvMfOINj7jZYnO5zX/S3cjHiOpAJiZkN/k9tTi1Ua3td8bEkQLB6Cxrq9MSiH3Q== +"@sentry/types@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.13.2.tgz#8388d5b92ea8608936e7aae842801dc90e0184e6" + integrity sha512-6WjGj/VjjN8LZDtqJH5ikeB1o39rO1gYS6anBxiS3d0sXNBb3Ux0pNNDFoBxQpOhmdDHXYS57MEptX9EV82gmg== -"@sentry/utils@6.13.0": - version "6.13.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.13.0.tgz#c75647890a5a9dfdb3df321517aa4886c8715b03" - integrity sha512-e82DBwjYqWkNmafIkHnbqirK4t7WCmqCGaoo1Et6vTRCBS4GthWvS6EzaozY7EKs/TzsfIiDdTLGTbYMQOq9Zw== +"@sentry/utils@6.13.2": + version "6.13.2" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.13.2.tgz#fb8010e7b67cc8c084d8067d64ef25289269cda5" + integrity sha512-foF4PbxqPMWNbuqdXkdoOmKm3quu3PP7Q7j/0pXkri4DtCuvF/lKY92mbY0V9rHS/phCoj+3/Se5JvM2ymh2/w== dependencies: - "@sentry/types" "6.13.0" + "@sentry/types" "6.13.2" tslib "^1.9.3" "@sentry/webpack-plugin@^1.17.1": @@ -2291,17 +2291,17 @@ resolved "https://registry.yarnpkg.com/@sphinxxxx/color-conversion/-/color-conversion-2.2.2.tgz#03ecc29279e3c0c832f6185a5bfa3497858ac8ca" integrity sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw== -"@stripe/react-stripe-js@^1.4.0": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@stripe/react-stripe-js/-/react-stripe-js-1.4.1.tgz#884d59286fff00ba77389b32c045516f65d7a340" - integrity sha512-FjcVrhf72+9fUL3Lz3xi02ni9tzH1A1x6elXlr6tvBDgSD55oPJuodoP8eC7xTnBIKq0olF5uJvgtkJyDCdzjA== +"@stripe/react-stripe-js@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@stripe/react-stripe-js/-/react-stripe-js-1.5.0.tgz#7e4d80077e88e1f2c1f10ac255f2838d7c9488c2" + integrity sha512-A7+bNeb0O/kw3JdtMeiB6frokPcks5obi+TIjuFRXUMZ5o/o1Qe7eLgLnsb0KOO/g3KJqNCpHiYcKCLESZJJbQ== dependencies: prop-types "^15.7.2" -"@stripe/stripe-js@^1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.17.1.tgz#afcb7e86d0b05d1a7af53af89111abd2e8d437ae" - integrity sha512-c9MyDvdi5Xou0j0JPNy86NebtTDfh9o62Ifuzx6GSm2YO0oedBpy51WSyOue2L8Fb+mqESS5gd6mGVEIPUnXsA== +"@stripe/stripe-js@^1.18.0": + version "1.18.0" + resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.18.0.tgz#687268d7cd68b44b92b86300d7c7f2a6e4df0b98" + integrity sha512-yBRHAMKHnF3kbzv0tpKB82kSow43wW5qXLK8ofg3V9NaaCyObSTO7wJfktWAtG/NBgkJOdUL+pV8dHBj0qvDkQ== "@surma/rollup-plugin-off-main-thread@^1.1.1": version "1.4.2" @@ -2472,41 +2472,41 @@ resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.3.3.tgz#85bc74ba782fb7aa3a514d11767832b0e3bc6803" integrity sha512-LKVP3cgXBT9RYj+t+9FDKwS5tdI+rPBXaNSkma7hvqy35lc7mAokC2zsqWJH0LaqIt3B962nuYI77hsJoT1gow== -"@types/d3-color@*": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/d3-color/-/d3-color-3.0.2.tgz#53f2d6325f66ee79afd707c05ac849e8ae0edbb0" - integrity sha512-WVx6zBiz4sWlboCy7TCgjeyHpNjMsoF36yaagny1uXfbadc9f+5BeBf7U+lRmQqY3EHbGQpP8UdW8AC+cywSwQ== +"@types/d3-color@^2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/d3-color/-/d3-color-2.0.3.tgz#8bc4589073c80e33d126345542f588056511fe82" + integrity sha512-+0EtEjBfKEDtH9Rk3u3kLOUXM5F+iZK+WvASPb0MhIZl8J8NUvGeZRwKCXl+P3HkYx5TdU4YtcibpqHkSR9n7w== -"@types/d3-interpolate@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/d3-interpolate/-/d3-interpolate-3.0.1.tgz#e7d17fa4a5830ad56fe22ce3b4fac8541a9572dc" - integrity sha512-jx5leotSeac3jr0RePOH1KdR9rISG91QIE4Q2PYTu4OymLTZfA3SrnURSLzKH48HmXVUru50b8nje4E79oQSQw== +"@types/d3-interpolate@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@types/d3-interpolate/-/d3-interpolate-2.0.2.tgz#78eddf7278b19e48e8652603045528d46897aba0" + integrity sha512-lElyqlUfIPyWG/cD475vl6msPL4aMU7eJvx1//Q177L8mdXoVPFl1djIESF2FKnc0NyaHvQlJpWwKJYwAhUoCw== dependencies: - "@types/d3-color" "*" + "@types/d3-color" "^2" -"@types/d3-path@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/d3-path/-/d3-path-3.0.0.tgz#939e3a784ae4f80b1fde8098b91af1776ff1312b" - integrity sha512-0g/A+mZXgFkQxN3HniRDbXMN79K3CdTpLsevj+PXiTcb2hVyvkZUBg37StmgCQkaD84cUJ4uaDAWq7UJOQy2Tg== +"@types/d3-path@^2": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/d3-path/-/d3-path-2.0.1.tgz#ca03dfa8b94d8add97ad0cd97e96e2006b4763cb" + integrity sha512-6K8LaFlztlhZO7mwsZg7ClRsdLg3FJRzIIi6SZXDWmmSJc2x8dd2VkESbLXdk3p8cuvz71f36S0y8Zv2AxqvQw== -"@types/d3-scale@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/d3-scale/-/d3-scale-4.0.1.tgz#fbe8238e2eff27af577d2b7d0b933ae50a546970" - integrity sha512-GDuXcRcR6mKcpUVMhPNttpOzHi2dP6YcDqLZYSZHgwTZ+sfCa8e9q0VEBwZomblAPNMYpVqxojnSyIEb4s/Pwg== +"@types/d3-scale@^3.0.0": + version "3.3.2" + resolved "https://registry.yarnpkg.com/@types/d3-scale/-/d3-scale-3.3.2.tgz#18c94e90f4f1c6b1ee14a70f14bfca2bd1c61d06" + integrity sha512-gGqr7x1ost9px3FvIfUMi5XA/F/yAf4UkUDtdQhpH92XCT0Oa7zkkRzY61gPVJq+DxpHn/btouw5ohWkbBsCzQ== dependencies: - "@types/d3-time" "*" + "@types/d3-time" "^2" -"@types/d3-shape@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/d3-shape/-/d3-shape-3.0.2.tgz#4b1ca4ddaac294e76b712429726d40365cd1e8ca" - integrity sha512-5+ButCmIfNX8id5seZ7jKj3igdcxx+S9IDBiT35fQGTLZUfkFgTv+oBH34xgeoWDKpWcMITSzBILWQtBoN5Piw== +"@types/d3-shape@^2.0.0": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@types/d3-shape/-/d3-shape-2.1.3.tgz#35d397b9e687abaa0de82343b250b9897b8cacf3" + integrity sha512-HAhCel3wP93kh4/rq+7atLdybcESZ5bRHDEZUojClyZWsRuEMo3A52NGYJSh48SxfxEU6RZIVbZL2YFZ2OAlzQ== dependencies: - "@types/d3-path" "*" + "@types/d3-path" "^2" -"@types/d3-time@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/d3-time/-/d3-time-3.0.0.tgz#e1ac0f3e9e195135361fa1a1d62f795d87e6e819" - integrity sha512-sZLCdHvBUcNby1cB6Fd3ZBrABbjz3v1Vm90nysCQ6Vt7vd6e/h9Lt7SiJUoEX0l4Dzc7P5llKyhqSi1ycSf1Hg== +"@types/d3-time@^2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@types/d3-time/-/d3-time-2.1.1.tgz#743fdc821c81f86537cbfece07093ac39b4bc342" + integrity sha512-9MVYlmIgmRR31C5b4FVSWtuMmBHh2mOWQYfl7XAYOa8dsnb7iEmUmRSWSFgXFtkjxO65d7hTUHQC+RhR/9IWFg== "@types/eslint@^7.2.6": version "7.28.0" @@ -5000,76 +5000,76 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= -"d3-array@2 - 3", "d3-array@2.10.0 - 3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-3.0.4.tgz#60550bcc9818be9ace88d269ccd97038fc399b55" - integrity sha512-ShFl90cxNqDaSynDF/Bik/kTzISqePqU3qo2fv6kSJEvF7y7tDCDpcU6WiT01rPO6zngZnrvJ/0j4q6Qg+5EQg== +d3-array@2, d3-array@^2.3.0: + version "2.12.1" + resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-2.12.1.tgz#e20b41aafcdffdf5d50928004ececf815a465e81" + integrity sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ== dependencies: - internmap "1 - 2" + internmap "^1.0.0" d3-array@^1.2.0: version "1.2.4" resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f" integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw== -"d3-color@1 - 3": - version "3.0.1" - resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-3.0.1.tgz#03316e595955d1fcd39d9f3610ad41bb90194d0a" - integrity sha512-6/SlHkDOBLyQSJ1j1Ghs82OIUXpKWlR0hCsw0XrLSQhuUPuCSmLQ1QPH98vpnQxMUQM2/gfAkUEWsupVpd9JGw== +"d3-color@1 - 2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-2.0.0.tgz#8d625cab42ed9b8f601a1760a389f7ea9189d62e" + integrity sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ== -"d3-format@1 - 3": - version "3.0.1" - resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-3.0.1.tgz#e41b81b2ab79277141ec1404aa5d05001da64084" - integrity sha512-hdL7+HBIohpgfolhBxr1KX47VMD6+vVD/oEFrxk5yhmzV2prk99EkFKYpXuhVkFpTgHdJ6/4bYcjdLPPXV4tIA== +"d3-format@1 - 2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-2.0.0.tgz#a10bcc0f986c372b729ba447382413aabf5b0767" + integrity sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA== -"d3-interpolate@1.2.0 - 3", d3-interpolate@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz#3c47aa5b32c5b3dfb56ef3fd4342078a632b400d" - integrity sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g== +"d3-interpolate@1.2.0 - 2", d3-interpolate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-2.0.1.tgz#98be499cfb8a3b94d4ff616900501a64abc91163" + integrity sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ== dependencies: - d3-color "1 - 3" + d3-color "1 - 2" -"d3-path@1 - 3": - version "3.0.1" - resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-3.0.1.tgz#f09dec0aaffd770b7995f1a399152bf93052321e" - integrity sha512-gq6gZom9AFZby0YLduxT1qmrp4xpBA1YZr19OI717WIdKE2OM5ETq5qrHLb301IgxhLwcuxvGZVLeeWc/k1I6w== +"d3-path@1 - 2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-2.0.0.tgz#55d86ac131a0548adae241eebfb56b4582dd09d8" + integrity sha512-ZwZQxKhBnv9yHaiWd6ZU4x5BtCQ7pXszEV9CU6kRgwIQVQGLMv1oiL4M+MK/n79sYzsj+gcgpPQSctJUsLN7fA== d3-polygon@^1.0.3: version "1.0.6" resolved "https://registry.yarnpkg.com/d3-polygon/-/d3-polygon-1.0.6.tgz#0bf8cb8180a6dc107f518ddf7975e12abbfbd38e" integrity sha512-k+RF7WvI08PC8reEoXa/w2nSg5AUMTi+peBD9cmFc+0ixHfbs4QmxxkarVal1IkVkgxVuk9JSHhJURHiyHKAuQ== -d3-scale@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-4.0.1.tgz#c65aa7a357e4f58954a66e1edacc712bab4b1034" - integrity sha512-akUAsUujCFnw6Sf1dF7y/FXTxz+VvEIOB3ValKtLhNrzFp8q5wPO3VCAmsbCLJWRTxyJCZDoooodjOI1plFqlw== +d3-scale@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-3.3.0.tgz#28c600b29f47e5b9cd2df9749c206727966203f3" + integrity sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ== dependencies: - d3-array "2.10.0 - 3" - d3-format "1 - 3" - d3-interpolate "1.2.0 - 3" - d3-time "2.1.1 - 3" - d3-time-format "2 - 4" + d3-array "^2.3.0" + d3-format "1 - 2" + d3-interpolate "1.2.0 - 2" + d3-time "^2.1.1" + d3-time-format "2 - 3" -d3-shape@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-3.0.1.tgz#9ccdfb28fd9b0d12f2d8aec234cd5c4a9ea27931" - integrity sha512-HNZNEQoDhuCrDWEc/BMbF/hKtzMZVoe64TvisFLDp2Iyj0UShB/E6/lBsLlJTfBMbYgftHj90cXJ0SEitlE6Xw== +d3-shape@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-2.1.0.tgz#3b6a82ccafbc45de55b57fcf956c584ded3b666f" + integrity sha512-PnjUqfM2PpskbSLTJvAzp2Wv4CZsnAgTfcVRTwW03QR3MkXF8Uo7B1y/lWkAsmbKwuecto++4NlsYcvYpXpTHA== dependencies: - d3-path "1 - 3" + d3-path "1 - 2" -"d3-time-format@2 - 4": - version "4.0.0" - resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-4.0.0.tgz#930ded86a9de761702344760d8a25753467f28b7" - integrity sha512-nzaCwlj+ZVBIlFuVOT1RmU+6xb/7D5IcnhHzHQcBgS/aTa5K9fWZNN5LCXA27LgF5WxoSNJqKBbLcGMtM6Ca6A== - dependencies: - d3-time "1 - 3" - -"d3-time@1 - 3", "d3-time@2.1.1 - 3": +"d3-time-format@2 - 3": version "3.0.0" - resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-3.0.0.tgz#65972cb98ae2d4954ef5c932e8704061335d4975" - integrity sha512-zmV3lRnlaLI08y9IMRXSDshQb5Nj77smnfpnd2LrBa/2K281Jijactokeak14QacHs/kKq0AQ121nidNYlarbQ== + resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-3.0.0.tgz#df8056c83659e01f20ac5da5fdeae7c08d5f1bb6" + integrity sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag== dependencies: - d3-array "2 - 3" + d3-time "1 - 2" + +"d3-time@1 - 2", d3-time@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-2.1.1.tgz#e9d8a8a88691f4548e68ca085e5ff956724a6682" + integrity sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ== + dependencies: + d3-array "2" d@1, d@^1.0.1: version "1.0.1" @@ -6736,10 +6736,10 @@ graphql-tag@^2.12.3: dependencies: tslib "^2.1.0" -graphql@^15.5.3: - version "15.5.3" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.3.tgz#c72349017d5c9f5446a897fe6908b3186db1da00" - integrity sha512-sM+jXaO5KinTui6lbK/7b7H/Knj9BpjGxZ+Ki35v7YbUJxxdBCUqNM0h3CRVU1ZF9t5lNiBzvBCSYPvIwxPOQA== +graphql@^15.6.0: + version "15.6.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.0.tgz#e69323c6a9780a1a4b9ddf7e35ca8904bb04df02" + integrity sha512-WJR872Zlc9hckiEPhXgyUftXH48jp2EjO5tgBBOyNMRJZ9fviL2mJBD6CAysk6N5S0r9BTs09Qk39nnJBkvOXQ== growly@^1.3.0: version "1.3.0" @@ -7093,10 +7093,10 @@ i18next-browser-languagedetector@^6.1.2: dependencies: "@babel/runtime" "^7.14.6" -i18next@^21.0.0: - version "21.0.0" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.0.0.tgz#ad730aced7df552515c92b318d16d847c6270612" - integrity sha512-17A00z5ASuOJkPUNSUMaZcfL3zOm2qYiN8UBIYhNYNmPbPrcP+IfabGEFEICv8CCStr/cbjF0Jk/IXNX9hj3ZA== +i18next@^21.0.2: + version "21.0.2" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.0.2.tgz#a394cbd0cc1879a9ad7a4a979a222d12033022cc" + integrity sha512-cSjRitffS1xm90YgPFTaqut89Y4Oc2i4aiCmAuhxHPryYdKzSIGl1YSv8PzlW+UPFOKRIUCOYZ5Rn+aUXKq/qQ== dependencies: "@babel/runtime" "^7.12.0" @@ -7292,10 +7292,10 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" -"internmap@1 - 2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/internmap/-/internmap-2.0.3.tgz#6685f23755e43c524e251d29cbc97248e3061009" - integrity sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg== +internmap@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/internmap/-/internmap-1.0.1.tgz#0017cc8a3b99605f0302f2b198d272e015e5df95" + integrity sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw== invariant@^2.2.4: version "2.2.4" @@ -8327,10 +8327,10 @@ json5@^2.1.2: dependencies: minimist "^1.2.5" -jsoneditor@^9.5.4: - version "9.5.5" - resolved "https://registry.yarnpkg.com/jsoneditor/-/jsoneditor-9.5.5.tgz#3275b4b327d51c5d6d30e386d326bed4da012a0b" - integrity sha512-q0bnZF8eyM+pXHfQGkI0ATZWI974eeWVLun3nRl4QP1uvaMlc2w9R5UkPerWcHmuX+p0EQLOw/IOWmRT1qHqHQ== +jsoneditor@^9.5.6: + version "9.5.6" + resolved "https://registry.yarnpkg.com/jsoneditor/-/jsoneditor-9.5.6.tgz#b2abca2aeb34bb5291025d0eeddcb2845e0d90a9" + integrity sha512-smu4CKCOeJiizGGGYQ7ZAvCclnuJP7gX/wcoHw/DWiJMUZq+3KjJNDhYnVTRgi+Zk0UlPngA4egmuJre/H2mXg== dependencies: ace-builds "^1.4.12" ajv "^6.12.6" @@ -11783,18 +11783,18 @@ recharts-scale@^0.4.4: dependencies: decimal.js-light "^2.4.1" -recharts@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/recharts/-/recharts-2.1.3.tgz#f7e82b274a569ca3c9665570bd6d4e78a0e8f24e" - integrity sha512-M0i8x+NKI2Bu/DTGm0LH3FzOhk0YJ4dmBY43YX/KIV82CXfkwkJ07obkje8yJbjdKMjEPZnS5K0XdP6VLx/hPw== +recharts@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/recharts/-/recharts-2.1.4.tgz#8d21750e3bb01a909e01ebe5573c48d813c25287" + integrity sha512-ZKaLgUo4g84FhIiLeRq0uWMqe5GTjjJk+5fxmIt2H4cn279QZCMEsuVFmBqYedJcmX1URYEII5qb9pOppr5fJA== dependencies: - "@types/d3-interpolate" "^3.0.0" - "@types/d3-scale" "^4.0.0" - "@types/d3-shape" "^3.0.0" + "@types/d3-interpolate" "^2.0.0" + "@types/d3-scale" "^3.0.0" + "@types/d3-shape" "^2.0.0" classnames "^2.2.5" - d3-interpolate "^3.0.0" - d3-scale "^4.0.0" - d3-shape "^3.0.0" + d3-interpolate "^2.0.0" + d3-scale "^3.0.0" + d3-shape "^2.0.0" eventemitter3 "^4.0.1" lodash "^4.17.19" react-is "16.10.2" @@ -12258,10 +12258,10 @@ sass-loader@^10.0.5: schema-utils "^3.0.0" semver "^7.3.2" -sass@^1.41.1: - version "1.41.1" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.41.1.tgz#bca5bed2154192779c29f48fca9c644c60c38d98" - integrity sha512-vIjX7izRxw3Wsiez7SX7D+j76v7tenfO18P59nonjr/nzCkZuoHuF7I/Fo0ZRZPKr88v29ivIdE9BqGDgQD/Nw== +sass@^1.42.1: + version "1.42.1" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.42.1.tgz#5ab17bebc1cb1881ad2e0c9a932c66ad64e441e2" + integrity sha512-/zvGoN8B7dspKc5mC6HlaygyCBRvnyzzgD5khiaCfglWztY99cYoiTUksVx11NlnemrcfH5CEaCpsUKoW0cQqg== dependencies: chokidar ">=3.0.0 <4.0.0" diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js new file mode 100644 index 000000000..16cecfcb0 --- /dev/null +++ b/server/accounting/qb-receivables-lines.js @@ -0,0 +1,378 @@ +const DineroQbFormat = require("./accounting-constants").DineroQbFormat; + +const Dinero = require("dinero.js"); +const logger = require("../utils/logger"); + +module.exports = function ({ + bodyshop, + jobs_by_pk, + qbo = false, + items, + taxCodes, +}) { + const InvoiceLineAdd = []; + const responsibilityCenters = bodyshop.md_responsibility_centers; + + const invoiceLineHash = {}; //The hash of cost and profit centers based on the center name. + + //Determine if there are MAPA and MASH lines already on the estimate. + //If there are, don't do anything extra (mitchell estimate) + //Otherwise, calculate them and add them to the default MAPA and MASH centers. + let hasMapaLine = false; + let hasMashLine = false; + + //Create the invoice lines mapping. + jobs_by_pk.joblines.map((jobline) => { + if (jobline.db_ref === "936008") { + //If either of these DB REFs change, they also need to change in job-totals/job-costing calculations. + hasMapaLine = true; + } + if (jobline.db_ref === "936007") { + hasMashLine = true; + } + //Parts Lines Mappings. + if (jobline.profitcenter_part && jobline.act_price) { + let DineroAmount = Dinero({ + amount: Math.round(jobline.act_price * 100), + }).multiply(jobline.part_qty || 1); + + if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) { + // console.log("Have a part discount", jobline); + DineroAmount = DineroAmount.add( + DineroAmount.percentage(Math.abs(jobline.prt_dsmk_p || 0)).multiply( + jobline.prt_dsmk_p > 0 ? 1 : -1 + ) + ); + } + const account = responsibilityCenters.profits.find( + (i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase() + ); + + if (!account) { + logger.log( + "qbxml-receivables-no-account", + "warn", + null, + jobline.id, + null + ); + throw new Error( + `A matching account does not exist for the part allocation. Center: ${jobline.profitcenter_part}` + ); + } + if (qbo) { + //Do the mapping as per QBO. + //Determine the Tax code grouping. + + //Going to always assume that we need to apply GST. + const taxAccountCode = findTaxCode( + { + local: false, + federal: "true", + state: jobline.tax_part, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ); + + //GST/PST BC is what comes in, need to find the tax rate reference. + const QboTaxId = taxCodes[taxAccountCode]; + if (!invoiceLineHash[account.name]) invoiceLineHash[account.name] = {}; + if (!invoiceLineHash[account.name][QboTaxId]) { + invoiceLineHash[account.name][QboTaxId] = { + DetailType: "SalesItemLineDetail", + Amount: DineroAmount, + SalesItemLineDetail: { + ItemRef: { + value: items[account.accountitem], + }, + TaxCodeRef: { + value: QboTaxId, + }, + Qty: 1, + }, + }; + } else { + invoiceLineHash[account.name][QboTaxId].Amount = + invoiceLineHash[account.name][QboTaxId].Amount.add(DineroAmount); + } + } else { + if (!invoiceLineHash[account.name]) { + invoiceLineHash[account.name] = { + ItemRef: { FullName: account.accountitem }, + Desc: account.accountdesc, + Quantity: 1, //jobline.part_qty, + Amount: DineroAmount, //.toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }; + } else { + invoiceLineHash[account.name].Amount = + invoiceLineHash[account.name].Amount.add(DineroAmount); + } + } + } + //End Parts line mappings. + + // Labor Lines + if (jobline.profitcenter_labor && jobline.mod_lb_hrs) { + const DineroAmount = Dinero({ + amount: Math.round( + jobs_by_pk[`rate_${jobline.mod_lbr_ty.toLowerCase()}`] * 100 + ), + }).multiply(jobline.mod_lb_hrs); + const account = responsibilityCenters.profits.find( + (i) => jobline.profitcenter_labor.toLowerCase() === i.name.toLowerCase() + ); + + if (!account) { + throw new Error( + `A matching account does not exist for the labor allocation. Center: ${jobline.profitcenter_labor}` + ); + } + if (qbo) { + //Do some QBO Stuff. + } else { + if (!invoiceLineHash[account.name]) { + invoiceLineHash[account.name] = { + ItemRef: { FullName: account.accountitem }, + Desc: account.accountdesc, + Quantity: 1, // jobline.mod_lb_hrs, + Amount: DineroAmount, + //Amount: DineroAmount.toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }; + } else { + invoiceLineHash[account.name].Amount = + invoiceLineHash[account.name].Amount.add(DineroAmount); + } + } + } + }); + + if (!hasMapaLine && jobs_by_pk.job_totals.rates.mapa.total.amount > 0) { + // console.log("Adding MAPA Line Manually."); + const mapaAccountName = responsibilityCenters.defaults.profits.MAPA; + + const mapaAccount = responsibilityCenters.profits.find( + (c) => c.name === mapaAccountName + ); + + if (mapaAccount) { + if (qbo) { + //Add QBO MAPA + } else { + InvoiceLineAdd.push({ + ItemRef: { FullName: mapaAccount.accountitem }, + Desc: mapaAccount.accountdesc, + Quantity: 1, + Amount: Dinero(jobs_by_pk.job_totals.rates.mapa.total).toFormat( + DineroQbFormat + ), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + } else { + //console.log("NO MAPA ACCOUNT FOUND!!"); + } + } + + if (!hasMashLine && jobs_by_pk.job_totals.rates.mash.total.amount > 0) { + // console.log("Adding MASH Line Manually."); + + const mashAccountName = responsibilityCenters.defaults.profits.MASH; + + const mashAccount = responsibilityCenters.profits.find( + (c) => c.name === mashAccountName + ); + + if (mashAccount) { + if (qbo) { + //do some QBO + } else { + InvoiceLineAdd.push({ + ItemRef: { FullName: mashAccount.accountitem }, + Desc: mashAccount.accountdesc, + Quantity: 1, + Amount: Dinero(jobs_by_pk.job_totals.rates.mash.total).toFormat( + DineroQbFormat + ), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + } else { + // console.log("NO MASH ACCOUNT FOUND!!"); + } + } + + //Convert the hash to an array. + Object.keys(invoiceLineHash).forEach((key) => { + Object.keys(invoiceLineHash[key]).forEach((key2) => { + InvoiceLineAdd.push({ + ...invoiceLineHash[key][key2], + Amount: invoiceLineHash[key][key2].Amount.toFormat(DineroQbFormat), + }); + }); + }); + + //Add Towing, storage and adjustment lines. + + if (jobs_by_pk.towing_payable && jobs_by_pk.towing_payable !== 0) { + if (qbo) { + // do qbo + } else { + InvoiceLineAdd.push({ + ItemRef: { + FullName: responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["TOW"] + ).accountitem, + }, + Desc: "Towing", + Quantity: 1, + Amount: Dinero({ + amount: Math.round((jobs_by_pk.towing_payable || 0) * 100), + }).toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + } + if (jobs_by_pk.storage_payable && jobs_by_pk.storage_payable !== 0) { + if (qbo) { + // do qbo + } else { + InvoiceLineAdd.push({ + ItemRef: { + FullName: responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["TOW"] + ).accountitem, + }, + Desc: "Storage", + Quantity: 1, + Amount: Dinero({ + amount: Math.round((jobs_by_pk.storage_payable || 0) * 100), + }).toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + } + if ( + jobs_by_pk.adjustment_bottom_line && + jobs_by_pk.adjustment_bottom_line !== 0 + ) { + if (qbo) { + // do qbo + } else { + InvoiceLineAdd.push({ + ItemRef: { + FullName: responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["PAO"] + ).accountitem, + }, + Desc: "Adjustment", + Quantity: 1, + Amount: Dinero({ + amount: Math.round((jobs_by_pk.adjustment_bottom_line || 0) * 100), + }).toFormat(DineroQbFormat), + SalesTaxCodeRef: { + FullName: "E", + }, + }); + } + } + + //Add tax lines + const job_totals = jobs_by_pk.job_totals; + + const federal_tax = Dinero(job_totals.totals.federal_tax); + const state_tax = Dinero(job_totals.totals.state_tax); + const local_tax = Dinero(job_totals.totals.local_tax); + + if (federal_tax.getAmount() > 0) { + if (qbo) { + // do qbo + } else { + InvoiceLineAdd.push({ + ItemRef: { + FullName: + bodyshop.md_responsibility_centers.taxes.federal.accountitem, + }, + Desc: bodyshop.md_responsibility_centers.taxes.federal.accountdesc, + Amount: federal_tax.toFormat(DineroQbFormat), + }); + } + } + + if (state_tax.getAmount() > 0) { + if (qbo) { + // do qbo + } else { + InvoiceLineAdd.push({ + ItemRef: { + FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, + }, + Desc: bodyshop.md_responsibility_centers.taxes.state.accountdesc, + Amount: state_tax.toFormat(DineroQbFormat), + }); + } + } + + if (local_tax.getAmount() > 0) { + if (qbo) { + // do qbo + } else { + InvoiceLineAdd.push({ + ItemRef: { + FullName: bodyshop.md_responsibility_centers.taxes.local.accountitem, + }, + Desc: bodyshop.md_responsibility_centers.taxes.local.accountdesc, + Amount: local_tax.toFormat(DineroQbFormat), + }); + } + } + + //Region Specific + const { ca_bc_pvrt } = jobs_by_pk; + if (ca_bc_pvrt) { + if (qbo) { + // do qbo + } else { + InvoiceLineAdd.push({ + ItemRef: { + FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, + }, + Desc: "PVRT", + Amount: Dinero({ amount: (ca_bc_pvrt || 0) * 100 }).toFormat( + DineroQbFormat + ), + }); + } + } + + return InvoiceLineAdd; +}; + +const findTaxCode = ({ local, state, federal }, taxcode) => { + const t = taxcode.filter( + (t) => + !!t.local === !!local && + !!t.state === !!state && + !!t.federal === !!federal + ); + if (t.length === 1) { + return t[0].code; + } else if (t.length > 1) { + return "Multiple Tax Codes Match"; + } else { + return "No Tax Code Matches"; + } +}; diff --git a/server/accounting/qbo/qbo-receivables.js b/server/accounting/qbo/qbo-receivables.js index 04b3853f0..87c7fe374 100644 --- a/server/accounting/qbo/qbo-receivables.js +++ b/server/accounting/qbo/qbo-receivables.js @@ -16,6 +16,7 @@ const { setNewRefreshToken, } = require("./qbo-callback"); const OAuthClient = require("intuit-oauth"); +const CreateInvoiceLines = require("../qb-receivables-lines"); const GraphQLClient = require("graphql-request").GraphQLClient; const { generateOwnerTier } = require("../qbxml/qbxml-utils"); @@ -348,321 +349,34 @@ async function QueryMetaData(oauthClient, req) { async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) { const { items, taxCodes } = await QueryMetaData(oauthClient, req); - const InvoiceLineAdd = []; - const responsibilityCenters = bodyshop.md_responsibility_centers; - - const invoiceLineHash = {}; //The hash of cost and profit centers based on the center name. - - //Determine if there are MAPA and MASH lines already on the estimate. - //If there are, don't do anything extra (mitchell estimate) - //Otherwise, calculate them and add them to the default MAPA and MASH centers. - let hasMapaLine = false; - let hasMashLine = false; - - //Create the invoice lines mapping. - job.joblines.map((jobline) => { - //Parts Lines - if (jobline.db_ref === "936008") { - //If either of these DB REFs change, they also need to change in job-totals/job-costing calculations. - hasMapaLine = true; - } - if (jobline.db_ref === "936007") { - hasMashLine = true; - } - - if (jobline.profitcenter_part && jobline.act_price) { - let DineroAmount = Dinero({ - amount: Math.round(jobline.act_price * 100), - }).multiply(jobline.part_qty || 1); - - if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) { - // console.log("Have a part discount", jobline); - DineroAmount = DineroAmount.add( - DineroAmount.percentage(jobline.prt_dsmk_p || 0) - ); - } - const account = responsibilityCenters.profits.find( - (i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase() - ); - - if (!account) { - logger.log( - "qbxml-receivables-no-account", - "warn", - null, - jobline.id, - null - ); - throw new Error( - `A matching account does not exist for the part allocation. Center: ${jobline.profitcenter_part}` - ); - } - if (!invoiceLineHash[account.name]) { - invoiceLineHash[account.name] = { - ItemRef: { FullName: account.accountitem }, - Desc: account.accountdesc, - Quantity: 1, //jobline.part_qty, - Amount: DineroAmount, //.toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }; - } else { - invoiceLineHash[account.name].Amount = - invoiceLineHash[account.name].Amount.add(DineroAmount); - } - } - // Labor Lines - if (jobline.profitcenter_labor && jobline.mod_lb_hrs) { - const DineroAmount = Dinero({ - amount: Math.round( - job[`rate_${jobline.mod_lbr_ty.toLowerCase()}`] * 100 - ), - }).multiply(jobline.mod_lb_hrs); - const account = responsibilityCenters.profits.find( - (i) => jobline.profitcenter_labor.toLowerCase() === i.name.toLowerCase() - ); - - if (!account) { - throw new Error( - `A matching account does not exist for the labor allocation. Center: ${jobline.profitcenter_labor}` - ); - } - if (!invoiceLineHash[account.name]) { - invoiceLineHash[account.name] = { - ItemRef: { FullName: account.accountitem }, - Desc: account.accountdesc, - Quantity: 1, // jobline.mod_lb_hrs, - Amount: DineroAmount, - //Amount: DineroAmount.toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }; - } else { - invoiceLineHash[account.name].Amount = - invoiceLineHash[account.name].Amount.add(DineroAmount); - } - } + const InvoiceLineAdd = CreateInvoiceLines({ + bodyshop, + jobs_by_pk: job, + qbo: true, + items, + taxCodes, }); - // console.log("Done creating hash", JSON.stringify(invoiceLineHash)); - - if (!hasMapaLine && job.job_totals.rates.mapa.total.amount > 0) { - // console.log("Adding MAPA Line Manually."); - const mapaAccountName = responsibilityCenters.defaults.profits.MAPA; - - const mapaAccount = responsibilityCenters.profits.find( - (c) => c.name === mapaAccountName - ); - - if (mapaAccount) { - InvoiceLineAdd.push({ - ItemRef: { FullName: mapaAccount.accountitem }, - Desc: mapaAccount.accountdesc, - Quantity: 1, - Amount: Dinero(job.job_totals.rates.mapa.total).toFormat( - DineroQbFormat - ), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } else { - //console.log("NO MAPA ACCOUNT FOUND!!"); - } - } - - if (!hasMashLine && job.job_totals.rates.mash.total.amount > 0) { - // console.log("Adding MASH Line Manually."); - - const mashAccountName = responsibilityCenters.defaults.profits.MASH; - - const mashAccount = responsibilityCenters.profits.find( - (c) => c.name === mashAccountName - ); - - if (mashAccount) { - InvoiceLineAdd.push({ - ItemRef: { FullName: mashAccount.accountitem }, - Desc: mashAccount.accountdesc, - Quantity: 1, - Amount: Dinero(job.job_totals.rates.mash.total).toFormat( - DineroQbFormat - ), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } else { - // console.log("NO MASH ACCOUNT FOUND!!"); - } - } - - //Convert the hash to an array. - Object.keys(invoiceLineHash).forEach((key) => { - InvoiceLineAdd.push({ - ...invoiceLineHash[key], - Amount: invoiceLineHash[key].Amount.toFormat(DineroQbFormat), - }); - }); - - //Add Towing, storage and adjustment lines. - - if (job.towing_payable && job.towing_payable !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["TOW"] - ).accountitem, - }, - Desc: "Towing", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((job.towing_payable || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - if (job.storage_payable && job.storage_payable !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["TOW"] - ).accountitem, - }, - Desc: "Storage", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((job.storage_payable || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - if (job.adjustment_bottom_line && job.adjustment_bottom_line !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["PAO"] - ).accountitem, - }, - Desc: "Adjustment", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((job.adjustment_bottom_line || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - - //Add tax lines - const job_totals = job.job_totals; - - const federal_tax = Dinero(job_totals.totals.federal_tax); - const state_tax = Dinero(job_totals.totals.state_tax); - const local_tax = Dinero(job_totals.totals.local_tax); - - if (federal_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.federal.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.federal.accountdesc, - Amount: federal_tax.toFormat(DineroQbFormat), - }); - } - - if (state_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.state.accountdesc, - Amount: state_tax.toFormat(DineroQbFormat), - }); - } - - if (local_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.local.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.local.accountdesc, - Amount: local_tax.toFormat(DineroQbFormat), - }); - } - - //Region Specific - const { ca_bc_pvrt } = job; - if (ca_bc_pvrt) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, - }, - Desc: "PVRT", - Amount: Dinero({ amount: (ca_bc_pvrt || 0) * 100 }).toFormat( - DineroQbFormat - ), - }); - } - - //map each invoice line to the correct style for QBO. const invoiceObj = { - Line: [ - { - DetailType: "SalesItemLineDetail", - Amount: 100, - SalesItemLineDetail: { - // ItemRef: { - // // name: "Services", - // value: "16", - // }, - TaxCodeRef: { - value: "2", - }, - Qty: 1, - UnitPrice: 100, - }, - }, - ], - // Line: InvoiceLineAdd.map((i) => { - // return { + // Line: [ + // { // DetailType: "SalesItemLineDetail", - // Amount: i.Amount, + // Amount: 100, // SalesItemLineDetail: { // ItemRef: { - // //name: "Services", - // value: items[i.ItemRef.FullName], + // // name: "Services", + // value: "1", + // }, + // TaxCodeRef: { + // value: "2", // }, - // // TaxCodeRef: { - // // value: "2", - // // }, // Qty: 1, + // UnitPrice: 100, // }, - // }; - // }), - TxnTaxDetail: { - TaxLine: [ - { - DetailType: "TaxLineDetail", + // }, + // ], + Line: InvoiceLineAdd, - TaxLineDetail: { - NetAmountTaxable: 100, - TaxPercent: 7, - TaxRateRef: { - value: "16", - }, - PercentBased: true, - }, - }, - ], - }, CustomerRef: { value: parentTierRef.Id, }, diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index 77f310cc2..1aa506f9a 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -7,6 +7,7 @@ const moment = require("moment"); var builder = require("xmlbuilder2"); const QbXmlUtils = require("./qbxml-utils"); const logger = require("../../utils/logger"); +const CreateInvoiceLines = require("../qb-receivables-lines"); require("dotenv").config({ path: path.resolve( @@ -227,273 +228,8 @@ const generateInvoiceQbxml = ( twoTierPref ) => { //Build the Invoice XML file. - const InvoiceLineAdd = []; - const responsibilityCenters = bodyshop.md_responsibility_centers; - const invoiceLineHash = {}; //The hash of cost and profit centers based on the center name. - - //Determine if there are MAPA and MASH lines already on the estimate. - //If there are, don't do anything extra (mitchell estimate) - //Otherwise, calculate them and add them to the default MAPA and MASH centers. - let hasMapaLine = false; - let hasMashLine = false; - - //Create the invoice lines mapping. - jobs_by_pk.joblines.map((jobline) => { - //Parts Lines - if (jobline.db_ref === "936008") { - //If either of these DB REFs change, they also need to change in job-totals/job-costing calculations. - hasMapaLine = true; - } - if (jobline.db_ref === "936007") { - hasMashLine = true; - } - - if (jobline.profitcenter_part && jobline.act_price) { - let DineroAmount = Dinero({ - amount: Math.round(jobline.act_price * 100), - }).multiply(jobline.part_qty || 1); - - if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) { - // console.log("Have a part discount", jobline); - DineroAmount = DineroAmount.add( - DineroAmount.percentage(Math.abs(jobline.prt_dsmk_p || 0)).multiply( - jobline.prt_dsmk_p > 0 ? 1 : -1 - ) - ); - } - const account = responsibilityCenters.profits.find( - (i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase() - ); - - if (!account) { - logger.log( - "qbxml-receivables-no-account", - "warn", - null, - jobline.id, - null - ); - throw new Error( - `A matching account does not exist for the part allocation. Center: ${jobline.profitcenter_part}` - ); - } - if (!invoiceLineHash[account.name]) { - invoiceLineHash[account.name] = { - ItemRef: { FullName: account.accountitem }, - Desc: account.accountdesc, - Quantity: 1, //jobline.part_qty, - Amount: DineroAmount, //.toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }; - } else { - invoiceLineHash[account.name].Amount = - invoiceLineHash[account.name].Amount.add(DineroAmount); - } - } - // Labor Lines - if (jobline.profitcenter_labor && jobline.mod_lb_hrs) { - const DineroAmount = Dinero({ - amount: Math.round( - jobs_by_pk[`rate_${jobline.mod_lbr_ty.toLowerCase()}`] * 100 - ), - }).multiply(jobline.mod_lb_hrs); - const account = responsibilityCenters.profits.find( - (i) => jobline.profitcenter_labor.toLowerCase() === i.name.toLowerCase() - ); - - if (!account) { - throw new Error( - `A matching account does not exist for the labor allocation. Center: ${jobline.profitcenter_labor}` - ); - } - if (!invoiceLineHash[account.name]) { - invoiceLineHash[account.name] = { - ItemRef: { FullName: account.accountitem }, - Desc: account.accountdesc, - Quantity: 1, // jobline.mod_lb_hrs, - Amount: DineroAmount, - //Amount: DineroAmount.toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }; - } else { - invoiceLineHash[account.name].Amount = - invoiceLineHash[account.name].Amount.add(DineroAmount); - } - } - }); - // console.log("Done creating hash", JSON.stringify(invoiceLineHash)); - - if (!hasMapaLine && jobs_by_pk.job_totals.rates.mapa.total.amount > 0) { - // console.log("Adding MAPA Line Manually."); - const mapaAccountName = responsibilityCenters.defaults.profits.MAPA; - - const mapaAccount = responsibilityCenters.profits.find( - (c) => c.name === mapaAccountName - ); - - if (mapaAccount) { - InvoiceLineAdd.push({ - ItemRef: { FullName: mapaAccount.accountitem }, - Desc: mapaAccount.accountdesc, - Quantity: 1, - Amount: Dinero(jobs_by_pk.job_totals.rates.mapa.total).toFormat( - DineroQbFormat - ), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } else { - //console.log("NO MAPA ACCOUNT FOUND!!"); - } - } - - if (!hasMashLine && jobs_by_pk.job_totals.rates.mash.total.amount > 0) { - // console.log("Adding MASH Line Manually."); - - const mashAccountName = responsibilityCenters.defaults.profits.MASH; - - const mashAccount = responsibilityCenters.profits.find( - (c) => c.name === mashAccountName - ); - - if (mashAccount) { - InvoiceLineAdd.push({ - ItemRef: { FullName: mashAccount.accountitem }, - Desc: mashAccount.accountdesc, - Quantity: 1, - Amount: Dinero(jobs_by_pk.job_totals.rates.mash.total).toFormat( - DineroQbFormat - ), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } else { - // console.log("NO MASH ACCOUNT FOUND!!"); - } - } - - //Convert the hash to an array. - Object.keys(invoiceLineHash).forEach((key) => { - InvoiceLineAdd.push({ - ...invoiceLineHash[key], - Amount: invoiceLineHash[key].Amount.toFormat(DineroQbFormat), - }); - }); - - //Add Towing, storage and adjustment lines. - - if (jobs_by_pk.towing_payable && jobs_by_pk.towing_payable !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["TOW"] - ).accountitem, - }, - Desc: "Towing", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((jobs_by_pk.towing_payable || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - if (jobs_by_pk.storage_payable && jobs_by_pk.storage_payable !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["TOW"] - ).accountitem, - }, - Desc: "Storage", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((jobs_by_pk.storage_payable || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - if ( - jobs_by_pk.adjustment_bottom_line && - jobs_by_pk.adjustment_bottom_line !== 0 - ) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["PAO"] - ).accountitem, - }, - Desc: "Adjustment", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((jobs_by_pk.adjustment_bottom_line || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - - //Add tax lines - const job_totals = jobs_by_pk.job_totals; - - const federal_tax = Dinero(job_totals.totals.federal_tax); - const state_tax = Dinero(job_totals.totals.state_tax); - const local_tax = Dinero(job_totals.totals.local_tax); - - if (federal_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.federal.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.federal.accountdesc, - Amount: federal_tax.toFormat(DineroQbFormat), - }); - } - - if (state_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.state.accountdesc, - Amount: state_tax.toFormat(DineroQbFormat), - }); - } - - if (local_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.local.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.local.accountdesc, - Amount: local_tax.toFormat(DineroQbFormat), - }); - } - - //Region Specific - const { ca_bc_pvrt } = jobs_by_pk; - if (ca_bc_pvrt) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, - }, - Desc: "PVRT", - Amount: Dinero({ amount: (ca_bc_pvrt || 0) * 100 }).toFormat( - DineroQbFormat - ), - }); - } + const InvoiceLineAdd = CreateInvoiceLines({ bodyshop, jobs_by_pk }); const invoiceQbxmlObj = { QBXML: { diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index df1397caa..3a095f8f8 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -120,6 +120,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) { profitcenter_part db_ref prt_dsmk_p + tax_part } } bodyshops(where: {associations: {active: {_eq: true}}}) { From c76da54b9362c2aa3bd7cca3cecca9355ccc1474 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 23 Sep 2021 16:53:41 -0700 Subject: [PATCH 03/21] IO-256 First succesful basic post of receivables. --- server/accounting/qb-receivables-lines.js | 191 +++++++++++++++++++++- 1 file changed, 184 insertions(+), 7 deletions(-) diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 16cecfcb0..f013600a1 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -68,13 +68,12 @@ module.exports = function ({ const taxAccountCode = findTaxCode( { local: false, - federal: "true", + federal: true, state: jobline.tax_part, }, bodyshop.md_responsibility_centers.sales_tax_codes ); - //GST/PST BC is what comes in, need to find the tax rate reference. const QboTaxId = taxCodes[taxAccountCode]; if (!invoiceLineHash[account.name]) invoiceLineHash[account.name] = {}; if (!invoiceLineHash[account.name][QboTaxId]) { @@ -131,7 +130,36 @@ module.exports = function ({ ); } if (qbo) { - //Do some QBO Stuff. + //Going to always assume that we need to apply GST and PST for labor. + const taxAccountCode = findTaxCode( + { + local: false, + federal: true, + state: true, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ); + + const QboTaxId = taxCodes[taxAccountCode]; + if (!invoiceLineHash[account.name]) invoiceLineHash[account.name] = {}; + if (!invoiceLineHash[account.name][QboTaxId]) { + invoiceLineHash[account.name][QboTaxId] = { + DetailType: "SalesItemLineDetail", + Amount: DineroAmount, + SalesItemLineDetail: { + ItemRef: { + value: items[account.accountitem], + }, + TaxCodeRef: { + value: QboTaxId, + }, + Qty: 1, + }, + }; + } else { + invoiceLineHash[account.name][QboTaxId].Amount = + invoiceLineHash[account.name][QboTaxId].Amount.add(DineroAmount); + } } else { if (!invoiceLineHash[account.name]) { invoiceLineHash[account.name] = { @@ -163,6 +191,41 @@ module.exports = function ({ if (mapaAccount) { if (qbo) { //Add QBO MAPA + + //Going to always assume that we need to apply GST and PST for labor. + const taxAccountCode = findTaxCode( + { + local: false, + federal: true, + state: true, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ); + + const QboTaxId = taxCodes[taxAccountCode]; + if (!invoiceLineHash[mapaAccount.name]) + invoiceLineHash[mapaAccount.name] = {}; + if (!invoiceLineHash[mapaAccount.name][QboTaxId]) { + invoiceLineHash[mapaAccount.name][QboTaxId] = { + DetailType: "SalesItemLineDetail", + Amount: Dinero(jobs_by_pk.job_totals.rates.mapa.total), + SalesItemLineDetail: { + ItemRef: { + value: items[mapaAccount.accountitem], + }, + TaxCodeRef: { + value: QboTaxId, + }, + Qty: 1, + }, + }; + } else { + invoiceLineHash[mapaAccount.name][QboTaxId].Amount = invoiceLineHash[ + mapaAccount.name + ][QboTaxId].Amount.add( + Dinero(jobs_by_pk.job_totals.rates.mapa.total) + ); + } } else { InvoiceLineAdd.push({ ItemRef: { FullName: mapaAccount.accountitem }, @@ -192,7 +255,40 @@ module.exports = function ({ if (mashAccount) { if (qbo) { - //do some QBO + //Going to always assume that we need to apply GST and PST for labor. + const taxAccountCode = findTaxCode( + { + local: false, + federal: true, + state: true, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ); + + const QboTaxId = taxCodes[taxAccountCode]; + if (!invoiceLineHash[mashAccount.name]) + invoiceLineHash[mashAccount.name] = {}; + if (!invoiceLineHash[mashAccount.name][QboTaxId]) { + invoiceLineHash[mashAccount.name][QboTaxId] = { + DetailType: "SalesItemLineDetail", + Amount: Dinero(jobs_by_pk.job_totals.rates.mash.total), + SalesItemLineDetail: { + ItemRef: { + value: items[mashAccount.accountitem], + }, + TaxCodeRef: { + value: QboTaxId, + }, + Qty: 1, + }, + }; + } else { + invoiceLineHash[mashAccount.name][QboTaxId].Amount = invoiceLineHash[ + mashAccount.name + ][QboTaxId].Amount.add( + Dinero(jobs_by_pk.job_totals.rates.mash.total) + ); + } } else { InvoiceLineAdd.push({ ItemRef: { FullName: mashAccount.accountitem }, @@ -225,7 +321,34 @@ module.exports = function ({ if (jobs_by_pk.towing_payable && jobs_by_pk.towing_payable !== 0) { if (qbo) { - // do qbo + //Going to always assume that we need to apply GST and PST for labor. + const taxAccountCode = findTaxCode( + { + local: false, + federal: true, + state: true, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ); + const account = responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["TOW"] + ); + const QboTaxId = taxCodes[taxAccountCode]; + InvoiceLineAdd.push({ + DetailType: "SalesItemLineDetail", + Amount: Dinero({ + amount: Math.round((jobs_by_pk.towing_payable || 0) * 100), + }).toFormat(DineroQbFormat), + SalesItemLineDetail: { + ItemRef: { + value: items[account.accountitem], + }, + TaxCodeRef: { + value: QboTaxId, + }, + Qty: 1, + }, + }); } else { InvoiceLineAdd.push({ ItemRef: { @@ -246,7 +369,34 @@ module.exports = function ({ } if (jobs_by_pk.storage_payable && jobs_by_pk.storage_payable !== 0) { if (qbo) { - // do qbo + //Going to always assume that we need to apply GST and PST for labor. + const taxAccountCode = findTaxCode( + { + local: false, + federal: true, + state: true, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ); + const account = responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["TOW"] + ); + const QboTaxId = taxCodes[taxAccountCode]; + InvoiceLineAdd.push({ + DetailType: "SalesItemLineDetail", + Amount: Dinero({ + amount: Math.round((jobs_by_pk.storage_payable || 0) * 100), + }).toFormat(DineroQbFormat), + SalesItemLineDetail: { + ItemRef: { + value: items[account.accountitem], + }, + TaxCodeRef: { + value: QboTaxId, + }, + Qty: 1, + }, + }); } else { InvoiceLineAdd.push({ ItemRef: { @@ -270,7 +420,34 @@ module.exports = function ({ jobs_by_pk.adjustment_bottom_line !== 0 ) { if (qbo) { - // do qbo + //Going to always assume that we need to apply GST and PST for labor. + const taxAccountCode = findTaxCode( + { + local: false, + federal: true, + state: true, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ); + const account = responsibilityCenters.profits.find( + (c) => c.name === responsibilityCenters.defaults.profits["PAO"] + ); + const QboTaxId = taxCodes[taxAccountCode]; + InvoiceLineAdd.push({ + DetailType: "SalesItemLineDetail", + Amount: Dinero({ + amount: Math.round((jobs_by_pk.adjustment_bottom_line || 0) * 100), + }).toFormat(DineroQbFormat), + SalesItemLineDetail: { + ItemRef: { + value: items[account.accountitem], + }, + TaxCodeRef: { + value: QboTaxId, + }, + Qty: 1, + }, + }); } else { InvoiceLineAdd.push({ ItemRef: { From 8f2b1f0f7866f2f50061dd4e0e8be5f4e2d941a7 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 24 Sep 2021 16:43:57 -0700 Subject: [PATCH 04/21] IO-256 Export receivables for QBO --- bodyshop_translations.babel | 21 +++ client/src/assets/C2QB_composite_English.svg | 24 ++++ .../src/assets/C2QB_transparent_English.svg | 24 ++++ .../assets/qbo/C2QB_green_btn_med_default.svg | 4 + .../assets/qbo/C2QB_green_btn_med_hover.svg | 5 + .../qbo/C2QB_green_btn_short_default.svg | 4 + .../assets/qbo/C2QB_green_btn_short_hover.svg | 5 + .../qbo/C2QB_green_btn_tall_default.svg | 4 + .../assets/qbo/C2QB_green_btn_tall_hover.svg | 5 + .../qbo/C2QB_transparent_btn_med_default.svg | 4 + .../qbo/C2QB_transparent_btn_med_hover.svg | 5 + .../C2QB_transparent_btn_short_default.svg | 4 + .../qbo/C2QB_transparent_btn_short_hover.svg | 5 + .../qbo/C2QB_transparent_btn_tall_default.svg | 4 + .../qbo/C2QB_transparent_btn_tall_hover.svg | 5 + ...accounting-receivables-table.component.jsx | 4 + .../jobs-close-export-button.component.jsx | 91 ++++++------ .../jobs-export-all-button.component.jsx | 95 ++++++------ .../qbo-authorize/qbo-authorize.component.jsx | 60 +++----- .../qbo-authorize/qbo-authorize.scss | 8 ++ .../shop-info/shop-info.general.component.jsx | 7 + client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + server/accounting/qbo/qbo-callback.js | 3 - server/accounting/qbo/qbo-receivables.js | 136 +++++++++--------- 26 files changed, 340 insertions(+), 190 deletions(-) create mode 100644 client/src/assets/C2QB_composite_English.svg create mode 100644 client/src/assets/C2QB_transparent_English.svg create mode 100644 client/src/assets/qbo/C2QB_green_btn_med_default.svg create mode 100644 client/src/assets/qbo/C2QB_green_btn_med_hover.svg create mode 100644 client/src/assets/qbo/C2QB_green_btn_short_default.svg create mode 100644 client/src/assets/qbo/C2QB_green_btn_short_hover.svg create mode 100644 client/src/assets/qbo/C2QB_green_btn_tall_default.svg create mode 100644 client/src/assets/qbo/C2QB_green_btn_tall_hover.svg create mode 100644 client/src/assets/qbo/C2QB_transparent_btn_med_default.svg create mode 100644 client/src/assets/qbo/C2QB_transparent_btn_med_hover.svg create mode 100644 client/src/assets/qbo/C2QB_transparent_btn_short_default.svg create mode 100644 client/src/assets/qbo/C2QB_transparent_btn_short_hover.svg create mode 100644 client/src/assets/qbo/C2QB_transparent_btn_tall_default.svg create mode 100644 client/src/assets/qbo/C2QB_transparent_btn_tall_hover.svg create mode 100644 client/src/components/qbo-authorize/qbo-authorize.scss diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 9348a53a0..e4549e29b 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -8229,6 +8229,27 @@ + + qbo + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + rbac false diff --git a/client/src/assets/C2QB_composite_English.svg b/client/src/assets/C2QB_composite_English.svg new file mode 100644 index 000000000..d5e302253 --- /dev/null +++ b/client/src/assets/C2QB_composite_English.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/src/assets/C2QB_transparent_English.svg b/client/src/assets/C2QB_transparent_English.svg new file mode 100644 index 000000000..d5e302253 --- /dev/null +++ b/client/src/assets/C2QB_transparent_English.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/src/assets/qbo/C2QB_green_btn_med_default.svg b/client/src/assets/qbo/C2QB_green_btn_med_default.svg new file mode 100644 index 000000000..5777594bf --- /dev/null +++ b/client/src/assets/qbo/C2QB_green_btn_med_default.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/src/assets/qbo/C2QB_green_btn_med_hover.svg b/client/src/assets/qbo/C2QB_green_btn_med_hover.svg new file mode 100644 index 000000000..4495659ad --- /dev/null +++ b/client/src/assets/qbo/C2QB_green_btn_med_hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/src/assets/qbo/C2QB_green_btn_short_default.svg b/client/src/assets/qbo/C2QB_green_btn_short_default.svg new file mode 100644 index 000000000..f5e02d040 --- /dev/null +++ b/client/src/assets/qbo/C2QB_green_btn_short_default.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/src/assets/qbo/C2QB_green_btn_short_hover.svg b/client/src/assets/qbo/C2QB_green_btn_short_hover.svg new file mode 100644 index 000000000..41c42a246 --- /dev/null +++ b/client/src/assets/qbo/C2QB_green_btn_short_hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/src/assets/qbo/C2QB_green_btn_tall_default.svg b/client/src/assets/qbo/C2QB_green_btn_tall_default.svg new file mode 100644 index 000000000..d93a0e482 --- /dev/null +++ b/client/src/assets/qbo/C2QB_green_btn_tall_default.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/src/assets/qbo/C2QB_green_btn_tall_hover.svg b/client/src/assets/qbo/C2QB_green_btn_tall_hover.svg new file mode 100644 index 000000000..78e4f7670 --- /dev/null +++ b/client/src/assets/qbo/C2QB_green_btn_tall_hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/src/assets/qbo/C2QB_transparent_btn_med_default.svg b/client/src/assets/qbo/C2QB_transparent_btn_med_default.svg new file mode 100644 index 000000000..575057b1c --- /dev/null +++ b/client/src/assets/qbo/C2QB_transparent_btn_med_default.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/src/assets/qbo/C2QB_transparent_btn_med_hover.svg b/client/src/assets/qbo/C2QB_transparent_btn_med_hover.svg new file mode 100644 index 000000000..f4bab4f04 --- /dev/null +++ b/client/src/assets/qbo/C2QB_transparent_btn_med_hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/src/assets/qbo/C2QB_transparent_btn_short_default.svg b/client/src/assets/qbo/C2QB_transparent_btn_short_default.svg new file mode 100644 index 000000000..d1c15abeb --- /dev/null +++ b/client/src/assets/qbo/C2QB_transparent_btn_short_default.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/src/assets/qbo/C2QB_transparent_btn_short_hover.svg b/client/src/assets/qbo/C2QB_transparent_btn_short_hover.svg new file mode 100644 index 000000000..ab88da614 --- /dev/null +++ b/client/src/assets/qbo/C2QB_transparent_btn_short_hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/src/assets/qbo/C2QB_transparent_btn_tall_default.svg b/client/src/assets/qbo/C2QB_transparent_btn_tall_default.svg new file mode 100644 index 000000000..66d56b3ff --- /dev/null +++ b/client/src/assets/qbo/C2QB_transparent_btn_tall_default.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/src/assets/qbo/C2QB_transparent_btn_tall_hover.svg b/client/src/assets/qbo/C2QB_transparent_btn_tall_hover.svg new file mode 100644 index 000000000..d8319ae93 --- /dev/null +++ b/client/src/assets/qbo/C2QB_transparent_btn_tall_hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx index d7f57388e..ea9e5517b 100644 --- a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx +++ b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx @@ -11,6 +11,7 @@ import JobsExportAllButton from "../jobs-export-all-button/jobs-export-all-butto import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import QboAuthorizeComponent from "../qbo-authorize/qbo-authorize.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -206,6 +207,9 @@ export function AccountingReceivablesTableComponent({ completedCallback={setSelectedJobs} /> )} + {bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && ( + + )} { + //Check if it's a CDK setup. if (bodyshop.cdk_dealerid) { history.push(`/manage/dms?jobId=${jobId}`); return; @@ -41,48 +42,58 @@ export function JobsCloseExportButton({ logImEXEvent("jobs_close_export"); setLoading(true); - let QbXmlResponse; - try { - QbXmlResponse = await axios.post( - "/accounting/qbxml/receivables", - { jobIds: [jobId] }, - { - headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, - }, - } - ); - console.log("handle -> XML", QbXmlResponse); - } catch (error) { - console.log("Error getting QBXML from Server.", error); - notification["error"]({ - message: t("jobs.errors.exporting", { - error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), - }), - }); - setLoading(false); - return; - } - + //Check if it's a QBO Setup. let PartnerResponse; - try { - PartnerResponse = await axios.post( - "http://localhost:1337/qb/", - // "http://609feaeae986.ngrok.io/qb/", - QbXmlResponse.data, - { - headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, - }, - } - ); - } catch (error) { - console.log("Error connecting to quickbooks or partner.", error); - notification["error"]({ - message: t("jobs.errors.exporting-partner"), + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + PartnerResponse = await axios.post(`/qbo/receivables`, { + withCredentials: true, + jobIds: [jobId], }); - setLoading(false); - return; + } else { + //Default is QBD + + let QbXmlResponse; + try { + QbXmlResponse = await axios.post( + "/accounting/qbxml/receivables", + { jobIds: [jobId] }, + { + headers: { + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, + }, + } + ); + console.log("handle -> XML", QbXmlResponse); + } catch (error) { + console.log("Error getting QBXML from Server.", error); + notification["error"]({ + message: t("jobs.errors.exporting", { + error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), + }), + }); + setLoading(false); + return; + } + + try { + PartnerResponse = await axios.post( + "http://localhost:1337/qb/", + // "http://609feaeae986.ngrok.io/qb/", + QbXmlResponse.data, + { + headers: { + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, + }, + } + ); + } catch (error) { + console.log("Error connecting to quickbooks or partner.", error); + notification["error"]({ + message: t("jobs.errors.exporting-partner"), + }); + setLoading(false); + return; + } } console.log("PartnerResponse", PartnerResponse); diff --git a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx index e0be5621c..69b15dcfc 100644 --- a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx +++ b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx @@ -34,53 +34,61 @@ export function JobsExportAllButton({ const [loading, setLoading] = useState(false); const handleQbxml = async () => { logImEXEvent("jobs_export_all"); - - setLoading(true); - let QbXmlResponse; - try { - QbXmlResponse = await axios.post( - "/accounting/qbxml/receivables", - { jobIds: jobIds }, - { - headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, - }, - } - ); - } catch (error) { - console.log("Error getting QBXML from Server.", error); - notification["error"]({ - message: t("jobs.errors.exporting", { - error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), - }), - }); - setLoading(false); - return; - } - let PartnerResponse; - try { - PartnerResponse = await axios.post( - "http://localhost:1337/qb/", - // "http://609feaeae986.ngrok.io/qb/", - QbXmlResponse.data, - { - headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, - }, - } - ); - } catch (error) { - console.log("Error connecting to quickbooks or partner.", error); - notification["error"]({ - message: t("jobs.errors.exporting-partner"), + setLoading(true); + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + PartnerResponse = await axios.post(`/qbo/receivables`, { + withCredentials: true, + jobIds: jobIds, }); - setLoading(false); - return; - } + } else { + let QbXmlResponse; + try { + QbXmlResponse = await axios.post( + "/accounting/qbxml/receivables", + { jobIds: jobIds }, + { + headers: { + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, + }, + } + ); + } catch (error) { + console.log("Error getting QBXML from Server.", error); + notification["error"]({ + message: t("jobs.errors.exporting", { + error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), + }), + }); + setLoading(false); + return; + } + try { + PartnerResponse = await axios.post( + "http://localhost:1337/qb/", + // "http://609feaeae986.ngrok.io/qb/", + QbXmlResponse.data, + { + headers: { + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, + }, + } + ); + } catch (error) { + console.log("Error connecting to quickbooks or partner.", error); + notification["error"]({ + message: t("jobs.errors.exporting-partner"), + }); + setLoading(false); + return; + } + } console.log("PartnerResponse", PartnerResponse); - const groupedData = _.groupBy(PartnerResponse.data, "id"); + const groupedData = _.groupBy( + PartnerResponse.data, + bodyshop.accountingconfig.qbo ? "jobid" : "id" + ); await Promise.all( Object.keys(groupedData).map(async (key) => { @@ -157,6 +165,7 @@ export function JobsExportAllButton({ if (!!completedCallback) completedCallback([]); if (!!loadingCallback) loadingCallback(false); + setLoading(false); }; diff --git a/client/src/components/qbo-authorize/qbo-authorize.component.jsx b/client/src/components/qbo-authorize/qbo-authorize.component.jsx index 839466f70..682e5ebe0 100644 --- a/client/src/components/qbo-authorize/qbo-authorize.component.jsx +++ b/client/src/components/qbo-authorize/qbo-authorize.component.jsx @@ -1,19 +1,19 @@ -import { Button, Space } from "antd"; +import { Space, Tag } from "antd"; import Axios from "axios"; -import React, { useEffect } from "react"; -//import QboImg from "./qbo_signin.png"; import queryString from "query-string"; -import { useLocation } from "react-router-dom"; +import React, { useEffect } from "react"; import { useCookies } from "react-cookie"; +import { useHistory, useLocation } from "react-router-dom"; +import QboSignIn from "../../assets/qbo/C2QB_green_btn_med_default.svg"; +import "./qbo-authorize.scss"; export default function QboAuthorizeComponent() { const location = useLocation(); - - const [, setCookie] = useCookies(["access_token", "refresh_token"]); + const history = useHistory(); + const [cookies, setCookie] = useCookies(["access_token", "refresh_token"]); const handleQbSignIn = async () => { const result = await Axios.post("/qbo/authorize"); - console.log("pushing to history", result.data); window.location.href = result.data; }; const qs = queryString.parse(location.search); @@ -35,42 +35,24 @@ export default function QboAuthorizeComponent() { path: "/", expires, }); + + history.push({ pathname: `/manage/accounting/receivables` }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [qs, location, setCookie]); return ( -
- - - - - + + Sign In to QuickBooks Online + {!cookies.qbo_realmId && ( + No QuickBooks company has been connected. + )} {error && JSON.parse(decodeURIComponent(error)).error_description} -
+ ); } diff --git a/client/src/components/qbo-authorize/qbo-authorize.scss b/client/src/components/qbo-authorize/qbo-authorize.scss new file mode 100644 index 000000000..b4016ae80 --- /dev/null +++ b/client/src/components/qbo-authorize/qbo-authorize.scss @@ -0,0 +1,8 @@ +.qbo-sign-in { + background-image: url("../../assets/qbo/C2QB_green_btn_med_default.svg"); + width: 274px; + height: 48px; + &:hover { + background-image: url("../../assets/qbo/C2QB_green_btn_med_hover.svg"); + } +} diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index 6aa952218..1ab1e13f5 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -121,6 +121,13 @@ export default function ShopInfoGeneral({ form }) { + + + { Authorization: BearerToken, }, }); - logger.log("qbo-payable-create", "DEBUG", req.user.email, jobIds); + logger.log("qbo-receivable-create", "DEBUG", req.user.email, jobIds); const result = await client .setHeaders({ Authorization: BearerToken }) .request(queries.QUERY_JOBS_FOR_RECEIVABLES_EXPORT, { - ids: ["966dc7f9-2acd-44dc-9df5-d07c5578070a"], - //jobIds + ids: jobIds, }); const { jobs, bodyshops } = result; - - const job = jobs[0]; const bodyshop = bodyshops[0]; - const isThreeTier = bodyshop.accountingconfig.tiers === 3; - const twoTierPref = bodyshop.accountingconfig.twotierpref; - //Replace this with a for-each loop to check every single Job that's included in the list. + const ret = []; + for (const job of jobs) { + //const job = jobs[0]; + try { + const isThreeTier = bodyshop.accountingconfig.tiers === 3; + const twoTierPref = bodyshop.accountingconfig.twotierpref; - let insCoCustomerTier, ownerCustomerTier, jobTier; - if (isThreeTier || twoTierPref === "source") { - //Insert the insurance company tier. - //Query for top level customer, the insurance company name. - insCoCustomerTier = await QueryInsuranceCo(oauthClient, req, job); - if (!insCoCustomerTier) { - //Creating the Insurance Customer. - insCoCustomerTier = await InsertInsuranceCo( - oauthClient, - req, - job, - bodyshop - ); + //Replace this with a for-each loop to check every single Job that's included in the list. + + let insCoCustomerTier, ownerCustomerTier, jobTier; + if (isThreeTier || twoTierPref === "source") { + //Insert the insurance company tier. + //Query for top level customer, the insurance company name. + insCoCustomerTier = await QueryInsuranceCo(oauthClient, req, job); + if (!insCoCustomerTier) { + //Creating the Insurance Customer. + insCoCustomerTier = await InsertInsuranceCo( + oauthClient, + req, + job, + bodyshop + ); + } + } + console.log(insCoCustomerTier); + if (isThreeTier || twoTierPref === "name") { + //Insert the name/owner and account for whether the source should be the ins co in 3 tier.. + ownerCustomerTier = await QueryOwner(oauthClient, req, job); + //Query for the owner itself. + if (!ownerCustomerTier) { + ownerCustomerTier = await InsertOwner( + oauthClient, + req, + job, + isThreeTier, + insCoCustomerTier + ); + } + } + console.log(ownerCustomerTier); + //Query for the Job or Create it. + jobTier = await QueryJob(oauthClient, req, job); + + // Need to validate that the job tier is associated to the right individual? + + if (!jobTier) { + jobTier = await InsertJob( + oauthClient, + req, + job, + isThreeTier, + ownerCustomerTier + ); + } + console.log(jobTier); + await InsertInvoice(oauthClient, req, job, bodyshop, jobTier); + ret.push({ jobid: job.id, success: true }); + } catch (error) { + ret.push({ + jobid: job.id, + success: false, + errorMessage: error.message, + }); } } - if (isThreeTier || twoTierPref === "name") { - //Insert the name/owner and account for whether the source should be the ins co in 3 tier.. - ownerCustomerTier = await QueryOwner(oauthClient, req, job); - //Query for the owner itself. - if (!ownerCustomerTier) { - ownerCustomerTier = await InsertOwner( - oauthClient, - req, - job, - isThreeTier, - insCoCustomerTier - ); - } - } - //Query for the Job or Create it. - jobTier = await QueryJob(oauthClient, req, job); - - // Need to validate that the job tier is associated to the right individual? - - if (!jobTier) { - jobTier = await InsertJob( - oauthClient, - req, - job, - isThreeTier, - ownerCustomerTier - ); - } - await InsertInvoice(oauthClient, req, job, bodyshop, jobTier); - res.sendStatus(200); + res.status(200).json(ret); } catch (error) { console.log(error); - logger.log("qbo-payable-create-error", "ERROR", req.user.email, { error }); + logger.log("qbo-receivable-create-error", "ERROR", req.user.email, { + error, + }); res.status(400).json(error); } }; @@ -168,7 +182,7 @@ async function InsertInsuranceCo(oauthClient, req, job, bodyshop) { body: JSON.stringify(Customer), }); setNewRefreshToken(req.user.email, result); - return result && result.Customer; + return result && result.json.Customer; } catch (error) { logger.log("qbo-receivables-error", "DEBUG", req.user.email, job.id, { error, @@ -230,7 +244,7 @@ async function InsertOwner(oauthClient, req, job, isThreeTier, parentTierRef) { body: JSON.stringify(Customer), }); setNewRefreshToken(req.user.email, result); - return result && result.Customer; + return result && result.json.Customer; } catch (error) { logger.log("qbo-receivables-error", "DEBUG", req.user.email, job.id, { error, @@ -290,7 +304,7 @@ async function InsertJob(oauthClient, req, job, isThreeTier, parentTierRef) { body: JSON.stringify(Customer), }); setNewRefreshToken(req.user.email, result); - return result && result.Customer; + return result && result.json.Customer; } catch (error) { logger.log("qbo-receivables-error", "DEBUG", req.user.email, job.id, { error, @@ -319,14 +333,6 @@ async function QueryMetaData(oauthClient, req) { const taxCodeMapping = {}; - const accounts = await oauthClient.makeApiCall({ - url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From Account`), - method: "POST", - headers: { - "Content-Type": "application/json", - }, - }); - taxCodes.json && taxCodes.json.QueryResponse && taxCodes.json.QueryResponse.TaxCode.forEach((t) => { From dfa95927555fe81122c4317bfda8faeb8038ae75 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 24 Sep 2021 17:17:23 -0700 Subject: [PATCH 05/21] IO-256 Add PVRT handling for QBO. --- .../qbo-authorize/qbo-authorize.component.jsx | 1 - .../qbo-authorize/qbo-authorize.scss | 8 ------ server/accounting/qb-receivables-lines.js | 26 +++++++++++++++++- server/accounting/qbo/qbo-receivables.js | 27 +++++++------------ 4 files changed, 34 insertions(+), 28 deletions(-) delete mode 100644 client/src/components/qbo-authorize/qbo-authorize.scss diff --git a/client/src/components/qbo-authorize/qbo-authorize.component.jsx b/client/src/components/qbo-authorize/qbo-authorize.component.jsx index 682e5ebe0..1f159afb0 100644 --- a/client/src/components/qbo-authorize/qbo-authorize.component.jsx +++ b/client/src/components/qbo-authorize/qbo-authorize.component.jsx @@ -5,7 +5,6 @@ import React, { useEffect } from "react"; import { useCookies } from "react-cookie"; import { useHistory, useLocation } from "react-router-dom"; import QboSignIn from "../../assets/qbo/C2QB_green_btn_med_default.svg"; -import "./qbo-authorize.scss"; export default function QboAuthorizeComponent() { const location = useLocation(); diff --git a/client/src/components/qbo-authorize/qbo-authorize.scss b/client/src/components/qbo-authorize/qbo-authorize.scss deleted file mode 100644 index b4016ae80..000000000 --- a/client/src/components/qbo-authorize/qbo-authorize.scss +++ /dev/null @@ -1,8 +0,0 @@ -.qbo-sign-in { - background-image: url("../../assets/qbo/C2QB_green_btn_med_default.svg"); - width: 274px; - height: 48px; - &:hover { - background-image: url("../../assets/qbo/C2QB_green_btn_med_hover.svg"); - } -} diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index f013600a1..2aabf11e1 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -521,7 +521,31 @@ module.exports = function ({ const { ca_bc_pvrt } = jobs_by_pk; if (ca_bc_pvrt) { if (qbo) { - // do qbo + InvoiceLineAdd.push({ + DetailType: "SalesItemLineDetail", + Amount: Dinero({ amount: (ca_bc_pvrt || 0) * 100 }).toFormat( + DineroQbFormat + ), + SalesItemLineDetail: { + ItemRef: { + value: items["PVRT"], + }, + Qty: 1, + TaxCodeRef: { + value: + taxCodes[ + findTaxCode( + { + local: false, + federal: false, + state: false, + }, + bodyshop.md_responsibility_centers.sales_tax_codes + ) + ], + }, + }, + }); } else { InvoiceLineAdd.push({ ItemRef: { diff --git a/server/accounting/qbo/qbo-receivables.js b/server/accounting/qbo/qbo-receivables.js index b1f981f97..010266812 100644 --- a/server/accounting/qbo/qbo-receivables.js +++ b/server/accounting/qbo/qbo-receivables.js @@ -15,6 +15,7 @@ const { } = require("./qbo-callback"); const OAuthClient = require("intuit-oauth"); const CreateInvoiceLines = require("../qb-receivables-lines"); +const moment = require("moment"); const GraphQLClient = require("graphql-request").GraphQLClient; const { generateOwnerTier } = require("../qbxml/qbxml-utils"); @@ -364,28 +365,18 @@ async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) { }); const invoiceObj = { - // Line: [ - // { - // DetailType: "SalesItemLineDetail", - // Amount: 100, - // SalesItemLineDetail: { - // ItemRef: { - // // name: "Services", - // value: "1", - // }, - // TaxCodeRef: { - // value: "2", - // }, - // Qty: 1, - // UnitPrice: 100, - // }, - // }, - // ], Line: InvoiceLineAdd, - + TxnDate: moment(job.date_invoiced).format("YYYY-MM-DD"), + DocNumber: job.ro_number, CustomerRef: { value: parentTierRef.Id, }, + ...(bodyshop.accountingconfig.printlater + ? { PrintStatus: "NeedToPrint" } + : {}), + ...(bodyshop.accountingconfig.emaillater + ? { EmailStatus: "NeedToSend" } + : {}), }; try { From c1dfba949e42889dd408884e27221939796fcad1 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 27 Sep 2021 09:17:34 -0700 Subject: [PATCH 06/21] IO-1349 Update Hasura to 2.0.9. --- hasura/config.yaml | 5 + hasura/metadata/actions.graphql | 0 hasura/metadata/actions.yaml | 6 + hasura/metadata/allow_list.yaml | 1 + hasura/metadata/cron_triggers.yaml | 1 + hasura/metadata/functions.yaml | 27 + hasura/metadata/query_collections.yaml | 1 + hasura/metadata/remote_schemas.yaml | 1 + hasura/metadata/tables.yaml | 4775 +++++++++++++++++ hasura/metadata/version.yaml | 1 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../1622571551101_run_sql_migration/up.sql | 3 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 6 + .../down.sql | 8 + .../up.sql | 6 + .../down.sql | 3 + .../up.sql | 3 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../1625768789569_run_sql_migration/up.sql | 30 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 3 + .../up.sql | 2 + .../down.sql | 3 + .../up.sql | 2 + .../down.sql | 3 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 6 + .../down.sql | 8 + .../up.sql | 6 + .../down.sql | 8 + .../up.sql | 6 + .../down.sql | 2 + .../up.sql | 6 + .../down.sql | 8 + .../up.sql | 6 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 3 + .../1629738990845_run_sql_migration/up.sql | 2 + .../down.sql | 2 + .../up.sql | 2 + .../down.sql | 2 + .../up.sql | 19 + .../1632265756746_run_sql_migration/up.sql | 11 + .../1632265816135_run_sql_migration/up.sql | 11 + .../1620771761757_Init/up.sql | 1546 ++++++ .../1620771761757_Init/up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../1622571551101_run_sql_migration/down.yaml | 1 + .../1622571551101_run_sql_migration/up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../1625768789569_run_sql_migration/down.yaml | 1 + .../1625768789569_run_sql_migration/up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../1629738990845_run_sql_migration/down.yaml | 1 + .../1629738990845_run_sql_migration/up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../down.yaml | 0 .../up.yaml | 0 .../1632265756746_run_sql_migration/down.yaml | 1 + .../1632265756746_run_sql_migration/up.yaml | 0 .../1632265816135_run_sql_migration/down.yaml | 1 + .../1632265816135_run_sql_migration/up.yaml | 0 .../metadata.yaml | 0 256 files changed, 6637 insertions(+) create mode 100644 hasura/metadata/actions.graphql create mode 100644 hasura/metadata/actions.yaml create mode 100644 hasura/metadata/allow_list.yaml create mode 100644 hasura/metadata/cron_triggers.yaml create mode 100644 hasura/metadata/functions.yaml create mode 100644 hasura/metadata/query_collections.yaml create mode 100644 hasura/metadata/remote_schemas.yaml create mode 100644 hasura/metadata/tables.yaml create mode 100644 hasura/metadata/version.yaml create mode 100755 hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/down.sql create mode 100755 hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/up.sql create mode 100755 hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/down.sql create mode 100755 hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/up.sql create mode 100755 hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.sql create mode 100755 hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.sql create mode 100755 hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.sql create mode 100755 hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.sql create mode 100755 hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.sql create mode 100755 hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.sql create mode 100755 hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.sql create mode 100755 hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.sql create mode 100755 hasura/migrations/1622571551101_run_sql_migration/up.sql create mode 100755 hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/down.sql create mode 100755 hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/up.sql create mode 100755 hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.sql create mode 100755 hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.sql create mode 100755 hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/down.sql create mode 100755 hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/up.sql create mode 100755 hasura/migrations/1622650359491_set_fk_public_exportlog_billid/down.sql create mode 100755 hasura/migrations/1622650359491_set_fk_public_exportlog_billid/up.sql create mode 100755 hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.sql create mode 100755 hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.sql create mode 100755 hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.sql create mode 100755 hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.sql create mode 100755 hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.sql create mode 100755 hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.sql create mode 100755 hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/down.sql create mode 100755 hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/up.sql create mode 100755 hasura/migrations/1625768789569_run_sql_migration/up.sql create mode 100755 hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.sql create mode 100755 hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.sql create mode 100755 hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.sql create mode 100755 hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.sql create mode 100755 hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.sql create mode 100755 hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.sql create mode 100755 hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.sql create mode 100755 hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.sql create mode 100755 hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.sql create mode 100755 hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.sql create mode 100755 hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.sql create mode 100755 hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.sql create mode 100755 hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/down.sql create mode 100755 hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/up.sql create mode 100755 hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/down.sql create mode 100755 hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/up.sql create mode 100755 hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/down.sql create mode 100755 hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/up.sql create mode 100755 hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/down.sql create mode 100755 hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/up.sql create mode 100755 hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/down.sql create mode 100755 hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/up.sql create mode 100755 hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/down.sql create mode 100755 hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/up.sql create mode 100755 hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/down.sql create mode 100755 hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/up.sql create mode 100755 hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/down.sql create mode 100755 hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/up.sql create mode 100755 hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.sql create mode 100755 hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.sql create mode 100755 hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.sql create mode 100755 hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.sql create mode 100755 hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.sql create mode 100755 hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.sql create mode 100755 hasura/migrations/1629520416914_create_table_public_dms_vehicles/down.sql create mode 100755 hasura/migrations/1629520416914_create_table_public_dms_vehicles/up.sql create mode 100755 hasura/migrations/1629738990845_run_sql_migration/up.sql create mode 100755 hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.sql create mode 100755 hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.sql create mode 100755 hasura/migrations/1631052192511_create_table_public_relatedjobs/down.sql create mode 100755 hasura/migrations/1631052192511_create_table_public_relatedjobs/up.sql create mode 100755 hasura/migrations/1632265756746_run_sql_migration/up.sql create mode 100755 hasura/migrations/1632265816135_run_sql_migration/up.sql create mode 100644 hasura/migrations_backup/1620771761757_Init/up.sql rename hasura/{migrations => migrations_backup}/1620771761757_Init/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1621379721863_alter_table_public_bodyshops_add_column_website/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1621379721863_alter_table_public_bodyshops_add_column_website/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1621379731471_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1621379731471_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1621379744928_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1621379744928_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1621469433708_alter_table_public_documents_add_column_takenat/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1621469433708_alter_table_public_documents_add_column_takenat/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1621469445403_update_permission_user_public_table_documents/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1621469445403_update_permission_user_public_table_documents/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1621469452694_update_permission_user_public_table_documents/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1621469452694_update_permission_user_public_table_documents/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147902848_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147902848_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147914381_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622147914381_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.yaml (100%) create mode 100644 hasura/migrations_backup/1622571551101_run_sql_migration/down.yaml rename hasura/{migrations => migrations_backup}/1622571551101_run_sql_migration/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622647828371_alter_table_public_conversations_add_column_archived/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622647828371_alter_table_public_conversations_add_column_archived/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648063952_set_fk_public_parts_orders_orderedby/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648063952_set_fk_public_parts_orders_orderedby/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648072730_update_permission_user_public_table_parts_orders/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648072730_update_permission_user_public_table_parts_orders/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648079209_update_permission_user_public_table_parts_orders/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648079209_update_permission_user_public_table_parts_orders/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648087365_update_permission_user_public_table_parts_orders/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648087365_update_permission_user_public_table_parts_orders/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648112396_update_permission_user_public_table_conversations/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648112396_update_permission_user_public_table_conversations/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648118751_update_permission_user_public_table_conversations/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622648118751_update_permission_user_public_table_conversations/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1622650359491_set_fk_public_exportlog_billid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1622650359491_set_fk_public_exportlog_billid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1623796895613_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1623796895613_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1623796904892_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1623796904892_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1624310795238_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1624310795238_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1624480412524_track_all_relationships/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1624480412524_track_all_relationships/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1624480467391_alter_table_public_bodyshops_add_column_features/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1624480467391_alter_table_public_bodyshops_add_column_features/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1624480496210_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1624480496210_update_permission_user_public_table_bodyshops/up.yaml (100%) create mode 100644 hasura/migrations_backup/1625768789569_run_sql_migration/down.yaml rename hasura/{migrations => migrations_backup}/1625768789569_run_sql_migration/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626795768315_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626795768315_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626795775694_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626795775694_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970563204_delete_permission_user_public_table_audit_trail/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970563204_delete_permission_user_public_table_audit_trail/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970699645_alter_table_public_audit_trail_add_column_billid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970699645_alter_table_public_audit_trail_add_column_billid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970720625_set_fk_public_audit_trail_billid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970720625_set_fk_public_audit_trail_billid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970735347_set_fk_public_audit_trail_billid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970735347_set_fk_public_audit_trail_billid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970788128_set_fk_public_audit_trail_billid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970788128_set_fk_public_audit_trail_billid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970818772_set_fk_public_audit_trail_jobid/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970818772_set_fk_public_audit_trail_jobid/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970831689_set_fk_public_audit_trail_useremail/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970831689_set_fk_public_audit_trail_useremail/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970851371_track_all_relationships/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626970851371_track_all_relationships/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626975869951_update_permission_user_public_table_audit_trail/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626975869951_update_permission_user_public_table_audit_trail/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1626975885477_update_permission_user_public_table_audit_trail/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1626975885477_update_permission_user_public_table_audit_trail/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487063259_alter_table_public_appointments_add_column_note/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487063259_alter_table_public_appointments_add_column_note/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487073069_update_permission_user_public_table_appointments/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487073069_update_permission_user_public_table_appointments/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487079534_update_permission_user_public_table_appointments/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487079534_update_permission_user_public_table_appointments/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487084218_update_permission_user_public_table_appointments/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1627487084218_update_permission_user_public_table_appointments/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1627501097014_alter_table_public_audit_trail_alter_column_created/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1627501097014_alter_table_public_audit_trail_alter_column_created/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1628014693949_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1628014693949_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1628014707161_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1628014707161_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1628544252299_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1628544252299_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1628544261316_update_permission_user_public_table_bodyshops/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1628544261316_update_permission_user_public_table_bodyshops/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321689733_update_permission_user_public_table_timetickets/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321689733_update_permission_user_public_table_timetickets/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321697271_update_permission_user_public_table_timetickets/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321697271_update_permission_user_public_table_timetickets/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321703175_update_permission_user_public_table_timetickets/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629321703175_update_permission_user_public_table_timetickets/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520416914_create_table_public_dms_vehicles/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520416914_create_table_public_dms_vehicles/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520454038_track_all_relationships/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520454038_track_all_relationships/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520509486_update_permission_user_public_table_dms_vehicles/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520509486_update_permission_user_public_table_dms_vehicles/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520623978_update_permission_user_public_table_dms_vehicles/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520623978_update_permission_user_public_table_dms_vehicles/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520632595_update_permission_user_public_table_dms_vehicles/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629520632595_update_permission_user_public_table_dms_vehicles/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1629521860924_update_permission_user_public_table_dms_vehicles/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1629521860924_update_permission_user_public_table_dms_vehicles/up.yaml (100%) create mode 100644 hasura/migrations_backup/1629738990845_run_sql_migration/down.yaml rename hasura/{migrations => migrations_backup}/1629738990845_run_sql_migration/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052192511_create_table_public_relatedjobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052192511_create_table_public_relatedjobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052229711_track_all_relationships/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052229711_track_all_relationships/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052776515_update_permission_user_public_table_relatedjobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052776515_update_permission_user_public_table_relatedjobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052784531_update_permission_user_public_table_relatedjobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052784531_update_permission_user_public_table_relatedjobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052794082_update_permission_user_public_table_relatedjobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631052794082_update_permission_user_public_table_relatedjobs/up.yaml (100%) rename hasura/{migrations => migrations_backup}/1631056626995_update_permission_user_public_table_relatedjobs/down.yaml (100%) rename hasura/{migrations => migrations_backup}/1631056626995_update_permission_user_public_table_relatedjobs/up.yaml (100%) create mode 100644 hasura/migrations_backup/1632265756746_run_sql_migration/down.yaml rename hasura/{migrations => migrations_backup}/1632265756746_run_sql_migration/up.yaml (100%) create mode 100644 hasura/migrations_backup/1632265816135_run_sql_migration/down.yaml rename hasura/{migrations => migrations_backup}/1632265816135_run_sql_migration/up.yaml (100%) rename hasura/{migrations => migrations_backup}/metadata.yaml (100%) diff --git a/hasura/config.yaml b/hasura/config.yaml index b3b3d8636..8b52487b5 100644 --- a/hasura/config.yaml +++ b/hasura/config.yaml @@ -1,2 +1,7 @@ +version: 2 endpoint: https://bodyshop-dev-db.herokuapp.com admin_secret: Dev-BodyShopApp! +metadata_directory: metadata +actions: + kind: synchronous + handler_webhook_baseurl: http://localhost:3000 diff --git a/hasura/metadata/actions.graphql b/hasura/metadata/actions.graphql new file mode 100644 index 000000000..e69de29bb diff --git a/hasura/metadata/actions.yaml b/hasura/metadata/actions.yaml new file mode 100644 index 000000000..1edb4c2ff --- /dev/null +++ b/hasura/metadata/actions.yaml @@ -0,0 +1,6 @@ +actions: [] +custom_types: + enums: [] + input_objects: [] + objects: [] + scalars: [] diff --git a/hasura/metadata/allow_list.yaml b/hasura/metadata/allow_list.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/metadata/allow_list.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/metadata/cron_triggers.yaml b/hasura/metadata/cron_triggers.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/metadata/cron_triggers.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/metadata/functions.yaml b/hasura/metadata/functions.yaml new file mode 100644 index 000000000..a2dd7ccf8 --- /dev/null +++ b/hasura/metadata/functions.yaml @@ -0,0 +1,27 @@ +- function: + schema: public + name: search_bills +- function: + schema: public + name: search_cccontracts +- function: + schema: public + name: search_dms_vehicles +- function: + schema: public + name: search_exportlog +- function: + schema: public + name: search_jobs +- function: + schema: public + name: search_owners +- function: + schema: public + name: search_payments +- function: + schema: public + name: search_phonebook +- function: + schema: public + name: search_vehicles diff --git a/hasura/metadata/query_collections.yaml b/hasura/metadata/query_collections.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/metadata/query_collections.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/metadata/remote_schemas.yaml b/hasura/metadata/remote_schemas.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/metadata/remote_schemas.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml new file mode 100644 index 000000000..9eee43482 --- /dev/null +++ b/hasura/metadata/tables.yaml @@ -0,0 +1,4775 @@ +- table: + schema: public + name: allocations + object_relationships: + - name: employee + using: + foreign_key_constraint_on: employeeid + - name: jobline + using: + foreign_key_constraint_on: joblineid + insert_permissions: + - role: user + permission: + check: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - hours + - created_at + - updated_at + - employeeid + - id + - joblineid + select_permissions: + - role: user + permission: + columns: + - hours + - created_at + - updated_at + - employeeid + - id + - joblineid + filter: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: [] + filter: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: appointments + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - arrived + - block + - bodyshopid + - canceled + - color + - created_at + - end + - id + - isintake + - jobid + - note + - start + - title + - updated_at + select_permissions: + - role: user + permission: + columns: + - arrived + - block + - bodyshopid + - canceled + - color + - created_at + - end + - id + - isintake + - jobid + - note + - start + - title + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - arrived + - block + - bodyshopid + - canceled + - color + - created_at + - end + - id + - isintake + - jobid + - note + - start + - title + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: associations + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: shopid + - name: user + using: + foreign_key_constraint_on: useremail + select_permissions: + - role: user + permission: + columns: + - active + - authlevel + - default_prod_list_view + - id + - shopid + - useremail + filter: + user: + authid: + _eq: X-Hasura-User-Id + update_permissions: + - role: user + permission: + columns: + - active + - authlevel + - default_prod_list_view + filter: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + check: null +- table: + schema: public + name: audit_trail + object_relationships: + - name: bill + using: + foreign_key_constraint_on: billid + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: job + using: + foreign_key_constraint_on: jobid + - name: user + using: + foreign_key_constraint_on: useremail + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created + - operation + - new_val + - old_val + - useremail + - bodyshopid + - jobid + - billid + backend_only: false + select_permissions: + - role: user + permission: + columns: + - id + - new_val + - old_val + - operation + - useremail + - created + - billid + - bodyshopid + - jobid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: available_jobs + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - bodyshopid + - cieca_id + - clm_amt + - clm_no + - created_at + - est_data + - id + - ins_co_nm + - issupplement + - jobid + - ownr_name + - source_system + - supplement_number + - updated_at + - uploaded_by + - vehicle_info + select_permissions: + - role: user + permission: + columns: + - bodyshopid + - cieca_id + - clm_amt + - clm_no + - created_at + - est_data + - id + - ins_co_nm + - issupplement + - jobid + - ownr_name + - source_system + - supplement_number + - updated_at + - uploaded_by + - vehicle_info + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - cieca_id + - clm_amt + - est_data + - ins_co_nm + - issupplement + - ownr_name + - source_system + - supplement_number + - uploaded_by + - vehicle_info + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: billlines + object_relationships: + - name: bill + using: + foreign_key_constraint_on: billid + - name: jobline + using: + foreign_key_constraint_on: joblineid + insert_permissions: + - role: user + permission: + check: + bill: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actual_cost + - actual_price + - applicable_taxes + - billid + - cost_center + - created_at + - deductedfromlbr + - id + - joblineid + - lbr_adjustment + - line_desc + - quantity + - updated_at + select_permissions: + - role: user + permission: + columns: + - actual_cost + - actual_price + - applicable_taxes + - billid + - cost_center + - created_at + - deductedfromlbr + - id + - joblineid + - lbr_adjustment + - line_desc + - quantity + - updated_at + filter: + bill: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - actual_cost + - actual_price + - applicable_taxes + - billid + - cost_center + - created_at + - deductedfromlbr + - id + - joblineid + - lbr_adjustment + - line_desc + - quantity + - updated_at + filter: + bill: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bill: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: bills + object_relationships: + - name: job + using: + foreign_key_constraint_on: jobid + - name: vendor + using: + foreign_key_constraint_on: vendorid + array_relationships: + - name: audit_trails + using: + foreign_key_constraint_on: + column: billid + table: + schema: public + name: audit_trail + - name: billlines + using: + foreign_key_constraint_on: + column: billid + table: + schema: public + name: billlines + - name: documents + using: + foreign_key_constraint_on: + column: billid + table: + schema: public + name: documents + - name: exportlogs + using: + foreign_key_constraint_on: + column: billid + table: + schema: public + name: exportlog + - name: parts_orders + using: + foreign_key_constraint_on: + column: returnfrombill + table: + schema: public + name: parts_orders + insert_permissions: + - role: user + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - created_at + - date + - due_date + - exported + - exported_at + - federal_tax_rate + - id + - invoice_number + - is_credit_memo + - isinhouse + - jobid + - local_tax_rate + - state_tax_rate + - total + - updated_at + - vendorid + select_permissions: + - role: user + permission: + columns: + - created_at + - date + - due_date + - exported + - exported_at + - federal_tax_rate + - id + - invoice_number + - is_credit_memo + - isinhouse + - jobid + - local_tax_rate + - state_tax_rate + - total + - updated_at + - vendorid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - created_at + - date + - due_date + - exported + - exported_at + - federal_tax_rate + - id + - invoice_number + - is_credit_memo + - isinhouse + - jobid + - local_tax_rate + - state_tax_rate + - total + - updated_at + - vendorid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + _and: + - job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - exported: + _eq: false +- table: + schema: public + name: bodyshops + array_relationships: + - name: appointments + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: appointments + - name: associations + using: + foreign_key_constraint_on: + column: shopid + table: + schema: public + name: associations + - name: audit_trails + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: audit_trail + - name: available_jobs + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: available_jobs + - name: conversations + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: conversations + - name: counters + using: + foreign_key_constraint_on: + column: shopid + table: + schema: public + name: counters + - name: courtesycars + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: courtesycars + - name: csiinvites + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: csi + - name: csiquestions + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: csiquestions + - name: dms_vehicles + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: dms_vehicles + - name: documents + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: documents + - name: employees + using: + foreign_key_constraint_on: + column: shopid + table: + schema: public + name: employees + - name: exportlogs + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: exportlog + - name: jobs + using: + foreign_key_constraint_on: + column: shopid + table: + schema: public + name: jobs + - name: owners + using: + foreign_key_constraint_on: + column: shopid + table: + schema: public + name: owners + - name: phonebooks + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: phonebook + - name: timetickets + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: timetickets + - name: vehicles + using: + foreign_key_constraint_on: + column: shopid + table: + schema: public + name: vehicles + - name: vendors + using: + foreign_key_constraint_on: + column: bodyshopid + table: + schema: public + name: vendors + select_permissions: + - role: user + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - attach_pdf_to_email + - bill_tax_rates + - cdk_configuration + - cdk_dealerid + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - enforce_referral + - features + - federal_tax_id + - id + - imexshopid + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - jc_hourly_rates + - jobsizelimit + - logo_img_path + - md_categories + - md_ccc_rates + - md_classes + - md_hour_split + - md_ins_cos + - md_jobline_presets + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_payment_types + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - phone + - prodtargethrs + - production_config + - region_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - sub_status + - target_touchtime + - template_header + - textid + - tt_allow_post_to_invoiced + - updated_at + - use_fippa + - website + - workingdays + - zip_post + filter: + associations: + user: + authid: + _eq: X-Hasura-User-Id + update_permissions: + - role: user + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - attach_pdf_to_email + - bill_tax_rates + - cdk_configuration + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - enforce_referral + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - jc_hourly_rates + - logo_img_path + - md_categories + - md_ccc_rates + - md_classes + - md_hour_split + - md_ins_cos + - md_jobline_presets + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_payment_types + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - phone + - prodtargethrs + - production_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - target_touchtime + - tt_allow_post_to_invoiced + - updated_at + - use_fippa + - website + - workingdays + - zip_post + filter: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null +- table: + schema: public + name: cccontracts + object_relationships: + - name: courtesycar + using: + foreign_key_constraint_on: courtesycarid + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + courtesycar: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actax + - actualreturn + - agreementnumber + - cleanupcharge + - contract_date + - courtesycarid + - coverage + - created_at + - dailyfreekm + - dailyrate + - damage + - damagewaiver + - driver_addr1 + - driver_addr2 + - driver_city + - driver_dlexpiry + - driver_dlnumber + - driver_dlst + - driver_dob + - driver_fn + - driver_ln + - driver_ph1 + - driver_state + - driver_zip + - excesskmrate + - federaltax + - fuelin + - fuelout + - id + - jobid + - kmend + - kmstart + - localtax + - refuelcharge + - scheduledreturn + - start + - statetax + - status + - updated_at + select_permissions: + - role: user + permission: + columns: + - actax + - actualreturn + - agreementnumber + - cleanupcharge + - contract_date + - courtesycarid + - coverage + - created_at + - dailyfreekm + - dailyrate + - damage + - damagewaiver + - driver_addr1 + - driver_addr2 + - driver_city + - driver_dlexpiry + - driver_dlnumber + - driver_dlst + - driver_dob + - driver_fn + - driver_ln + - driver_ph1 + - driver_state + - driver_zip + - excesskmrate + - federaltax + - fuelin + - fuelout + - id + - jobid + - kmend + - kmstart + - localtax + - refuelcharge + - scheduledreturn + - start + - statetax + - status + - updated_at + filter: + courtesycar: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - actax + - actualreturn + - agreementnumber + - cleanupcharge + - contract_date + - courtesycarid + - coverage + - created_at + - dailyfreekm + - dailyrate + - damage + - damagewaiver + - driver_addr1 + - driver_addr2 + - driver_city + - driver_dlexpiry + - driver_dlnumber + - driver_dlst + - driver_dob + - driver_fn + - driver_ln + - driver_ph1 + - driver_state + - driver_zip + - excesskmrate + - federaltax + - fuelin + - fuelout + - id + - jobid + - kmend + - kmstart + - localtax + - refuelcharge + - scheduledreturn + - start + - statetax + - status + - updated_at + filter: + courtesycar: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + courtesycar: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: conversations + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + array_relationships: + - name: job_conversations + using: + foreign_key_constraint_on: + column: conversationid + table: + schema: public + name: job_conversations + - name: messages + using: + foreign_key_constraint_on: + column: conversationid + table: + schema: public + name: messages + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - bodyshopid + - phone_num + select_permissions: + - role: user + permission: + columns: + - archived + - bodyshopid + - created_at + - id + - phone_num + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - archived + - bodyshopid + - created_at + - id + - phone_num + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null +- table: + schema: public + name: counters + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: shopid +- table: + schema: public + name: courtesycars + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + array_relationships: + - name: cccontracts + using: + foreign_key_constraint_on: + column: courtesycarid + table: + schema: public + name: cccontracts + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - bodyshopid + - make + - model + - year + - plate + - color + - vin + - fleetnumber + - purchasedate + - servicestartdate + - serviceenddate + - leaseenddate + - status + - nextservicekm + - nextservicedate + - damage + - notes + - fuel + - registrationexpires + - insuranceexpires + - dailycost + - mileage + select_permissions: + - role: user + permission: + columns: + - insuranceexpires + - leaseenddate + - nextservicedate + - purchasedate + - registrationexpires + - serviceenddate + - servicestartdate + - dailycost + - fuel + - mileage + - nextservicekm + - color + - damage + - fleetnumber + - make + - model + - notes + - plate + - status + - vin + - year + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - insuranceexpires + - leaseenddate + - nextservicedate + - purchasedate + - registrationexpires + - serviceenddate + - servicestartdate + - dailycost + - fuel + - mileage + - nextservicekm + - color + - damage + - fleetnumber + - make + - model + - notes + - plate + - status + - vin + - year + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: csi + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: csiquestion + using: + foreign_key_constraint_on: questionset + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - bodyshopid + - created_at + - id + - jobid + - questionset + - relateddata + - updated_at + - valid + - validuntil + select_permissions: + - role: anonymous + permission: + columns: + - id + - relateddata + - valid + - validuntil + filter: + valid: + _eq: true + limit: 1 + - role: user + permission: + columns: + - bodyshopid + - completedon + - created_at + - id + - jobid + - questionset + - relateddata + - response + - updated_at + - valid + - validuntil + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: anonymous + permission: + columns: + - completedon + - response + - valid + filter: + valid: + _eq: true + check: null + - role: user + permission: + columns: + - bodyshopid + - completedon + - created_at + - id + - jobid + - relateddata + - updated_at + - valid + - validuntil + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null +- table: + schema: public + name: csiquestions + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + array_relationships: + - name: csis + using: + foreign_key_constraint_on: + column: questionset + table: + schema: public + name: csi + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - current + - config + - created_at + - updated_at + - bodyshopid + - id + select_permissions: + - role: anonymous + permission: + columns: + - config + - id + filter: {} + limit: 1 + - role: user + permission: + columns: + - current + - config + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - current + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null +- table: + schema: public + name: dms_vehicles + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - makecode + - modelcode + - make + - model + - bodyshopid + backend_only: false + select_permissions: + - role: user + permission: + columns: + - id + - created_at + - makecode + - modelcode + - make + - model + - bodyshopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - make + - makecode + - model + - modelcode + - created_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: documents + object_relationships: + - name: bill + using: + foreign_key_constraint_on: billid + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + _or: + - job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - billid + - bodyshopid + - created_at + - extension + - id + - jobid + - key + - name + - size + - takenat + - type + - updated_at + - uploaded_by + select_permissions: + - role: user + permission: + columns: + - billid + - bodyshopid + - created_at + - extension + - id + - jobid + - key + - name + - size + - takenat + - type + - updated_at + - uploaded_by + filter: + _or: + - job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - extension + - key + - name + - type + - uploaded_by + - created_at + - updated_at + - billid + - bodyshopid + - id + - jobid + filter: + _or: + - job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + _or: + - job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: employees + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: shopid + - name: user + using: + foreign_key_constraint_on: user_email + array_relationships: + - name: allocations + using: + foreign_key_constraint_on: + column: employeeid + table: + schema: public + name: allocations + - name: jobsByEmployeeBody + using: + foreign_key_constraint_on: + column: employee_body + table: + schema: public + name: jobs + - name: jobsByEmployeeCsr + using: + foreign_key_constraint_on: + column: employee_csr + table: + schema: public + name: jobs + - name: jobsByEmployeePrep + using: + foreign_key_constraint_on: + column: employee_prep + table: + schema: public + name: jobs + - name: jobsByEmployeeRefinish + using: + foreign_key_constraint_on: + column: employee_refinish + table: + schema: public + name: jobs + - name: timetickets + using: + foreign_key_constraint_on: + column: employeeid + table: + schema: public + name: timetickets + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - active + - created_at + - employee_number + - first_name + - flat_rate + - hire_date + - id + - last_name + - pin + - rates + - shopid + - termination_date + - updated_at + - user_email + select_permissions: + - role: user + permission: + columns: + - active + - created_at + - employee_number + - first_name + - flat_rate + - hire_date + - id + - last_name + - pin + - rates + - shopid + - termination_date + - updated_at + - user_email + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - active + - created_at + - employee_number + - first_name + - flat_rate + - hire_date + - id + - last_name + - pin + - rates + - shopid + - termination_date + - updated_at + - user_email + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: exportlog + object_relationships: + - name: bill + using: + foreign_key_constraint_on: billid + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: job + using: + foreign_key_constraint_on: jobid + - name: payment + using: + foreign_key_constraint_on: paymentid + - name: user + using: + foreign_key_constraint_on: useremail + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - jobid + - billid + - paymentid + - successful + - message + - bodyshopid + - useremail + backend_only: false + select_permissions: + - role: user + permission: + columns: + - successful + - message + - useremail + - created_at + - updated_at + - billid + - bodyshopid + - id + - jobid + - paymentid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true +- table: + schema: public + name: ioevents +- table: + schema: public + name: job_conversations + object_relationships: + - name: conversation + using: + foreign_key_constraint_on: conversationid + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - conversationid + - id + - jobid + select_permissions: + - role: user + permission: + columns: + - conversationid + - id + - jobid + filter: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - conversationid + - jobid + filter: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: joblines + object_relationships: + - name: job + using: + foreign_key_constraint_on: jobid + array_relationships: + - name: allocations + using: + foreign_key_constraint_on: + column: joblineid + table: + schema: public + name: allocations + - name: billlines + using: + foreign_key_constraint_on: + column: joblineid + table: + schema: public + name: billlines + - name: parts_order_lines + using: + foreign_key_constraint_on: + column: job_line_id + table: + schema: public + name: parts_order_lines + insert_permissions: + - role: user + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - act_price + - alt_co_id + - alt_overrd + - alt_part_i + - alt_partm + - alt_partno + - bett_amt + - bett_pctg + - bett_tax + - bett_type + - cert_part + - created_at + - db_hrs + - db_price + - db_ref + - est_seq + - glass_flag + - id + - jobid + - lbr_amt + - lbr_hrs_j + - lbr_inc + - lbr_op + - lbr_op_j + - lbr_tax + - lbr_typ_j + - line_desc + - line_ind + - line_no + - line_ref + - location + - manual_line + - misc_amt + - misc_sublt + - misc_tax + - mod_lb_hrs + - mod_lbr_ty + - notes + - oem_partno + - op_code_desc + - paint_stg + - paint_tone + - part_qty + - part_type + - price_inc + - price_j + - profitcenter_labor + - profitcenter_part + - prt_dsmk_m + - prt_dsmk_p + - removed + - status + - sublet_completed + - sublet_ignored + - tax_part + - unq_seq + - updated_at + select_permissions: + - role: user + permission: + columns: + - act_price + - alt_co_id + - alt_overrd + - alt_part_i + - alt_partm + - alt_partno + - bett_amt + - bett_pctg + - bett_tax + - bett_type + - cert_part + - created_at + - db_hrs + - db_price + - db_ref + - est_seq + - glass_flag + - id + - jobid + - lbr_amt + - lbr_hrs_j + - lbr_inc + - lbr_op + - lbr_op_j + - lbr_tax + - lbr_typ_j + - line_desc + - line_ind + - line_no + - line_ref + - location + - manual_line + - misc_amt + - misc_sublt + - misc_tax + - mod_lb_hrs + - mod_lbr_ty + - notes + - oem_partno + - op_code_desc + - paint_stg + - paint_tone + - part_qty + - part_type + - price_inc + - price_j + - profitcenter_labor + - profitcenter_part + - prt_dsmk_m + - prt_dsmk_p + - removed + - status + - sublet_completed + - sublet_ignored + - tax_part + - unq_seq + - updated_at + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - act_price + - alt_co_id + - alt_overrd + - alt_part_i + - alt_partm + - alt_partno + - bett_amt + - bett_pctg + - bett_tax + - bett_type + - cert_part + - created_at + - db_hrs + - db_price + - db_ref + - est_seq + - glass_flag + - id + - jobid + - lbr_amt + - lbr_hrs_j + - lbr_inc + - lbr_op + - lbr_op_j + - lbr_tax + - lbr_typ_j + - line_desc + - line_ind + - line_no + - line_ref + - location + - manual_line + - misc_amt + - misc_sublt + - misc_tax + - mod_lb_hrs + - mod_lbr_ty + - notes + - oem_partno + - op_code_desc + - paint_stg + - paint_tone + - part_qty + - part_type + - price_inc + - price_j + - profitcenter_labor + - profitcenter_part + - prt_dsmk_m + - prt_dsmk_p + - removed + - status + - sublet_completed + - sublet_ignored + - tax_part + - unq_seq + - updated_at + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: joblines_status + object_relationships: + - name: job + using: + manual_configuration: + remote_table: + schema: public + name: jobs + insertion_order: null + column_mapping: + jobid: id + select_permissions: + - role: user + permission: + columns: + - jobid + - status + - count + - part_type + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: jobs + object_relationships: + - name: bill + using: + manual_configuration: + remote_table: + schema: public + name: bills + insertion_order: null + column_mapping: + id: jobid + - name: bodyshop + using: + foreign_key_constraint_on: shopid + - name: employee_body_rel + using: + foreign_key_constraint_on: employee_body + - name: employee_csr_rel + using: + foreign_key_constraint_on: employee_csr + - name: employee_prep_rel + using: + foreign_key_constraint_on: employee_prep + - name: employee_refinish_rel + using: + foreign_key_constraint_on: employee_refinish + - name: owner + using: + foreign_key_constraint_on: ownerid + - name: vehicle + using: + foreign_key_constraint_on: vehicleid + array_relationships: + - name: appointments + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: appointments + - name: audit_trails + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: audit_trail + - name: available_jobs + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: available_jobs + - name: bills + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: bills + - name: cccontracts + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: cccontracts + - name: csiinvites + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: csi + - name: documents + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: documents + - name: exportlogs + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: exportlog + - name: job_conversations + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: job_conversations + - name: joblines + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: joblines + - name: joblines_status + using: + manual_configuration: + remote_table: + schema: public + name: joblines_status + insertion_order: null + column_mapping: + id: jobid + - name: notes + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: notes + - name: parts_orders + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: parts_orders + - name: payments + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: payments + - name: relatedjobs_child + using: + foreign_key_constraint_on: + column: childjob + table: + schema: public + name: relatedjobs + - name: relatedjobs_parent + using: + foreign_key_constraint_on: + column: parentjob + table: + schema: public + name: relatedjobs + - name: scoreboards + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: scoreboard + - name: timetickets + using: + foreign_key_constraint_on: + column: jobid + table: + schema: public + name: timetickets + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_customer_gst + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_csr + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + select_permissions: + - role: user + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_customer_gst + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_csr + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - alt_transport + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - ca_bc_pvrt + - ca_customer_gst + - ca_gst_registrant + - cat_no + - category + - cieca_stl + - cieca_ttl + - ciecaid + - class + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deliverchecklist + - depreciation_taxes + - driveable + - employee_body + - employee_csr + - employee_prep + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - lbr_adjustments + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - queued_for_parts + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_registration_number + - tax_shop_mat_rt + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towin + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + - voided + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: masterdata + select_permissions: + - role: anonymous + permission: + columns: + - key + - value + filter: {} + - role: user + permission: + columns: + - key + - value + filter: {} +- table: + schema: public + name: messages + object_relationships: + - name: conversation + using: + foreign_key_constraint_on: conversationid + - name: user + using: + foreign_key_constraint_on: userid + insert_permissions: + - role: user + permission: + check: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - conversationid + - created_at + - id + - image + - image_path + - isoutbound + - msid + - read + - status + - text + - updated_at + - userid + select_permissions: + - role: user + permission: + columns: + - conversationid + - created_at + - id + - image + - image_path + - isoutbound + - msid + - read + - status + - text + - updated_at + - userid + filter: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - conversationid + - created_at + - id + - image + - image_path + - isoutbound + - msid + - read + - status + - text + - updated_at + filter: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + conversation: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: notes + object_relationships: + - name: job + using: + foreign_key_constraint_on: jobid + - name: user + using: + foreign_key_constraint_on: created_by + insert_permissions: + - role: user + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - audit + - created_at + - created_by + - critical + - id + - jobid + - private + - text + - updated_at + select_permissions: + - role: user + permission: + columns: + - audit + - created_at + - created_by + - critical + - id + - jobid + - private + - text + - updated_at + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - audit + - created_at + - created_by + - critical + - id + - jobid + - private + - text + - updated_at + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: owners + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: shopid + array_relationships: + - name: jobs + using: + foreign_key_constraint_on: + column: ownerid + table: + schema: public + name: jobs + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - ownr_fn + - ownr_ln + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ea + - ownr_ph1 + - preferred_contact + - allow_text_message + - shopid + - ownr_ph2 + - ownr_co_nm + - ownr_title + - accountingid + select_permissions: + - role: user + permission: + columns: + - allow_text_message + - accountingid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_title + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - allow_text_message + - accountingid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_title + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: parts_order_lines + object_relationships: + - name: jobline + using: + foreign_key_constraint_on: job_line_id + - name: parts_order + using: + foreign_key_constraint_on: orderid + insert_permissions: + - role: user + permission: + check: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - act_price + - backordered_eta + - backordered_on + - cost + - created_at + - db_price + - id + - job_line_id + - line_desc + - line_remarks + - oem_partno + - orderid + - part_type + - quantity + - status + - updated_at + select_permissions: + - role: user + permission: + columns: + - act_price + - backordered_eta + - backordered_on + - cost + - created_at + - db_price + - id + - job_line_id + - line_desc + - line_remarks + - oem_partno + - orderid + - part_type + - quantity + - status + - updated_at + filter: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - act_price + - backordered_eta + - backordered_on + - cost + - created_at + - db_price + - id + - job_line_id + - line_desc + - line_remarks + - oem_partno + - orderid + - part_type + - quantity + - status + - updated_at + filter: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: parts_orders + object_relationships: + - name: bill + using: + foreign_key_constraint_on: returnfrombill + - name: job + using: + foreign_key_constraint_on: jobid + - name: user + using: + foreign_key_constraint_on: user_email + - name: userByOrderedby + using: + foreign_key_constraint_on: orderedby + - name: vendor + using: + foreign_key_constraint_on: vendorid + array_relationships: + - name: parts_order_lines + using: + foreign_key_constraint_on: + column: orderid + table: + schema: public + name: parts_order_lines + insert_permissions: + - role: user + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - created_at + - deliver_by + - id + - jobid + - order_date + - order_number + - orderedby + - return + - returnfrombill + - status + - updated_at + - user_email + - vendorid + select_permissions: + - role: user + permission: + columns: + - created_at + - deliver_by + - id + - jobid + - order_date + - order_number + - orderedby + - return + - returnfrombill + - status + - updated_at + - user_email + - vendorid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - created_at + - deliver_by + - id + - jobid + - order_date + - order_number + - orderedby + - returnfrombill + - status + - updated_at + - user_email + - vendorid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: payments + object_relationships: + - name: job + using: + foreign_key_constraint_on: jobid + array_relationships: + - name: exportlogs + using: + foreign_key_constraint_on: + column: paymentid + table: + schema: public + name: exportlog + insert_permissions: + - role: user + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - amount + - created_at + - date + - exportedat + - id + - jobid + - memo + - payer + - paymentnum + - stripeid + - transactionid + - type + - updated_at + select_permissions: + - role: user + permission: + columns: + - amount + - created_at + - date + - exportedat + - id + - jobid + - memo + - payer + - paymentnum + - stripeid + - transactionid + - type + - updated_at + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - amount + - created_at + - date + - exportedat + - id + - jobid + - memo + - payer + - paymentnum + - stripeid + - transactionid + - type + - updated_at + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: phonebook + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - bodyshopid + - firstname + - lastname + - phone1 + - email + - address1 + - address2 + - city + - state + - zip + - country + - company + - phone2 + - fax + - category + backend_only: false + select_permissions: + - role: user + permission: + columns: + - address1 + - address2 + - category + - city + - company + - country + - email + - fax + - firstname + - lastname + - phone1 + - phone2 + - state + - zip + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - address1 + - address2 + - category + - city + - company + - country + - email + - fax + - firstname + - lastname + - phone1 + - phone2 + - state + - zip + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: relatedjobs + object_relationships: + - name: childjob_rel + using: + foreign_key_constraint_on: childjob + - name: parentjob_rel + using: + foreign_key_constraint_on: parentjob + insert_permissions: + - role: user + permission: + check: + _or: + - parentjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - childjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - parentjob + - childjob + backend_only: false + select_permissions: + - role: user + permission: + columns: + - created_at + - updated_at + - childjob + - id + - parentjob + filter: + _or: + - parentjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - childjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - created_at + - updated_at + - childjob + - id + - parentjob + filter: + _or: + - parentjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - childjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + _or: + - parentjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + - childjob_rel: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: scoreboard + object_relationships: + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - jobid + - painthrs + - bodyhrs + - date + backend_only: false + select_permissions: + - role: user + permission: + columns: + - date + - bodyhrs + - painthrs + - id + - jobid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - date + - bodyhrs + - painthrs + - id + - jobid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: timetickets + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + - name: employee + using: + foreign_key_constraint_on: employeeid + - name: job + using: + foreign_key_constraint_on: jobid + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actualhrs + - bodyshopid + - ciecacode + - clockoff + - clockon + - cost_center + - created_at + - date + - employeeid + - flat_rate + - id + - jobid + - memo + - productivehrs + - rate + - updated_at + select_permissions: + - role: user + permission: + columns: + - actualhrs + - bodyshopid + - ciecacode + - clockoff + - clockon + - cost_center + - created_at + - date + - employeeid + - flat_rate + - id + - jobid + - memo + - productivehrs + - rate + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - actualhrs + - bodyshopid + - ciecacode + - clockoff + - clockon + - cost_center + - created_at + - date + - employeeid + - flat_rate + - id + - jobid + - memo + - productivehrs + - rate + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: users + object_relationships: + - name: employee + using: + manual_configuration: + remote_table: + schema: public + name: employees + insertion_order: null + column_mapping: + email: user_email + array_relationships: + - name: associations + using: + foreign_key_constraint_on: + column: useremail + table: + schema: public + name: associations + - name: audit_trails + using: + foreign_key_constraint_on: + column: useremail + table: + schema: public + name: audit_trail + - name: exportlogs + using: + foreign_key_constraint_on: + column: useremail + table: + schema: public + name: exportlog + - name: messages + using: + foreign_key_constraint_on: + column: userid + table: + schema: public + name: messages + - name: notes + using: + foreign_key_constraint_on: + column: created_by + table: + schema: public + name: notes + - name: partsOrdersByOrderedby + using: + foreign_key_constraint_on: + column: orderedby + table: + schema: public + name: parts_orders + - name: parts_orders + using: + foreign_key_constraint_on: + column: user_email + table: + schema: public + name: parts_orders + insert_permissions: + - role: user + permission: + check: {} + columns: + - authid + - email + - fcmtokens + - validemail + select_permissions: + - role: user + permission: + columns: + - authid + - created_at + - dashboardlayout + - email + - fcmtokens + - updated_at + - validemail + filter: + associations: + bodyshop: + associations: + active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - authid + - dashboardlayout + - email + - fcmtokens + filter: + authid: + _eq: X-Hasura-User-Id + check: null +- table: + schema: public + name: vehicles + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: shopid + array_relationships: + - name: jobs + using: + foreign_key_constraint_on: + column: vehicleid + table: + schema: public + name: jobs + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - v_vin + - v_make_desc + - v_model_desc + - v_model_yr + - v_color + - v_paint_codes + - v_bstyle + - v_engine + - shopid + - db_v_code + - plate_no + - plate_st + - v_cond + - v_prod_dt + - v_type + - v_trimcode + - trim_color + - v_mldgcode + - v_options + - v_tone + - v_stage + - v_makecode + select_permissions: + - role: user + permission: + columns: + - v_paint_codes + - db_v_code + - plate_no + - plate_st + - trim_color + - v_bstyle + - v_color + - v_cond + - v_engine + - v_makecode + - v_make_desc + - v_mldgcode + - v_model_desc + - v_model_yr + - v_options + - v_prod_dt + - v_stage + - v_tone + - v_trimcode + - v_type + - v_vin + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - v_paint_codes + - db_v_code + - plate_no + - plate_st + - trim_color + - v_bstyle + - v_color + - v_cond + - v_engine + - v_makecode + - v_make_desc + - v_mldgcode + - v_model_desc + - v_model_yr + - v_options + - v_prod_dt + - v_stage + - v_tone + - v_trimcode + - v_type + - v_vin + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true +- table: + schema: public + name: vendors + object_relationships: + - name: bodyshop + using: + foreign_key_constraint_on: bodyshopid + array_relationships: + - name: invoices + using: + foreign_key_constraint_on: + column: vendorid + table: + schema: public + name: bills + - name: parts_orders + using: + foreign_key_constraint_on: + column: vendorid + table: + schema: public + name: parts_orders + insert_permissions: + - role: user + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - active + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - due_date + - email + - favorite + - id + - name + - phone + - state + - street1 + - street2 + - updated_at + - zip + select_permissions: + - role: user + permission: + columns: + - active + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - due_date + - email + - favorite + - id + - name + - phone + - state + - street1 + - street2 + - updated_at + - zip + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + allow_aggregations: true + update_permissions: + - role: user + permission: + columns: + - active + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - due_date + - email + - favorite + - id + - name + - phone + - state + - street1 + - street2 + - updated_at + - zip + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null + delete_permissions: + - role: user + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true diff --git a/hasura/metadata/version.yaml b/hasura/metadata/version.yaml new file mode 100644 index 000000000..22817d2a9 --- /dev/null +++ b/hasura/metadata/version.yaml @@ -0,0 +1 @@ +version: 2 diff --git a/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/down.sql b/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/down.sql new file mode 100755 index 000000000..ca1538eb3 --- /dev/null +++ b/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "website"; \ No newline at end of file diff --git a/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/up.sql b/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/up.sql new file mode 100755 index 000000000..2e54088f3 --- /dev/null +++ b/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "website" text NULL; \ No newline at end of file diff --git a/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/down.sql b/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/down.sql new file mode 100755 index 000000000..bed5a2b75 --- /dev/null +++ b/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."documents" DROP COLUMN "takenat"; \ No newline at end of file diff --git a/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/up.sql b/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/up.sql new file mode 100755 index 000000000..b408c04fd --- /dev/null +++ b/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."documents" ADD COLUMN "takenat" timestamptz NULL; \ No newline at end of file diff --git a/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.sql b/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.sql new file mode 100755 index 000000000..654b08147 --- /dev/null +++ b/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD CONSTRAINT "bodyshops_autohouseid_key" UNIQUE ("autohouseid"); \ No newline at end of file diff --git a/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.sql b/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.sql new file mode 100755 index 000000000..c4c29e77a --- /dev/null +++ b/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP CONSTRAINT "bodyshops_autohouseid_key"; \ No newline at end of file diff --git a/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.sql b/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.sql new file mode 100755 index 000000000..49d3039f9 --- /dev/null +++ b/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "jc_hourly_rates"; \ No newline at end of file diff --git a/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.sql b/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.sql new file mode 100755 index 000000000..8b76f21cd --- /dev/null +++ b/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "jc_hourly_rates" jsonb NULL DEFAULT jsonb_build_object(); \ No newline at end of file diff --git a/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.sql b/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.sql new file mode 100755 index 000000000..55640aa85 --- /dev/null +++ b/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."vehicles" ALTER COLUMN "v_vin" SET NOT NULL; \ No newline at end of file diff --git a/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.sql b/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.sql new file mode 100755 index 000000000..2c50d4d2b --- /dev/null +++ b/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."vehicles" ALTER COLUMN "v_vin" DROP NOT NULL; \ No newline at end of file diff --git a/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.sql b/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.sql new file mode 100755 index 000000000..ffc56683e --- /dev/null +++ b/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE ONLY "public"."joblines" ALTER COLUMN "prt_dsmk_p" DROP DEFAULT; \ No newline at end of file diff --git a/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.sql b/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.sql new file mode 100755 index 000000000..c3fcc4d10 --- /dev/null +++ b/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE ONLY "public"."joblines" ALTER COLUMN "prt_dsmk_p" SET DEFAULT 0; \ No newline at end of file diff --git a/hasura/migrations/1622571551101_run_sql_migration/up.sql b/hasura/migrations/1622571551101_run_sql_migration/up.sql new file mode 100755 index 000000000..6062cec35 --- /dev/null +++ b/hasura/migrations/1622571551101_run_sql_migration/up.sql @@ -0,0 +1,3 @@ + +update joblines +set prt_dsmk_p = 0 where joblines.prt_dsmk_p is null; \ No newline at end of file diff --git a/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/down.sql b/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/down.sql new file mode 100755 index 000000000..2d42a7369 --- /dev/null +++ b/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."conversations" DROP COLUMN "archived"; \ No newline at end of file diff --git a/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/up.sql b/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/up.sql new file mode 100755 index 000000000..dec3a0253 --- /dev/null +++ b/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."conversations" ADD COLUMN "archived" boolean NOT NULL DEFAULT false; \ No newline at end of file diff --git a/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.sql b/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.sql new file mode 100755 index 000000000..8bd3a569a --- /dev/null +++ b/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."parts_orders" DROP COLUMN "orderedby"; \ No newline at end of file diff --git a/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.sql b/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.sql new file mode 100755 index 000000000..eab633bec --- /dev/null +++ b/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."parts_orders" ADD COLUMN "orderedby" text NULL; \ No newline at end of file diff --git a/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/down.sql b/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/down.sql new file mode 100755 index 000000000..6ada9ef98 --- /dev/null +++ b/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."parts_orders" drop constraint "parts_orders_orderedby_fkey"; \ No newline at end of file diff --git a/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/up.sql b/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/up.sql new file mode 100755 index 000000000..17988f285 --- /dev/null +++ b/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/up.sql @@ -0,0 +1,6 @@ + +alter table "public"."parts_orders" + add constraint "parts_orders_orderedby_fkey" + foreign key ("orderedby") + references "public"."users" + ("email") on update set null on delete set null; \ No newline at end of file diff --git a/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/down.sql b/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/down.sql new file mode 100755 index 000000000..f394e6fb0 --- /dev/null +++ b/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/down.sql @@ -0,0 +1,8 @@ + +alter table "public"."exportlog" drop constraint "exportlog_billid_fkey", + add constraint "exportlog_billid_fkey" + foreign key ("billid") + references "public"."bills" + ("id") + on update restrict + on delete restrict; \ No newline at end of file diff --git a/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/up.sql b/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/up.sql new file mode 100755 index 000000000..a23413bfd --- /dev/null +++ b/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/up.sql @@ -0,0 +1,6 @@ + +alter table "public"."exportlog" drop constraint "exportlog_billid_fkey", + add constraint "exportlog_billid_fkey" + foreign key ("billid") + references "public"."bills" + ("id") on update cascade on delete cascade; \ No newline at end of file diff --git a/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.sql b/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.sql new file mode 100755 index 000000000..cc1a5a10d --- /dev/null +++ b/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE ONLY "public"."users" ALTER COLUMN "dashboardlayout" SET DEFAULT jsonb_build_array(); +ALTER TABLE "public"."users" ALTER COLUMN "dashboardlayout" SET NOT NULL; \ No newline at end of file diff --git a/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.sql b/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.sql new file mode 100755 index 000000000..19154bddf --- /dev/null +++ b/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."users" ALTER COLUMN "dashboardlayout" DROP DEFAULT; +ALTER TABLE "public"."users" ALTER COLUMN "dashboardlayout" DROP NOT NULL; \ No newline at end of file diff --git a/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.sql b/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.sql new file mode 100755 index 000000000..865036ba9 --- /dev/null +++ b/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "md_jobline_presets"; \ No newline at end of file diff --git a/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.sql b/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.sql new file mode 100755 index 000000000..93c5b4056 --- /dev/null +++ b/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "md_jobline_presets" jsonb NULL DEFAULT jsonb_build_array(); \ No newline at end of file diff --git a/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.sql b/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.sql new file mode 100755 index 000000000..0178499e0 --- /dev/null +++ b/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "cdk_dealerid"; \ No newline at end of file diff --git a/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.sql b/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.sql new file mode 100755 index 000000000..0814cb148 --- /dev/null +++ b/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "cdk_dealerid" text NULL; \ No newline at end of file diff --git a/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/down.sql b/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/down.sql new file mode 100755 index 000000000..61141dff7 --- /dev/null +++ b/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "features"; \ No newline at end of file diff --git a/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/up.sql b/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/up.sql new file mode 100755 index 000000000..8402f680a --- /dev/null +++ b/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "features" jsonb NULL DEFAULT jsonb_build_object(); \ No newline at end of file diff --git a/hasura/migrations/1625768789569_run_sql_migration/up.sql b/hasura/migrations/1625768789569_run_sql_migration/up.sql new file mode 100755 index 000000000..289dbcee6 --- /dev/null +++ b/hasura/migrations/1625768789569_run_sql_migration/up.sql @@ -0,0 +1,30 @@ + +CREATE OR REPLACE FUNCTION public.search_payments(search text) + RETURNS SETOF payments + LANGUAGE plpgsql + STABLE +AS $function$ + +BEGIN + if search = '' then + return query select * from payments ; + else + return query SELECT + p.* +FROM + payments p, jobs j +WHERE +p.jobid = j.id AND +( +search <% p.paymentnum OR +search <% j.ownr_fn OR +search <% j.ownr_ln OR +search <% j.ownr_co_nm OR +search <% j.ro_number OR + search <% (p.payer) OR + search <% (p.transactionid) OR + search <% (p.memo)); + end if; + + END +$function$; \ No newline at end of file diff --git a/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.sql b/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.sql new file mode 100755 index 000000000..fd78549bd --- /dev/null +++ b/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."vehicles" add constraint "vehicles_v_vin_shopid_key" unique ("v_vin", "shopid"); \ No newline at end of file diff --git a/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.sql b/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.sql new file mode 100755 index 000000000..dbd5097ab --- /dev/null +++ b/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.sql @@ -0,0 +1,2 @@ + +alter table "public"."vehicles" drop constraint "vehicles_v_vin_shopid_key"; \ No newline at end of file diff --git a/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.sql b/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.sql new file mode 100755 index 000000000..1bc1230ae --- /dev/null +++ b/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "attach_pdf_to_email"; \ No newline at end of file diff --git a/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.sql b/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.sql new file mode 100755 index 000000000..80364c700 --- /dev/null +++ b/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "attach_pdf_to_email" boolean NOT NULL DEFAULT False; \ No newline at end of file diff --git a/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.sql b/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.sql new file mode 100755 index 000000000..f8e400fc7 --- /dev/null +++ b/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."audit_trail" ADD COLUMN "schemaname" text; +ALTER TABLE "public"."audit_trail" ALTER COLUMN "schemaname" DROP NOT NULL; \ No newline at end of file diff --git a/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.sql b/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.sql new file mode 100755 index 000000000..9b03788b5 --- /dev/null +++ b/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" DROP COLUMN "schemaname" CASCADE; \ No newline at end of file diff --git a/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.sql b/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.sql new file mode 100755 index 000000000..12aa4c6c3 --- /dev/null +++ b/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."audit_trail" ADD COLUMN "tabname" text; +ALTER TABLE "public"."audit_trail" ALTER COLUMN "tabname" DROP NOT NULL; \ No newline at end of file diff --git a/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.sql b/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.sql new file mode 100755 index 000000000..30697a639 --- /dev/null +++ b/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" DROP COLUMN "tabname" CASCADE; \ No newline at end of file diff --git a/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.sql b/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.sql new file mode 100755 index 000000000..203b17335 --- /dev/null +++ b/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.sql @@ -0,0 +1,3 @@ + +ALTER TABLE "public"."audit_trail" ADD COLUMN "recordid" uuid; +ALTER TABLE "public"."audit_trail" ALTER COLUMN "recordid" DROP NOT NULL; \ No newline at end of file diff --git a/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.sql b/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.sql new file mode 100755 index 000000000..92c2d68df --- /dev/null +++ b/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" DROP COLUMN "recordid" CASCADE; \ No newline at end of file diff --git a/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.sql b/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.sql new file mode 100755 index 000000000..76fd01a83 --- /dev/null +++ b/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" DROP COLUMN "jobid"; \ No newline at end of file diff --git a/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.sql b/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.sql new file mode 100755 index 000000000..32cadb341 --- /dev/null +++ b/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" ADD COLUMN "jobid" uuid NULL; \ No newline at end of file diff --git a/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/down.sql b/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/down.sql new file mode 100755 index 000000000..12388d894 --- /dev/null +++ b/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" DROP COLUMN "billid"; \ No newline at end of file diff --git a/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/up.sql b/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/up.sql new file mode 100755 index 000000000..e0edb2518 --- /dev/null +++ b/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" ADD COLUMN "billid" uuid NULL; \ No newline at end of file diff --git a/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/down.sql b/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/down.sql new file mode 100755 index 000000000..52cdca705 --- /dev/null +++ b/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_billid_fkey"; \ No newline at end of file diff --git a/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/up.sql b/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/up.sql new file mode 100755 index 000000000..4b7024b66 --- /dev/null +++ b/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/up.sql @@ -0,0 +1,6 @@ + +alter table "public"."audit_trail" + add constraint "audit_trail_billid_fkey" + foreign key ("billid") + references "public"."bills" + ("id") on update cascade on delete cascade; \ No newline at end of file diff --git a/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/down.sql b/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/down.sql new file mode 100755 index 000000000..96f55e717 --- /dev/null +++ b/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/down.sql @@ -0,0 +1,8 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_billid_fkey", + add constraint "audit_trail_billid_fkey" + foreign key ("billid") + references "public"."bills" + ("id") + on update cascade + on delete cascade; \ No newline at end of file diff --git a/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/up.sql b/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/up.sql new file mode 100755 index 000000000..6e6cd273e --- /dev/null +++ b/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/up.sql @@ -0,0 +1,6 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_billid_fkey", + add constraint "audit_trail_billid_fkey" + foreign key ("billid") + references "public"."bills" + ("id") on update cascade on delete set null; \ No newline at end of file diff --git a/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/down.sql b/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/down.sql new file mode 100755 index 000000000..54580a323 --- /dev/null +++ b/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/down.sql @@ -0,0 +1,8 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_billid_fkey", + add constraint "audit_trail_billid_fkey" + foreign key ("billid") + references "public"."bills" + ("id") + on update cascade + on delete set null; \ No newline at end of file diff --git a/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/up.sql b/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/up.sql new file mode 100755 index 000000000..6e6cd273e --- /dev/null +++ b/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/up.sql @@ -0,0 +1,6 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_billid_fkey", + add constraint "audit_trail_billid_fkey" + foreign key ("billid") + references "public"."bills" + ("id") on update cascade on delete set null; \ No newline at end of file diff --git a/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/down.sql b/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/down.sql new file mode 100755 index 000000000..e42787a20 --- /dev/null +++ b/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/down.sql @@ -0,0 +1,2 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_jobid_fkey"; \ No newline at end of file diff --git a/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/up.sql b/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/up.sql new file mode 100755 index 000000000..0195ef84c --- /dev/null +++ b/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/up.sql @@ -0,0 +1,6 @@ + +alter table "public"."audit_trail" + add constraint "audit_trail_jobid_fkey" + foreign key ("jobid") + references "public"."jobs" + ("id") on update cascade on delete set null; \ No newline at end of file diff --git a/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/down.sql b/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/down.sql new file mode 100755 index 000000000..457df784b --- /dev/null +++ b/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/down.sql @@ -0,0 +1,8 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_useremail_fkey", + add constraint "audit_trail_useremail_fkey" + foreign key ("useremail") + references "public"."users" + ("email") + on update restrict + on delete restrict; \ No newline at end of file diff --git a/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/up.sql b/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/up.sql new file mode 100755 index 000000000..fe0b6be91 --- /dev/null +++ b/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/up.sql @@ -0,0 +1,6 @@ + +alter table "public"."audit_trail" drop constraint "audit_trail_useremail_fkey", + add constraint "audit_trail_useremail_fkey" + foreign key ("useremail") + references "public"."users" + ("email") on update cascade on delete set null; \ No newline at end of file diff --git a/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/down.sql b/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/down.sql new file mode 100755 index 000000000..271a22de2 --- /dev/null +++ b/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."appointments" DROP COLUMN "note"; \ No newline at end of file diff --git a/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/up.sql b/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/up.sql new file mode 100755 index 000000000..93c71585a --- /dev/null +++ b/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."appointments" ADD COLUMN "note" text NULL; \ No newline at end of file diff --git a/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/down.sql b/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/down.sql new file mode 100755 index 000000000..c76e8d247 --- /dev/null +++ b/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" ALTER COLUMN "created" TYPE timestamp without time zone; \ No newline at end of file diff --git a/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/up.sql b/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/up.sql new file mode 100755 index 000000000..beaadc13f --- /dev/null +++ b/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."audit_trail" ALTER COLUMN "created" TYPE timestamptz; \ No newline at end of file diff --git a/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.sql b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.sql new file mode 100755 index 000000000..52ccbf061 --- /dev/null +++ b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "tt_allow_post_to_invoiced"; \ No newline at end of file diff --git a/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.sql b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.sql new file mode 100755 index 000000000..a5be8cfe4 --- /dev/null +++ b/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "tt_allow_post_to_invoiced" boolean NOT NULL DEFAULT false; \ No newline at end of file diff --git a/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.sql b/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.sql new file mode 100755 index 000000000..19501b616 --- /dev/null +++ b/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" DROP COLUMN "cdk_configuration"; \ No newline at end of file diff --git a/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.sql b/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.sql new file mode 100755 index 000000000..872e27e37 --- /dev/null +++ b/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."bodyshops" ADD COLUMN "cdk_configuration" jsonb NULL; \ No newline at end of file diff --git a/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.sql b/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.sql new file mode 100755 index 000000000..86289eb37 --- /dev/null +++ b/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."timetickets" DROP COLUMN "flat_rate"; \ No newline at end of file diff --git a/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.sql b/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.sql new file mode 100755 index 000000000..166cc1474 --- /dev/null +++ b/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."timetickets" ADD COLUMN "flat_rate" boolean NULL DEFAULT false; \ No newline at end of file diff --git a/hasura/migrations/1629520416914_create_table_public_dms_vehicles/down.sql b/hasura/migrations/1629520416914_create_table_public_dms_vehicles/down.sql new file mode 100755 index 000000000..802258725 --- /dev/null +++ b/hasura/migrations/1629520416914_create_table_public_dms_vehicles/down.sql @@ -0,0 +1,2 @@ + +DROP TABLE "public"."dms_vehicles"; \ No newline at end of file diff --git a/hasura/migrations/1629520416914_create_table_public_dms_vehicles/up.sql b/hasura/migrations/1629520416914_create_table_public_dms_vehicles/up.sql new file mode 100755 index 000000000..b3a55c8ef --- /dev/null +++ b/hasura/migrations/1629520416914_create_table_public_dms_vehicles/up.sql @@ -0,0 +1,3 @@ + +CREATE EXTENSION IF NOT EXISTS pgcrypto; +CREATE TABLE "public"."dms_vehicles"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "makecode" text NOT NULL, "modelcode" text NOT NULL, "make" text NOT NULL, "model" text NOT NULL, "bodyshopid" uuid NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE cascade ON DELETE cascade); \ No newline at end of file diff --git a/hasura/migrations/1629738990845_run_sql_migration/up.sql b/hasura/migrations/1629738990845_run_sql_migration/up.sql new file mode 100755 index 000000000..bd74c80f8 --- /dev/null +++ b/hasura/migrations/1629738990845_run_sql_migration/up.sql @@ -0,0 +1,2 @@ + +CREATE OR REPLACE FUNCTION public.search_dms_vehicles(search text)RETURNS SETOF dms_vehicles LANGUAGE plpgsql STABLE AS $FUNCTION$ BEGIN IF search='' THEN RETURN query SELECT*FROM dms_vehicles;ELSE RETURN query SELECT*FROM dms_vehicles WHERE make ILIKE'%'||search||'%' OR model ILIKE'%'||search||'%' ORDER BY make ILIKE'%'||search||'%' OR NULL,model ILIKE'%'||search||'%' OR NULL;END IF;END$FUNCTION$; \ No newline at end of file diff --git a/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.sql b/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.sql new file mode 100755 index 000000000..2646429ab --- /dev/null +++ b/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."associations" DROP COLUMN "qbo_auth"; \ No newline at end of file diff --git a/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.sql b/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.sql new file mode 100755 index 000000000..1e6a45bfd --- /dev/null +++ b/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.sql @@ -0,0 +1,2 @@ + +ALTER TABLE "public"."associations" ADD COLUMN "qbo_auth" jsonb NULL; \ No newline at end of file diff --git a/hasura/migrations/1631052192511_create_table_public_relatedjobs/down.sql b/hasura/migrations/1631052192511_create_table_public_relatedjobs/down.sql new file mode 100755 index 000000000..5e0e079a1 --- /dev/null +++ b/hasura/migrations/1631052192511_create_table_public_relatedjobs/down.sql @@ -0,0 +1,2 @@ + +DROP TABLE "public"."relatedjobs"; \ No newline at end of file diff --git a/hasura/migrations/1631052192511_create_table_public_relatedjobs/up.sql b/hasura/migrations/1631052192511_create_table_public_relatedjobs/up.sql new file mode 100755 index 000000000..b9ac7a965 --- /dev/null +++ b/hasura/migrations/1631052192511_create_table_public_relatedjobs/up.sql @@ -0,0 +1,19 @@ + +CREATE EXTENSION IF NOT EXISTS pgcrypto; +CREATE TABLE "public"."relatedjobs"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "parentjob" uuid NOT NULL, "childjob" UUID NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("parentjob") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("childjob") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade, UNIQUE ("id")); +CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() +RETURNS TRIGGER AS $$ +DECLARE + _new record; +BEGIN + _new := NEW; + _new."updated_at" = NOW(); + RETURN _new; +END; +$$ LANGUAGE plpgsql; +CREATE TRIGGER "set_public_relatedjobs_updated_at" +BEFORE UPDATE ON "public"."relatedjobs" +FOR EACH ROW +EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); +COMMENT ON TRIGGER "set_public_relatedjobs_updated_at" ON "public"."relatedjobs" +IS 'trigger to set value of column "updated_at" to current timestamp on row update'; \ No newline at end of file diff --git a/hasura/migrations/1632265756746_run_sql_migration/up.sql b/hasura/migrations/1632265756746_run_sql_migration/up.sql new file mode 100755 index 000000000..3748c5654 --- /dev/null +++ b/hasura/migrations/1632265756746_run_sql_migration/up.sql @@ -0,0 +1,11 @@ + +CREATE OR REPLACE FUNCTION public.update_conversation_on_message() + RETURNS trigger + LANGUAGE plpgsql +AS $function$ +BEGIN + UPDATE conversations SET updated_at = now() WHERE id = NEW.conversationid; + RETURN NEW; +END; +$function$ +; \ No newline at end of file diff --git a/hasura/migrations/1632265816135_run_sql_migration/up.sql b/hasura/migrations/1632265816135_run_sql_migration/up.sql new file mode 100755 index 000000000..c6279dc6b --- /dev/null +++ b/hasura/migrations/1632265816135_run_sql_migration/up.sql @@ -0,0 +1,11 @@ + +CREATE OR REPLACE FUNCTION public.update_conversation_on_message() + RETURNS trigger + LANGUAGE plpgsql +AS $function$ +BEGIN + UPDATE conversations SET updated_at = now() WHERE conversations.id = NEW.conversationid; + RETURN NEW; +END; +$function$ +; \ No newline at end of file diff --git a/hasura/migrations_backup/1620771761757_Init/up.sql b/hasura/migrations_backup/1620771761757_Init/up.sql new file mode 100644 index 000000000..3b608100b --- /dev/null +++ b/hasura/migrations_backup/1620771761757_Init/up.sql @@ -0,0 +1,1546 @@ +CREATE FUNCTION public.assign_ibh_number() RETURNS trigger + LANGUAGE plpgsql + AS $$ + begin + IF NEW.isinhouse = true and (new.invoice_number is null or new.invoice_number = 'ih') THEN + UPDATE counters + SET count = count + 1 + where shopid = (select shopid from jobs where jobs.id = new.jobid) + AND countertype = 'ihbnum' + RETURNING concat(prefix,count) into new.invoice_number; + END IF; + RETURN NEW; + END; + $$; +CREATE FUNCTION public.assign_payment_number() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + IF (new.paymentnum IS NULL + OR new.paymentnum = 'pnew') THEN + UPDATE + counters + SET + count = count + 1 + WHERE + shopid = ( + SELECT + shopid + FROM + jobs + WHERE + jobs.id = new.jobid) + AND countertype = 'paymentnum' + RETURNING + concat(prefix, count) INTO new.paymentnum; +END IF; + RETURN NEW; +END; +$$; +CREATE FUNCTION public.assign_ro_number() RETURNS trigger + LANGUAGE plpgsql + AS $$ + begin + IF NEW.converted = true and (new.ro_number is null or new.ro_number = '') THEN + UPDATE counters + SET count = count + 1 where shopid=new.shopid AND countertype = 'ronum' + RETURNING concat(prefix,count) into new.ro_number; + END IF; + RETURN NEW; + END; + $$; +CREATE FUNCTION public.audit_trigger() RETURNS trigger + LANGUAGE plpgsql SECURITY DEFINER + AS $$ + DECLARE + shopid uuid ; + email text; + BEGIN + select b.id, u.email INTO shopid, email from users u join associations a on u.email = a.useremail join bodyshops b on b.id = a.shopid where u.authid = current_setting('hasura.user', 't')::jsonb->>'x-hasura-user-id' and a.active = true; + IF TG_OP = 'INSERT' + THEN + INSERT INTO public.audit_trail (tabname, schemaname, operation, new_val, recordid, bodyshopid, useremail) + VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(NEW), NEW.id, shopid, email); + RETURN NEW; + ELSIF TG_OP = 'UPDATE' + THEN + INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, new_val, recordid, bodyshopid, useremail) + VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, + json_diff(to_jsonb(OLD), to_jsonb(NEW)) , json_diff(to_jsonb(NEW), to_jsonb(OLD)), OLD.id, shopid, email); + RETURN NEW; + ELSIF TG_OP = 'DELETE' + THEN + INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, recordid, bodyshopid, useremail) + VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(OLD), OLD.ID, shopid, email); + RETURN OLD; + END IF; + END; +$$; +CREATE FUNCTION public.json_diff(l jsonb, r jsonb) RETURNS jsonb + LANGUAGE sql + AS $$ + SELECT jsonb_object_agg(a.key, a.value) FROM + ( SELECT key, value FROM jsonb_each(l) ) a LEFT OUTER JOIN + ( SELECT key, value FROM jsonb_each(r) ) b ON a.key = b.key + WHERE a.value != b.value OR b.key IS NULL; +$$; +CREATE TABLE public.bills ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + vendorid uuid NOT NULL, + jobid uuid NOT NULL, + date date DEFAULT now() NOT NULL, + due_date date, + exported boolean DEFAULT false NOT NULL, + exported_at timestamp with time zone, + is_credit_memo boolean DEFAULT false NOT NULL, + total numeric DEFAULT 0 NOT NULL, + invoice_number text NOT NULL, + federal_tax_rate numeric DEFAULT 0 NOT NULL, + state_tax_rate numeric DEFAULT 0 NOT NULL, + local_tax_rate numeric DEFAULT 0 NOT NULL, + isinhouse boolean DEFAULT false NOT NULL +); +CREATE FUNCTION public.search_bills(search text) RETURNS SETOF public.bills + LANGUAGE plpgsql STABLE + AS $$ +BEGIN + if search = '' then + return query select * from bills ; + else + return query SELECT + bills.* +FROM + bills, vendors +WHERE +bills.vendorid= vendors.id and + (search <% (invoice_number) + OR + search <% (name) + ) + ; + end if; + END +$$; +CREATE TABLE public.cccontracts ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + agreementnumber integer NOT NULL, + courtesycarid uuid NOT NULL, + jobid uuid NOT NULL, + status text DEFAULT 'Reserved'::text NOT NULL, + start timestamp with time zone, + scheduledreturn timestamp with time zone, + actualreturn timestamp with time zone, + kmstart numeric NOT NULL, + kmend numeric, + driver_dlnumber text, + driver_dlexpiry date, + driver_dlst text, + driver_fn text NOT NULL, + driver_ln text NOT NULL, + driver_addr1 text, + driver_addr2 text, + driver_city text, + driver_state text, + driver_zip text, + driver_ph1 text, + driver_dob date, + contract_date date DEFAULT now() NOT NULL, + dailyrate numeric, + actax numeric, + dailyfreekm integer, + refuelcharge numeric, + excesskmrate numeric, + cleanupcharge numeric, + damagewaiver numeric, + federaltax numeric, + statetax numeric, + localtax numeric, + coverage numeric, + fuelout numeric DEFAULT 100 NOT NULL, + fuelin numeric DEFAULT 0 NOT NULL, + damage text +); +CREATE FUNCTION public.search_cccontracts(search text) RETURNS SETOF public.cccontracts + LANGUAGE plpgsql STABLE + AS $$ +BEGIN + IF search = '' THEN + RETURN query + SELECT + * + FROM + cccontracts c; + ELSE + RETURN query + SELECT + contracts.* + FROM + courtesycars cars, + jobs jobs, + cccontracts contracts + WHERE (jobs.ro_number ILIKE '%' || search || '%' + OR jobs.ownr_fn ILIKE '%' || search || '%' + OR jobs.ownr_ln ILIKE '%' || search || '%' + OR jobs.ownr_co_nm ILIKE '%' || search || '%' + OR (cast(contracts.agreementnumber as text)) ILIKE '%' || search || '%' + OR contracts.driver_fn ILIKE '%' || search || '%' + OR contracts.driver_ln ILIKE '%' || search || '%' + OR cars.fleetnumber ILIKE '%' || search || '%' + OR cars.make ILIKE '%' || search || '%' + OR cars.model ILIKE '%' || search || '%') + AND contracts.jobid = jobs.id + AND contracts.courtesycarid = cars.id; + END IF; +END +$$; +CREATE TABLE public.exportlog ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + jobid uuid, + billid uuid, + paymentid uuid, + successful boolean DEFAULT false NOT NULL, + message text, + bodyshopid uuid NOT NULL, + useremail text NOT NULL +); +CREATE FUNCTION public.search_exportlog(search text) RETURNS SETOF public.exportlog + LANGUAGE plpgsql STABLE + AS $$ BEGIN IF search = '' THEN RETURN query +SELECT + * +FROM + exportlog e; + ELSE RETURN query +SELECT + e.* +FROM + exportlog e + LEFT JOIN jobs j on j.id = e.jobid +LEFT JOIN payments p + ON p.id = e.paymentid +LEFT JOIN bills b + ON e.billid = b.id +WHERE + ( + j.ro_number ILIKE '%' || search || '%' + OR b.invoice_number ILIKE '%' || search || '%' + OR p.paymentnum ILIKE '%' || search || '%' + OR e.useremail ILIKE '%' || search || '%' + ) + AND (e.jobid = j.id + or e.paymentid = p.id + or e.billid = b.id) +; +END IF; +END $$; +CREATE TABLE public.jobs ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + shopid uuid NOT NULL, + ro_number text, + ownerid uuid, + vehicleid uuid, + labor_rate_id text, + labor_rate_desc text, + rate_lab numeric, + rate_lad numeric, + rate_lae numeric, + rate_lar numeric, + rate_las numeric, + rate_laf numeric, + rate_lam numeric, + rate_lag numeric, + rate_lau numeric, + rate_la1 numeric, + rate_la2 numeric, + rate_la3 numeric, + rate_la4 numeric, + rate_mapa numeric, + rate_mash numeric, + rate_mahw numeric, + rate_ma2s numeric, + rate_ma3s numeric, + rate_ma2t numeric, + rate_mabl numeric, + rate_macs numeric, + rate_matd numeric, + federal_tax_rate numeric, + state_tax_rate numeric, + local_tax_rate numeric, + est_co_nm text, + est_addr1 text, + est_addr2 text, + est_city text, + est_st text, + est_zip text, + est_ctry text, + est_ph1 text, + est_ea text, + est_ct_ln text, + est_ct_fn text, + scheduled_in timestamp with time zone, + actual_in timestamp with time zone, + scheduled_completion timestamp with time zone, + actual_completion timestamp with time zone, + scheduled_delivery timestamp with time zone, + actual_delivery timestamp with time zone, + regie_number text, + invoice_date date, + inproduction boolean DEFAULT false NOT NULL, + ins_co_id text, + ins_co_nm text, + ins_addr1 text, + ins_addr2 text, + ins_city text, + ins_st text, + ins_zip text, + ins_ctry text, + ins_ph1 text, + ins_ph1x text, + ins_ph2 text, + ins_ph2x text, + ins_fax text, + ins_faxx text, + ins_ct_ln text, + ins_ct_fn text, + ins_title text, + ins_ct_ph text, + ins_ct_phx text, + ins_ea text, + ins_memo text, + policy_no text, + ded_amt numeric, + ded_status text, + asgn_no text, + asgn_date date, + asgn_type text, + clm_no text, + clm_ofc_id text, + date_estimated date, + date_open timestamp with time zone, + date_scheduled timestamp with time zone, + date_invoiced timestamp with time zone, + date_exported timestamp with time zone, + clm_total numeric DEFAULT 0, + owner_owing numeric, + converted boolean DEFAULT false NOT NULL, + ciecaid text, + loss_date date, + clm_ofc_nm text, + clm_addr1 text, + clm_addr2 text, + clm_city text, + clm_st text, + clm_zip text, + clm_ctry text, + clm_ph1 text, + clm_ph1x text, + clm_ph2 text, + clm_ph2x text, + clm_fax text, + clm_faxx text, + clm_ct_ln text, + clm_ct_fn text, + clm_title text, + clm_ct_ph text, + clm_ct_phx text, + clm_ea text, + payee_nms text, + pay_type text, + pay_date date, + pay_chknm text, + pay_amt numeric, + agt_co_id text, + agt_co_nm text, + agt_addr1 text, + agt_addr2 text, + agt_city text, + agt_st text, + agt_zip text, + agt_ctry text, + agt_ph1 text, + agt_ph1x text, + agt_ph2 text, + agt_ph2x text, + agt_fax text, + agt_faxx text, + agt_ct_ln text, + agt_ct_fn text, + agt_ct_ph text, + agt_ct_phx text, + agt_ea text, + agt_lic_no text, + loss_type text, + loss_desc text, + theft_ind boolean DEFAULT false, + cat_no text, + tlos_ind boolean DEFAULT false, + cust_pr text, + insd_ln text, + insd_fn text, + insd_title text, + insd_co_nm text, + insd_addr1 text, + insd_addr2 text, + insd_city text, + insd_st text, + insd_zip text, + insd_ctry text, + insd_ph1 text, + insd_ph1x text, + insd_ph2 text, + insd_ph2x text, + insd_fax text, + insd_faxx text, + insd_ea text, + ownr_ln text, + ownr_fn text, + ownr_title text, + ownr_co_nm text, + ownr_addr1 text, + ownr_addr2 text, + ownr_city text, + ownr_st text, + ownr_zip text, + ownr_ctry text, + ownr_ph1 text, + ownr_ph1x text, + ownr_ph2 text, + ownr_ph2x text, + ownr_fax text, + ownr_faxx text, + ownr_ea text, + area_of_damage jsonb, + loss_cat text, + special_coverage_policy boolean DEFAULT false NOT NULL, + po_number text, + unit_number text, + kmin integer, + kmout integer, + referral_source text, + selling_dealer text, + servicing_dealer text, + servicing_dealer_contact text, + selling_dealer_contact text, + depreciation_taxes numeric, + other_amount_payable numeric, + towing_payable numeric, + storage_payable numeric, + adjustment_bottom_line numeric, + tax_pstthr numeric, + tax_tow_rt numeric, + tax_sub_rt numeric, + tax_paint_mat_rt numeric, + tax_levies_rt numeric, + tax_prethr numeric, + tax_thramt numeric, + tax_str_rt numeric, + tax_lbr_rt numeric, + adj_g_disc numeric, + adj_towdis numeric, + adj_strdis numeric, + tax_predis numeric, + rate_laa numeric, + status text DEFAULT 'Open'::text NOT NULL, + cieca_stl jsonb, + g_bett_amt numeric DEFAULT 0, + cieca_ttl jsonb, + plate_no text, + plate_st text, + v_vin text, + v_model_yr text, + v_model_desc text, + v_make_desc text, + v_color text, + parts_tax_rates jsonb, + job_totals jsonb, + production_vars jsonb, + intakechecklist jsonb, + invoice_allocation jsonb, + kanbanparent text, + employee_body uuid, + employee_refinish uuid, + employee_prep uuid, + tax_registration_number text, + class text, + category text, + deliverchecklist jsonb, + tax_shop_mat_rt numeric, + queued_for_parts boolean DEFAULT false NOT NULL, + ca_gst_registrant boolean DEFAULT false, + alt_transport text, + lbr_adjustments jsonb DEFAULT jsonb_build_object() NOT NULL, + voided boolean DEFAULT false NOT NULL, + towin boolean DEFAULT false NOT NULL, + driveable boolean DEFAULT false NOT NULL, + ca_bc_pvrt numeric, + ca_customer_gst numeric DEFAULT 0, + employee_csr uuid +); +COMMENT ON COLUMN public.jobs.tax_pstthr IS 'Parts Tax Rate'; +COMMENT ON COLUMN public.jobs.tax_tow_rt IS 'Towing Tax Rate'; +COMMENT ON COLUMN public.jobs.tax_sub_rt IS 'Sublet Tax Rate'; +CREATE FUNCTION public.search_jobs(search text) RETURNS SETOF public.jobs + LANGUAGE plpgsql STABLE + AS $$ BEGIN if search = '' then return query +select * +from jobs j; +else return query +SELECT * +FROM jobs j2 +WHERE ro_number ILIKE '%' || search || '%' + or ownr_fn ILIKE '%' || search || '%' + or ownr_ln ILIKE '%' || search || '%' + or ownr_co_nm ILIKE '%' || search || '%' + or clm_no ILIKE '%' || search || '%' + or v_make_desc ILIKE '%' || search || '%' + or v_model_desc ILIKE '%' || search || '%' + OR plate_no ILIKE '%' || search || '%' +ORDER BY ro_number ILIKE '%' || search || '%' + OR NULL, + ownr_ln ILIKE '%' || search || '%' + OR null, + ownr_co_nm ILIKE '%' || search || '%' + OR NULL, + ownr_fn ILIKE '%' || search || '%' + OR NULL, + clm_no ILIKE '%' || search || '%' + OR NULL, + v_make_desc ILIKE '%' || search || '%' + OR NULL, + v_model_desc ILIKE '%' || search || '%' + OR NULL, + plate_no ILIKE '%' || search || '%' + OR NULL; +end if; +END $$; +CREATE TABLE public.owners ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + ownr_fn text, + ownr_ln text, + ownr_addr1 text, + ownr_addr2 text, + ownr_city text, + ownr_st text, + ownr_zip text, + ownr_ctry text, + ownr_ea text, + ownr_ph1 text, + preferred_contact text, + allow_text_message boolean DEFAULT false NOT NULL, + shopid uuid NOT NULL, + ownr_ph2 text, + ownr_co_nm text, + ownr_title text, + accountingid bigint NOT NULL +); +CREATE FUNCTION public.search_owners(search text) RETURNS SETOF public.owners + LANGUAGE plpgsql STABLE + AS $$ +BEGIN + IF search = '' THEN + RETURN query + SELECT + * + FROM + owners; + ELSE + RETURN query + SELECT + * + FROM + owners + WHERE (ownr_fn || ' ' || ownr_ln) + ILIKE '%' || search || '%' + OR ownr_ln ILIKE '%' || search || '%' + OR ownr_fn ILIKE '%' || search || '%' + OR ownr_fn ILIKE '%' || search || '%' + OR ownr_co_nm ILIKE '%' || search || '%' + OR ownr_ph1 ILIKE '%' || search || '%' + OR ownr_addr1 ILIKE '%' || search || '%' + ORDER BY + (ownr_fn || ' ' || ownr_ln) + ILIKE '%' || search || '%' + OR NULL, + ownr_ln ILIKE '%' || search || '%' + OR NULL, + ownr_fn ILIKE '%' || search || '%' + OR NULL, + ownr_co_nm ILIKE '%' || search || '%' + OR NULL, + ownr_fn ILIKE '%' || search || '%' + OR NULL, + ownr_ph1 ILIKE '%' || search || '%' + OR NULL, + ownr_addr1 ILIKE '%' || search || '%' + OR NULL; + END IF; +END +$$; +CREATE TABLE public.payments ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + jobid uuid NOT NULL, + amount numeric NOT NULL, + transactionid text, + memo text, + stripeid text, + payer text, + exportedat timestamp with time zone, + type text, + paymentnum text, + date date +); +CREATE FUNCTION public.search_payments(search text) RETURNS SETOF public.payments + LANGUAGE plpgsql STABLE + AS $$ +BEGIN + if search = '' then + return query select * from payments ; + else + return query SELECT + p.* +FROM + payments p, jobs j +WHERE +p.jobid = j.id AND +( +search <% j.ownr_fn OR +search <% j.ownr_ln OR +search <% j.ownr_co_nm OR +search <% j.ro_number OR + search <% (p.payer) OR + search <% (p.transactionid) OR + search <% (p.memo)); + end if; + END +$$; +CREATE TABLE public.phonebook ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + bodyshopid uuid NOT NULL, + firstname text, + lastname text, + phone1 text, + email text, + address1 text, + address2 text, + city text, + state text, + zip text, + country text, + company text, + phone2 text, + fax text, + category text +); +CREATE FUNCTION public.search_phonebook(search text) RETURNS SETOF public.phonebook + LANGUAGE plpgsql STABLE + AS $$ +BEGIN + IF search = '' THEN + RETURN query + SELECT + * + FROM + phonebook; + ELSE + RETURN query + SELECT + phonebook.* + FROM + phonebook + WHERE firstname ILIKE '%' || search || '%' + OR lastname ILIKE '%' || search || '%' + OR company ILIKE '%' || search || '%' + OR address1 ILIKE '%' || search || '%' + OR phone1 ILIKE '%' || search || '%' + OR phone2 ILIKE '%' || search || '%' + OR email ILIKE '%' || search || '%' + OR category ILIKE '%' || search || '%' + ORDER BY + firstname ILIKE '%' || search || '%' + OR NULL, + lastname ILIKE '%' || search || '%' + OR NULL, + company ILIKE '%' || search || '%' + OR NULL, + address1 ILIKE '%' || search || '%' + OR NULL, + phone1 ILIKE '%' || search || '%' + OR NULL, + phone2 ILIKE '%' || search || '%' + OR NULL, + email ILIKE '%' || search || '%' + OR NULL, + category ILIKE '%' || search || '%' + OR NULL; + END IF; +END +$$; +CREATE TABLE public.vehicles ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + v_vin text NOT NULL, + v_make_desc text, + v_model_desc text, + v_model_yr text, + v_color text, + v_paint_codes jsonb, + v_bstyle text, + v_engine text, + shopid uuid NOT NULL, + db_v_code text, + plate_no text, + plate_st text, + v_cond text, + v_prod_dt text, + v_type text, + v_trimcode text, + trim_color text, + v_mldgcode text, + v_options text, + v_tone text, + v_stage text, + v_makecode text +); +CREATE FUNCTION public.search_vehicles(search text) RETURNS SETOF public.vehicles + LANGUAGE plpgsql STABLE + AS $$ +BEGIN + if search = '' then + return query select * from vehicles ; + else + return query + SELECT * +FROM vehicles +WHERE v_vin ILIKE '%' || search || '%' + or plate_no ILIKE '%' || search || '%' + or v_make_desc ILIKE '%' || search || '%' + or v_model_desc ILIKE '%' || search || '%' + ORDER BY v_vin ILIKE '%' || search || '%' + OR NULL, + plate_no ILIKE '%' || search || '%' + OR NULL, + v_model_desc ILIKE '%' || search || '%' + OR NULL, + v_make_desc ILIKE '%' || search || '%' + OR null; + end if; + END +$$; +CREATE FUNCTION public.set_current_timestamp_updated_at() RETURNS trigger + LANGUAGE plpgsql + AS $$ +DECLARE + _new record; +BEGIN + _new := NEW; + _new."updated_at" = NOW(); + RETURN _new; +END; +$$; +CREATE FUNCTION public.update_conversation_on_message() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + UPDATE conversations SET updated_at = now() WHERE id = NEW."conversationid"; + RETURN NEW; +END; +$$; +CREATE TABLE public.allocations ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + joblineid uuid NOT NULL, + employeeid uuid NOT NULL, + hours numeric DEFAULT 0 NOT NULL +); +CREATE TABLE public.appointments ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + jobid uuid, + start timestamp with time zone NOT NULL, + "end" timestamp with time zone NOT NULL, + canceled boolean DEFAULT false NOT NULL, + arrived boolean DEFAULT false NOT NULL, + isintake boolean DEFAULT true NOT NULL, + bodyshopid uuid NOT NULL, + title text, + block boolean DEFAULT false NOT NULL, + color text +); +CREATE TABLE public.associations ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + shopid uuid NOT NULL, + useremail text NOT NULL, + active boolean DEFAULT true NOT NULL, + authlevel integer DEFAULT 0 NOT NULL, + default_prod_list_view text +); +CREATE TABLE public.audit_trail ( + id integer NOT NULL, + created timestamp without time zone DEFAULT now(), + schemaname text, + tabname text, + operation text, + recordid uuid, + new_val json, + old_val json, + useremail text, + bodyshopid uuid +); +CREATE SEQUENCE public.audit_trail_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; +ALTER SEQUENCE public.audit_trail_id_seq OWNED BY public.audit_trail.id; +CREATE TABLE public.available_jobs ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + uploaded_by text NOT NULL, + cieca_id text NOT NULL, + bodyshopid uuid NOT NULL, + est_data jsonb NOT NULL, + issupplement boolean DEFAULT false NOT NULL, + jobid uuid, + supplement_number integer, + ownr_name text, + vehicle_info text, + clm_amt numeric, + clm_no text, + source_system text, + ins_co_nm text +); +CREATE TABLE public.billlines ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + billid uuid NOT NULL, + line_desc text, + actual_price numeric DEFAULT 0 NOT NULL, + actual_cost numeric DEFAULT 0 NOT NULL, + cost_center text NOT NULL, + joblineid uuid, + applicable_taxes jsonb, + quantity integer DEFAULT 1 NOT NULL, + deductedfromlbr boolean DEFAULT false NOT NULL, + lbr_adjustment jsonb +); +CREATE TABLE public.bodyshops ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + shopname text NOT NULL, + created_at timestamp with time zone DEFAULT now(), + updated_at timestamp with time zone DEFAULT now(), + address1 text, + address2 text, + city text, + state text, + zip_post text, + country text, + email text, + federal_tax_id text, + insurance_vendor_id text, + state_tax_id text, + md_ro_statuses jsonb, + region_config text DEFAULT 'CA_BC'::text NOT NULL, + md_order_statuses jsonb, + md_responsibility_centers jsonb, + messagingservicesid text, + shoprates jsonb, + template_header text, + textid text, + production_config jsonb, + bill_tax_rates jsonb, + inhousevendorid uuid, + intakechecklist jsonb DEFAULT jsonb_build_object(), + accountingconfig jsonb, + appt_length integer DEFAULT 60 NOT NULL, + stripe_acct_id text, + ssbuckets jsonb DEFAULT jsonb_build_array(), + scoreboard_target jsonb DEFAULT jsonb_build_object(), + md_referral_sources jsonb DEFAULT jsonb_build_array() NOT NULL, + md_messaging_presets jsonb DEFAULT jsonb_build_array() NOT NULL, + speedprint jsonb DEFAULT jsonb_build_array(), + md_parts_locations jsonb DEFAULT jsonb_build_array(), + md_notes_presets jsonb DEFAULT jsonb_build_array() NOT NULL, + md_rbac jsonb, + prodtargethrs numeric DEFAULT 1 NOT NULL, + md_classes jsonb DEFAULT jsonb_build_array(), + md_categories jsonb DEFAULT jsonb_build_array(), + md_ins_cos jsonb DEFAULT jsonb_build_array(), + enforce_class boolean DEFAULT false NOT NULL, + md_labor_rates jsonb DEFAULT jsonb_build_array(), + deliverchecklist jsonb DEFAULT jsonb_build_object(), + phone text, + target_touchtime numeric DEFAULT 3.5, + appt_colors jsonb DEFAULT jsonb_build_array(), + appt_alt_transport jsonb DEFAULT jsonb_build_array(), + schedule_start_time timestamp with time zone, + schedule_end_time timestamp with time zone, + imexshopid text, + default_adjustment_rate numeric DEFAULT 0, + workingdays jsonb DEFAULT jsonb_build_object() NOT NULL, + use_fippa boolean DEFAULT false NOT NULL, + md_payment_types jsonb DEFAULT jsonb_build_array() NOT NULL, + md_hour_split jsonb DEFAULT jsonb_build_object() NOT NULL, + autohouseid text, + logo_img_path jsonb DEFAULT jsonb_build_object(), + sub_status text DEFAULT 'active'::text NOT NULL, + jobsizelimit integer DEFAULT 26214400 NOT NULL, + md_ccc_rates jsonb DEFAULT jsonb_build_array(), + enforce_referral boolean DEFAULT false NOT NULL +); +CREATE SEQUENCE public.cccontract_agreementnumber_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; +ALTER SEQUENCE public.cccontract_agreementnumber_seq OWNED BY public.cccontracts.agreementnumber; +CREATE TABLE public.conversations ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + bodyshopid uuid NOT NULL, + phone_num text NOT NULL +); +CREATE TABLE public.counters ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + shopid uuid NOT NULL, + countertype text NOT NULL, + prefix text, + count integer DEFAULT 1 NOT NULL +); +CREATE TABLE public.courtesycars ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + bodyshopid uuid NOT NULL, + make text NOT NULL, + model text NOT NULL, + year text NOT NULL, + plate text NOT NULL, + color text NOT NULL, + vin text NOT NULL, + fleetnumber text, + purchasedate date, + servicestartdate date, + serviceenddate date, + leaseenddate date, + status text DEFAULT 'Available'::text NOT NULL, + nextservicekm numeric DEFAULT 0 NOT NULL, + nextservicedate date, + damage text, + notes text, + fuel numeric DEFAULT 100 NOT NULL, + registrationexpires date, + insuranceexpires date, + dailycost numeric DEFAULT 0 NOT NULL, + mileage numeric DEFAULT 0 NOT NULL +); +CREATE TABLE public.csi ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + jobid uuid NOT NULL, + valid boolean DEFAULT true NOT NULL, + relateddata jsonb, + bodyshopid uuid NOT NULL, + validuntil date, + response jsonb, + questionset uuid, + completedon timestamp with time zone +); +CREATE TABLE public.csiquestions ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + bodyshopid uuid NOT NULL, + current boolean DEFAULT true NOT NULL, + config jsonb +); +CREATE TABLE public.documents ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + uploaded_by text NOT NULL, + jobid uuid, + name text, + key text DEFAULT '0'::text NOT NULL, + billid uuid, + type text, + extension text, + bodyshopid uuid, + size integer DEFAULT 0 NOT NULL +); +CREATE TABLE public.employees ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + first_name text NOT NULL, + last_name text NOT NULL, + employee_number text, + shopid uuid NOT NULL, + active boolean DEFAULT true NOT NULL, + hire_date date, + termination_date date, + base_rate numeric DEFAULT 0 NOT NULL, + flat_rate boolean DEFAULT false NOT NULL, + pin text, + user_email text, + rates jsonb DEFAULT jsonb_build_array() NOT NULL +); +CREATE TABLE public.ioevents ( + id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + operationname text NOT NULL, + "time" numeric, + variables jsonb, + dbevent boolean DEFAULT false NOT NULL +); +CREATE SEQUENCE public.ioevents_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; +ALTER SEQUENCE public.ioevents_id_seq OWNED BY public.ioevents.id; +CREATE TABLE public.job_conversations ( + jobid uuid NOT NULL, + conversationid uuid NOT NULL, + id uuid DEFAULT public.gen_random_uuid() NOT NULL +); +CREATE TABLE public.joblines ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + jobid uuid NOT NULL, + unq_seq integer, + line_ind text, + line_desc text, + part_type text, + oem_partno text, + est_seq integer, + db_ref text, + line_ref numeric, + tax_part boolean DEFAULT true NOT NULL, + db_price numeric, + act_price numeric, + part_qty integer, + alt_partno text, + mod_lbr_ty text, + db_hrs numeric, + mod_lb_hrs numeric, + lbr_op text, + lbr_amt numeric, + glass_flag boolean, + price_inc boolean, + alt_part_i boolean, + price_j boolean, + cert_part boolean, + alt_co_id text, + alt_overrd boolean, + alt_partm text, + prt_dsmk_p numeric, + prt_dsmk_m numeric, + lbr_inc boolean, + lbr_hrs_j boolean, + lbr_typ_j boolean, + lbr_op_j boolean, + paint_stg integer, + paint_tone integer, + lbr_tax boolean, + misc_amt numeric, + misc_sublt boolean, + misc_tax boolean, + bett_type text, + bett_pctg numeric, + bett_amt numeric, + bett_tax boolean, + op_code_desc text, + status text, + removed boolean DEFAULT false NOT NULL, + line_no integer, + notes text, + location text, + profitcenter_labor text, + profitcenter_part text, + sublet_ignored boolean DEFAULT false NOT NULL, + sublet_completed boolean DEFAULT false NOT NULL, + manual_line boolean DEFAULT false NOT NULL +); +CREATE VIEW public.joblines_status AS + SELECT j.jobid, + j.status, + count(1) AS count, + j.part_type + FROM public.joblines j + WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text)) + GROUP BY j.jobid, j.status, j.part_type; +CREATE TABLE public.masterdata ( + key text NOT NULL, + value text NOT NULL +); +CREATE TABLE public.messages ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + msid text NOT NULL, + conversationid uuid NOT NULL, + text text, + image boolean DEFAULT false NOT NULL, + isoutbound boolean DEFAULT false NOT NULL, + status text DEFAULT 'posted'::text NOT NULL, + read boolean DEFAULT false NOT NULL, + userid text, + image_path jsonb +); +CREATE TABLE public.notes ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + jobid uuid NOT NULL, + text text, + created_by text NOT NULL, + critical boolean DEFAULT false NOT NULL, + private boolean DEFAULT false NOT NULL, + audit boolean DEFAULT false NOT NULL +); +CREATE SEQUENCE public.owners_accountingid_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; +ALTER SEQUENCE public.owners_accountingid_seq OWNED BY public.owners.accountingid; +CREATE TABLE public.parts_order_lines ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + orderid uuid NOT NULL, + job_line_id uuid, + line_desc text, + oem_partno text, + db_price numeric, + act_price numeric, + status text DEFAULT 'Ordered'::text NOT NULL, + line_remarks text, + quantity numeric DEFAULT 1 NOT NULL, + backordered_on date, + backordered_eta date, + part_type text, + cost numeric +); +CREATE TABLE public.parts_orders ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + jobid uuid NOT NULL, + vendorid uuid NOT NULL, + order_date date DEFAULT now() NOT NULL, + user_email text NOT NULL, + status text NOT NULL, + deliver_by date, + order_number integer NOT NULL, + return boolean DEFAULT false NOT NULL, + returnfrombill uuid +); +CREATE SEQUENCE public.parts_order_order_number_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; +ALTER SEQUENCE public.parts_order_order_number_seq OWNED BY public.parts_orders.order_number; +CREATE TABLE public.scoreboard ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + jobid uuid NOT NULL, + painthrs numeric DEFAULT 0 NOT NULL, + bodyhrs numeric DEFAULT 0 NOT NULL, + date date DEFAULT now() NOT NULL +); +CREATE TABLE public.timetickets ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + date date DEFAULT now() NOT NULL, + cost_center text NOT NULL, + employeeid uuid NOT NULL, + jobid uuid, + rate numeric DEFAULT 0 NOT NULL, + productivehrs numeric DEFAULT 0 NOT NULL, + actualhrs numeric DEFAULT 0 NOT NULL, + clockon timestamp with time zone, + clockoff timestamp with time zone, + ciecacode text, + bodyshopid uuid NOT NULL, + memo text +); +CREATE TABLE public.users ( + email text NOT NULL, + authid text NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + fcmtokens jsonb DEFAULT '{}'::jsonb, + dashboardlayout jsonb DEFAULT jsonb_build_array() NOT NULL, + validemail boolean DEFAULT true NOT NULL +); +CREATE TABLE public.vendors ( + id uuid DEFAULT public.gen_random_uuid() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + bodyshopid uuid NOT NULL, + name text NOT NULL, + street1 text, + street2 text, + city text, + state text, + zip text, + country text, + email text, + discount numeric DEFAULT 0 NOT NULL, + due_date integer, + cost_center text, + favorite jsonb DEFAULT jsonb_build_array(), + phone text, + active boolean DEFAULT true NOT NULL +); +ALTER TABLE ONLY public.audit_trail ALTER COLUMN id SET DEFAULT nextval('public.audit_trail_id_seq'::regclass); +ALTER TABLE ONLY public.cccontracts ALTER COLUMN agreementnumber SET DEFAULT nextval('public.cccontract_agreementnumber_seq'::regclass); +ALTER TABLE ONLY public.ioevents ALTER COLUMN id SET DEFAULT nextval('public.ioevents_id_seq'::regclass); +ALTER TABLE ONLY public.owners ALTER COLUMN accountingid SET DEFAULT nextval('public.owners_accountingid_seq'::regclass); +ALTER TABLE ONLY public.parts_orders ALTER COLUMN order_number SET DEFAULT nextval('public.parts_order_order_number_seq'::regclass); +ALTER TABLE ONLY public.allocations + ADD CONSTRAINT allocations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.appointments + ADD CONSTRAINT appointments_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.associations + ADD CONSTRAINT associations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.audit_trail + ADD CONSTRAINT audit_trail_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.available_jobs + ADD CONSTRAINT available_jobs_clm_no_bodyshopid_key UNIQUE (clm_no, bodyshopid); +ALTER TABLE ONLY public.available_jobs + ADD CONSTRAINT available_jobs_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.bodyshops + ADD CONSTRAINT bodyshops_autohouseid_key UNIQUE (autohouseid); +ALTER TABLE ONLY public.bodyshops + ADD CONSTRAINT bodyshops_imexshopid_key UNIQUE (imexshopid); +ALTER TABLE ONLY public.bodyshops + ADD CONSTRAINT bodyshops_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.cccontracts + ADD CONSTRAINT cccontract_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.conversations + ADD CONSTRAINT conversations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.counters + ADD CONSTRAINT counters_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.courtesycars + ADD CONSTRAINT courtesycars_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.csi + ADD CONSTRAINT csiinvites_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.csiquestions + ADD CONSTRAINT csiquestion_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.documents + ADD CONSTRAINT documents_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.employees + ADD CONSTRAINT employees_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.employees + ADD CONSTRAINT employees_user_email_key UNIQUE (user_email); +ALTER TABLE ONLY public.exportlog + ADD CONSTRAINT exportlog_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.billlines + ADD CONSTRAINT invoicelines_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.bills + ADD CONSTRAINT invoices_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.ioevents + ADD CONSTRAINT ioevents_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.job_conversations + ADD CONSTRAINT job_conversations_id_key UNIQUE (id); +ALTER TABLE ONLY public.job_conversations + ADD CONSTRAINT job_conversations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.joblines + ADD CONSTRAINT joblines_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.masterdata + ADD CONSTRAINT masterdata_pkey PRIMARY KEY (key); +ALTER TABLE ONLY public.messages + ADD CONSTRAINT messages_msid_key UNIQUE (msid); +ALTER TABLE ONLY public.messages + ADD CONSTRAINT messages_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.notes + ADD CONSTRAINT notes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.owners + ADD CONSTRAINT owners_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.parts_order_lines + ADD CONSTRAINT parts_order_lines_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.parts_orders + ADD CONSTRAINT parts_order_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.payments + ADD CONSTRAINT payments_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.phonebook + ADD CONSTRAINT phonebook_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.scoreboard + ADD CONSTRAINT scoreboard_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.timetickets + ADD CONSTRAINT timetickets_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.users + ADD CONSTRAINT users_pkey PRIMARY KEY (email); +ALTER TABLE ONLY public.vehicles + ADD CONSTRAINT vehicles_pkey PRIMARY KEY (id); +ALTER TABLE ONLY public.vehicles + ADD CONSTRAINT vehicles_v_vin_shopid_key UNIQUE (v_vin, shopid); +ALTER TABLE ONLY public.vendors + ADD CONSTRAINT vendors_pkey PRIMARY KEY (id); +CREATE INDEX bills_idx_date ON public.bills USING btree (date); +CREATE INDEX bills_idx_invoice_number ON public.bills USING btree (lower(invoice_number)); +CREATE INDEX cccontracts_idx_actual_return ON public.cccontracts USING btree (actualreturn); +CREATE INDEX conversations_idx_phone_num ON public.conversations USING btree (phone_num); +CREATE INDEX conversations_idx_updated_at ON public.conversations USING btree (updated_at); +CREATE INDEX courtesycars_idx_fleet ON public.courtesycars USING btree (fleetnumber); +CREATE INDEX employees_idx_employee_number ON public.employees USING btree (employee_number); +CREATE INDEX idx_invoices_invoicenumber ON public.bills USING gin (invoice_number public.gin_trgm_ops); +CREATE INDEX idx_jobs_clmno ON public.jobs USING gin (clm_no public.gin_trgm_ops); +CREATE INDEX idx_jobs_ownrfn ON public.jobs USING gin (ownr_fn public.gin_trgm_ops); +CREATE INDEX idx_jobs_ownrln ON public.jobs USING gin (ownr_ln public.gin_trgm_ops); +CREATE INDEX idx_jobs_plateno ON public.jobs USING gin (plate_no public.gin_trgm_ops); +CREATE INDEX idx_jobs_ronumber ON public.jobs USING gin (ro_number public.gin_trgm_ops); +CREATE INDEX idx_jobs_vmakedesc ON public.jobs USING gin (v_make_desc public.gin_trgm_ops); +CREATE INDEX idx_jobs_vmodeldesc ON public.jobs USING gin (v_model_desc public.gin_trgm_ops); +CREATE INDEX idx_owner_name ON public.owners USING gin ((((((ownr_fn || ' '::text) || ownr_ln) || ' '::text) || ownr_co_nm)) public.gin_trgm_ops); +CREATE INDEX idx_owners_estnumber ON public.owners USING gin (ownr_co_nm public.gin_trgm_ops); +CREATE INDEX idx_owners_ownr_addr1 ON public.owners USING gin (ownr_addr1 public.gin_trgm_ops); +CREATE INDEX idx_owners_ownr_co_nm ON public.owners USING gin (ownr_co_nm public.gin_trgm_ops); +CREATE INDEX idx_owners_ownr_fn ON public.owners USING gin (ownr_fn public.gin_trgm_ops); +CREATE INDEX idx_owners_ownr_ln ON public.owners USING gin (ownr_ln public.gin_trgm_ops); +CREATE INDEX idx_owners_ownr_ph1 ON public.owners USING gin (ownr_ph1 public.gin_trgm_ops); +CREATE INDEX idx_owners_ownrfn ON public.owners USING gin (ownr_fn public.gin_trgm_ops); +CREATE INDEX idx_owners_ownrln ON public.owners USING gin (ownr_ln public.gin_trgm_ops); +CREATE INDEX idx_payments_memo ON public.payments USING gin (memo public.gin_trgm_ops); +CREATE INDEX idx_payments_payer ON public.payments USING gin (payer public.gin_trgm_ops); +CREATE INDEX idx_payments_txnid ON public.payments USING gin (transactionid public.gin_trgm_ops); +CREATE INDEX idx_vehicles_plateno ON public.vehicles USING gin (plate_no public.gin_trgm_ops); +CREATE INDEX idx_vehicles_vin ON public.vehicles USING gin (v_vin public.gin_trgm_ops); +CREATE INDEX joblines_idx_line_no ON public.joblines USING btree (line_no, jobid); +CREATE INDEX joblines_idx_mod_lbr_ty ON public.joblines USING btree (mod_lbr_ty); +CREATE INDEX joblines_idx_removed ON public.joblines USING btree (removed); +CREATE INDEX jobs_idx_date_exported ON public.jobs USING btree (date_exported); +CREATE INDEX jobs_idx_ownr_fn ON public.jobs USING btree (lower(ownr_fn)); +CREATE INDEX jobs_idx_ownr_ln ON public.jobs USING btree (lower(ownr_ln)); +CREATE INDEX jobs_idx_ro_number ON public.jobs USING btree (lower(ro_number)); +CREATE INDEX jobs_idx_status ON public.jobs USING btree (status); +CREATE INDEX messages_idx_created_at ON public.messages USING btree (created_at); +CREATE INDEX owners_idx_ownr_co_nm ON public.owners USING btree (lower(ownr_co_nm)); +CREATE INDEX owners_idx_ownr_fn ON public.owners USING btree (lower(ownr_fn)); +CREATE INDEX owners_idx_ownr_ln ON public.owners USING btree (lower(ownr_ln)); +CREATE INDEX parts_orders_idx_order_date ON public.parts_orders USING btree (order_date); +CREATE INDEX vehicles_idx_v_make_desc ON public.vehicles USING btree (lower(v_make_desc)); +CREATE INDEX vehicles_idx_v_model_desc ON public.vehicles USING btree (lower(v_model_desc)); +CREATE INDEX vendor_idx_active ON public.vendors USING btree (active); +CREATE INDEX vendor_idx_name ON public.vendors USING btree (name); +CREATE TRIGGER bills_assign_ihbnum BEFORE INSERT ON public.bills FOR EACH ROW EXECUTE FUNCTION public.assign_ibh_number(); +CREATE TRIGGER jobs_assign_ro BEFORE UPDATE ON public.jobs FOR EACH ROW EXECUTE FUNCTION public.assign_ro_number(); +CREATE TRIGGER jobs_assign_ro_insert BEFORE INSERT ON public.jobs FOR EACH ROW EXECUTE FUNCTION public.assign_ro_number(); +CREATE TRIGGER payments_assign_paymentnum BEFORE INSERT ON public.payments FOR EACH ROW EXECUTE FUNCTION public.assign_payment_number(); +CREATE TRIGGER set_public_allocations_updated_at BEFORE UPDATE ON public.allocations FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_allocations_updated_at ON public.allocations IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_appointments_updated_at BEFORE UPDATE ON public.appointments FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_appointments_updated_at ON public.appointments IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_available_jobs_updated_at BEFORE UPDATE ON public.available_jobs FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_available_jobs_updated_at ON public.available_jobs IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_bodyshops_updated_at BEFORE UPDATE ON public.bodyshops FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_bodyshops_updated_at ON public.bodyshops IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_cccontract_updated_at BEFORE UPDATE ON public.cccontracts FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_cccontract_updated_at ON public.cccontracts IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_conversations_updated_at BEFORE UPDATE ON public.conversations FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_conversations_updated_at ON public.conversations IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_counters_updated_at BEFORE UPDATE ON public.counters FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_counters_updated_at ON public.counters IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_courtesycars_updated_at BEFORE UPDATE ON public.courtesycars FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_courtesycars_updated_at ON public.courtesycars IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_csiinvites_updated_at BEFORE UPDATE ON public.csi FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_csiinvites_updated_at ON public.csi IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_csiquestion_updated_at BEFORE UPDATE ON public.csiquestions FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_csiquestion_updated_at ON public.csiquestions IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_documents_updated_at BEFORE UPDATE ON public.documents FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_documents_updated_at ON public.documents IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_employees_updated_at BEFORE UPDATE ON public.employees FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_employees_updated_at ON public.employees IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_exportlog_updated_at BEFORE UPDATE ON public.exportlog FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_exportlog_updated_at ON public.exportlog IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_invoicelines_updated_at BEFORE UPDATE ON public.billlines FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_invoicelines_updated_at ON public.billlines IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_invoices_updated_at BEFORE UPDATE ON public.bills FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_invoices_updated_at ON public.bills IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_joblines_updated_at BEFORE UPDATE ON public.joblines FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_joblines_updated_at ON public.joblines IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_jobs_updated_at BEFORE UPDATE ON public.jobs FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_jobs_updated_at ON public.jobs IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_messages_updated_at BEFORE UPDATE ON public.messages FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_messages_updated_at ON public.messages IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_notes_updated_at BEFORE UPDATE ON public.notes FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_notes_updated_at ON public.notes IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_owners_updated_at BEFORE UPDATE ON public.owners FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_owners_updated_at ON public.owners IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_parts_order_lines_updated_at BEFORE UPDATE ON public.parts_order_lines FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_parts_order_lines_updated_at ON public.parts_order_lines IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_parts_order_updated_at BEFORE UPDATE ON public.parts_orders FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_parts_order_updated_at ON public.parts_orders IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_payments_updated_at BEFORE UPDATE ON public.payments FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_payments_updated_at ON public.payments IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_phonebook_updated_at BEFORE UPDATE ON public.phonebook FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_phonebook_updated_at ON public.phonebook IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_timetickets_updated_at BEFORE UPDATE ON public.timetickets FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_timetickets_updated_at ON public.timetickets IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_users_updated_at BEFORE UPDATE ON public.users FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_users_updated_at ON public.users IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_vehicles_updated_at BEFORE UPDATE ON public.vehicles FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_vehicles_updated_at ON public.vehicles IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER set_public_vendors_updated_at BEFORE UPDATE ON public.vendors FOR EACH ROW EXECUTE FUNCTION public.set_current_timestamp_updated_at(); +COMMENT ON TRIGGER set_public_vendors_updated_at ON public.vendors IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE TRIGGER trigger_update_conversation_on_message AFTER INSERT ON public.messages FOR EACH ROW EXECUTE FUNCTION public.update_conversation_on_message(); +ALTER TABLE ONLY public.allocations + ADD CONSTRAINT allocations_employeeid_fkey FOREIGN KEY (employeeid) REFERENCES public.employees(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.allocations + ADD CONSTRAINT allocations_joblineid_fkey FOREIGN KEY (joblineid) REFERENCES public.joblines(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.appointments + ADD CONSTRAINT appointments_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.appointments + ADD CONSTRAINT appointments_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.associations + ADD CONSTRAINT associations_shopid_fkey FOREIGN KEY (shopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.associations + ADD CONSTRAINT associations_useremail_fkey FOREIGN KEY (useremail) REFERENCES public.users(email) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.audit_trail + ADD CONSTRAINT audit_trail_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.audit_trail + ADD CONSTRAINT audit_trail_useremail_fkey FOREIGN KEY (useremail) REFERENCES public.users(email) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.available_jobs + ADD CONSTRAINT available_jobs_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.available_jobs + ADD CONSTRAINT available_jobs_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE RESTRICT ON DELETE CASCADE; +ALTER TABLE ONLY public.billlines + ADD CONSTRAINT billlines_joblineid_fkey FOREIGN KEY (joblineid) REFERENCES public.joblines(id) ON UPDATE RESTRICT ON DELETE SET NULL; +ALTER TABLE ONLY public.cccontracts + ADD CONSTRAINT cccontract_courtesycarid_fkey FOREIGN KEY (courtesycarid) REFERENCES public.courtesycars(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.cccontracts + ADD CONSTRAINT cccontract_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.conversations + ADD CONSTRAINT conversations_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.counters + ADD CONSTRAINT counters_shopid_fkey FOREIGN KEY (shopid) REFERENCES public.bodyshops(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.courtesycars + ADD CONSTRAINT courtesycars_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.csi + ADD CONSTRAINT csi_questionset_fkey FOREIGN KEY (questionset) REFERENCES public.csiquestions(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.csi + ADD CONSTRAINT csiinvites_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.csi + ADD CONSTRAINT csiinvites_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.csiquestions + ADD CONSTRAINT csiquestion_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.documents + ADD CONSTRAINT documents_billid_fkey FOREIGN KEY (billid) REFERENCES public.bills(id) ON UPDATE RESTRICT ON DELETE SET NULL; +ALTER TABLE ONLY public.documents + ADD CONSTRAINT documents_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.documents + ADD CONSTRAINT documents_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.employees + ADD CONSTRAINT employees_shopid_fkey FOREIGN KEY (shopid) REFERENCES public.bodyshops(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.employees + ADD CONSTRAINT employees_user_email_fkey FOREIGN KEY (user_email) REFERENCES public.users(email) ON UPDATE SET NULL ON DELETE SET NULL; +ALTER TABLE ONLY public.exportlog + ADD CONSTRAINT exportlog_billid_fkey FOREIGN KEY (billid) REFERENCES public.bills(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.exportlog + ADD CONSTRAINT exportlog_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.exportlog + ADD CONSTRAINT exportlog_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.exportlog + ADD CONSTRAINT exportlog_paymentid_fkey FOREIGN KEY (paymentid) REFERENCES public.payments(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.exportlog + ADD CONSTRAINT exportlog_useremail_fkey FOREIGN KEY (useremail) REFERENCES public.users(email) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.billlines + ADD CONSTRAINT invoicelines_invoiceid_fkey FOREIGN KEY (billid) REFERENCES public.bills(id) ON UPDATE RESTRICT ON DELETE CASCADE; +ALTER TABLE ONLY public.bills + ADD CONSTRAINT invoices_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE RESTRICT ON DELETE CASCADE; +ALTER TABLE ONLY public.bills + ADD CONSTRAINT invoices_vendorid_fkey FOREIGN KEY (vendorid) REFERENCES public.vendors(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.job_conversations + ADD CONSTRAINT job_conversations_conversationid_fkey FOREIGN KEY (conversationid) REFERENCES public.conversations(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.job_conversations + ADD CONSTRAINT job_conversations_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.joblines + ADD CONSTRAINT joblines_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_employee_body_fkey FOREIGN KEY (employee_body) REFERENCES public.employees(id) ON UPDATE SET NULL ON DELETE SET NULL; +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_employee_csr_fkey FOREIGN KEY (employee_csr) REFERENCES public.employees(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_employee_prep_fkey FOREIGN KEY (employee_prep) REFERENCES public.employees(id) ON UPDATE SET NULL ON DELETE SET NULL; +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_employee_refinish_fkey FOREIGN KEY (employee_refinish) REFERENCES public.employees(id) ON UPDATE SET NULL ON DELETE SET NULL; +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_ownerid_fkey FOREIGN KEY (ownerid) REFERENCES public.owners(id) ON UPDATE RESTRICT ON DELETE CASCADE; +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_shopid_fkey FOREIGN KEY (shopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_vehicleid_fkey FOREIGN KEY (vehicleid) REFERENCES public.vehicles(id) ON UPDATE RESTRICT ON DELETE CASCADE; +ALTER TABLE ONLY public.messages + ADD CONSTRAINT messages_conversationid_fkey FOREIGN KEY (conversationid) REFERENCES public.conversations(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.messages + ADD CONSTRAINT messages_userid_fkey FOREIGN KEY (userid) REFERENCES public.users(email) ON UPDATE SET NULL ON DELETE SET NULL; +ALTER TABLE ONLY public.notes + ADD CONSTRAINT notes_created_by_fkey FOREIGN KEY (created_by) REFERENCES public.users(email) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.notes + ADD CONSTRAINT notes_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.owners + ADD CONSTRAINT owners_shopid_fkey FOREIGN KEY (shopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE CASCADE; +ALTER TABLE ONLY public.parts_orders + ADD CONSTRAINT parts_order_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.parts_order_lines + ADD CONSTRAINT parts_order_lines_job_line_id_fkey FOREIGN KEY (job_line_id) REFERENCES public.joblines(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.parts_order_lines + ADD CONSTRAINT parts_order_lines_orderid_fkey FOREIGN KEY (orderid) REFERENCES public.parts_orders(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.parts_orders + ADD CONSTRAINT parts_order_ordered_by_user_id_fkey FOREIGN KEY (user_email) REFERENCES public.users(email) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.parts_orders + ADD CONSTRAINT parts_orders_returnfrombill_fkey FOREIGN KEY (returnfrombill) REFERENCES public.bills(id) ON UPDATE SET NULL ON DELETE SET NULL; +ALTER TABLE ONLY public.parts_orders + ADD CONSTRAINT parts_orders_vendorid_fkey FOREIGN KEY (vendorid) REFERENCES public.vendors(id) ON UPDATE SET NULL ON DELETE SET NULL; +ALTER TABLE ONLY public.payments + ADD CONSTRAINT payments_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.phonebook + ADD CONSTRAINT phonebook_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.scoreboard + ADD CONSTRAINT scoreboard_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY public.timetickets + ADD CONSTRAINT timetickets_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.timetickets + ADD CONSTRAINT timetickets_employeeid_fkey FOREIGN KEY (employeeid) REFERENCES public.employees(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.timetickets + ADD CONSTRAINT timetickets_jobid_fkey FOREIGN KEY (jobid) REFERENCES public.jobs(id) ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE ONLY public.vehicles + ADD CONSTRAINT vehicles_shopid_fkey FOREIGN KEY (shopid) REFERENCES public.bodyshops(id) ON UPDATE RESTRICT ON DELETE CASCADE; +ALTER TABLE ONLY public.vendors + ADD CONSTRAINT vendors_bodyshopid_fkey FOREIGN KEY (bodyshopid) REFERENCES public.bodyshops(id) ON UPDATE CASCADE ON DELETE CASCADE; diff --git a/hasura/migrations/1620771761757_Init/up.yaml b/hasura/migrations_backup/1620771761757_Init/up.yaml similarity index 100% rename from hasura/migrations/1620771761757_Init/up.yaml rename to hasura/migrations_backup/1620771761757_Init/up.yaml diff --git a/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/down.yaml b/hasura/migrations_backup/1621379721863_alter_table_public_bodyshops_add_column_website/down.yaml similarity index 100% rename from hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/down.yaml rename to hasura/migrations_backup/1621379721863_alter_table_public_bodyshops_add_column_website/down.yaml diff --git a/hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/up.yaml b/hasura/migrations_backup/1621379721863_alter_table_public_bodyshops_add_column_website/up.yaml similarity index 100% rename from hasura/migrations/1621379721863_alter_table_public_bodyshops_add_column_website/up.yaml rename to hasura/migrations_backup/1621379721863_alter_table_public_bodyshops_add_column_website/up.yaml diff --git a/hasura/migrations/1621379731471_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1621379731471_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1621379731471_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1621379731471_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1621379731471_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1621379731471_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1621379731471_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1621379731471_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1621379744928_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1621379744928_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1621379744928_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1621379744928_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1621379744928_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1621379744928_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1621379744928_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1621379744928_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/down.yaml b/hasura/migrations_backup/1621469433708_alter_table_public_documents_add_column_takenat/down.yaml similarity index 100% rename from hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/down.yaml rename to hasura/migrations_backup/1621469433708_alter_table_public_documents_add_column_takenat/down.yaml diff --git a/hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/up.yaml b/hasura/migrations_backup/1621469433708_alter_table_public_documents_add_column_takenat/up.yaml similarity index 100% rename from hasura/migrations/1621469433708_alter_table_public_documents_add_column_takenat/up.yaml rename to hasura/migrations_backup/1621469433708_alter_table_public_documents_add_column_takenat/up.yaml diff --git a/hasura/migrations/1621469445403_update_permission_user_public_table_documents/down.yaml b/hasura/migrations_backup/1621469445403_update_permission_user_public_table_documents/down.yaml similarity index 100% rename from hasura/migrations/1621469445403_update_permission_user_public_table_documents/down.yaml rename to hasura/migrations_backup/1621469445403_update_permission_user_public_table_documents/down.yaml diff --git a/hasura/migrations/1621469445403_update_permission_user_public_table_documents/up.yaml b/hasura/migrations_backup/1621469445403_update_permission_user_public_table_documents/up.yaml similarity index 100% rename from hasura/migrations/1621469445403_update_permission_user_public_table_documents/up.yaml rename to hasura/migrations_backup/1621469445403_update_permission_user_public_table_documents/up.yaml diff --git a/hasura/migrations/1621469452694_update_permission_user_public_table_documents/down.yaml b/hasura/migrations_backup/1621469452694_update_permission_user_public_table_documents/down.yaml similarity index 100% rename from hasura/migrations/1621469452694_update_permission_user_public_table_documents/down.yaml rename to hasura/migrations_backup/1621469452694_update_permission_user_public_table_documents/down.yaml diff --git a/hasura/migrations/1621469452694_update_permission_user_public_table_documents/up.yaml b/hasura/migrations_backup/1621469452694_update_permission_user_public_table_documents/up.yaml similarity index 100% rename from hasura/migrations/1621469452694_update_permission_user_public_table_documents/up.yaml rename to hasura/migrations_backup/1621469452694_update_permission_user_public_table_documents/up.yaml diff --git a/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.yaml b/hasura/migrations_backup/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.yaml similarity index 100% rename from hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.yaml rename to hasura/migrations_backup/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/down.yaml diff --git a/hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.yaml b/hasura/migrations_backup/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.yaml similarity index 100% rename from hasura/migrations/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.yaml rename to hasura/migrations_backup/1622147830428_alter_table_public_bodyshops_alter_column_autohouseid/up.yaml diff --git a/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.yaml b/hasura/migrations_backup/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.yaml similarity index 100% rename from hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.yaml rename to hasura/migrations_backup/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/down.yaml diff --git a/hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.yaml b/hasura/migrations_backup/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.yaml similarity index 100% rename from hasura/migrations/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.yaml rename to hasura/migrations_backup/1622147892235_alter_table_public_bodyshops_add_column_jc_hourly_rates/up.yaml diff --git a/hasura/migrations/1622147902848_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1622147902848_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1622147902848_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1622147902848_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1622147902848_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1622147902848_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1622147902848_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1622147902848_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1622147914381_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1622147914381_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1622147914381_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1622147914381_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1622147914381_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1622147914381_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1622147914381_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1622147914381_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.yaml b/hasura/migrations_backup/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.yaml similarity index 100% rename from hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.yaml rename to hasura/migrations_backup/1622495491154_alter_table_public_vehicles_alter_column_v_vin/down.yaml diff --git a/hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.yaml b/hasura/migrations_backup/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.yaml similarity index 100% rename from hasura/migrations/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.yaml rename to hasura/migrations_backup/1622495491154_alter_table_public_vehicles_alter_column_v_vin/up.yaml diff --git a/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.yaml b/hasura/migrations_backup/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.yaml similarity index 100% rename from hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.yaml rename to hasura/migrations_backup/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/down.yaml diff --git a/hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.yaml b/hasura/migrations_backup/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.yaml similarity index 100% rename from hasura/migrations/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.yaml rename to hasura/migrations_backup/1622571272382_alter_table_public_joblines_alter_column_prt_dsmk_p/up.yaml diff --git a/hasura/migrations_backup/1622571551101_run_sql_migration/down.yaml b/hasura/migrations_backup/1622571551101_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations_backup/1622571551101_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1622571551101_run_sql_migration/up.yaml b/hasura/migrations_backup/1622571551101_run_sql_migration/up.yaml similarity index 100% rename from hasura/migrations/1622571551101_run_sql_migration/up.yaml rename to hasura/migrations_backup/1622571551101_run_sql_migration/up.yaml diff --git a/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/down.yaml b/hasura/migrations_backup/1622647828371_alter_table_public_conversations_add_column_archived/down.yaml similarity index 100% rename from hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/down.yaml rename to hasura/migrations_backup/1622647828371_alter_table_public_conversations_add_column_archived/down.yaml diff --git a/hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/up.yaml b/hasura/migrations_backup/1622647828371_alter_table_public_conversations_add_column_archived/up.yaml similarity index 100% rename from hasura/migrations/1622647828371_alter_table_public_conversations_add_column_archived/up.yaml rename to hasura/migrations_backup/1622647828371_alter_table_public_conversations_add_column_archived/up.yaml diff --git a/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.yaml b/hasura/migrations_backup/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.yaml similarity index 100% rename from hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.yaml rename to hasura/migrations_backup/1622648039058_alter_table_public_parts_orders_add_column_orderedby/down.yaml diff --git a/hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.yaml b/hasura/migrations_backup/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.yaml similarity index 100% rename from hasura/migrations/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.yaml rename to hasura/migrations_backup/1622648039058_alter_table_public_parts_orders_add_column_orderedby/up.yaml diff --git a/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/down.yaml b/hasura/migrations_backup/1622648063952_set_fk_public_parts_orders_orderedby/down.yaml similarity index 100% rename from hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/down.yaml rename to hasura/migrations_backup/1622648063952_set_fk_public_parts_orders_orderedby/down.yaml diff --git a/hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/up.yaml b/hasura/migrations_backup/1622648063952_set_fk_public_parts_orders_orderedby/up.yaml similarity index 100% rename from hasura/migrations/1622648063952_set_fk_public_parts_orders_orderedby/up.yaml rename to hasura/migrations_backup/1622648063952_set_fk_public_parts_orders_orderedby/up.yaml diff --git a/hasura/migrations/1622648072730_update_permission_user_public_table_parts_orders/down.yaml b/hasura/migrations_backup/1622648072730_update_permission_user_public_table_parts_orders/down.yaml similarity index 100% rename from hasura/migrations/1622648072730_update_permission_user_public_table_parts_orders/down.yaml rename to hasura/migrations_backup/1622648072730_update_permission_user_public_table_parts_orders/down.yaml diff --git a/hasura/migrations/1622648072730_update_permission_user_public_table_parts_orders/up.yaml b/hasura/migrations_backup/1622648072730_update_permission_user_public_table_parts_orders/up.yaml similarity index 100% rename from hasura/migrations/1622648072730_update_permission_user_public_table_parts_orders/up.yaml rename to hasura/migrations_backup/1622648072730_update_permission_user_public_table_parts_orders/up.yaml diff --git a/hasura/migrations/1622648079209_update_permission_user_public_table_parts_orders/down.yaml b/hasura/migrations_backup/1622648079209_update_permission_user_public_table_parts_orders/down.yaml similarity index 100% rename from hasura/migrations/1622648079209_update_permission_user_public_table_parts_orders/down.yaml rename to hasura/migrations_backup/1622648079209_update_permission_user_public_table_parts_orders/down.yaml diff --git a/hasura/migrations/1622648079209_update_permission_user_public_table_parts_orders/up.yaml b/hasura/migrations_backup/1622648079209_update_permission_user_public_table_parts_orders/up.yaml similarity index 100% rename from hasura/migrations/1622648079209_update_permission_user_public_table_parts_orders/up.yaml rename to hasura/migrations_backup/1622648079209_update_permission_user_public_table_parts_orders/up.yaml diff --git a/hasura/migrations/1622648087365_update_permission_user_public_table_parts_orders/down.yaml b/hasura/migrations_backup/1622648087365_update_permission_user_public_table_parts_orders/down.yaml similarity index 100% rename from hasura/migrations/1622648087365_update_permission_user_public_table_parts_orders/down.yaml rename to hasura/migrations_backup/1622648087365_update_permission_user_public_table_parts_orders/down.yaml diff --git a/hasura/migrations/1622648087365_update_permission_user_public_table_parts_orders/up.yaml b/hasura/migrations_backup/1622648087365_update_permission_user_public_table_parts_orders/up.yaml similarity index 100% rename from hasura/migrations/1622648087365_update_permission_user_public_table_parts_orders/up.yaml rename to hasura/migrations_backup/1622648087365_update_permission_user_public_table_parts_orders/up.yaml diff --git a/hasura/migrations/1622648112396_update_permission_user_public_table_conversations/down.yaml b/hasura/migrations_backup/1622648112396_update_permission_user_public_table_conversations/down.yaml similarity index 100% rename from hasura/migrations/1622648112396_update_permission_user_public_table_conversations/down.yaml rename to hasura/migrations_backup/1622648112396_update_permission_user_public_table_conversations/down.yaml diff --git a/hasura/migrations/1622648112396_update_permission_user_public_table_conversations/up.yaml b/hasura/migrations_backup/1622648112396_update_permission_user_public_table_conversations/up.yaml similarity index 100% rename from hasura/migrations/1622648112396_update_permission_user_public_table_conversations/up.yaml rename to hasura/migrations_backup/1622648112396_update_permission_user_public_table_conversations/up.yaml diff --git a/hasura/migrations/1622648118751_update_permission_user_public_table_conversations/down.yaml b/hasura/migrations_backup/1622648118751_update_permission_user_public_table_conversations/down.yaml similarity index 100% rename from hasura/migrations/1622648118751_update_permission_user_public_table_conversations/down.yaml rename to hasura/migrations_backup/1622648118751_update_permission_user_public_table_conversations/down.yaml diff --git a/hasura/migrations/1622648118751_update_permission_user_public_table_conversations/up.yaml b/hasura/migrations_backup/1622648118751_update_permission_user_public_table_conversations/up.yaml similarity index 100% rename from hasura/migrations/1622648118751_update_permission_user_public_table_conversations/up.yaml rename to hasura/migrations_backup/1622648118751_update_permission_user_public_table_conversations/up.yaml diff --git a/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/down.yaml b/hasura/migrations_backup/1622650359491_set_fk_public_exportlog_billid/down.yaml similarity index 100% rename from hasura/migrations/1622650359491_set_fk_public_exportlog_billid/down.yaml rename to hasura/migrations_backup/1622650359491_set_fk_public_exportlog_billid/down.yaml diff --git a/hasura/migrations/1622650359491_set_fk_public_exportlog_billid/up.yaml b/hasura/migrations_backup/1622650359491_set_fk_public_exportlog_billid/up.yaml similarity index 100% rename from hasura/migrations/1622650359491_set_fk_public_exportlog_billid/up.yaml rename to hasura/migrations_backup/1622650359491_set_fk_public_exportlog_billid/up.yaml diff --git a/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.yaml b/hasura/migrations_backup/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.yaml similarity index 100% rename from hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.yaml rename to hasura/migrations_backup/1623697759837_alter_table_public_users_alter_column_dashboardlayout/down.yaml diff --git a/hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.yaml b/hasura/migrations_backup/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.yaml similarity index 100% rename from hasura/migrations/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.yaml rename to hasura/migrations_backup/1623697759837_alter_table_public_users_alter_column_dashboardlayout/up.yaml diff --git a/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.yaml b/hasura/migrations_backup/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.yaml similarity index 100% rename from hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.yaml rename to hasura/migrations_backup/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/down.yaml diff --git a/hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.yaml b/hasura/migrations_backup/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.yaml similarity index 100% rename from hasura/migrations/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.yaml rename to hasura/migrations_backup/1623796879914_alter_table_public_bodyshops_add_column_md_jobline_presets/up.yaml diff --git a/hasura/migrations/1623796895613_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1623796895613_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1623796895613_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1623796895613_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1623796895613_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1623796895613_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1623796895613_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1623796895613_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1623796904892_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1623796904892_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1623796904892_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1623796904892_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1623796904892_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1623796904892_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1623796904892_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1623796904892_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.yaml b/hasura/migrations_backup/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.yaml similarity index 100% rename from hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.yaml rename to hasura/migrations_backup/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/down.yaml diff --git a/hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.yaml b/hasura/migrations_backup/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.yaml similarity index 100% rename from hasura/migrations/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.yaml rename to hasura/migrations_backup/1624310782649_alter_table_public_bodyshops_add_column_cdk_dealerid/up.yaml diff --git a/hasura/migrations/1624310795238_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1624310795238_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1624310795238_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1624310795238_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1624310795238_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1624310795238_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1624310795238_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1624310795238_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1624480412524_track_all_relationships/down.yaml b/hasura/migrations_backup/1624480412524_track_all_relationships/down.yaml similarity index 100% rename from hasura/migrations/1624480412524_track_all_relationships/down.yaml rename to hasura/migrations_backup/1624480412524_track_all_relationships/down.yaml diff --git a/hasura/migrations/1624480412524_track_all_relationships/up.yaml b/hasura/migrations_backup/1624480412524_track_all_relationships/up.yaml similarity index 100% rename from hasura/migrations/1624480412524_track_all_relationships/up.yaml rename to hasura/migrations_backup/1624480412524_track_all_relationships/up.yaml diff --git a/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/down.yaml b/hasura/migrations_backup/1624480467391_alter_table_public_bodyshops_add_column_features/down.yaml similarity index 100% rename from hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/down.yaml rename to hasura/migrations_backup/1624480467391_alter_table_public_bodyshops_add_column_features/down.yaml diff --git a/hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/up.yaml b/hasura/migrations_backup/1624480467391_alter_table_public_bodyshops_add_column_features/up.yaml similarity index 100% rename from hasura/migrations/1624480467391_alter_table_public_bodyshops_add_column_features/up.yaml rename to hasura/migrations_backup/1624480467391_alter_table_public_bodyshops_add_column_features/up.yaml diff --git a/hasura/migrations/1624480496210_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1624480496210_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1624480496210_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1624480496210_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1624480496210_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1624480496210_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1624480496210_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1624480496210_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations_backup/1625768789569_run_sql_migration/down.yaml b/hasura/migrations_backup/1625768789569_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations_backup/1625768789569_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1625768789569_run_sql_migration/up.yaml b/hasura/migrations_backup/1625768789569_run_sql_migration/up.yaml similarity index 100% rename from hasura/migrations/1625768789569_run_sql_migration/up.yaml rename to hasura/migrations_backup/1625768789569_run_sql_migration/up.yaml diff --git a/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.yaml b/hasura/migrations_backup/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.yaml similarity index 100% rename from hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.yaml rename to hasura/migrations_backup/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/down.yaml diff --git a/hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.yaml b/hasura/migrations_backup/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.yaml similarity index 100% rename from hasura/migrations/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.yaml rename to hasura/migrations_backup/1626374103197_alter_table_public_vehicles_drop_constraint_vehicles_v_vin_shopid_key/up.yaml diff --git a/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.yaml b/hasura/migrations_backup/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.yaml similarity index 100% rename from hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.yaml rename to hasura/migrations_backup/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/down.yaml diff --git a/hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.yaml b/hasura/migrations_backup/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.yaml similarity index 100% rename from hasura/migrations/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.yaml rename to hasura/migrations_backup/1626795754549_alter_table_public_bodyshops_add_column_attach_pdf_to_email/up.yaml diff --git a/hasura/migrations/1626795768315_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1626795768315_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1626795768315_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1626795768315_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1626795768315_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1626795768315_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1626795768315_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1626795768315_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1626795775694_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1626795775694_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1626795775694_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1626795775694_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1626795775694_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1626795775694_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1626795775694_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1626795775694_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1626970563204_delete_permission_user_public_table_audit_trail/down.yaml b/hasura/migrations_backup/1626970563204_delete_permission_user_public_table_audit_trail/down.yaml similarity index 100% rename from hasura/migrations/1626970563204_delete_permission_user_public_table_audit_trail/down.yaml rename to hasura/migrations_backup/1626970563204_delete_permission_user_public_table_audit_trail/down.yaml diff --git a/hasura/migrations/1626970563204_delete_permission_user_public_table_audit_trail/up.yaml b/hasura/migrations_backup/1626970563204_delete_permission_user_public_table_audit_trail/up.yaml similarity index 100% rename from hasura/migrations/1626970563204_delete_permission_user_public_table_audit_trail/up.yaml rename to hasura/migrations_backup/1626970563204_delete_permission_user_public_table_audit_trail/up.yaml diff --git a/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.yaml b/hasura/migrations_backup/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.yaml similarity index 100% rename from hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.yaml rename to hasura/migrations_backup/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/down.yaml diff --git a/hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.yaml b/hasura/migrations_backup/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.yaml similarity index 100% rename from hasura/migrations/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.yaml rename to hasura/migrations_backup/1626970576399_alter_table_public_audit_trail_drop_column_schemaname/up.yaml diff --git a/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.yaml b/hasura/migrations_backup/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.yaml similarity index 100% rename from hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.yaml rename to hasura/migrations_backup/1626970611819_alter_table_public_audit_trail_drop_column_tabname/down.yaml diff --git a/hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.yaml b/hasura/migrations_backup/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.yaml similarity index 100% rename from hasura/migrations/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.yaml rename to hasura/migrations_backup/1626970611819_alter_table_public_audit_trail_drop_column_tabname/up.yaml diff --git a/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.yaml b/hasura/migrations_backup/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.yaml similarity index 100% rename from hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.yaml rename to hasura/migrations_backup/1626970630304_alter_table_public_audit_trail_drop_column_recordid/down.yaml diff --git a/hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.yaml b/hasura/migrations_backup/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.yaml similarity index 100% rename from hasura/migrations/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.yaml rename to hasura/migrations_backup/1626970630304_alter_table_public_audit_trail_drop_column_recordid/up.yaml diff --git a/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.yaml b/hasura/migrations_backup/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.yaml similarity index 100% rename from hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.yaml rename to hasura/migrations_backup/1626970677672_alter_table_public_audit_trail_add_column_jobid/down.yaml diff --git a/hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.yaml b/hasura/migrations_backup/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.yaml similarity index 100% rename from hasura/migrations/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.yaml rename to hasura/migrations_backup/1626970677672_alter_table_public_audit_trail_add_column_jobid/up.yaml diff --git a/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/down.yaml b/hasura/migrations_backup/1626970699645_alter_table_public_audit_trail_add_column_billid/down.yaml similarity index 100% rename from hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/down.yaml rename to hasura/migrations_backup/1626970699645_alter_table_public_audit_trail_add_column_billid/down.yaml diff --git a/hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/up.yaml b/hasura/migrations_backup/1626970699645_alter_table_public_audit_trail_add_column_billid/up.yaml similarity index 100% rename from hasura/migrations/1626970699645_alter_table_public_audit_trail_add_column_billid/up.yaml rename to hasura/migrations_backup/1626970699645_alter_table_public_audit_trail_add_column_billid/up.yaml diff --git a/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/down.yaml b/hasura/migrations_backup/1626970720625_set_fk_public_audit_trail_billid/down.yaml similarity index 100% rename from hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/down.yaml rename to hasura/migrations_backup/1626970720625_set_fk_public_audit_trail_billid/down.yaml diff --git a/hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/up.yaml b/hasura/migrations_backup/1626970720625_set_fk_public_audit_trail_billid/up.yaml similarity index 100% rename from hasura/migrations/1626970720625_set_fk_public_audit_trail_billid/up.yaml rename to hasura/migrations_backup/1626970720625_set_fk_public_audit_trail_billid/up.yaml diff --git a/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/down.yaml b/hasura/migrations_backup/1626970735347_set_fk_public_audit_trail_billid/down.yaml similarity index 100% rename from hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/down.yaml rename to hasura/migrations_backup/1626970735347_set_fk_public_audit_trail_billid/down.yaml diff --git a/hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/up.yaml b/hasura/migrations_backup/1626970735347_set_fk_public_audit_trail_billid/up.yaml similarity index 100% rename from hasura/migrations/1626970735347_set_fk_public_audit_trail_billid/up.yaml rename to hasura/migrations_backup/1626970735347_set_fk_public_audit_trail_billid/up.yaml diff --git a/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/down.yaml b/hasura/migrations_backup/1626970788128_set_fk_public_audit_trail_billid/down.yaml similarity index 100% rename from hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/down.yaml rename to hasura/migrations_backup/1626970788128_set_fk_public_audit_trail_billid/down.yaml diff --git a/hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/up.yaml b/hasura/migrations_backup/1626970788128_set_fk_public_audit_trail_billid/up.yaml similarity index 100% rename from hasura/migrations/1626970788128_set_fk_public_audit_trail_billid/up.yaml rename to hasura/migrations_backup/1626970788128_set_fk_public_audit_trail_billid/up.yaml diff --git a/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/down.yaml b/hasura/migrations_backup/1626970818772_set_fk_public_audit_trail_jobid/down.yaml similarity index 100% rename from hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/down.yaml rename to hasura/migrations_backup/1626970818772_set_fk_public_audit_trail_jobid/down.yaml diff --git a/hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/up.yaml b/hasura/migrations_backup/1626970818772_set_fk_public_audit_trail_jobid/up.yaml similarity index 100% rename from hasura/migrations/1626970818772_set_fk_public_audit_trail_jobid/up.yaml rename to hasura/migrations_backup/1626970818772_set_fk_public_audit_trail_jobid/up.yaml diff --git a/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/down.yaml b/hasura/migrations_backup/1626970831689_set_fk_public_audit_trail_useremail/down.yaml similarity index 100% rename from hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/down.yaml rename to hasura/migrations_backup/1626970831689_set_fk_public_audit_trail_useremail/down.yaml diff --git a/hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/up.yaml b/hasura/migrations_backup/1626970831689_set_fk_public_audit_trail_useremail/up.yaml similarity index 100% rename from hasura/migrations/1626970831689_set_fk_public_audit_trail_useremail/up.yaml rename to hasura/migrations_backup/1626970831689_set_fk_public_audit_trail_useremail/up.yaml diff --git a/hasura/migrations/1626970851371_track_all_relationships/down.yaml b/hasura/migrations_backup/1626970851371_track_all_relationships/down.yaml similarity index 100% rename from hasura/migrations/1626970851371_track_all_relationships/down.yaml rename to hasura/migrations_backup/1626970851371_track_all_relationships/down.yaml diff --git a/hasura/migrations/1626970851371_track_all_relationships/up.yaml b/hasura/migrations_backup/1626970851371_track_all_relationships/up.yaml similarity index 100% rename from hasura/migrations/1626970851371_track_all_relationships/up.yaml rename to hasura/migrations_backup/1626970851371_track_all_relationships/up.yaml diff --git a/hasura/migrations/1626975869951_update_permission_user_public_table_audit_trail/down.yaml b/hasura/migrations_backup/1626975869951_update_permission_user_public_table_audit_trail/down.yaml similarity index 100% rename from hasura/migrations/1626975869951_update_permission_user_public_table_audit_trail/down.yaml rename to hasura/migrations_backup/1626975869951_update_permission_user_public_table_audit_trail/down.yaml diff --git a/hasura/migrations/1626975869951_update_permission_user_public_table_audit_trail/up.yaml b/hasura/migrations_backup/1626975869951_update_permission_user_public_table_audit_trail/up.yaml similarity index 100% rename from hasura/migrations/1626975869951_update_permission_user_public_table_audit_trail/up.yaml rename to hasura/migrations_backup/1626975869951_update_permission_user_public_table_audit_trail/up.yaml diff --git a/hasura/migrations/1626975885477_update_permission_user_public_table_audit_trail/down.yaml b/hasura/migrations_backup/1626975885477_update_permission_user_public_table_audit_trail/down.yaml similarity index 100% rename from hasura/migrations/1626975885477_update_permission_user_public_table_audit_trail/down.yaml rename to hasura/migrations_backup/1626975885477_update_permission_user_public_table_audit_trail/down.yaml diff --git a/hasura/migrations/1626975885477_update_permission_user_public_table_audit_trail/up.yaml b/hasura/migrations_backup/1626975885477_update_permission_user_public_table_audit_trail/up.yaml similarity index 100% rename from hasura/migrations/1626975885477_update_permission_user_public_table_audit_trail/up.yaml rename to hasura/migrations_backup/1626975885477_update_permission_user_public_table_audit_trail/up.yaml diff --git a/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/down.yaml b/hasura/migrations_backup/1627487063259_alter_table_public_appointments_add_column_note/down.yaml similarity index 100% rename from hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/down.yaml rename to hasura/migrations_backup/1627487063259_alter_table_public_appointments_add_column_note/down.yaml diff --git a/hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/up.yaml b/hasura/migrations_backup/1627487063259_alter_table_public_appointments_add_column_note/up.yaml similarity index 100% rename from hasura/migrations/1627487063259_alter_table_public_appointments_add_column_note/up.yaml rename to hasura/migrations_backup/1627487063259_alter_table_public_appointments_add_column_note/up.yaml diff --git a/hasura/migrations/1627487073069_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations_backup/1627487073069_update_permission_user_public_table_appointments/down.yaml similarity index 100% rename from hasura/migrations/1627487073069_update_permission_user_public_table_appointments/down.yaml rename to hasura/migrations_backup/1627487073069_update_permission_user_public_table_appointments/down.yaml diff --git a/hasura/migrations/1627487073069_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations_backup/1627487073069_update_permission_user_public_table_appointments/up.yaml similarity index 100% rename from hasura/migrations/1627487073069_update_permission_user_public_table_appointments/up.yaml rename to hasura/migrations_backup/1627487073069_update_permission_user_public_table_appointments/up.yaml diff --git a/hasura/migrations/1627487079534_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations_backup/1627487079534_update_permission_user_public_table_appointments/down.yaml similarity index 100% rename from hasura/migrations/1627487079534_update_permission_user_public_table_appointments/down.yaml rename to hasura/migrations_backup/1627487079534_update_permission_user_public_table_appointments/down.yaml diff --git a/hasura/migrations/1627487079534_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations_backup/1627487079534_update_permission_user_public_table_appointments/up.yaml similarity index 100% rename from hasura/migrations/1627487079534_update_permission_user_public_table_appointments/up.yaml rename to hasura/migrations_backup/1627487079534_update_permission_user_public_table_appointments/up.yaml diff --git a/hasura/migrations/1627487084218_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations_backup/1627487084218_update_permission_user_public_table_appointments/down.yaml similarity index 100% rename from hasura/migrations/1627487084218_update_permission_user_public_table_appointments/down.yaml rename to hasura/migrations_backup/1627487084218_update_permission_user_public_table_appointments/down.yaml diff --git a/hasura/migrations/1627487084218_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations_backup/1627487084218_update_permission_user_public_table_appointments/up.yaml similarity index 100% rename from hasura/migrations/1627487084218_update_permission_user_public_table_appointments/up.yaml rename to hasura/migrations_backup/1627487084218_update_permission_user_public_table_appointments/up.yaml diff --git a/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/down.yaml b/hasura/migrations_backup/1627501097014_alter_table_public_audit_trail_alter_column_created/down.yaml similarity index 100% rename from hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/down.yaml rename to hasura/migrations_backup/1627501097014_alter_table_public_audit_trail_alter_column_created/down.yaml diff --git a/hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/up.yaml b/hasura/migrations_backup/1627501097014_alter_table_public_audit_trail_alter_column_created/up.yaml similarity index 100% rename from hasura/migrations/1627501097014_alter_table_public_audit_trail_alter_column_created/up.yaml rename to hasura/migrations_backup/1627501097014_alter_table_public_audit_trail_alter_column_created/up.yaml diff --git a/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml b/hasura/migrations_backup/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml similarity index 100% rename from hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml rename to hasura/migrations_backup/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/down.yaml diff --git a/hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml b/hasura/migrations_backup/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml similarity index 100% rename from hasura/migrations/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml rename to hasura/migrations_backup/1628014681446_alter_table_public_bodyshops_add_column_tt_allow_post_to_invoiced/up.yaml diff --git a/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1628014693949_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1628014693949_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1628014693949_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1628014693949_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1628014693949_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1628014707161_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1628014707161_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1628014707161_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1628014707161_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1628014707161_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.yaml b/hasura/migrations_backup/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.yaml similarity index 100% rename from hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.yaml rename to hasura/migrations_backup/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/down.yaml diff --git a/hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.yaml b/hasura/migrations_backup/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.yaml similarity index 100% rename from hasura/migrations/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.yaml rename to hasura/migrations_backup/1628544240019_alter_table_public_bodyshops_add_column_cdk_configuration/up.yaml diff --git a/hasura/migrations/1628544252299_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1628544252299_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1628544252299_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1628544252299_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1628544252299_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1628544252299_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1628544252299_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1628544252299_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1628544261316_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations_backup/1628544261316_update_permission_user_public_table_bodyshops/down.yaml similarity index 100% rename from hasura/migrations/1628544261316_update_permission_user_public_table_bodyshops/down.yaml rename to hasura/migrations_backup/1628544261316_update_permission_user_public_table_bodyshops/down.yaml diff --git a/hasura/migrations/1628544261316_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations_backup/1628544261316_update_permission_user_public_table_bodyshops/up.yaml similarity index 100% rename from hasura/migrations/1628544261316_update_permission_user_public_table_bodyshops/up.yaml rename to hasura/migrations_backup/1628544261316_update_permission_user_public_table_bodyshops/up.yaml diff --git a/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.yaml b/hasura/migrations_backup/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.yaml similarity index 100% rename from hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.yaml rename to hasura/migrations_backup/1629321680242_alter_table_public_timetickets_add_column_flat_rate/down.yaml diff --git a/hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.yaml b/hasura/migrations_backup/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.yaml similarity index 100% rename from hasura/migrations/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.yaml rename to hasura/migrations_backup/1629321680242_alter_table_public_timetickets_add_column_flat_rate/up.yaml diff --git a/hasura/migrations/1629321689733_update_permission_user_public_table_timetickets/down.yaml b/hasura/migrations_backup/1629321689733_update_permission_user_public_table_timetickets/down.yaml similarity index 100% rename from hasura/migrations/1629321689733_update_permission_user_public_table_timetickets/down.yaml rename to hasura/migrations_backup/1629321689733_update_permission_user_public_table_timetickets/down.yaml diff --git a/hasura/migrations/1629321689733_update_permission_user_public_table_timetickets/up.yaml b/hasura/migrations_backup/1629321689733_update_permission_user_public_table_timetickets/up.yaml similarity index 100% rename from hasura/migrations/1629321689733_update_permission_user_public_table_timetickets/up.yaml rename to hasura/migrations_backup/1629321689733_update_permission_user_public_table_timetickets/up.yaml diff --git a/hasura/migrations/1629321697271_update_permission_user_public_table_timetickets/down.yaml b/hasura/migrations_backup/1629321697271_update_permission_user_public_table_timetickets/down.yaml similarity index 100% rename from hasura/migrations/1629321697271_update_permission_user_public_table_timetickets/down.yaml rename to hasura/migrations_backup/1629321697271_update_permission_user_public_table_timetickets/down.yaml diff --git a/hasura/migrations/1629321697271_update_permission_user_public_table_timetickets/up.yaml b/hasura/migrations_backup/1629321697271_update_permission_user_public_table_timetickets/up.yaml similarity index 100% rename from hasura/migrations/1629321697271_update_permission_user_public_table_timetickets/up.yaml rename to hasura/migrations_backup/1629321697271_update_permission_user_public_table_timetickets/up.yaml diff --git a/hasura/migrations/1629321703175_update_permission_user_public_table_timetickets/down.yaml b/hasura/migrations_backup/1629321703175_update_permission_user_public_table_timetickets/down.yaml similarity index 100% rename from hasura/migrations/1629321703175_update_permission_user_public_table_timetickets/down.yaml rename to hasura/migrations_backup/1629321703175_update_permission_user_public_table_timetickets/down.yaml diff --git a/hasura/migrations/1629321703175_update_permission_user_public_table_timetickets/up.yaml b/hasura/migrations_backup/1629321703175_update_permission_user_public_table_timetickets/up.yaml similarity index 100% rename from hasura/migrations/1629321703175_update_permission_user_public_table_timetickets/up.yaml rename to hasura/migrations_backup/1629321703175_update_permission_user_public_table_timetickets/up.yaml diff --git a/hasura/migrations/1629520416914_create_table_public_dms_vehicles/down.yaml b/hasura/migrations_backup/1629520416914_create_table_public_dms_vehicles/down.yaml similarity index 100% rename from hasura/migrations/1629520416914_create_table_public_dms_vehicles/down.yaml rename to hasura/migrations_backup/1629520416914_create_table_public_dms_vehicles/down.yaml diff --git a/hasura/migrations/1629520416914_create_table_public_dms_vehicles/up.yaml b/hasura/migrations_backup/1629520416914_create_table_public_dms_vehicles/up.yaml similarity index 100% rename from hasura/migrations/1629520416914_create_table_public_dms_vehicles/up.yaml rename to hasura/migrations_backup/1629520416914_create_table_public_dms_vehicles/up.yaml diff --git a/hasura/migrations/1629520454038_track_all_relationships/down.yaml b/hasura/migrations_backup/1629520454038_track_all_relationships/down.yaml similarity index 100% rename from hasura/migrations/1629520454038_track_all_relationships/down.yaml rename to hasura/migrations_backup/1629520454038_track_all_relationships/down.yaml diff --git a/hasura/migrations/1629520454038_track_all_relationships/up.yaml b/hasura/migrations_backup/1629520454038_track_all_relationships/up.yaml similarity index 100% rename from hasura/migrations/1629520454038_track_all_relationships/up.yaml rename to hasura/migrations_backup/1629520454038_track_all_relationships/up.yaml diff --git a/hasura/migrations/1629520509486_update_permission_user_public_table_dms_vehicles/down.yaml b/hasura/migrations_backup/1629520509486_update_permission_user_public_table_dms_vehicles/down.yaml similarity index 100% rename from hasura/migrations/1629520509486_update_permission_user_public_table_dms_vehicles/down.yaml rename to hasura/migrations_backup/1629520509486_update_permission_user_public_table_dms_vehicles/down.yaml diff --git a/hasura/migrations/1629520509486_update_permission_user_public_table_dms_vehicles/up.yaml b/hasura/migrations_backup/1629520509486_update_permission_user_public_table_dms_vehicles/up.yaml similarity index 100% rename from hasura/migrations/1629520509486_update_permission_user_public_table_dms_vehicles/up.yaml rename to hasura/migrations_backup/1629520509486_update_permission_user_public_table_dms_vehicles/up.yaml diff --git a/hasura/migrations/1629520623978_update_permission_user_public_table_dms_vehicles/down.yaml b/hasura/migrations_backup/1629520623978_update_permission_user_public_table_dms_vehicles/down.yaml similarity index 100% rename from hasura/migrations/1629520623978_update_permission_user_public_table_dms_vehicles/down.yaml rename to hasura/migrations_backup/1629520623978_update_permission_user_public_table_dms_vehicles/down.yaml diff --git a/hasura/migrations/1629520623978_update_permission_user_public_table_dms_vehicles/up.yaml b/hasura/migrations_backup/1629520623978_update_permission_user_public_table_dms_vehicles/up.yaml similarity index 100% rename from hasura/migrations/1629520623978_update_permission_user_public_table_dms_vehicles/up.yaml rename to hasura/migrations_backup/1629520623978_update_permission_user_public_table_dms_vehicles/up.yaml diff --git a/hasura/migrations/1629520632595_update_permission_user_public_table_dms_vehicles/down.yaml b/hasura/migrations_backup/1629520632595_update_permission_user_public_table_dms_vehicles/down.yaml similarity index 100% rename from hasura/migrations/1629520632595_update_permission_user_public_table_dms_vehicles/down.yaml rename to hasura/migrations_backup/1629520632595_update_permission_user_public_table_dms_vehicles/down.yaml diff --git a/hasura/migrations/1629520632595_update_permission_user_public_table_dms_vehicles/up.yaml b/hasura/migrations_backup/1629520632595_update_permission_user_public_table_dms_vehicles/up.yaml similarity index 100% rename from hasura/migrations/1629520632595_update_permission_user_public_table_dms_vehicles/up.yaml rename to hasura/migrations_backup/1629520632595_update_permission_user_public_table_dms_vehicles/up.yaml diff --git a/hasura/migrations/1629521860924_update_permission_user_public_table_dms_vehicles/down.yaml b/hasura/migrations_backup/1629521860924_update_permission_user_public_table_dms_vehicles/down.yaml similarity index 100% rename from hasura/migrations/1629521860924_update_permission_user_public_table_dms_vehicles/down.yaml rename to hasura/migrations_backup/1629521860924_update_permission_user_public_table_dms_vehicles/down.yaml diff --git a/hasura/migrations/1629521860924_update_permission_user_public_table_dms_vehicles/up.yaml b/hasura/migrations_backup/1629521860924_update_permission_user_public_table_dms_vehicles/up.yaml similarity index 100% rename from hasura/migrations/1629521860924_update_permission_user_public_table_dms_vehicles/up.yaml rename to hasura/migrations_backup/1629521860924_update_permission_user_public_table_dms_vehicles/up.yaml diff --git a/hasura/migrations_backup/1629738990845_run_sql_migration/down.yaml b/hasura/migrations_backup/1629738990845_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations_backup/1629738990845_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1629738990845_run_sql_migration/up.yaml b/hasura/migrations_backup/1629738990845_run_sql_migration/up.yaml similarity index 100% rename from hasura/migrations/1629738990845_run_sql_migration/up.yaml rename to hasura/migrations_backup/1629738990845_run_sql_migration/up.yaml diff --git a/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.yaml b/hasura/migrations_backup/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.yaml similarity index 100% rename from hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.yaml rename to hasura/migrations_backup/1630078518068_alter_table_public_associations_add_column_qbo_auth/down.yaml diff --git a/hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.yaml b/hasura/migrations_backup/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.yaml similarity index 100% rename from hasura/migrations/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.yaml rename to hasura/migrations_backup/1630078518068_alter_table_public_associations_add_column_qbo_auth/up.yaml diff --git a/hasura/migrations/1631052192511_create_table_public_relatedjobs/down.yaml b/hasura/migrations_backup/1631052192511_create_table_public_relatedjobs/down.yaml similarity index 100% rename from hasura/migrations/1631052192511_create_table_public_relatedjobs/down.yaml rename to hasura/migrations_backup/1631052192511_create_table_public_relatedjobs/down.yaml diff --git a/hasura/migrations/1631052192511_create_table_public_relatedjobs/up.yaml b/hasura/migrations_backup/1631052192511_create_table_public_relatedjobs/up.yaml similarity index 100% rename from hasura/migrations/1631052192511_create_table_public_relatedjobs/up.yaml rename to hasura/migrations_backup/1631052192511_create_table_public_relatedjobs/up.yaml diff --git a/hasura/migrations/1631052229711_track_all_relationships/down.yaml b/hasura/migrations_backup/1631052229711_track_all_relationships/down.yaml similarity index 100% rename from hasura/migrations/1631052229711_track_all_relationships/down.yaml rename to hasura/migrations_backup/1631052229711_track_all_relationships/down.yaml diff --git a/hasura/migrations/1631052229711_track_all_relationships/up.yaml b/hasura/migrations_backup/1631052229711_track_all_relationships/up.yaml similarity index 100% rename from hasura/migrations/1631052229711_track_all_relationships/up.yaml rename to hasura/migrations_backup/1631052229711_track_all_relationships/up.yaml diff --git a/hasura/migrations/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/down.yaml b/hasura/migrations_backup/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/down.yaml similarity index 100% rename from hasura/migrations/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/down.yaml rename to hasura/migrations_backup/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/down.yaml diff --git a/hasura/migrations/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/up.yaml b/hasura/migrations_backup/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/up.yaml similarity index 100% rename from hasura/migrations/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/up.yaml rename to hasura/migrations_backup/1631052264437_rename_relationship_job_to_parentjob_rel_schema_public_table_relatedjobs/up.yaml diff --git a/hasura/migrations/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/down.yaml b/hasura/migrations_backup/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/down.yaml similarity index 100% rename from hasura/migrations/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/down.yaml rename to hasura/migrations_backup/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/down.yaml diff --git a/hasura/migrations/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/up.yaml b/hasura/migrations_backup/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/up.yaml similarity index 100% rename from hasura/migrations/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/up.yaml rename to hasura/migrations_backup/1631052277534_rename_relationship_jobByChildjob_to_childjob_rel_schema_public_table_relatedjobs/up.yaml diff --git a/hasura/migrations/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/down.yaml b/hasura/migrations_backup/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/down.yaml similarity index 100% rename from hasura/migrations/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/down.yaml rename to hasura/migrations_backup/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/down.yaml diff --git a/hasura/migrations/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/up.yaml b/hasura/migrations_backup/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/up.yaml similarity index 100% rename from hasura/migrations/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/up.yaml rename to hasura/migrations_backup/1631052341674_rename_relationship_relatedjobs_to_relatedjobs_parent_schema_public_table_jobs/up.yaml diff --git a/hasura/migrations/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/down.yaml b/hasura/migrations_backup/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/down.yaml similarity index 100% rename from hasura/migrations/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/down.yaml rename to hasura/migrations_backup/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/down.yaml diff --git a/hasura/migrations/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/up.yaml b/hasura/migrations_backup/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/up.yaml similarity index 100% rename from hasura/migrations/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/up.yaml rename to hasura/migrations_backup/1631052355761_rename_relationship_relatedjobsByChildjob_to_relatedjobs_child_schema_public_table_jobs/up.yaml diff --git a/hasura/migrations/1631052776515_update_permission_user_public_table_relatedjobs/down.yaml b/hasura/migrations_backup/1631052776515_update_permission_user_public_table_relatedjobs/down.yaml similarity index 100% rename from hasura/migrations/1631052776515_update_permission_user_public_table_relatedjobs/down.yaml rename to hasura/migrations_backup/1631052776515_update_permission_user_public_table_relatedjobs/down.yaml diff --git a/hasura/migrations/1631052776515_update_permission_user_public_table_relatedjobs/up.yaml b/hasura/migrations_backup/1631052776515_update_permission_user_public_table_relatedjobs/up.yaml similarity index 100% rename from hasura/migrations/1631052776515_update_permission_user_public_table_relatedjobs/up.yaml rename to hasura/migrations_backup/1631052776515_update_permission_user_public_table_relatedjobs/up.yaml diff --git a/hasura/migrations/1631052784531_update_permission_user_public_table_relatedjobs/down.yaml b/hasura/migrations_backup/1631052784531_update_permission_user_public_table_relatedjobs/down.yaml similarity index 100% rename from hasura/migrations/1631052784531_update_permission_user_public_table_relatedjobs/down.yaml rename to hasura/migrations_backup/1631052784531_update_permission_user_public_table_relatedjobs/down.yaml diff --git a/hasura/migrations/1631052784531_update_permission_user_public_table_relatedjobs/up.yaml b/hasura/migrations_backup/1631052784531_update_permission_user_public_table_relatedjobs/up.yaml similarity index 100% rename from hasura/migrations/1631052784531_update_permission_user_public_table_relatedjobs/up.yaml rename to hasura/migrations_backup/1631052784531_update_permission_user_public_table_relatedjobs/up.yaml diff --git a/hasura/migrations/1631052794082_update_permission_user_public_table_relatedjobs/down.yaml b/hasura/migrations_backup/1631052794082_update_permission_user_public_table_relatedjobs/down.yaml similarity index 100% rename from hasura/migrations/1631052794082_update_permission_user_public_table_relatedjobs/down.yaml rename to hasura/migrations_backup/1631052794082_update_permission_user_public_table_relatedjobs/down.yaml diff --git a/hasura/migrations/1631052794082_update_permission_user_public_table_relatedjobs/up.yaml b/hasura/migrations_backup/1631052794082_update_permission_user_public_table_relatedjobs/up.yaml similarity index 100% rename from hasura/migrations/1631052794082_update_permission_user_public_table_relatedjobs/up.yaml rename to hasura/migrations_backup/1631052794082_update_permission_user_public_table_relatedjobs/up.yaml diff --git a/hasura/migrations/1631056626995_update_permission_user_public_table_relatedjobs/down.yaml b/hasura/migrations_backup/1631056626995_update_permission_user_public_table_relatedjobs/down.yaml similarity index 100% rename from hasura/migrations/1631056626995_update_permission_user_public_table_relatedjobs/down.yaml rename to hasura/migrations_backup/1631056626995_update_permission_user_public_table_relatedjobs/down.yaml diff --git a/hasura/migrations/1631056626995_update_permission_user_public_table_relatedjobs/up.yaml b/hasura/migrations_backup/1631056626995_update_permission_user_public_table_relatedjobs/up.yaml similarity index 100% rename from hasura/migrations/1631056626995_update_permission_user_public_table_relatedjobs/up.yaml rename to hasura/migrations_backup/1631056626995_update_permission_user_public_table_relatedjobs/up.yaml diff --git a/hasura/migrations_backup/1632265756746_run_sql_migration/down.yaml b/hasura/migrations_backup/1632265756746_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations_backup/1632265756746_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1632265756746_run_sql_migration/up.yaml b/hasura/migrations_backup/1632265756746_run_sql_migration/up.yaml similarity index 100% rename from hasura/migrations/1632265756746_run_sql_migration/up.yaml rename to hasura/migrations_backup/1632265756746_run_sql_migration/up.yaml diff --git a/hasura/migrations_backup/1632265816135_run_sql_migration/down.yaml b/hasura/migrations_backup/1632265816135_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations_backup/1632265816135_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1632265816135_run_sql_migration/up.yaml b/hasura/migrations_backup/1632265816135_run_sql_migration/up.yaml similarity index 100% rename from hasura/migrations/1632265816135_run_sql_migration/up.yaml rename to hasura/migrations_backup/1632265816135_run_sql_migration/up.yaml diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations_backup/metadata.yaml similarity index 100% rename from hasura/migrations/metadata.yaml rename to hasura/migrations_backup/metadata.yaml From 1e30642d28ba35e6928bbceeca2036f61261ebad Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 27 Sep 2021 09:49:08 -0700 Subject: [PATCH 07/21] Package updates for Tracker. --- client/package.json | 12 +- client/yarn.lock | 528 ++++++++++++++++++++++---------------------- 2 files changed, 265 insertions(+), 275 deletions(-) diff --git a/client/package.json b/client/package.json index 9dcddf8ef..fdecd814e 100644 --- a/client/package.json +++ b/client/package.json @@ -4,12 +4,12 @@ "private": true, "proxy": "http://localhost:5000", "dependencies": { - "@apollo/client": "^3.4.13", + "@apollo/client": "^3.4.14", "@craco/craco": "^6.3.0", "@fingerprintjs/fingerprintjs": "^3.3.0", "@lourenci/react-kanban": "^2.1.0", - "@openreplay/tracker": "^3.3.1", - "@openreplay/tracker-assist": "^3.1.1", + "@openreplay/tracker": "^3.4.0", + "@openreplay/tracker-assist": "^3.4.0", "@openreplay/tracker-graphql": "^3.0.0", "@openreplay/tracker-redux": "^3.0.0", "@sentry/react": "^6.13.2", @@ -26,15 +26,15 @@ "enquire-js": "^0.2.1", "env-cmd": "^10.1.0", "exifr": "^7.1.3", - "firebase": "^9.0.2", + "firebase": "^9.1.0", "graphql": "^15.6.0", - "i18next": "^21.0.2", + "i18next": "^21.1.1", "i18next-browser-languagedetector": "^6.1.2", "jsoneditor": "^9.5.6", "jsreport-browser-client-dist": "^1.3.0", "libphonenumber-js": "^1.9.34", "logrocket": "^2.0.0", - "markerjs2": "^2.11.2", + "markerjs2": "^2.12.0", "moment-business-days": "^1.2.0", "phone": "^3.1.8", "preval.macro": "^5.0.0", diff --git a/client/yarn.lock b/client/yarn.lock index 3f4067a21..2640dbc1b 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -36,10 +36,10 @@ lodash "^4.17.21" resize-observer-polyfill "^1.5.0" -"@apollo/client@^3.4.13": - version "3.4.13" - resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.4.13.tgz#81670c27b376e80e3845ecf6468e534d908fa5b5" - integrity sha512-/nH8z/0X6WJ+wtUREHTlKQGX4lo6u3XkF1hy+k4eCxLZzT5+VRw1rm92iIkj1H85vep/eE/KV3DdRq1x3t9NnQ== +"@apollo/client@^3.4.14": + version "3.4.14" + resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.4.14.tgz#069adcaef53d96c84eea5c0022efeace5cd09afb" + integrity sha512-9yrxbPwQbQ3n/+TeOGtalrf8mT4XyOcBBDlRPWC1E5JJp5exrl9n2GIgrUvd2KsVZLUT876kUJY3zfyyjW5Udg== dependencies: "@graphql-typed-document-node/core" "^3.0.0" "@wry/context" "^0.6.0" @@ -1330,15 +1330,15 @@ dependencies: tslib "^2.0.1" -"@firebase/analytics-compat@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@firebase/analytics-compat/-/analytics-compat-0.1.1.tgz#77a3e5d28f15df303c3836db4740a43955fcfcac" - integrity sha512-pMTrA8cxMXFRv7bwZEXXz0NCepnyH2Jay/32RZ7xAufij2VJhF5S1BtfCO0wuri3FB94rlM8SmSEbwxxHcAtVg== +"@firebase/analytics-compat@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@firebase/analytics-compat/-/analytics-compat-0.1.2.tgz#db115aabf1b30b43567e45cca86f3856aafb93b4" + integrity sha512-TpWpz0s8EgVt9aqyOCFktONqVkjyrNRR4esn3cEYrueH+XXSMDLWY9oFHuUJzntcoEOlOBWMvpsJCPG/1kthkg== dependencies: - "@firebase/analytics" "0.7.0" + "@firebase/analytics" "0.7.1" "@firebase/analytics-types" "0.7.0" - "@firebase/component" "0.5.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/analytics-types@0.7.0": @@ -1346,26 +1346,26 @@ resolved "https://registry.yarnpkg.com/@firebase/analytics-types/-/analytics-types-0.7.0.tgz#91960e7c87ce8bf18cf8dd9e55ccbf5dc3989b5d" integrity sha512-DNE2Waiwy5+zZnCfintkDtBfaW6MjIG883474v6Z0K1XZIvl76cLND4iv0YUb48leyF+PJK1KO2XrgHb/KpmhQ== -"@firebase/analytics@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.7.0.tgz#7f4450936a2cac3227cc6439130c09b9a0a7d83e" - integrity sha512-YEPyeW6CV8xbIvWaJMvfRdWUPKe/xchJ1bjV6GpLfkYRX+ZE1/YSNU14pX292M4bZ6Qg+bbu2DuWp8fEpa/YQg== +"@firebase/analytics@0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.7.1.tgz#e95cf81ffc748fc73422eed081d4dd8e1e5f1e0c" + integrity sha512-fTUN47UK4obzIJwmgLMJU46dWZ7pzitCEO+80pQZC7mdLlVs/NW0+tMf6rETwMpKjGSgb25cKidpgEuioQtT7w== dependencies: - "@firebase/component" "0.5.6" - "@firebase/installations" "0.5.0" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/installations" "0.5.1" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" -"@firebase/app-check-compat@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@firebase/app-check-compat/-/app-check-compat-0.1.1.tgz#84c7ef29bb683fd3dea66a66f82b799474c904ee" - integrity sha512-XTV5Ns0Lpwn5GgXV5T0soOkoOGACaw9xiNvAXcISQYFBIse0k7fKo8V5J9VUS1ppzGpyTRCg0m9efz4CNrwPyQ== +"@firebase/app-check-compat@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@firebase/app-check-compat/-/app-check-compat-0.1.2.tgz#1e5480a9f83c1cec814b3a11032a797b1a50eaec" + integrity sha512-JB+OHk4Cp9ZgT+UfX0A+lwH1AoM5Y2X1rDhmhCsEXcKKwz1w9DpL9PjStciP8UYg1dpqbp5p9OMxmty+21EBsA== dependencies: - "@firebase/app-check" "0.4.0" - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/app-check" "0.4.1" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/app-check-interop-types@0.1.0": @@ -1373,25 +1373,25 @@ resolved "https://registry.yarnpkg.com/@firebase/app-check-interop-types/-/app-check-interop-types-0.1.0.tgz#83afd9d41f99166c2bdb2d824e5032e9edd8fe53" integrity sha512-uZfn9s4uuRsaX5Lwx+gFP3B6YsyOKUE+Rqa6z9ojT4VSRAsZFko9FRn6OxQUA1z5t5d08fY4pf+/+Dkd5wbdbA== -"@firebase/app-check@0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@firebase/app-check/-/app-check-0.4.0.tgz#a048fc396b2a97ef8eba77fe909efbff07a5c75c" - integrity sha512-KQ/k8cukzZbH/LC9Iu5/Dbhr7w6byu8bYjfCA38B6v8aISgASYfP/nirxRD+hSuDoxXtAnPGEuv+v0YU3D1R2w== +"@firebase/app-check@0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@firebase/app-check/-/app-check-0.4.1.tgz#60e329b3871574a0431536edca69e0d0a8cbd674" + integrity sha512-Kpqh0Y2zpx+acTL7eOVYIWBOmAwoconJpqOAlByGNXuxm/ccP00XREo+HsqaC7wapZRXh+h8BK0jZjvdV36qow== dependencies: - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" -"@firebase/app-compat@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@firebase/app-compat/-/app-compat-0.1.1.tgz#47d5f5ac350f59ea4b721f17e01b1e46a1a3154a" - integrity sha512-AoUO7PnQlDPyMAvAE972kBhrwXRZRLGdHM8obyIeTzPNqIiEoULD4Rdq5TBB4UmV2HYAlYdrS+dk4nuWx67w6A== +"@firebase/app-compat@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@firebase/app-compat/-/app-compat-0.1.2.tgz#ed9682325bbec6e177449f4b7403c60b088c89db" + integrity sha512-kF1maoqA8bZqJ4v/ojVvA7kIyyXEPkJmL48otGrC8LIgdcen7xCx3JFDe0DGeQywg+qujvdkJz/TptFN1cvAgw== dependencies: - "@firebase/app" "0.7.0" - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/app" "0.7.1" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/app-types@0.7.0": @@ -1399,26 +1399,26 @@ resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.7.0.tgz#c9e16d1b8bed1a991840b8d2a725fb58d0b5899f" integrity sha512-6fbHQwDv2jp/v6bXhBw2eSRbNBpxHcd1NBF864UksSMVIqIyri9qpJB1Mn6sGZE+bnDsSQBC5j2TbMxYsJQkQg== -"@firebase/app@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.7.0.tgz#989e9f354951de2a8ac806f6e3fa0afd9f80b470" - integrity sha512-l4Pd69re6JyjumQrl719dnY5JSKROSYda/0N2wzOhSzqg8DsZOIErr8+xj6QAE6BtNsoIEk7ma9WMS/2r02MhA== +"@firebase/app@0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.7.1.tgz#b594ac4cd15bf94d2a3b97681354a52fa5cfca29" + integrity sha512-B4z6E1EPQc0mOjF35IPKdDRCFnT/fNQIHfM+v7F9obB7ItPhGILK3LxaQfuampSQpF6GG6TPFDbrWK6myXAq+g== dependencies: - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" -"@firebase/auth-compat@0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@firebase/auth-compat/-/auth-compat-0.1.2.tgz#a971cb7859eb4d45c233043bea102993376d9fca" - integrity sha512-0eqWSV4XoyOltT4HVJUzh8hBFNO5f78ZGDplRQImQ97/6wR45x6Q/9R19KTWOd109+3Axw6Orfq2cSNY0opgEA== +"@firebase/auth-compat@0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@firebase/auth-compat/-/auth-compat-0.1.3.tgz#0110398e665e7b709dfbb81ab9410f58e3d1a98d" + integrity sha512-eDDtY5If+ERJxalt+plvX6avZspuwo4/kPXssvV+csm414awhDzQBtSDPDajgbH3YB9V+O3LAFHeWcP3rrHS5w== dependencies: - "@firebase/auth" "0.17.2" + "@firebase/auth" "0.18.0" "@firebase/auth-types" "0.11.0" - "@firebase/component" "0.5.6" - "@firebase/util" "1.3.0" - node-fetch "2.6.1" + "@firebase/component" "0.5.7" + "@firebase/util" "1.4.0" + node-fetch "2.6.2" selenium-webdriver "^4.0.0-beta.2" tslib "^2.1.0" @@ -1432,67 +1432,67 @@ resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.11.0.tgz#b9c73c60ca07945b3bbd7a097633e5f78fa9e886" integrity sha512-q7Bt6cx+ySj9elQHTsKulwk3+qDezhzRBFC9zlQ1BjgMueUOnGMcvqmU0zuKlQ4RhLSH7MNAdBV2znVaoN3Vxw== -"@firebase/auth@0.17.2": - version "0.17.2" - resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.17.2.tgz#54ad76cfdc2f6d1201fb780365cf7d362586f3c6" - integrity sha512-t1iHB5Eg7vAbyOEzMMarsyJNGiO2xP8Zag0hLRVXWVaWymXZnyVKp62sXqyonvz4eVT8+iGBjDySB9zKIb5Pqg== +"@firebase/auth@0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.18.0.tgz#00de488a43f84bd9b1e2f8e1d9887a499d30b93d" + integrity sha512-iK+VXkdDkum8SmJNgz9ZcOboRLrUN1VW7AHHkpZb76VJvoYRoCPD+A9O/v/ziI0LpwIZJwi1GFes9XjZTlfLiA== dependencies: - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" - node-fetch "2.6.1" - selenium-webdriver "4.0.0-beta.1" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" + node-fetch "2.6.2" + selenium-webdriver "4.0.0-rc-1" tslib "^2.1.0" -"@firebase/component@0.5.6": - version "0.5.6" - resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.5.6.tgz#6b7c7aff69866e0925721543a2ef5f47b0f97cbe" - integrity sha512-GyQJ+2lrhsDqeGgd1VdS7W+Y6gNYyI0B51ovNTxeZVG/W8I7t9MwEiCWsCvfm5wQgfsKp9dkzOcJrL5k8oVO/Q== +"@firebase/component@0.5.7": + version "0.5.7" + resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.5.7.tgz#a50c5fbd14a2136a99ade6f59f53498729c0f174" + integrity sha512-CiAHUPXh2hn/lpzMShNmfAxHNQhKQwmQUJSYMPCjf2bCCt4Z2vLGpS+UWEuNFm9Zf8LNmkS+Z+U/s4Obi5carg== dependencies: - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" -"@firebase/database-compat@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@firebase/database-compat/-/database-compat-0.1.0.tgz#f02abaa9f493fd14aaae6e2b34262bafc5d033c7" - integrity sha512-jLN0JMYnYijg8f3QFtSuPGNuKAt3yYVRsHHlR8sADgx8MptByRRwVmMOk7QPc/DY7qscZIJow3hXFwvbeApFLA== +"@firebase/database-compat@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@firebase/database-compat/-/database-compat-0.1.1.tgz#9fe69e3bd3f71d29011bb6ca793f38edb65ca536" + integrity sha512-K3DFWiw0YkLZtlfA9TOGPw6zVXKu5dQ1XqIGztUufFVRYW8IizReXVxzSSmJNR4Adr2LiU9j66Wenc6e5UfwaQ== dependencies: - "@firebase/component" "0.5.6" - "@firebase/database" "0.12.0" - "@firebase/database-types" "0.9.0" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/database" "0.12.1" + "@firebase/database-types" "0.9.1" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" -"@firebase/database-types@0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.9.0.tgz#dad3db745531f40b60f7726a76b2bf6bbf6c6471" - integrity sha512-x2TeTVnMZGPvT3y4Nayio4WprQA/zGwqMrPMQwSdF+PFnaFJAhA/eLgUB6cmWFzFYO9VvmuRkFzDzo6ezTo1Zw== +"@firebase/database-types@0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.9.1.tgz#0cab989e8154d812b535d80f23c1578b1d391f5f" + integrity sha512-RUixK/YrbpxbfdE+nYP0wMcEsz1xPTnafP0q3UlSS/+fW744OITKtR1J0cMRaXbvY7EH0wUVTNVkrtgxYY8IgQ== dependencies: "@firebase/app-types" "0.7.0" - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" -"@firebase/database@0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.12.0.tgz#2aa33138128cfcaf74388efe13e0eda10825d564" - integrity sha512-/gl6z6fAxAAFAdDllzidzweGpuXJu0b9AusSLrdW4LpP6KCuxJbhonMJuSGpHLzAHzx6Q9uitbvqHqBb17sttQ== +"@firebase/database@0.12.1": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.12.1.tgz#7e43f27ac4057858d5bd0dd371b134b304fecdb0" + integrity sha512-Ethk0hc476qnkSKNBa+8Yc7iM8AO69HYWsaD+QUC983FZtnuMyNLHtEeSUbLQYvyHo7cOjcc52slop14WmfZeQ== dependencies: "@firebase/auth-interop-types" "0.1.6" - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" - faye-websocket "0.11.3" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" + faye-websocket "0.11.4" tslib "^2.1.0" -"@firebase/firestore-compat@0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@firebase/firestore-compat/-/firestore-compat-0.1.2.tgz#af9e28735376ee04c147ea3ac11b592b3f7a68ac" - integrity sha512-xtjj2qOBN0+S5KlXmWa5UozGmYJ1OAGBNT0qkCSvzQitHED5/B2fNwKnpy7Em+Zu3Yc3r/eM94OGx93USFXifg== +"@firebase/firestore-compat@0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@firebase/firestore-compat/-/firestore-compat-0.1.3.tgz#a898f6819b9d87134b5e09fcf9b2fb5bfc0ee68b" + integrity sha512-tO3uAkIguKeFeKPu99GR7F7v1/Hc8nV1h7B1kdpkVRRBe+NfVYA3qAUictQ3OAA0oy7Ae9z4SfEURO/R1b6YlQ== dependencies: - "@firebase/component" "0.5.6" - "@firebase/firestore" "3.0.2" + "@firebase/component" "0.5.7" + "@firebase/firestore" "3.1.0" "@firebase/firestore-types" "2.5.0" - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/firestore-types@2.5.0": @@ -1500,29 +1500,29 @@ resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-2.5.0.tgz#16fca40b6980fdb000de86042d7a96635f2bcdd7" integrity sha512-I6c2m1zUhZ5SH0cWPmINabDyH5w0PPFHk2UHsjBpKdZllzJZ2TwTkXbDtpHUZNmnc/zAa0WNMNMvcvbb/xJLKA== -"@firebase/firestore@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-3.0.2.tgz#594130bb125803b6e28611075c2f396f59ba8186" - integrity sha512-AWh1pugDifwCXHaQalZHp+Hr/3o+cxYvlbgQrPB35bh1A3do4I1xim/8Pba7gtpTzlClDryd5pK/XbK0TC/2kg== +"@firebase/firestore@3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-3.1.0.tgz#0a59e41f164b28116aca1a264acef0dbc8e5a585" + integrity sha512-vOXueHNRjlgBlKVCWuUDhr3dQW2hJwbcqcJaFiIV9V+PamfyhOHzX8pEQkrPort4YQQvoRmY9uiFhfOGj2hbeA== dependencies: - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" - "@firebase/webchannel-wrapper" "0.5.1" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" + "@firebase/webchannel-wrapper" "0.6.0" "@grpc/grpc-js" "^1.3.2" "@grpc/proto-loader" "^0.6.0" - node-fetch "2.6.1" + node-fetch "2.6.2" tslib "^2.1.0" -"@firebase/functions-compat@0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@firebase/functions-compat/-/functions-compat-0.1.2.tgz#557461ed4f2928747461c6b2d246ac328aea3248" - integrity sha512-eisJazUrqOL/pAZJPqamYiaAyV3ch6GQMx8Sso792tvRr8SFsNCFbN9eVun0U0ubWAON5qdLoruoc6npXg6FIg== +"@firebase/functions-compat@0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@firebase/functions-compat/-/functions-compat-0.1.3.tgz#19758884bf41752102bd0a420be2aa49ee2d45de" + integrity sha512-NdobePNq5LUHCI1dJHUGlOTw+Qmq/FJre981/ELEMBdEs95kmKwnXB2UaLjAQYWkgkr4YS3lEnNpsiSTaEHFCg== dependencies: - "@firebase/component" "0.5.6" - "@firebase/functions" "0.7.1" + "@firebase/component" "0.5.7" + "@firebase/functions" "0.7.2" "@firebase/functions-types" "0.5.0" - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/functions-types@0.5.0": @@ -1530,42 +1530,44 @@ resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.5.0.tgz#b50ba95ccce9e96f7cda453228ffe1684645625b" integrity sha512-qza0M5EwX+Ocrl1cYI14zoipUX4gI/Shwqv0C1nB864INAD42Dgv4v94BCyxGHBg2kzlWy8PNafdP7zPO8aJQA== -"@firebase/functions@0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.7.1.tgz#aa95aaed34649d0656d50df0ed21802f117cca88" - integrity sha512-F6XZVVBpqupCX7/YXpdzyXKYCeLVmHO/jxAKbN9I4B+c8doDqVtGkO23DPzf4ppzR4FuXDiKEEU9ZZ85kqZ1QA== +"@firebase/functions@0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.7.2.tgz#9628afb88c0c9d302969b4dd37f09010b18c43f4" + integrity sha512-B+b57xXtpsRYD3UgVtteeyavXjXfBTtuv+sG8LA0vgJs6bhORswVlKZQqpfW9SDxCMBwzzytzn1m3ZZGfUw2Lg== dependencies: "@firebase/app-check-interop-types" "0.1.0" "@firebase/auth-interop-types" "0.1.6" - "@firebase/component" "0.5.6" + "@firebase/component" "0.5.7" "@firebase/messaging-interop-types" "0.1.0" - "@firebase/util" "1.3.0" - node-fetch "2.6.1" + "@firebase/util" "1.4.0" + node-fetch "2.6.2" tslib "^2.1.0" -"@firebase/installations@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.5.0.tgz#4a21e1c7467795802b031af413df2555b17cf1b1" - integrity sha512-wF1CKIx+SoiEbtNdutulxW4z80B5lGXW+8JdAtcKQwgKxF0VtlCaDFsd9AEB3aTtzIve5UkGak8hQOMvvOpydg== +"@firebase/installations@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.5.1.tgz#3c515494fad8fba552ae0f01c675219e29e218e2" + integrity sha512-KZ1XHrEPmCx3Z70P9d8mHmYEZXA/uiLIkV0D8R45Q65c0DUxBDm5tSQs56QWofxB/wx16xmO3xAZw4BdJUBnlQ== dependencies: - "@firebase/component" "0.5.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/util" "1.4.0" idb "3.0.2" tslib "^2.1.0" -"@firebase/logger@0.2.6": - version "0.2.6" - resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.2.6.tgz#3aa2ca4fe10327cabf7808bd3994e88db26d7989" - integrity sha512-KIxcUvW/cRGWlzK9Vd2KB864HlUnCfdTH0taHE0sXW5Xl7+W68suaeau1oKNEqmc3l45azkd4NzXTCWZRZdXrw== - -"@firebase/messaging-compat@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@firebase/messaging-compat/-/messaging-compat-0.1.0.tgz#ab164540f6ba954c8d150b2e96dc6bf8c1536eb4" - integrity sha512-58qQmKwOiXhxZwrRwwjQDbjlRx1uMVVuV/DNbDzqilDJDdoYXMdK6RBTF9Bs51qy/Z1BI2Q9B1JX01QYlgZpxQ== +"@firebase/logger@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.3.0.tgz#a3992e40f62c10276dbfcb8b4ab376b7e25d7fd9" + integrity sha512-7oQ+TctqekfgZImWkKuda50JZfkmAKMgh5qY4aR4pwRyqZXuJXN1H/BKkHvN1y0S4XWtF0f/wiCLKHhyi1ppPA== dependencies: - "@firebase/component" "0.5.6" - "@firebase/messaging" "0.9.0" - "@firebase/util" "1.3.0" + tslib "^2.1.0" + +"@firebase/messaging-compat@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@firebase/messaging-compat/-/messaging-compat-0.1.1.tgz#aef5045cc30c781e33aa9030e26feca3f7aedda4" + integrity sha512-8FxrQjJCOfP9HibFsymT3qB18rBBmMPxOV+k0n6B7L6KW6Idswq01hMW12d93ZnvlNNKdikCKwUtBNbITBd8FA== + dependencies: + "@firebase/component" "0.5.7" + "@firebase/messaging" "0.9.1" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/messaging-interop-types@0.1.0": @@ -1573,28 +1575,28 @@ resolved "https://registry.yarnpkg.com/@firebase/messaging-interop-types/-/messaging-interop-types-0.1.0.tgz#bdac02dd31edd5cb9eec37b1db698ea5e2c1a631" integrity sha512-DbvUl/rXAZpQeKBnwz0NYY5OCqr2nFA0Bj28Fmr3NXGqR4PAkfTOHuQlVtLO1Nudo3q0HxAYLa68ZDAcuv2uKQ== -"@firebase/messaging@0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.9.0.tgz#a868bea75d0c26210903178cf22d31c47bc84584" - integrity sha512-NTUB+gVJsgL/f6wqwUlgadaNuLZvyk1IlTcRvR3391t8jDSWOT2efwzNqcI7Xv4nhzaiPhzAQ4ncH/m8kfUUXQ== +"@firebase/messaging@0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.9.1.tgz#4403dc5fdb2193818cecc359a4b31504c2cd5ac8" + integrity sha512-0g3JWTfkv0WHnu4xgx1zcChJXU2dLjWT0e2MI13Q7NbP3TgLu5CgQ/H/lad16j4Zb4RNqZbAUJurEAB6v2BJ/w== dependencies: - "@firebase/component" "0.5.6" - "@firebase/installations" "0.5.0" + "@firebase/component" "0.5.7" + "@firebase/installations" "0.5.1" "@firebase/messaging-interop-types" "0.1.0" - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" idb "3.0.2" tslib "^2.1.0" -"@firebase/performance-compat@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@firebase/performance-compat/-/performance-compat-0.1.0.tgz#c1edeccd9b60d83de26d8e645e0d2ddd64e9a2d7" - integrity sha512-H+/A5+y/15hFn5FHRP8lcogDzO6qm9YoACNEXn71UN4PiGQ+/BbHkQafDEXxD6wLfqfqR8u8oclHPFIYxMBF7Q== +"@firebase/performance-compat@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@firebase/performance-compat/-/performance-compat-0.1.1.tgz#c895aaa57a08b3b9be035de764ccad4b02cb4e52" + integrity sha512-xN/TjU0hVNiJshZzrUvPYB+3sPS9SgaWrfxh3p0eGFVdwHp/3Z8HlT772bkHAEKXVc64v19ktpUVd+sF5aoJNQ== dependencies: - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/performance" "0.5.0" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/performance" "0.5.1" "@firebase/performance-types" "0.1.0" - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/performance-types@0.1.0": @@ -1602,15 +1604,15 @@ resolved "https://registry.yarnpkg.com/@firebase/performance-types/-/performance-types-0.1.0.tgz#5e6efa9dc81860aee2cb7121b39ae8fa137e69fc" integrity sha512-6p1HxrH0mpx+622Ql6fcxFxfkYSBpE3LSuwM7iTtYU2nw91Hj6THC8Bc8z4nboIq7WvgsT/kOTYVVZzCSlXl8w== -"@firebase/performance@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.5.0.tgz#cc237e65791c75dba856ace8971b94d7adcbc60b" - integrity sha512-E+L18eJKshr/ijnWZMexEEddwkp2T4Ye2dJSK4TcOKRYfrmfZJ95RRZ+MPNp1ES7RH2JYiyym1NIQKPcNNvhug== +"@firebase/performance@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.5.1.tgz#bb38ce1d98faba4e1c88530cc2af53cfecb58b7e" + integrity sha512-O93Yry8KhAaFrhnmBaMkM0lpgVmpd7CRX0eq1S0IKLdE3MdF+oAtbQiZG/NuRl3Vz8vjoz96R6bPbCWaDuiy8Q== dependencies: - "@firebase/component" "0.5.6" - "@firebase/installations" "0.5.0" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/installations" "0.5.1" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/polyfill@0.3.36": @@ -1622,16 +1624,16 @@ promise-polyfill "8.1.3" whatwg-fetch "2.0.4" -"@firebase/remote-config-compat@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@firebase/remote-config-compat/-/remote-config-compat-0.1.0.tgz#8eb2582d1909dd4d5023383e43d73ad605d56daa" - integrity sha512-PpCh5f5hUUaDCmiJsuu/u9a0g0G5WH3YSbfH1jPejVOaJ1lS82615E7WOzco4zMllLYfX62VaUYD2vvcLyXE/w== +"@firebase/remote-config-compat@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@firebase/remote-config-compat/-/remote-config-compat-0.1.1.tgz#8ff028e53b1f0b6c482257a5da371c7dea9928d3" + integrity sha512-ZHRHYTdDztXHxgYXzuuD6Goa6ScmAqtctXl2eC6D8vxA8fIGRQKHN+9AMwxm8b3JHzdVY/5XhAOmKCcFvPOgtw== dependencies: - "@firebase/component" "0.5.6" - "@firebase/logger" "0.2.6" - "@firebase/remote-config" "0.2.0" + "@firebase/component" "0.5.7" + "@firebase/logger" "0.3.0" + "@firebase/remote-config" "0.3.0" "@firebase/remote-config-types" "0.2.0" - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/remote-config-types@0.2.0": @@ -1639,26 +1641,26 @@ resolved "https://registry.yarnpkg.com/@firebase/remote-config-types/-/remote-config-types-0.2.0.tgz#1e2759fc01f20b58c564db42196f075844c3d1fd" integrity sha512-hqK5sCPeZvcHQ1D6VjJZdW6EexLTXNMJfPdTwbD8NrXUw6UjWC4KWhLK/TSlL0QPsQtcKRkaaoP+9QCgKfMFPw== -"@firebase/remote-config@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.2.0.tgz#aa2bd7b34e0e40a259c3f0409a5084864f234f0f" - integrity sha512-hNZ+BqsTmfe8ogpeow95NSwQmKIeetKdPxKpyC6RZBeFUae782+2HrUx4/Quep6OZjOHQF6xZ5d3VOxu2ZKEfg== +"@firebase/remote-config@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.3.0.tgz#43faf34eeb7407f7660eeca2790ccab25f76903d" + integrity sha512-Yf9/iXToC6Kbec1yOQ9mdTc1MP0mR2VCCR/n3Q+Ol3U+PML+ePXfqWiL2VHrUA86BeB2hpXF1BcTxvD4uOiDnA== dependencies: - "@firebase/component" "0.5.6" - "@firebase/installations" "0.5.0" - "@firebase/logger" "0.2.6" - "@firebase/util" "1.3.0" + "@firebase/component" "0.5.7" + "@firebase/installations" "0.5.1" + "@firebase/logger" "0.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" -"@firebase/storage-compat@0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@firebase/storage-compat/-/storage-compat-0.1.2.tgz#98e6b3516a70799935618c32e6b8937370587929" - integrity sha512-eff0e2qcDX188mqr7aKrqr4TIS25/cE6E7Xo9WRLe3c17nqGgmrYM4DDS3VDttNbf1j5XaoEnZVZafE9/BR3Rg== +"@firebase/storage-compat@0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@firebase/storage-compat/-/storage-compat-0.1.3.tgz#74a579aac6dc6e2c8293c8bdebb93bbcff0e0da9" + integrity sha512-m2htGJjCFlTONsqYRKXTfzkux3nbhpIpd72RK2iPkRPE69nQ0wiVplIE7bCaq3CSFMbkI3ETOtTTfW1wrOpF2g== dependencies: - "@firebase/component" "0.5.6" - "@firebase/storage" "0.8.2" + "@firebase/component" "0.5.7" + "@firebase/storage" "0.8.3" "@firebase/storage-types" "0.6.0" - "@firebase/util" "1.3.0" + "@firebase/util" "1.4.0" tslib "^2.1.0" "@firebase/storage-types@0.6.0": @@ -1666,27 +1668,27 @@ resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.6.0.tgz#0b1af64a2965af46fca138e5b70700e9b7e6312a" integrity sha512-1LpWhcCb1ftpkP/akhzjzeFxgVefs6eMD2QeKiJJUGH1qOiows2w5o0sKCUSQrvrRQS1lz3SFGvNR1Ck/gqxeA== -"@firebase/storage@0.8.2": - version "0.8.2" - resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.8.2.tgz#e08c05d070a468f0976a3d0cd32318655f0ae3b7" - integrity sha512-I9mVYhQ/DkWI1MKHhYvI4dnguXdXC50S5ryehOcR/JmSwyYjh1+T+IFQp0hHb1VWTixShzWoSGo1PhbrolFmIA== +"@firebase/storage@0.8.3": + version "0.8.3" + resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.8.3.tgz#49bdfb47a1b136eebf884e7343038d8f3437f08c" + integrity sha512-oraycQ787tEr6xu2Qc4nngLz1YEoEjZ+lrjThx0CJZB7VwdlkIJ24TkzJ9xoeWc+cpo34deg/If4w8AU5/WupQ== dependencies: - "@firebase/component" "0.5.6" - "@firebase/util" "1.3.0" - node-fetch "2.6.1" + "@firebase/component" "0.5.7" + "@firebase/util" "1.4.0" + node-fetch "2.6.2" tslib "^2.1.0" -"@firebase/util@1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@firebase/util/-/util-1.3.0.tgz#e71113bdd5073e9736ceca665b54d9f6df232b20" - integrity sha512-SESvmYwuKOVCZ1ZxLbberbx+9cnbxpCa4CG2FUSQYqN6Ab8KyltegMDIsqMw5KyIBZ4n1phfHoOa22xo5NzAlQ== +"@firebase/util@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@firebase/util/-/util-1.4.0.tgz#81e985adba44b4d1f21ec9f5af9628d505891de8" + integrity sha512-Qn58d+DVi1nGn0bA9RV89zkz0zcbt6aUcRdyiuub/SuEvjKYstWmHcHwh1C0qmE1wPf9a3a+AuaRtduaGaRT7A== dependencies: tslib "^2.1.0" -"@firebase/webchannel-wrapper@0.5.1": - version "0.5.1" - resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.5.1.tgz#a64d1af3c62e3bb89576ec58af880980a562bf4e" - integrity sha512-dZMzN0uAjwJXWYYAcnxIwXqRTZw3o14hGe7O6uhwjD1ZQWPVYA5lASgnNskEBra0knVBsOXB4KXg+HnlKewN/A== +"@firebase/webchannel-wrapper@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.6.0.tgz#e18ea901c84917f8dadd0185048a9d00573fe595" + integrity sha512-Pz4+7HPzKvOFI1ICQ6pyUv/VgStEWq9IGiVaaV1cQLi66NIA1mD5INnY4CDNoVAxlkuZvDEUZ+cVHLQ8iwA2hQ== "@gar/promisify@^1.0.1": version "1.1.2" @@ -2003,10 +2005,10 @@ mkdirp "^1.0.4" rimraf "^3.0.2" -"@openreplay/tracker-assist@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@openreplay/tracker-assist/-/tracker-assist-3.1.1.tgz#32bbadbeb17928b368baf6956d8ee27e380ec77f" - integrity sha512-jOei1oEio88NqyPgsE2keRIB0lYhbBxKsJdEn0mhnacZ0dvGcoThHg4pdvq9qQnX+VZciJWbskXL0A56dvfuVg== +"@openreplay/tracker-assist@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@openreplay/tracker-assist/-/tracker-assist-3.4.0.tgz#93a5e5314b3af55c23979cfe654e7617f76844af" + integrity sha512-tKxb0FuUmSo76gH7fBeZ+KYj+G7nDe0N8Ii7dwPCmljfi+0gCXNEtju1+ioQM1XVlT0IWl3a3/JUBvE5MXLEAA== dependencies: npm-dragndrop "^1.2.0" peerjs "^1.3.2" @@ -2021,10 +2023,10 @@ resolved "https://registry.yarnpkg.com/@openreplay/tracker-redux/-/tracker-redux-3.0.0.tgz#7d71c8d2b58b08229e6af2c677d53980cee0b9ef" integrity sha512-ctybOquoDj8QNj82pETftgXjEoAzwEoKSxIhwstJaUv5xUkBVv0rDIjMBgCSys8cB/vbRkI/QhvksDaFr9hY0g== -"@openreplay/tracker@^3.3.1": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@openreplay/tracker/-/tracker-3.3.1.tgz#a95afb6c95d52ff8a81f97f0eafb03c4b1464d9b" - integrity sha512-6R2l7t75jeNJnFhbh46pOfKLRqiroRDMs9xiShpq8AFuY7/zfIIgWobbNTu17XYC3h4r95HcTQ4eSr/vyA/baQ== +"@openreplay/tracker@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@openreplay/tracker/-/tracker-3.4.0.tgz#ad53936b501d98b365b1252b3388c8466c6cac90" + integrity sha512-i4Lv4c5097gLCRAr9ZuU0mWEmQYWL6W+y2AlF1oqLCdzmYFvsRKSpSa/ytS7iPNRbJRSfau7BTZoeUvLU/ugeA== dependencies: "@medv/finder" "^2.0.0" error-stack-parser "^2.0.6" @@ -6232,14 +6234,7 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -faye-websocket@0.11.3: - version "0.11.3" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.3.tgz#5c0e9a8968e8912c286639fde977a8b209f2508e" - integrity sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA== - dependencies: - websocket-driver ">=0.5.1" - -faye-websocket@^0.11.3: +faye-websocket@0.11.4, faye-websocket@^0.11.3: version "0.11.4" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== @@ -6372,37 +6367,37 @@ find-yarn-workspace-root@^2.0.0: dependencies: micromatch "^4.0.2" -firebase@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/firebase/-/firebase-9.0.2.tgz#092019326f1c9a67ec00ec78d50f80244581c705" - integrity sha512-+wdsD3Sk3fOgplzv4yzBmJ3Pdr01QiFF38Zq+8hzd+Dv6ZKMrgiq5CRljCaWenhZ/j8nuvHlq82u64ZARaXC+w== +firebase@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/firebase/-/firebase-9.1.0.tgz#f284634ae4f4e7c789ff36494f4534cba5dffbf2" + integrity sha512-Pj9/FwNzT4pdSS6vpXZzm4mFscI73N+AH70gaWZPnZrQBvyMAPTuKXXscjrFePPlqs94b4Emq+2mSwLGcwod/A== dependencies: - "@firebase/analytics" "0.7.0" - "@firebase/analytics-compat" "0.1.1" - "@firebase/app" "0.7.0" - "@firebase/app-check" "0.4.0" - "@firebase/app-check-compat" "0.1.1" - "@firebase/app-compat" "0.1.1" + "@firebase/analytics" "0.7.1" + "@firebase/analytics-compat" "0.1.2" + "@firebase/app" "0.7.1" + "@firebase/app-check" "0.4.1" + "@firebase/app-check-compat" "0.1.2" + "@firebase/app-compat" "0.1.2" "@firebase/app-types" "0.7.0" - "@firebase/auth" "0.17.2" - "@firebase/auth-compat" "0.1.2" - "@firebase/database" "0.12.0" - "@firebase/database-compat" "0.1.0" - "@firebase/firestore" "3.0.2" - "@firebase/firestore-compat" "0.1.2" - "@firebase/functions" "0.7.1" - "@firebase/functions-compat" "0.1.2" - "@firebase/installations" "0.5.0" - "@firebase/messaging" "0.9.0" - "@firebase/messaging-compat" "0.1.0" - "@firebase/performance" "0.5.0" - "@firebase/performance-compat" "0.1.0" + "@firebase/auth" "0.18.0" + "@firebase/auth-compat" "0.1.3" + "@firebase/database" "0.12.1" + "@firebase/database-compat" "0.1.1" + "@firebase/firestore" "3.1.0" + "@firebase/firestore-compat" "0.1.3" + "@firebase/functions" "0.7.2" + "@firebase/functions-compat" "0.1.3" + "@firebase/installations" "0.5.1" + "@firebase/messaging" "0.9.1" + "@firebase/messaging-compat" "0.1.1" + "@firebase/performance" "0.5.1" + "@firebase/performance-compat" "0.1.1" "@firebase/polyfill" "0.3.36" - "@firebase/remote-config" "0.2.0" - "@firebase/remote-config-compat" "0.1.0" - "@firebase/storage" "0.8.2" - "@firebase/storage-compat" "0.1.2" - "@firebase/util" "1.3.0" + "@firebase/remote-config" "0.3.0" + "@firebase/remote-config-compat" "0.1.1" + "@firebase/storage" "0.8.3" + "@firebase/storage-compat" "0.1.3" + "@firebase/util" "1.4.0" flat-cache@^3.0.4: version "3.0.4" @@ -7093,10 +7088,10 @@ i18next-browser-languagedetector@^6.1.2: dependencies: "@babel/runtime" "^7.14.6" -i18next@^21.0.2: - version "21.0.2" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.0.2.tgz#a394cbd0cc1879a9ad7a4a979a222d12033022cc" - integrity sha512-cSjRitffS1xm90YgPFTaqut89Y4Oc2i4aiCmAuhxHPryYdKzSIGl1YSv8PzlW+UPFOKRIUCOYZ5Rn+aUXKq/qQ== +i18next@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.1.1.tgz#e7569de4d9fea2972c28ca4c334d13799b94ce76" + integrity sha512-oBEi+3MI/jEv0DifAmA+e47WAS55Sv6yG2CmZ0Kpz/VGu8rTQARJGRkwhMcLhcIi+JYmxmfBD/DQ/7Ho3FYryw== dependencies: "@babel/runtime" "^7.12.0" @@ -8376,7 +8371,7 @@ jsreport-browser-client-dist@^1.3.0: array-includes "^3.1.2" object.assign "^4.1.2" -jszip@^3.5.0, jszip@^3.6.0: +jszip@^3.6.0: version "3.7.1" resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.7.1.tgz#bd63401221c15625a1228c556ca8a68da6fda3d9" integrity sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg== @@ -8740,10 +8735,10 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -markerjs2@^2.11.2: - version "2.11.2" - resolved "https://registry.yarnpkg.com/markerjs2/-/markerjs2-2.11.2.tgz#5c6d400e02ca6ef7d44d61f7153908e6bf55027a" - integrity sha512-Y/Cb8iD9x+33QHM1O6xYINUDxaoGvjYnszx46hIHUJTCWopMWOjy9QY+ZWUgbPBJs23jFt7/lOkZddvDDYjd0g== +markerjs2@^2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/markerjs2/-/markerjs2-2.12.0.tgz#07cd918d9185991e219c16b54fd66020d58a34ea" + integrity sha512-7lo5HFA9ehHnyzii8QcvuZWqHpfI6KEIr5lmbFiaEvyA9uW2ZbyNuVzMR4rkgfyJuIvdITqNmyQbd5j8eZHWiQ== material-colors@^1.2.1: version "1.2.6" @@ -9156,7 +9151,12 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-fetch@2.6.1, node-fetch@^2.6.0: +node-fetch@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.2.tgz#986996818b73785e47b1965cc34eb093a1d464d0" + integrity sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA== + +node-fetch@^2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -12115,7 +12115,7 @@ rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rimraf@^2.5.4, rimraf@^2.6.3, rimraf@^2.7.1: +rimraf@^2.5.4, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -12334,17 +12334,7 @@ select-hose@^2.0.0: resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= -selenium-webdriver@4.0.0-beta.1: - version "4.0.0-beta.1" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-beta.1.tgz#db645b0d775f26e4e12235db05796a1bc1e7efda" - integrity sha512-DJ10z6Yk+ZBaLrt1CLElytQ/FOayx29ANKDtmtyW1A6kCJx3+dsc5fFMOZxwzukDniyYsC3OObT5pUAsgkjpxQ== - dependencies: - jszip "^3.5.0" - rimraf "^2.7.1" - tmp "^0.2.1" - ws "^7.3.1" - -selenium-webdriver@^4.0.0-beta.2: +selenium-webdriver@4.0.0-rc-1, selenium-webdriver@^4.0.0-beta.2: version "4.0.0-rc-1" resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-rc-1.tgz#b1e7e5821298c8a071e988518dd6b759f0c41281" integrity sha512-bcrwFPRax8fifRP60p7xkWDGSJJoMkPAzufMlk5K2NyLPht/YZzR2WcIk1+3gR8VOCLlst1P2PI+MXACaFzpIw== @@ -14522,7 +14512,7 @@ ws@>=7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.1.tgz#bdd92b3c56fdb47d2379b5ae534281922cc5bd12" integrity sha512-XkgWpJU3sHU7gX8f13NqTn6KQ85bd1WU7noBHTT8fSohx7OS1TPY8k+cyRPCzFkia7C4mM229yeHr1qK9sM4JQ== -"ws@^5.2.0 || ^6.0.0 || ^7.0.0", ws@^7.3.1, ws@^7.4.6: +"ws@^5.2.0 || ^6.0.0 || ^7.0.0", ws@^7.4.6: version "7.5.4" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.4.tgz#56bfa20b167427e138a7795de68d134fe92e21f9" integrity sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg== From aa69fef9ba08ce415ba1bcc3c31515a3ea2569db Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 27 Sep 2021 10:22:47 -0700 Subject: [PATCH 08/21] IO-1379 Updated CSI key for actions menu --- .../jobs-detail-header-actions.csi.component.jsx | 2 +- client/src/utils/TemplateConstants.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx index c205e3088..b603fb31a 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.csi.component.jsx @@ -104,7 +104,7 @@ export function JobsDetailHeaderCsi({ replyTo: bodyshop.email, }, template: { - name: TemplateList("job").csi_invitation.key, + name: TemplateList("job_special").csi_invitation_action.key, variables: { id: result.data.insert_csi.returning[0].id, }, diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 8799a87ef..72edb6ac4 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -370,6 +370,13 @@ export const TemplateList = (type, context) => { key: "special_thirdpartypayer", disabled: false, }, + csi_invitation_action: { + title: i18n.t("printcenter.jobs.csi_invitation_action"), + description: "CSI invite", + key: "csi_invitation_action", + subject: i18n.t("printcenter.jobs.csi_invitation_action"), + disabled: false, + }, } : {}), ...(!type || type === "appointment" From 545db54c145e2b4d39f74d0f5ae873e9f36693e3 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 27 Sep 2021 10:36:12 -0700 Subject: [PATCH 09/21] IO-653 IO-654 Add SGI documents & regions filtering on print center. --- bodyshop_translations.babel | 63 +++++++++++++++++++ .../print-center-jobs.component.jsx | 17 +++-- client/src/translations/en_us/common.json | 3 + client/src/translations/es/common.json | 3 + client/src/translations/fr/common.json | 3 + client/src/utils/TemplateConstants.js | 22 +++++++ 6 files changed, 106 insertions(+), 5 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index e4549e29b..73624e110 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -32596,6 +32596,27 @@
+ + csi_invitation_action + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diagnostic_authorization false @@ -33226,6 +33247,48 @@ + + sgi_certificate_of_repairs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + sgi_windshield_auth + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + stolen_recovery_checklist false diff --git a/client/src/components/print-center-jobs/print-center-jobs.component.jsx b/client/src/components/print-center-jobs/print-center-jobs.component.jsx index bf641ae74..7773a89df 100644 --- a/client/src/components/print-center-jobs/print-center-jobs.component.jsx +++ b/client/src/components/print-center-jobs/print-center-jobs.component.jsx @@ -1,28 +1,35 @@ import { Card, Col, Input, Row, Space, Typography } from "antd"; import _ from "lodash"; import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectPrintCenter } from "../../redux/modals/modals.selectors"; +import { selectBodyshop } from "../../redux/user/user.selectors"; import { TemplateList } from "../../utils/TemplateConstants"; import Jobd3RdPartyModal from "../job-3rd-party-modal/job-3rd-party-modal.component"; import PrintCenterItem from "../print-center-item/print-center-item.component"; import PrintCenterSpeedPrint from "../print-center-speed-print/print-center-speed-print.component"; -import { useTranslation } from "react-i18next"; const mapStateToProps = createStructuredSelector({ printCenterModal: selectPrintCenter, + bodyshop: selectBodyshop, }); const mapDispatchToProps = (dispatch) => ({}); -export function PrintCenterJobsComponent({ printCenterModal }) { +export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) { const [search, setSearch] = useState(""); const { id: jobId } = printCenterModal.context; const tempList = TemplateList("job", {}); const { t } = useTranslation(); - const JobsReportsList = Object.keys(tempList).map((key) => { - return tempList[key]; - }); + const JobsReportsList = Object.keys(tempList) + .map((key) => { + return tempList[key]; + }) + .filter( + (temp) => + !temp.regions || (temp.regions && temp.regions[bodyshop.region_config]) + ); const filteredJobsReportsList = search !== "" diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index c2775a5b3..533efd873 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1953,6 +1953,7 @@ "coversheet_landscape": "Coversheet (Landscape)", "coversheet_portrait": "Coversheet Portrait", "csi_invitation": "CSI Invitation", + "csi_invitation_action": "CSI Invite", "diagnostic_authorization": "Diagnostic Authorization", "estimate": "Estimate Only", "estimate_detail": "Estimate Details", @@ -1983,6 +1984,8 @@ "qc_sheet": "Quality Control Sheet", "ro_totals": "RO Totals", "ro_with_description": "RO Summary with Descriptions", + "sgi_certificate_of_repairs": "SGI - Certificate of Repairs", + "sgi_windshield_auth": "SGI - Windshield Authorization", "stolen_recovery_checklist": "Stolen Recovery Checklist", "supplement_request": "Supplement Request", "thank_you_ro": "Thank You Letter", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 3c258ddb2..69c67002b 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1953,6 +1953,7 @@ "coversheet_landscape": "", "coversheet_portrait": "", "csi_invitation": "", + "csi_invitation_action": "", "diagnostic_authorization": "", "estimate": "", "estimate_detail": "", @@ -1983,6 +1984,8 @@ "qc_sheet": "", "ro_totals": "", "ro_with_description": "", + "sgi_certificate_of_repairs": "", + "sgi_windshield_auth": "", "stolen_recovery_checklist": "", "supplement_request": "", "thank_you_ro": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 272c43393..6f31d9b24 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1953,6 +1953,7 @@ "coversheet_landscape": "", "coversheet_portrait": "", "csi_invitation": "", + "csi_invitation_action": "", "diagnostic_authorization": "", "estimate": "", "estimate_detail": "", @@ -1983,6 +1984,8 @@ "qc_sheet": "", "ro_totals": "", "ro_with_description": "", + "sgi_certificate_of_repairs": "", + "sgi_windshield_auth": "", "stolen_recovery_checklist": "", "supplement_request": "", "thank_you_ro": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 72edb6ac4..941941f28 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -352,6 +352,28 @@ export const TemplateList = (type, context) => { disabled: false, group: "ro", }, + sgi_certificate_of_repairs: { + title: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"), + description: "Thank You Letter by RO", + key: "sgi_certificate_of_repairs", + subject: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"), + disabled: false, + group: "ro", + regions: { + CA_SK: true, + }, + }, + sgi_windshield_auth: { + title: i18n.t("printcenter.jobs.sgi_windshield_auth"), + description: "Thank You Letter by RO", + key: "sgi_windshield_auth", + subject: i18n.t("printcenter.jobs.sgi_windshield_auth"), + disabled: false, + group: "pre", + regions: { + CA_SK: true, + }, + }, // parts_label_multi: { // title: i18n.t("printcenter.jobs.parts_label_multi"), // description: "Thank You Letter by RO", From 6e22091b81bd6d76f5d0cce6143feee8b477a260 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 27 Sep 2021 11:38:48 -0700 Subject: [PATCH 10/21] IO-1382 Add ownr_co_nm to queries that were missing it. --- client/src/graphql/jobs.queries.js | 4 ++++ client/src/pages/parts-queue/parts-queue.page.component.jsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index ead399f68..e2afbd94d 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -77,6 +77,7 @@ export const QUERY_PARTS_QUEUE = gql` ) { ownr_fn ownr_ln + ownr_co_nm ownr_ph1 ownr_ea plate_no @@ -98,6 +99,7 @@ export const QUERY_PARTS_QUEUE = gql` status updated_at vehicleid + ownerid } } `; @@ -110,6 +112,7 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql` ro_number ownr_fn ownr_ln + ownr_co_nm v_model_yr v_model_desc clm_no @@ -1636,6 +1639,7 @@ export const QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED = gql` ) { ownr_fn ownr_ln + ownr_co_nm ownerid ownr_ph1 ownr_ea diff --git a/client/src/pages/parts-queue/parts-queue.page.component.jsx b/client/src/pages/parts-queue/parts-queue.page.component.jsx index 3e8486afa..e77b76b26 100644 --- a/client/src/pages/parts-queue/parts-queue.page.component.jsx +++ b/client/src/pages/parts-queue/parts-queue.page.component.jsx @@ -116,8 +116,8 @@ export function PartsQueuePageComponent({ bodyshop }) { // sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln), // sortOrder: sortcolumn === "owner" && sortorder, render: (text, record) => { - return record.owner ? ( - + return record.ownerid ? ( + {`${record.ownr_fn || ""} ${record.ownr_ln || ""} ${ record.ownr_co_nm || "" }`} From fc68b669db77b3d8eb2dfb1da53571c57f6381d4 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 27 Sep 2021 14:49:33 -0700 Subject: [PATCH 11/21] Add GST to PVRT on QBO. --- server/accounting/qb-receivables-lines.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 2aabf11e1..596cf8768 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -537,7 +537,7 @@ module.exports = function ({ findTaxCode( { local: false, - federal: false, + federal: true, state: false, }, bodyshop.md_responsibility_centers.sales_tax_codes From 10f3c0167794b5afe45a56c19062025a52c38bdf Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Sep 2021 15:44:17 -0700 Subject: [PATCH 12/21] IO-1375 SGI Add Sublet Labor Lines Calculation --- server/job/job-totals.js | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/server/job/job-totals.js b/server/job/job-totals.js index e0c069bba..21ca72504 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -189,6 +189,25 @@ function CalculateRatesTotals(ratesList) { } if (item.mod_lbr_ty) { + //Check to see if it has 0 hours and a price instead. + if ( + item.mod_lb_hrs === 0 && + item.act_price > 0 && + item.lbr_op === "OP14" + ) { + //Scenario where SGI may pay out hours using a part price. + if (!ret[item.mod_lbr_ty.toLowerCase()].total) { + ret[item.mod_lbr_ty.toLowerCase()].total = Dinero(); + } + ret[item.mod_lbr_ty.toLowerCase()].total = ret[ + item.mod_lbr_ty.toLowerCase() + ].total.add( + Dinero({ amount: Math.round((item.act_price || 0) * 100) }).multiply( + item.part_qty + ) + ); + } + //There's a labor type, assign the hours. ret[item.mod_lbr_ty.toLowerCase()].hours = ret[item.mod_lbr_ty.toLowerCase()].hours + item.mod_lb_hrs; @@ -212,9 +231,14 @@ function CalculateRatesTotals(ratesList) { (property === "mash" && hasMashLine) ) ) { - ret[property].total = Dinero({ - amount: Math.round((ret[property].rate || 0) * 100), - }).multiply(ret[property].hours); + if (!ret[property].total) { + ret[property].total = Dinero(); + } + ret[property].total = ret[property].total.add( + Dinero({ + amount: Math.round((ret[property].rate || 0) * 100), + }).multiply(ret[property].hours) + ); } subtotal = subtotal.add(ret[property].total); @@ -222,6 +246,7 @@ function CalculateRatesTotals(ratesList) { if (property !== "mapa" && property !== "mash") rates_subtotal = rates_subtotal.add(ret[property].total); } + ret.subtotal = subtotal; ret.rates_subtotal = rates_subtotal; From 1f2bec06ef75d4adb16eae68e10a238be998465e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Sep 2021 16:34:11 -0700 Subject: [PATCH 13/21] IO-1381 Updates to mark up calculations process. --- client/src/graphql/jobs.queries.js | 1 + server/accounting/qb-receivables-lines.js | 13 ++++-- server/cdk/cdk-calculate-allocations.js | 10 ++-- server/graphql-client/queries.js | 2 + server/job/job-costing.js | 28 +++++++----- server/job/job-totals.js | 56 +++++++++++++---------- 6 files changed, 66 insertions(+), 44 deletions(-) diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index e2afbd94d..0640e101f 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -543,6 +543,7 @@ export const GET_JOB_BY_PK = gql` db_ref manual_line prt_dsmk_p + prt_dsmk_m billlines(limit: 1, order_by: { bill: { date: desc } }) { id quantity diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 596cf8768..22908ca88 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -36,12 +36,17 @@ module.exports = function ({ amount: Math.round(jobline.act_price * 100), }).multiply(jobline.part_qty || 1); - if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) { + if ( + (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) || + jobline.prt_dsmk_m !== 0 + ) { // console.log("Have a part discount", jobline); DineroAmount = DineroAmount.add( - DineroAmount.percentage(Math.abs(jobline.prt_dsmk_p || 0)).multiply( - jobline.prt_dsmk_p > 0 ? 1 : -1 - ) + jobline.prt_dsmk_m && jobline.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(jobline.prt_dsmk_m * 100) }) + : DineroAmount.percentage( + Math.abs(jobline.prt_dsmk_p || 0) + ).multiply(jobline.prt_dsmk_p > 0 ? 1 : -1) ); } const account = responsibilityCenters.profits.find( diff --git a/server/cdk/cdk-calculate-allocations.js b/server/cdk/cdk-calculate-allocations.js index c7b8a8bda..5676a0eda 100644 --- a/server/cdk/cdk-calculate-allocations.js +++ b/server/cdk/cdk-calculate-allocations.js @@ -70,12 +70,14 @@ exports.default = async function (socket, jobid) { amount: Math.round(val.act_price * 100), }).multiply(val.part_qty || 1); - if (val.prt_dsmk_p && val.prt_dsmk_p !== 0) { + if ((val.prt_dsmk_p && val.prt_dsmk_p !== 0) || val.prt_dsmk_m !== 0) { // console.log("Have a part discount", val); DineroAmount = DineroAmount.add( - DineroAmount.percentage(Math.abs(val.prt_dsmk_p || 0)).multiply( - val.prt_dsmk_p > 0 ? 1 : -1 - ) + val.prt_dsmk_m && val.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) }) + : DineroAmount.percentage(Math.abs(val.prt_dsmk_p || 0)).multiply( + val.prt_dsmk_p > 0 ? 1 : -1 + ) ); } diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index 3a095f8f8..9a83dffc1 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -120,6 +120,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) { profitcenter_part db_ref prt_dsmk_p + prt_dsmk_m tax_part } } @@ -700,6 +701,7 @@ exports.GET_JOB_BY_PK = ` query GET_JOB_BY_PK($id: uuid!) { db_ref manual_line prt_dsmk_p + prt_dsmk_m parts_order_lines { id parts_order { diff --git a/server/job/job-costing.js b/server/job/job-costing.js index 3b466c6d1..7756810f6 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -297,12 +297,14 @@ function GenerateCostingData(job) { }) .multiply(val.part_qty || 1) .add( - Dinero({ - amount: Math.round((val.act_price || 0) * 100), - }) - .multiply(val.part_qty || 0) - .percentage(Math.abs(val.prt_dsmk_p || 0)) - .multiply(val.prt_dsmk_p > 0 ? 1 : -1) + val.prt_dsmk_m && val.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) }) + : Dinero({ + amount: Math.round(val.act_price * 100), + }) + .multiply(val.part_qty || 0) + .percentage(Math.abs(val.prt_dsmk_p || 0)) + .multiply(val.prt_dsmk_p > 0 ? 1 : -1) ); if (!acc.parts[partsProfitCenter]) acc.parts[partsProfitCenter] = Dinero(); @@ -327,12 +329,14 @@ function GenerateCostingData(job) { }) .multiply(val.part_qty || 1) .add( - Dinero({ - amount: Math.round((val.act_price || 0) * 100), - }) - .multiply(val.part_qty || 0) - .percentage(Math.abs(val.prt_dsmk_p || 0)) - .multiply(val.prt_dsmk_p > 0 ? 1 : -1) + val.prt_dsmk_m && val.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) }) + : Dinero({ + amount: Math.round(val.act_price * 100), + }) + .multiply(val.part_qty || 0) + .percentage(Math.abs(val.prt_dsmk_p || 0)) + .multiply(val.prt_dsmk_p > 0 ? 1 : -1) ); if (!acc.parts[partsProfitCenter]) diff --git a/server/job/job-totals.js b/server/job/job-totals.js index 21ca72504..30f761840 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -270,12 +270,14 @@ function CalculatePartsTotals(jobLines) { }) .multiply(value.part_qty || 0) .add( - Dinero({ - amount: Math.round(value.act_price * 100), - }) - .multiply(value.part_qty || 0) - .percentage(Math.abs(value.prt_dsmk_p || 0)) - .multiply(value.prt_dsmk_p > 0 ? 1 : -1) + value.prt_dsmk_m && value.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(value.prt_dsmk_m * 100) }) + : Dinero({ + amount: Math.round(value.act_price * 100), + }) + .multiply(value.part_qty || 0) + .percentage(Math.abs(value.prt_dsmk_p || 0)) + .multiply(value.prt_dsmk_p > 0 ? 1 : -1) ) ), }, @@ -288,12 +290,14 @@ function CalculatePartsTotals(jobLines) { parts: { ...acc.parts, prt_dsmk_total: acc.parts.prt_dsmk_total.add( - Dinero({ - amount: Math.round((value.act_price || 0) * 100), - }) - .multiply(value.part_qty || 0) - .percentage(Math.abs(value.prt_dsmk_p || 0)) - .multiply(value.prt_dsmk_p > 0 ? 1 : -1) + value.prt_dsmk_m && value.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(value.prt_dsmk_m * 100) }) + : Dinero({ + amount: Math.round(value.act_price * 100), + }) + .multiply(value.part_qty || 0) + .percentage(Math.abs(value.prt_dsmk_p || 0)) + .multiply(value.prt_dsmk_p > 0 ? 1 : -1) ), list: { ...acc.parts.list, @@ -320,12 +324,14 @@ function CalculatePartsTotals(jobLines) { }).multiply(value.part_qty || 0) ) .add( - Dinero({ - amount: Math.round((value.act_price || 0) * 100), - }) - .multiply(value.part_qty || 0) - .percentage(Math.abs(value.prt_dsmk_p || 0)) - .multiply(value.prt_dsmk_p > 0 ? 1 : -1) + value.prt_dsmk_m && value.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(value.prt_dsmk_m * 100) }) + : Dinero({ + amount: Math.round(value.act_price * 100), + }) + .multiply(value.part_qty || 0) + .percentage(Math.abs(value.prt_dsmk_p || 0)) + .multiply(value.prt_dsmk_p > 0 ? 1 : -1) ), }, }; @@ -458,12 +464,14 @@ function CalculateTaxesTotals(job, otherTotals) { Dinero({ amount: Math.round((val.act_price || 0) * 100) }) .multiply(val.part_qty || 0) .add( - Dinero({ - amount: Math.round((val.act_price || 0) * 100), - }) - .multiply(val.part_qty || 0) - .percentage(Math.abs(val.prt_dsmk_p || 0)) - .multiply(val.prt_dsmk_p > 0 ? 1 : -1) + val.prt_dsmk_m && val.prt_dsmk_m !== 0 + ? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) }) + : Dinero({ + amount: Math.round(val.act_price * 100), + }) + .multiply(val.part_qty || 0) + .percentage(Math.abs(val.prt_dsmk_p || 0)) + .multiply(val.prt_dsmk_p > 0 ? 1 : -1) ) .percentage( ((job.parts_tax_rates && From 8ec5bc049b8cd339f0462abb7247ca832a792ecd Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Sep 2021 16:50:37 -0700 Subject: [PATCH 14/21] Resolve Qb Export not separating for QBO. --- server/accounting/qb-receivables-lines.js | 23 ++++++++++++++------ server/accounting/qbxml/qbxml-receivables.js | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 22908ca88..1302998a7 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -312,15 +312,24 @@ module.exports = function ({ } } - //Convert the hash to an array. - Object.keys(invoiceLineHash).forEach((key) => { - Object.keys(invoiceLineHash[key]).forEach((key2) => { - InvoiceLineAdd.push({ - ...invoiceLineHash[key][key2], - Amount: invoiceLineHash[key][key2].Amount.toFormat(DineroQbFormat), + if (qbo) { + Object.keys(invoiceLineHash).forEach((key) => { + Object.keys(invoiceLineHash[key]).forEach((key2) => { + InvoiceLineAdd.push({ + ...invoiceLineHash[key][key2], + Amount: invoiceLineHash[key][key2].Amount.toFormat(DineroQbFormat), + }); }); }); - }); + } else { + Object.keys(invoiceLineHash).forEach((key) => { + InvoiceLineAdd.push({ + ...invoiceLineHash[key], + Amount: invoiceLineHash[key].Amount.toFormat(DineroQbFormat), + }); + }); + } + //Convert the hash to an array. //Add Towing, storage and adjustment lines. diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index 1aa506f9a..352088cba 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -109,7 +109,7 @@ exports.default = async (req, res) => { "error", req.user.email, req.body.jobIds, - error + {error: (error)} ); res.status(400).send(JSON.stringify(error)); } From 97f1be9d6f353b60372934a0db20a89308654810 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 28 Sep 2021 10:59:18 -0700 Subject: [PATCH 15/21] IO-1390 Resolve breaking import changes from Hasura. --- .../jobs-available-table.container.jsx | 83 ++++++++++--------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/client/src/components/jobs-available-table/jobs-available-table.container.jsx b/client/src/components/jobs-available-table/jobs-available-table.container.jsx index b4758f361..86efbfc66 100644 --- a/client/src/components/jobs-available-table/jobs-available-table.container.jsx +++ b/client/src/components/jobs-available-table/jobs-available-table.container.jsx @@ -140,16 +140,17 @@ export function JobsAvailableContainer({ : {}), }; + if (selectedOwner) { + newJob.ownerid = selectedOwner; + delete newJob.owner; + } + if (newJob.vehicleid) { + delete newJob.vehicle; + } + insertNewJob({ variables: { - job: selectedOwner - ? Object.assign( - {}, - newJob, - { owner: null }, - { ownerid: selectedOwner } - ) - : newJob, + job: newJob, }, }) .then((r) => { @@ -199,11 +200,10 @@ export function JobsAvailableContainer({ message: t("jobs.errors.creating", { error: "No job data present." }), }); } else { - //IO-539 Check for Parts Rate on PAL for SGI use case. - await CheckTaxRates(estData, bodyshop); - //create upsert job let supp = replaceEmpty({ ...estData.est_data }); + //IO-539 Check for Parts Rate on PAL for SGI use case. + await CheckTaxRates(supp, bodyshop); delete supp.owner; delete supp.vehicle; @@ -391,101 +391,104 @@ function replaceEmpty(someObj, replaceValue = null) { value === "" ? replaceValue || null : value; //^ because you seem to want to replace (strings) "null" or "undefined" too const temp = JSON.stringify(someObj, replacer); - console.log("Parsed", JSON.parse(temp)); return JSON.parse(temp); } async function CheckTaxRates(estData, bodyshop) { + console.log( + "🚀 ~ file: jobs-available-table.container.jsx ~ line 398 ~ estData", + estData + ); //LKQ Check if ( - !estData.est_data.parts_tax_rates?.PAL || - estData.est_data.parts_tax_rates?.PAL?.prt_tax_rt === null || - estData.est_data.parts_tax_rates?.PAL?.prt_tax_rt === 0 + !estData.parts_tax_rates?.PAL || + estData.parts_tax_rates?.PAL?.prt_tax_rt === null || + estData.parts_tax_rates?.PAL?.prt_tax_rt === 0 ) { const res = await confirmDialog( `ImEX Online has detected that there is a missing tax rate for LKQ parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.` ); if (res) { - if (!estData.est_data.parts_tax_rates.PAL) { - estData.est_data.parts_tax_rates.PAL = { + if (!estData.parts_tax_rates.PAL) { + estData.parts_tax_rates.PAL = { prt_discp: 0, prt_mktyp: true, prt_mkupp: 0, prt_type: "PAL", }; } - estData.est_data.parts_tax_rates.PAL.prt_tax_rt = + estData.parts_tax_rates.PAL.prt_tax_rt = bodyshop.bill_tax_rates.state_tax_rate / 100; - estData.est_data.parts_tax_rates.PAL.prt_tax_in = true; + estData.parts_tax_rates.PAL.prt_tax_in = true; } } //PAC Check if ( - !estData.est_data.parts_tax_rates?.PAC || - estData.est_data.parts_tax_rates?.PAC?.prt_tax_rt === null || - estData.est_data.parts_tax_rates?.PAC?.prt_tax_rt === 0 + !estData.parts_tax_rates?.PAC || + estData.parts_tax_rates?.PAC?.prt_tax_rt === null || + estData.parts_tax_rates?.PAC?.prt_tax_rt === 0 ) { const res = await confirmDialog( `ImEX Online has detected that there is a missing tax rate for rechromed parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.` ); if (res) { - if (!estData.est_data.parts_tax_rates.PAC) { - estData.est_data.parts_tax_rates.PAC = { + if (!estData.parts_tax_rates.PAC) { + estData.parts_tax_rates.PAC = { prt_discp: 0, prt_mktyp: true, prt_mkupp: 0, prt_type: "PAC", }; } - estData.est_data.parts_tax_rates.PAC.prt_tax_rt = + estData.parts_tax_rates.PAC.prt_tax_rt = bodyshop.bill_tax_rates.state_tax_rate / 100; - estData.est_data.parts_tax_rates.PAC.prt_tax_in = true; + estData.parts_tax_rates.PAC.prt_tax_in = true; } } //PAM Check if ( - !estData.est_data.parts_tax_rates?.PAM || - estData.est_data.parts_tax_rates?.PAM?.prt_tax_rt === null || - estData.est_data.parts_tax_rates?.PAM?.prt_tax_rt === 0 + !estData.parts_tax_rates?.PAM || + estData.parts_tax_rates?.PAM?.prt_tax_rt === null || + estData.parts_tax_rates?.PAM?.prt_tax_rt === 0 ) { const res = await confirmDialog( `ImEX Online has detected that there is a missing tax rate for remanufactured parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.` ); if (res) { - if (!estData.est_data.parts_tax_rates.PAM) { - estData.est_data.parts_tax_rates.PAM = { + if (!estData.parts_tax_rates.PAM) { + estData.parts_tax_rates.PAM = { prt_discp: 0, prt_mktyp: true, prt_mkupp: 0, prt_type: "PAM", }; } - estData.est_data.parts_tax_rates.PAM.prt_tax_rt = + estData.parts_tax_rates.PAM.prt_tax_rt = bodyshop.bill_tax_rates.state_tax_rate / 100; - estData.est_data.parts_tax_rates.PAM.prt_tax_in = true; + estData.parts_tax_rates.PAM.prt_tax_in = true; } } if ( - !estData.est_data.parts_tax_rates?.PAR || - estData.est_data.parts_tax_rates?.PAR?.prt_tax_rt === null || - estData.est_data.parts_tax_rates?.PAR?.prt_tax_rt === 0 + !estData.parts_tax_rates?.PAR || + estData.parts_tax_rates?.PAR?.prt_tax_rt === null || + estData.parts_tax_rates?.PAR?.prt_tax_rt === 0 ) { const res = await confirmDialog( `ImEX Online has detected that there is a missing tax rate for recored parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.` ); if (res) { - if (!estData.est_data.parts_tax_rates.PAR) { - estData.est_data.parts_tax_rates.PAR = { + if (!estData.parts_tax_rates.PAR) { + estData.parts_tax_rates.PAR = { prt_discp: 0, prt_mktyp: true, prt_mkupp: 0, prt_type: "PAR", }; } - estData.est_data.parts_tax_rates.PAR.prt_tax_rt = + estData.parts_tax_rates.PAR.prt_tax_rt = bodyshop.bill_tax_rates.state_tax_rate / 100; - estData.est_data.parts_tax_rates.PAR.prt_tax_in = true; + estData.parts_tax_rates.PAR.prt_tax_in = true; } } } From aa410d6847657d9fcb94d91f98ff001ea1e8de40 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 28 Sep 2021 11:45:12 -0700 Subject: [PATCH 16/21] IO-1283 IO-1371 Updates to add to scoreboard button. --- .../job-scoreboard-add-button.component.jsx | 157 ++++++++++++------ client/src/graphql/scoreboard.queries.js | 11 ++ 2 files changed, 115 insertions(+), 53 deletions(-) diff --git a/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx b/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx index 9f1f12e0e..846950eaa 100644 --- a/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx +++ b/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx @@ -1,11 +1,24 @@ -import { useMutation } from "@apollo/client"; -import { Button, Card, Form, InputNumber, notification, Popover } from "antd"; +import { useMutation, useLazyQuery } from "@apollo/client"; +import { + Button, + Card, + Form, + InputNumber, + notification, + Popover, + Space, +} from "antd"; import moment from "moment"; -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { logImEXEvent } from "../../firebase/firebase.utils"; -import { INSERT_SCOREBOARD_ENTRY } from "../../graphql/scoreboard.queries"; +import { + INSERT_SCOREBOARD_ENTRY, + QUERY_SCOREBOARD_ENTRY, + UPDATE_SCOREBOARD_ENTRY, +} from "../../graphql/scoreboard.queries"; import FormDatePicker from "../form-date-picker/form-date-picker.component"; +import LoadingSpinner from "../loading-spinner/loading-spinner.component"; export default function ScoreboardAddButton({ job, @@ -14,17 +27,46 @@ export default function ScoreboardAddButton({ }) { const { t } = useTranslation(); const [insertScoreboardEntry] = useMutation(INSERT_SCOREBOARD_ENTRY); + const [updateScoreboardEntry] = useMutation(UPDATE_SCOREBOARD_ENTRY); const [loading, setLoading] = useState(false); const [form] = Form.useForm(); const [visibility, setVisibility] = useState(false); + const [callQuery, { loading: entryLoading, data: entryData }] = useLazyQuery( + QUERY_SCOREBOARD_ENTRY + ); + + useEffect(() => { + if (visibility) { + callQuery({ variables: { jobid: job.id } }); + } + }, [visibility, job.id, callQuery]); + + useEffect(() => { + console.log("UE", entryData); + if (entryData && entryData.scoreboard && entryData.scoreboard[0]) { + console.log("Setting FOrm"); + form.setFieldsValue(entryData.scoreboard[0]); + } + }, [entryData, form]); const handleFinish = async (values) => { logImEXEvent("job_close_add_to_scoreboard"); setLoading(true); - const result = await insertScoreboardEntry({ - variables: { sbInput: [{ jobid: job.id, ...values }] }, - }); + let result; + + if (entryData && entryData.scoreboard && entryData.scoreboard[0]) { + result = await updateScoreboardEntry({ + variables: { + sbId: entryData.scoreboard[0].id, + sbInput: values, + }, + }); + } else { + result = await insertScoreboardEntry({ + variables: { sbInput: [{ jobid: job.id, ...values }] }, + }); + } if (!!result.errors) { notification["error"]({ @@ -44,53 +86,62 @@ export default function ScoreboardAddButton({ const overlay = (
-
- + ) : ( + - - - - - - - - + + + + + + + + + - -
+ + + + + + )}
); @@ -99,7 +150,7 @@ export default function ScoreboardAddButton({ setLoading(true); const v = job.joblines.reduce( (acc, val) => { - if (val.mod_lbr_ty === "LAB") + if (val.mod_lbr_ty !== "LAR") acc = { ...acc, bodyhrs: acc.bodyhrs + val.mod_lb_hrs }; if (val.mod_lbr_ty === "LAR") acc = { ...acc, painthrs: acc.painthrs + val.mod_lb_hrs }; diff --git a/client/src/graphql/scoreboard.queries.js b/client/src/graphql/scoreboard.queries.js index 1132fd65d..e2b5794d5 100644 --- a/client/src/graphql/scoreboard.queries.js +++ b/client/src/graphql/scoreboard.queries.js @@ -51,3 +51,14 @@ export const UPDATE_SCOREBOARD_ENTRY = gql` } } `; + +export const QUERY_SCOREBOARD_ENTRY = gql` + query QUERY_SCOREBOARD_ENTRY($jobid: uuid!) { + scoreboard(where: { jobid: { _eq: $jobid } }) { + bodyhrs + date + id + painthrs + } + } +`; From eb58274f90d01900b38b431909d5a82d27d701b7 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 28 Sep 2021 13:19:02 -0700 Subject: [PATCH 17/21] IO-1391 Scoreboard Improvements --- .../scoreboard-chart.component.jsx | 20 +++-- .../scoreboard-display.component.jsx | 77 ++++++++++++++++++- .../scoreboard-targets-table.util.js | 6 +- client/src/graphql/scoreboard.queries.js | 20 +++++ 4 files changed, 110 insertions(+), 13 deletions(-) diff --git a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx index b39d70d5b..7b1fd410e 100644 --- a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx +++ b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx @@ -18,6 +18,11 @@ import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util"; import _ from "lodash"; + +const graphProps = { + strokeWidth: 3, +}; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -51,7 +56,7 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) { } const theValue = { - date: moment(val).format("D dd"), + date: moment(val).format("D ddd"), paintHrs: _.round(dayhrs.painthrs, 1), bodyHrs: _.round(dayhrs.bodyhrs, 1), accTargetHrs: _.round( @@ -81,36 +86,37 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) { margin={{ top: 20, right: 20, bottom: 20, left: 20 }} > - - + + diff --git a/client/src/components/scoreboard-display/scoreboard-display.component.jsx b/client/src/components/scoreboard-display/scoreboard-display.component.jsx index 6c126c736..29b3065cc 100644 --- a/client/src/components/scoreboard-display/scoreboard-display.component.jsx +++ b/client/src/components/scoreboard-display/scoreboard-display.component.jsx @@ -1,12 +1,33 @@ import { Col, Row } from "antd"; -import React from "react"; +import React, { useEffect } from "react"; import ScoreboardChart from "../scoreboard-chart/scoreboard-chart.component"; import ScoreboardLastDays from "../scoreboard-last-days/scoreboard-last-days.component"; import ScoreboardTargetsTable from "../scoreboard-targets-table/scoreboard-targets-table.component"; -export default function ScoreboardDisplayComponent({ scoreboardSubscription }) { - const { data } = scoreboardSubscription; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import moment from "moment"; +import { useApolloClient } from "@apollo/client"; +import { GET_BLOCKED_DAYS } from "../../graphql/scoreboard.queries"; +const mapStateToProps = createStructuredSelector({ + //currentUser: selectCurrentUser + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); +export default connect( + mapStateToProps, + mapDispatchToProps +)(ScoreboardDisplayComponent); +export function ScoreboardDisplayComponent({ + bodyshop, + scoreboardSubscription, +}) { + const { data } = scoreboardSubscription; + const client = useApolloClient(); const scoreBoardlist = (data && data.scoreboard) || []; const sbEntriesByDate = {}; @@ -19,6 +40,29 @@ export default function ScoreboardDisplayComponent({ scoreboardSubscription }) { sbEntriesByDate[entryDate].push(i); }); + useEffect(() => { + //Update the locals. + async function setMomentSettings() { + const { + data: { appointments }, + } = await client.query({ + query: GET_BLOCKED_DAYS, + variables: { + start: moment().startOf("month"), + end: moment().endOf("month"), + }, + }); + + moment.updateLocale("ca", { + workingWeekdays: translateSettingsToWorkingDays(bodyshop.workingdays), + holidays: appointments.map((h) => moment(h.start).format("MM-DD-YYYY")), + holidayFormat: "MM-DD-YYYY", + }); + } + + setMomentSettings(); + }, [client, bodyshop]); + return ( @@ -35,3 +79,30 @@ export default function ScoreboardDisplayComponent({ scoreboardSubscription }) { ); } + +function translateSettingsToWorkingDays(workingdays) { + const days = []; + + if (workingdays.monday) { + days.push(1); + } + if (workingdays.tuesday) { + days.push(2); + } + if (workingdays.wednesday) { + days.push(3); + } + if (workingdays.thursday) { + days.push(4); + } + if (workingdays.friday) { + days.push(5); + } + if (workingdays.saturday) { + days.push(6); + } + if (workingdays.sunday) { + days.push(0); + } + return days; +} diff --git a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js index 47d40c759..97f1813b9 100644 --- a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js +++ b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.util.js @@ -1,8 +1,8 @@ import moment from "moment-business-days"; -moment.updateLocale("ca", { - workingWeekdays: [1, 2, 3, 4, 5], -}); +// moment.updateLocale("ca", { +// workingWeekdays: [1, 2, 3, 4, 5, 6], +// }); export const CalculateWorkingDaysThisMonth = () => { return moment().endOf("month").businessDaysIntoMonth(); diff --git a/client/src/graphql/scoreboard.queries.js b/client/src/graphql/scoreboard.queries.js index e2b5794d5..16a1c6103 100644 --- a/client/src/graphql/scoreboard.queries.js +++ b/client/src/graphql/scoreboard.queries.js @@ -62,3 +62,23 @@ export const QUERY_SCOREBOARD_ENTRY = gql` } } `; + +export const GET_BLOCKED_DAYS = gql` + query GET_BLOCKED_DAYS($start: timestamptz, $end: timestamptz) { + appointments( + where: { + _and: [ + { block: { _eq: true } } + { canceled: { _eq: false } } + { start: { _gte: $start } } + { end: { _lte: $end } } + ] + } + ) { + id + block + start + end + } + } +`; From 2637538d9a2e7d4867fe01241164a82d2a15fc60 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 29 Sep 2021 08:43:15 -0700 Subject: [PATCH 18/21] IO-256 QBO Payables --- .../accounting-payables-table.component.jsx | 22 +- .../jobs-available-table.container.jsx | 2 +- .../payable-export-all-button.component.jsx | 85 +-- .../payable-export-button.component.jsx | 90 ++-- server/accounting/qb-receivables-lines.js | 3 +- server/accounting/qbo/qbo-payables.js | 500 +++++------------- server/accounting/qbo/qbo-receivables.js | 21 +- server/accounting/qbxml/qbxml-receivables.js | 4 +- 8 files changed, 266 insertions(+), 461 deletions(-) diff --git a/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx b/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx index 64e335833..8b017991a 100644 --- a/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx +++ b/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx @@ -9,8 +9,25 @@ import PayableExportAll from "../payable-export-all-button/payable-export-all-bu import { DateFormatter } from "../../utils/DateFormatter"; import queryString from "query-string"; import { logImEXEvent } from "../../firebase/firebase.utils"; +import QboAuthorizeComponent from "../qbo-authorize/qbo-authorize.component"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; -export default function AccountingPayablesTableComponent({ loading, bills }) { +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); + +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); + +export default connect( + mapStateToProps, + mapDispatchToProps +)(AccountingPayablesTableComponent); + +export function AccountingPayablesTableComponent({ bodyshop, loading, bills }) { const { t } = useTranslation(); const [selectedBills, setSelectedBills] = useState([]); const [transInProgress, setTransInProgress] = useState(false); @@ -166,6 +183,9 @@ export default function AccountingPayablesTableComponent({ loading, bills }) { loadingCallback={setTransInProgress} completedCallback={setSelectedBills} /> + {bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && ( + + )} { logImEXEvent("accounting_payables_export_all"); + let PartnerResponse; setLoading(true); if (!!loadingCallback) loadingCallback(true); - - let QbXmlResponse; - try { - QbXmlResponse = await axios.post( - "/accounting/qbxml/payables", - { bills: billids }, - { - headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, - }, - } - ); - } catch (error) { - console.log("Error getting QBXML from Server.", error); - notification["error"]({ - message: t("bills.errors.exporting", { - error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), - }), + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + PartnerResponse = await axios.post(`/qbo/receivables`, { + withCredentials: true, + bills: billids, }); - if (loadingCallback) loadingCallback(false); - setLoading(false); - return; - } + } else { + let QbXmlResponse; + try { + QbXmlResponse = await axios.post( + "/accounting/qbxml/payables", + { bills: billids }, + { + headers: { + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, + }, + } + ); + } catch (error) { + console.log("Error getting QBXML from Server.", error); + notification["error"]({ + message: t("bills.errors.exporting", { + error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), + }), + }); + if (loadingCallback) loadingCallback(false); + setLoading(false); + return; + } - let PartnerResponse; - - try { - PartnerResponse = await axios.post( - "http://localhost:1337/qb/", - QbXmlResponse.data - ); - } catch (error) { - console.log("Error connecting to quickbooks or partner.", error); - notification["error"]({ - message: t("bills.errors.exporting-partner"), - }); - if (!!loadingCallback) loadingCallback(false); - setLoading(false); - return; + try { + PartnerResponse = await axios.post( + "http://localhost:1337/qb/", + QbXmlResponse.data + ); + } catch (error) { + console.log("Error connecting to quickbooks or partner.", error); + notification["error"]({ + message: t("bills.errors.exporting-partner"), + }); + if (!!loadingCallback) loadingCallback(false); + setLoading(false); + return; + } } console.log("handleQbxml -> PartnerResponse", PartnerResponse); - const groupedData = _.groupBy(PartnerResponse.data, "id"); + const groupedData = _.groupBy( + PartnerResponse.data, + bodyshop.accountingconfig.qbo ? "billid" : "id" + ); + const proms = []; Object.keys(groupedData).forEach((key) => { proms.push( diff --git a/client/src/components/payable-export-button/payable-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx index d531b308f..6a9fd2494 100644 --- a/client/src/components/payable-export-button/payable-export-button.component.jsx +++ b/client/src/components/payable-export-button/payable-export-button.component.jsx @@ -38,44 +38,53 @@ export function PayableExportButton({ setLoading(true); if (!!loadingCallback) loadingCallback(true); - let QbXmlResponse; - try { - QbXmlResponse = await axios.post( - "/accounting/qbxml/payables", - { bills: [billId] }, - { - headers: { - Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, - }, - } - ); - } catch (error) { - console.log("Error getting QBXML from Server.", error); - notification["error"]({ - message: t("bills.errors.exporting", { - error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), - }), - }); - if (loadingCallback) loadingCallback(false); - setLoading(false); - return; - } - + //Check if it's a QBO Setup. let PartnerResponse; - - try { - PartnerResponse = await axios.post( - "http://localhost:1337/qb/", - QbXmlResponse.data - ); - } catch (error) { - console.log("Error connecting to quickbooks or partner.", error); - notification["error"]({ - message: t("bills.errors.exporting-partner"), + if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) { + PartnerResponse = await axios.post(`/qbo/payables`, { + withCredentials: true, + bills: [billId], }); - if (!!loadingCallback) loadingCallback(false); - setLoading(false); - return; + } else { + //Default is QBD + + let QbXmlResponse; + try { + QbXmlResponse = await axios.post( + "/accounting/qbxml/payables", + { bills: [billId] }, + { + headers: { + Authorization: `Bearer ${await auth.currentUser.getIdToken()}`, + }, + } + ); + } catch (error) { + console.log("Error getting QBXML from Server.", error); + notification["error"]({ + message: t("bills.errors.exporting", { + error: "Unable to retrieve QBXML. " + JSON.stringify(error.message), + }), + }); + if (loadingCallback) loadingCallback(false); + setLoading(false); + return; + } + + try { + PartnerResponse = await axios.post( + "http://localhost:1337/qb/", + QbXmlResponse.data + ); + } catch (error) { + console.log("Error connecting to quickbooks or partner.", error); + notification["error"]({ + message: t("bills.errors.exporting-partner"), + }); + if (!!loadingCallback) loadingCallback(false); + setLoading(false); + return; + } } console.log("handleQbxml -> PartnerResponse", PartnerResponse); @@ -123,7 +132,14 @@ export function PayableExportButton({ }); const billUpdateResponse = await updateBill({ variables: { - billIdList: successfulTransactions.map((st) => st.id), + billIdList: successfulTransactions.map( + (st) => + st[ + bodyshop.accountingconfig && bodyshop.accountingconfig.qbo + ? "billid" + : "id" + ] + ), bill: { exported: true, exported_at: new Date(), diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 1302998a7..909473f13 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -3,7 +3,7 @@ const DineroQbFormat = require("./accounting-constants").DineroQbFormat; const Dinero = require("dinero.js"); const logger = require("../utils/logger"); -module.exports = function ({ +exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, @@ -591,3 +591,4 @@ const findTaxCode = ({ local, state, federal }, taxcode) => { return "No Tax Code Matches"; } }; +exports.findTaxCode = findTaxCode; diff --git a/server/accounting/qbo/qbo-payables.js b/server/accounting/qbo/qbo-payables.js index 4a42c9e87..ffe60b373 100644 --- a/server/accounting/qbo/qbo-payables.js +++ b/server/accounting/qbo/qbo-payables.js @@ -16,9 +16,9 @@ const { setNewRefreshToken, } = require("./qbo-callback"); const OAuthClient = require("intuit-oauth"); - +const moment = require("moment"); const GraphQLClient = require("graphql-request").GraphQLClient; -const { generateOwnerTier } = require("../qbxml/qbxml-utils"); +const findTaxCode = require("../qb-receivables-lines").findTaxCode; exports.default = async (req, res) => { const oauthClient = new OAuthClient({ @@ -53,20 +53,36 @@ exports.default = async (req, res) => { .request(queries.QUERY_BILLS_FOR_PAYABLES_EXPORT, { bills: billsToQuery, }); + const { bills } = result; + const ret = []; for (const bill of bills) { - let vendorRecord; - vendorRecord = await QueryVendorRecord(oauthClient, req, bill); + try { + let vendorRecord; + vendorRecord = await QueryVendorRecord(oauthClient, req, bill); - if (!vendorRecord) { - vendorRecord = await InsertVendorRecord(oauthClient, req, bill); + if (!vendorRecord) { + vendorRecord = await InsertVendorRecord(oauthClient, req, bill); + } + + const insertResults = await InsertBill( + oauthClient, + req, + bill, + vendorRecord + ); + ret.push({ billid: bill.id, success: true }); + } catch (error) { + ret.push({ + billid: bill.id, + success: false, + errorMessage: error.message, + }); } - - const insertResults = await InsertBill(oauthClient, req, bill); } - res.json({}); + res.status(200).json(ret); } catch (error) { console.log(error); logger.log("qbo-payable-create-error", "ERROR", req.user.email, { error }); @@ -126,54 +142,108 @@ async function InsertVendorRecord(oauthClient, req, bill) { } } -async function InsertBill(oauthClient, req, bill) { - const vendor = { - DisplayName: job.ro_number, - BillAddr: { - City: job.ownr_city, - Line1: job.ownr_addr1, - Line2: job.ownr_addr2, - PostalCode: job.ownr_zip, - CountrySubDivisionCode: job.ownr_st, +async function InsertBill(oauthClient, req, bill, vendor) { + const { accounts, taxCodes, classes } = await QueryMetaData(oauthClient, req); + + const billQbo = { + VendorRef: { + value: vendor.Id, }, - ...(isThreeTier - ? { - Job: true, - ParentRef: { - value: parentTierRef.Id, - }, - } - : {}), + TxnDate: moment(bill.date).format("YYYY-MM-DD"), + DueDate: bill.due_date && moment(bill.due_date).format("YYYY-MM-DD"), + DocNumber: bill.invoice_number, + ...(bill.job.class ? { ClassRef: { Id: classes[bill.job.class] } } : {}), + + Memo: `RO ${bill.job.ro_number || ""} OWNER ${bill.job.ownr_fn || ""} ${ + bill.job.ownr_ln || "" + } ${bill.job.ownr_co_nm || ""}`, + Line: bill.billlines.map((il) => + generateBillLine( + il, + accounts, + bill.job.class, + bill.job.bodyshop.md_responsibility_centers.sales_tax_codes, + classes, + taxCodes + ) + ), }; try { const result = await oauthClient.makeApiCall({ - url: urlBuilder(req.cookies.qbo_realmId, "vendor"), + url: urlBuilder(req.cookies.qbo_realmId, "bill"), method: "POST", headers: { "Content-Type": "application/json", }, - body: JSON.stringify(vendor), + body: JSON.stringify(billQbo), }); setNewRefreshToken(req.user.email, result); - return result && result.Customer; + return result && result.Bill; } catch (error) { logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, { error, - method: "InsertOwner", + method: "InsertBill", }); throw error; } } +// [ +// { +// DetailType: "AccountBasedExpenseLineDetail", +// Amount: 200.0, +// Id: "1", +// AccountBasedExpenseLineDetail: { +// AccountRef: { +// value: "7", +// }, +// }, +// }, +// ], +const generateBillLine = ( + billLine, + accounts, + jobClass, + responsibilityCenters, + classes, + taxCodes +) => { + return { + DetailType: "AccountBasedExpenseLineDetail", + + AccountBasedExpenseLineDetail: { + ...(jobClass ? { ClassRef: { Id: classes[jobClass] } } : {}), + TaxCodeRef: { + value: + taxCodes[ + findTaxCode(billLine.applicable_taxes, responsibilityCenters) + ], + }, + AccountRef: { + value: accounts[billLine.cost_center], + }, + }, + + Amount: Dinero({ + amount: Math.round(billLine.actual_cost * 100), + }) + .multiply(billLine.quantity || 1) + .toFormat(DineroQbFormat), + }; +}; async function QueryMetaData(oauthClient, req) { - const items = await oauthClient.makeApiCall({ - url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From Item`), + const accounts = await oauthClient.makeApiCall({ + url: urlBuilder( + req.cookies.qbo_realmId, + "query", + `select * From Account where AccountType = 'Cost of Goods Sold'` + ), method: "POST", headers: { "Content-Type": "application/json", }, }); - setNewRefreshToken(req.user.email, items); + setNewRefreshToken(req.user.email, accounts); const taxCodes = await oauthClient.makeApiCall({ url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From TaxCode`), method: "POST", @@ -182,368 +252,40 @@ async function QueryMetaData(oauthClient, req) { }, }); - const taxCodeMapping = {}; - - const accounts = await oauthClient.makeApiCall({ - url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From Account`), + const classes = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From Class`), method: "POST", headers: { "Content-Type": "application/json", }, }); + const taxCodeMapping = {}; + taxCodes.json && taxCodes.json.QueryResponse && taxCodes.json.QueryResponse.TaxCode.forEach((t) => { taxCodeMapping[t.Name] = t.Id; }); - const itemMapping = {}; + const accountMapping = {}; - items.json && - items.json.QueryResponse && - items.json.QueryResponse.Item.forEach((t) => { - itemMapping[t.Name] = t.Id; + accounts.json && + accounts.json.QueryResponse && + accounts.json.QueryResponse.Account.forEach((t) => { + accountMapping[t.Name] = t.Id; + }); + + const classMapping = {}; + classes.json && + classes.json.QueryResponse && + classes.json.QueryResponse.Class.forEach((t) => { + accountMapping[t.Name] = t.Id; }); return { - items: itemMapping, + accounts: accountMapping, taxCodes: taxCodeMapping, + classes: classMapping, }; } - -async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) { - const { items, taxCodes } = await QueryMetaData(oauthClient, req); - const InvoiceLineAdd = []; - const responsibilityCenters = bodyshop.md_responsibility_centers; - - const invoiceLineHash = {}; //The hash of cost and profit centers based on the center name. - - //Determine if there are MAPA and MASH lines already on the estimate. - //If there are, don't do anything extra (mitchell estimate) - //Otherwise, calculate them and add them to the default MAPA and MASH centers. - let hasMapaLine = false; - let hasMashLine = false; - - //Create the invoice lines mapping. - job.joblines.map((jobline) => { - //Parts Lines - if (jobline.db_ref === "936008") { - //If either of these DB REFs change, they also need to change in job-totals/job-costing calculations. - hasMapaLine = true; - } - if (jobline.db_ref === "936007") { - hasMashLine = true; - } - - if (jobline.profitcenter_part && jobline.act_price) { - let DineroAmount = Dinero({ - amount: Math.round(jobline.act_price * 100), - }).multiply(jobline.part_qty || 1); - - if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) { - // console.log("Have a part discount", jobline); - DineroAmount = DineroAmount.add( - DineroAmount.percentage(jobline.prt_dsmk_p || 0) - ); - } - const account = responsibilityCenters.profits.find( - (i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase() - ); - - if (!account) { - logger.log("qbxml-payables-no-account", "warn", null, jobline.id, null); - throw new Error( - `A matching account does not exist for the part allocation. Center: ${jobline.profitcenter_part}` - ); - } - if (!invoiceLineHash[account.name]) { - invoiceLineHash[account.name] = { - ItemRef: { FullName: account.accountitem }, - Desc: account.accountdesc, - Quantity: 1, //jobline.part_qty, - Amount: DineroAmount, //.toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }; - } else { - invoiceLineHash[account.name].Amount = - invoiceLineHash[account.name].Amount.add(DineroAmount); - } - } - // Labor Lines - if (jobline.profitcenter_labor && jobline.mod_lb_hrs) { - const DineroAmount = Dinero({ - amount: Math.round( - job[`rate_${jobline.mod_lbr_ty.toLowerCase()}`] * 100 - ), - }).multiply(jobline.mod_lb_hrs); - const account = responsibilityCenters.profits.find( - (i) => jobline.profitcenter_labor.toLowerCase() === i.name.toLowerCase() - ); - - if (!account) { - throw new Error( - `A matching account does not exist for the labor allocation. Center: ${jobline.profitcenter_labor}` - ); - } - if (!invoiceLineHash[account.name]) { - invoiceLineHash[account.name] = { - ItemRef: { FullName: account.accountitem }, - Desc: account.accountdesc, - Quantity: 1, // jobline.mod_lb_hrs, - Amount: DineroAmount, - //Amount: DineroAmount.toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }; - } else { - invoiceLineHash[account.name].Amount = - invoiceLineHash[account.name].Amount.add(DineroAmount); - } - } - }); - // console.log("Done creating hash", JSON.stringify(invoiceLineHash)); - - if (!hasMapaLine && job.job_totals.rates.mapa.total.amount > 0) { - // console.log("Adding MAPA Line Manually."); - const mapaAccountName = responsibilityCenters.defaults.profits.MAPA; - - const mapaAccount = responsibilityCenters.profits.find( - (c) => c.name === mapaAccountName - ); - - if (mapaAccount) { - InvoiceLineAdd.push({ - ItemRef: { FullName: mapaAccount.accountitem }, - Desc: mapaAccount.accountdesc, - Quantity: 1, - Amount: Dinero(job.job_totals.rates.mapa.total).toFormat( - DineroQbFormat - ), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } else { - //console.log("NO MAPA ACCOUNT FOUND!!"); - } - } - - if (!hasMashLine && job.job_totals.rates.mash.total.amount > 0) { - // console.log("Adding MASH Line Manually."); - - const mashAccountName = responsibilityCenters.defaults.profits.MASH; - - const mashAccount = responsibilityCenters.profits.find( - (c) => c.name === mashAccountName - ); - - if (mashAccount) { - InvoiceLineAdd.push({ - ItemRef: { FullName: mashAccount.accountitem }, - Desc: mashAccount.accountdesc, - Quantity: 1, - Amount: Dinero(job.job_totals.rates.mash.total).toFormat( - DineroQbFormat - ), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } else { - // console.log("NO MASH ACCOUNT FOUND!!"); - } - } - - //Convert the hash to an array. - Object.keys(invoiceLineHash).forEach((key) => { - InvoiceLineAdd.push({ - ...invoiceLineHash[key], - Amount: invoiceLineHash[key].Amount.toFormat(DineroQbFormat), - }); - }); - - //Add Towing, storage and adjustment lines. - - if (job.towing_payable && job.towing_payable !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["TOW"] - ).accountitem, - }, - Desc: "Towing", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((job.towing_payable || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - if (job.storage_payable && job.storage_payable !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["TOW"] - ).accountitem, - }, - Desc: "Storage", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((job.storage_payable || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - if (job.adjustment_bottom_line && job.adjustment_bottom_line !== 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: responsibilityCenters.profits.find( - (c) => c.name === responsibilityCenters.defaults.profits["PAO"] - ).accountitem, - }, - Desc: "Adjustment", - Quantity: 1, - Amount: Dinero({ - amount: Math.round((job.adjustment_bottom_line || 0) * 100), - }).toFormat(DineroQbFormat), - SalesTaxCodeRef: { - FullName: "E", - }, - }); - } - - //Add tax lines - const job_totals = job.job_totals; - - const federal_tax = Dinero(job_totals.totals.federal_tax); - const state_tax = Dinero(job_totals.totals.state_tax); - const local_tax = Dinero(job_totals.totals.local_tax); - - if (federal_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.federal.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.federal.accountdesc, - Amount: federal_tax.toFormat(DineroQbFormat), - }); - } - - if (state_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.state.accountdesc, - Amount: state_tax.toFormat(DineroQbFormat), - }); - } - - if (local_tax.getAmount() > 0) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.local.accountitem, - }, - Desc: bodyshop.md_responsibility_centers.taxes.local.accountdesc, - Amount: local_tax.toFormat(DineroQbFormat), - }); - } - - //Region Specific - const { ca_bc_pvrt } = job; - if (ca_bc_pvrt) { - InvoiceLineAdd.push({ - ItemRef: { - FullName: bodyshop.md_responsibility_centers.taxes.state.accountitem, - }, - Desc: "PVRT", - Amount: Dinero({ amount: (ca_bc_pvrt || 0) * 100 }).toFormat( - DineroQbFormat - ), - }); - } - - //map each invoice line to the correct style for QBO. - - const invoiceObj = { - Line: [ - { - DetailType: "SalesItemLineDetail", - Amount: 100, - SalesItemLineDetail: { - // ItemRef: { - // // name: "Services", - // value: "16", - // }, - TaxCodeRef: { - value: "2", - }, - Qty: 1, - UnitPrice: 100, - }, - }, - ], - // Line: InvoiceLineAdd.map((i) => { - // return { - // DetailType: "SalesItemLineDetail", - // Amount: i.Amount, - // SalesItemLineDetail: { - // ItemRef: { - // //name: "Services", - // value: items[i.ItemRef.FullName], - // }, - // // TaxCodeRef: { - // // value: "2", - // // }, - // Qty: 1, - // }, - // }; - // }), - TxnTaxDetail: { - TaxLine: [ - { - DetailType: "TaxLineDetail", - - TaxLineDetail: { - NetAmountTaxable: 100, - TaxPercent: 7, - TaxRateRef: { - value: "16", - }, - PercentBased: true, - }, - }, - ], - }, - CustomerRef: { - value: parentTierRef.Id, - }, - }; - - try { - const result = await oauthClient.makeApiCall({ - url: urlBuilder(req.cookies.qbo_realmId, "invoice"), - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(invoiceObj), - }); - setNewRefreshToken(req.user.email, result); - return result && result.Invoice; - } catch (error) { - logger.log("qbo-payables-error", "DEBUG", req.user.email, job.id, { - error, - method: "InsertOwner", - }); - throw error; - } -} diff --git a/server/accounting/qbo/qbo-receivables.js b/server/accounting/qbo/qbo-receivables.js index 010266812..f23873544 100644 --- a/server/accounting/qbo/qbo-receivables.js +++ b/server/accounting/qbo/qbo-receivables.js @@ -14,7 +14,7 @@ const { setNewRefreshToken, } = require("./qbo-callback"); const OAuthClient = require("intuit-oauth"); -const CreateInvoiceLines = require("../qb-receivables-lines"); +const CreateInvoiceLines = require("../qb-receivables-lines").default; const moment = require("moment"); const GraphQLClient = require("graphql-request").GraphQLClient; @@ -332,6 +332,14 @@ async function QueryMetaData(oauthClient, req) { }, }); + const classes = await oauthClient.makeApiCall({ + url: urlBuilder(req.cookies.qbo_realmId, "query", `select * From Class`), + method: "POST", + headers: { + "Content-Type": "application/json", + }, + }); + const taxCodeMapping = {}; taxCodes.json && @@ -348,14 +356,22 @@ async function QueryMetaData(oauthClient, req) { itemMapping[t.Name] = t.Id; }); + const classMapping = {}; + classes.json && + classes.json.QueryResponse && + classes.json.QueryResponse.Class.forEach((t) => { + itemMapping[t.Name] = t.Id; + }); + return { items: itemMapping, taxCodes: taxCodeMapping, + classes: classMapping, }; } async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) { - const { items, taxCodes } = await QueryMetaData(oauthClient, req); + const { items, taxCodes, classes } = await QueryMetaData(oauthClient, req); const InvoiceLineAdd = CreateInvoiceLines({ bodyshop, jobs_by_pk: job, @@ -368,6 +384,7 @@ async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) { Line: InvoiceLineAdd, TxnDate: moment(job.date_invoiced).format("YYYY-MM-DD"), DocNumber: job.ro_number, + ...(job.class ? { ClassRef: { Id: classes[job.class] } } : {}), CustomerRef: { value: parentTierRef.Id, }, diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index 352088cba..c683f45a9 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -7,7 +7,7 @@ const moment = require("moment"); var builder = require("xmlbuilder2"); const QbXmlUtils = require("./qbxml-utils"); const logger = require("../../utils/logger"); -const CreateInvoiceLines = require("../qb-receivables-lines"); +const CreateInvoiceLines = require("../qb-receivables-lines").default; require("dotenv").config({ path: path.resolve( @@ -109,7 +109,7 @@ exports.default = async (req, res) => { "error", req.user.email, req.body.jobIds, - {error: (error)} + { error: error } ); res.status(400).send(JSON.stringify(error)); } From e73d082eab8926da6920a61a1574f7d06dd5f762 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 29 Sep 2021 08:49:55 -0700 Subject: [PATCH 19/21] IO-1349 Resolve manual job creation. --- client/src/pages/jobs-create/jobs-create.container.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/pages/jobs-create/jobs-create.container.jsx b/client/src/pages/jobs-create/jobs-create.container.jsx index 079a109c9..b7ffad7b2 100644 --- a/client/src/pages/jobs-create/jobs-create.container.jsx +++ b/client/src/pages/jobs-create/jobs-create.container.jsx @@ -85,7 +85,6 @@ function JobsCreateContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) { }); }; - console.log("Manual State", state); const handleFinish = (values) => { let job = Object.assign( {}, @@ -142,6 +141,10 @@ function JobsCreateContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) { } job = { ...job, ...ownerData }; + + if (job.owner === null) delete job.owner; + if (job.vehicle === null) delete job.vehicle; + runInsertJob(job); }; From 85d79a8d7fbe77f3327ca18b1229ce2614a480e4 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 29 Sep 2021 12:03:21 -0700 Subject: [PATCH 20/21] Remove extra console logs. --- client/src/firebase/firebase.utils.js | 12 ++++++------ client/src/utils/GraphQLClient.js | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/firebase/firebase.utils.js b/client/src/firebase/firebase.utils.js index 30828c71a..dac0fc8ca 100644 --- a/client/src/firebase/firebase.utils.js +++ b/client/src/firebase/firebase.utils.js @@ -63,12 +63,12 @@ export const logImEXEvent = (eventName, additionalParams, stateProp = null) => { null, ...additionalParams, }; - console.log( - "%c[Analytics]", - "background-color: green ;font-weight:bold;", - eventName, - eventParams - ); + // console.log( + // "%c[Analytics]", + // "background-color: green ;font-weight:bold;", + // eventName, + // eventParams + // ); logEvent(analytics, eventName, eventParams); //Log event to OpenReplay server. diff --git a/client/src/utils/GraphQLClient.js b/client/src/utils/GraphQLClient.js index 5c5223107..d0fa29461 100644 --- a/client/src/utils/GraphQLClient.js +++ b/client/src/utils/GraphQLClient.js @@ -38,9 +38,9 @@ const roundTripLink = new ApolloLink((operation, forward) => { return forward(operation).map((data) => { // Called after server responds const time = new Date() - operation.getContext().start; - console.log( - `Operation ${operation.operationName} took ${time} to complete` - ); + // console.log( + // `Operation ${operation.operationName} took ${time} to complete` + // ); TrackExecutionTime(operation.operationName, time); return data; }); From 8bb8eee384f406ea2d6cc6b067f1f70eaf489616 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 29 Sep 2021 14:38:40 -0700 Subject: [PATCH 21/21] Remove open replay tracker. --- client/src/App/App.container.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx index 2f05560ef..335700af3 100644 --- a/client/src/App/App.container.jsx +++ b/client/src/App/App.container.jsx @@ -11,7 +11,7 @@ import App from "./App"; import trackerGraphQL from "@openreplay/tracker-graphql"; //import trackerRedux from "@openreplay/tracker-redux"; import Tracker from "@openreplay/tracker"; -import trackerAssist from "@openreplay/tracker-assist"; +//import trackerAssist from "@openreplay/tracker-assist"; import { getCurrentUser } from "../firebase/firebase.utils"; moment.locale("en-US"); @@ -29,9 +29,9 @@ export const tracker = new Tracker({ }, }); -tracker.use( - trackerAssist({ confirmText: "Technical support is about to assist you." }) -); // check the list of available options below +// tracker.use( +// trackerAssist({ confirmText: "Technical support is about to assist you." }) +// ); // check the list of available options below export const recordGraphQL = tracker.use(trackerGraphQL()); tracker.start(); if (process.env.NODE_ENV === "production") LogRocket.init("gvfvfw/bodyshopapp");