1
.gitignore
vendored
1
.gitignore
vendored
@@ -28,6 +28,7 @@ client/.env
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
/out
|
||||
/dist
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
||||
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug Main Process",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
|
||||
},
|
||||
"args": ["."],
|
||||
"outputCapture": "std"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,17 +1,47 @@
|
||||
const { DBFFile } = require("dbffile");
|
||||
const path = require("path");
|
||||
const _ = require("lodash");
|
||||
const log = require("electron-log");
|
||||
const { store } = require("../electron-store");
|
||||
|
||||
async function DecodeEstimate(filePath) {
|
||||
const parsedFilePath = path.parse(filePath);
|
||||
let extensionlessFilePath = `${parsedFilePath.dir}\\${parsedFilePath.name}`;
|
||||
const ret = {
|
||||
let extensionlessFilePath = path.join(
|
||||
parsedFilePath.dir,
|
||||
parsedFilePath.name
|
||||
);
|
||||
const job = {
|
||||
...(await DecodeAd1File(extensionlessFilePath)),
|
||||
...(await DecodeVehFile(extensionlessFilePath)),
|
||||
...(await DecodeTtlFile(extensionlessFilePath)),
|
||||
...(await DecodeLinFile(extensionlessFilePath)),
|
||||
};
|
||||
return ret;
|
||||
|
||||
const ad2 = await DecodeAd2File(extensionlessFilePath);
|
||||
|
||||
if (job.OWNR_FN === "") job.OWNR_FN = ad2.CLMT_FN;
|
||||
if (job.OWNR_LN === "") job.OWNR_LN = ad2.CLMT_LN;
|
||||
|
||||
const accepted_ins_co = store.get("accepted_ins_co");
|
||||
|
||||
let returnValue;
|
||||
if (job.V_MILEAGE <= 20000) {
|
||||
returnValue = { ERROR: "Vehicle mileage is less than 20,000kms." };
|
||||
} else if (!accepted_ins_co.includes(job.INS_CO_NM)) {
|
||||
returnValue = {
|
||||
ERROR: `Insurance Company Name is not valid for RPS. (${job.INS_CO_NM})`,
|
||||
};
|
||||
} else if (!job.clm_no) {
|
||||
returnValue = {
|
||||
ERROR: `An unique claim number must be set for all jobs sent to RPS.`,
|
||||
};
|
||||
} else {
|
||||
returnValue = _.transform(job, function (result, val, key) {
|
||||
result[key.toLowerCase()] = val;
|
||||
});
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
async function DecodeAd1File(extensionlessFilePath) {
|
||||
@@ -32,7 +62,7 @@ async function DecodeAd1File(extensionlessFilePath) {
|
||||
// "DED_AMT",
|
||||
// "DED_STATUS",
|
||||
// "ASGN_NO",
|
||||
// "ASGN_DATE",
|
||||
//"ASGN_DATE",
|
||||
// "ASGN_TYPE",
|
||||
"CLM_NO",
|
||||
// "CLM_OFC_ID",
|
||||
@@ -80,7 +110,7 @@ async function DecodeAd1File(extensionlessFilePath) {
|
||||
// "AGT_CT_PHX",
|
||||
// "AGT_EA",
|
||||
// "AGT_LIC_NO",
|
||||
// "LOSS_DATE",
|
||||
"LOSS_DATE",
|
||||
// "LOSS_TYPE",
|
||||
// "LOSS_DESC",
|
||||
// "THEFT_IND",
|
||||
@@ -135,6 +165,13 @@ async function DecodeAd1File(extensionlessFilePath) {
|
||||
// "LOSS_CAT",
|
||||
]);
|
||||
}
|
||||
|
||||
async function DecodeAd2File(extensionlessFilePath) {
|
||||
let dbf = await DBFFile.open(`${extensionlessFilePath}B.AD2`);
|
||||
let records = await dbf.readRecords(1);
|
||||
return _.pick(records[0], ["CLMT_LN", "CLMT_FN"]);
|
||||
}
|
||||
|
||||
async function DecodeVehFile(extensionlessFilePath) {
|
||||
let dbf = await DBFFile.open(`${extensionlessFilePath}V.VEH`);
|
||||
let records = await dbf.readRecords(1);
|
||||
@@ -152,6 +189,7 @@ async function DecodeVehFile(extensionlessFilePath) {
|
||||
"V_MAKEDESC",
|
||||
"V_MODEL",
|
||||
"V_TYPE",
|
||||
"V_MILEAGE",
|
||||
// "V_BSTYLE",
|
||||
// "V_TRIMCODE",
|
||||
// "TRIM_COLOR",
|
||||
@@ -174,64 +212,167 @@ async function DecodeTtlFile(extensionlessFilePath) {
|
||||
async function DecodeLinFile(extensionlessFilePath) {
|
||||
let dbf = await DBFFile.open(`${extensionlessFilePath}.LIN`);
|
||||
let records = await dbf.readRecords();
|
||||
let joblines = records
|
||||
.map((record) => {
|
||||
console.log(
|
||||
"object",
|
||||
_.pick(record, [
|
||||
"LINE_NO",
|
||||
"LINE_IND",
|
||||
// "LINE_REF",
|
||||
// "TRAN_CODE",
|
||||
"DB_REF",
|
||||
"UNQ_SEQ",
|
||||
// "WHO_PAYS",
|
||||
"LINE_DESC",
|
||||
"PART_TYPE",
|
||||
// "PART_DESCJ",
|
||||
"GLASS_FLAG",
|
||||
"OEM_PARTNO",
|
||||
// "PRICE_INC",
|
||||
// "ALT_PART_I",
|
||||
// "TAX_PART",
|
||||
"DB_PRICE",
|
||||
"ACT_PRICE",
|
||||
// "PRICE_J",
|
||||
// "CERT_PART",
|
||||
"PART_QTY",
|
||||
// "ALT_CO_ID",
|
||||
// "ALT_PARTNO",
|
||||
// "ALT_OVERRD",
|
||||
// "ALT_PARTM",
|
||||
// "PRT_DSMK_P",
|
||||
// "PRT_DSMK_M",
|
||||
// "MOD_LBR_TY",
|
||||
// "DB_HRS",
|
||||
// "MOD_LB_HRS",
|
||||
// "LBR_INC",
|
||||
// "LBR_OP",
|
||||
// "LBR_HRS_J",
|
||||
// "LBR_TYP_J",
|
||||
// "LBR_OP_J",
|
||||
// "PAINT_STG",
|
||||
// "PAINT_TONE",
|
||||
// "LBR_TAX",
|
||||
// "LBR_AMT",
|
||||
// "MISC_AMT",
|
||||
// "MISC_SUBLT",
|
||||
// "MISC_TAX",
|
||||
// "BETT_TYPE",
|
||||
// "BETT_PCTG",
|
||||
// "BETT_AMT",
|
||||
// "BETT_TAX",
|
||||
])
|
||||
);
|
||||
return _.transform(
|
||||
_.pick(record, [
|
||||
"LINE_NO",
|
||||
"LINE_IND",
|
||||
// "LINE_REF",
|
||||
// "TRAN_CODE",
|
||||
"DB_REF",
|
||||
"UNQ_SEQ",
|
||||
// "WHO_PAYS",
|
||||
"LINE_DESC",
|
||||
"PART_TYPE",
|
||||
// "PART_DESCJ",
|
||||
|
||||
let joblines = records.map((record) =>
|
||||
_.transform(
|
||||
_.pick(record, [
|
||||
// "LINE_NO",
|
||||
"LINE_IND",
|
||||
// "LINE_REF",
|
||||
// "TRAN_CODE",
|
||||
// "DB_REF",
|
||||
"UNQ_SEQ",
|
||||
// "WHO_PAYS",
|
||||
"LINE_DESC",
|
||||
"PART_TYPE",
|
||||
// "PART_DESCJ",
|
||||
// "GLASS_FLAG",
|
||||
"OEM_PARTNO",
|
||||
// "PRICE_INC",
|
||||
// "ALT_PART_I",
|
||||
// "TAX_PART",
|
||||
"DB_PRICE",
|
||||
"ACT_PRICE",
|
||||
// "PRICE_J",
|
||||
// "CERT_PART",
|
||||
"PART_QTY",
|
||||
// "ALT_CO_ID",
|
||||
// "ALT_PARTNO",
|
||||
// "ALT_OVERRD",
|
||||
// "ALT_PARTM",
|
||||
// "PRT_DSMK_P",
|
||||
// "PRT_DSMK_M",
|
||||
// "MOD_LBR_TY",
|
||||
// "DB_HRS",
|
||||
// "MOD_LB_HRS",
|
||||
// "LBR_INC",
|
||||
// "LBR_OP",
|
||||
// "LBR_HRS_J",
|
||||
// "LBR_TYP_J",
|
||||
// "LBR_OP_J",
|
||||
// "PAINT_STG",
|
||||
// "PAINT_TONE",
|
||||
// "LBR_TAX",
|
||||
// "LBR_AMT",
|
||||
// "MISC_AMT",
|
||||
// "MISC_SUBLT",
|
||||
// "MISC_TAX",
|
||||
// "BETT_TYPE",
|
||||
// "BETT_PCTG",
|
||||
// "BETT_AMT",
|
||||
// "BETT_TAX",
|
||||
]),
|
||||
function (result, val, key) {
|
||||
if (key === "UNQ_SEQ") {
|
||||
return (result[key.toLowerCase()] = val.toString());
|
||||
"OEM_PARTNO",
|
||||
// "PRICE_INC",
|
||||
// "ALT_PART_I",
|
||||
// "TAX_PART",
|
||||
"DB_PRICE",
|
||||
"ACT_PRICE",
|
||||
// "PRICE_J",
|
||||
// "CERT_PART",
|
||||
"PART_QTY",
|
||||
// "ALT_CO_ID",
|
||||
// "ALT_PARTNO",
|
||||
// "ALT_OVERRD",
|
||||
// "ALT_PARTM",
|
||||
// "PRT_DSMK_P",
|
||||
// "PRT_DSMK_M",
|
||||
// "MOD_LBR_TY",
|
||||
// "DB_HRS",
|
||||
// "MOD_LB_HRS",
|
||||
// "LBR_INC",
|
||||
// "LBR_OP",
|
||||
// "LBR_HRS_J",
|
||||
// "LBR_TYP_J",
|
||||
// "LBR_OP_J",
|
||||
// "PAINT_STG",
|
||||
// "PAINT_TONE",
|
||||
// "LBR_TAX",
|
||||
// "LBR_AMT",
|
||||
// "MISC_AMT",
|
||||
// "MISC_SUBLT",
|
||||
// "MISC_TAX",
|
||||
// "BETT_TYPE",
|
||||
// "BETT_PCTG",
|
||||
// "BETT_AMT",
|
||||
// "BETT_TAX",
|
||||
"GLASS_FLAG",
|
||||
]),
|
||||
function (result, val, key) {
|
||||
//Required because unq_seq gets pulled as a numeric instaed of a string.
|
||||
console.log("key", key);
|
||||
if (key === "UNQ_SEQ") {
|
||||
return (result[key.toLowerCase()] = val.toString());
|
||||
}
|
||||
return (result[key.toLowerCase()] = val);
|
||||
}
|
||||
return (result[key.toLowerCase()] = val);
|
||||
}
|
||||
);
|
||||
})
|
||||
.filter(
|
||||
(jobline) =>
|
||||
jobline.part_type &&
|
||||
!jobline.db_ref.startsWith("900") &&
|
||||
!jobline.db_ref.toLowerCase().startsWith("urethane") &&
|
||||
!jobline.db_ref.toLowerCase().startsWith("wheel") &&
|
||||
!jobline.db_ref.toLowerCase().startsWith("hazardous") &&
|
||||
!jobline.db_ref.toLowerCase().startsWith("detail") &&
|
||||
!jobline.db_ref.toLowerCase().startsWith("clean") &&
|
||||
jobline.part_type.toUpperCase() !== "PAG" &&
|
||||
jobline.part_type.toUpperCase() !== "PAS" &&
|
||||
jobline.part_type.toUpperCase() !== "PASL" &&
|
||||
jobline.part_type.toUpperCase() !== "PAE" &&
|
||||
jobline.glass_flag === false
|
||||
)
|
||||
);
|
||||
.map((jobline) => {
|
||||
if (
|
||||
(jobline.db_price === null || jobline.db_price === 0) &&
|
||||
!!jobline.act_price &&
|
||||
jobline.act_price > 0
|
||||
) {
|
||||
console.log(1, jobline.line_desc, jobline.db_price, jobline.act_price);
|
||||
log.info(
|
||||
"DB Price null/lower than act price",
|
||||
jobline.line_desc,
|
||||
jobline.db_price,
|
||||
jobline.act_price
|
||||
);
|
||||
jobline.db_price = jobline.act_price;
|
||||
}
|
||||
|
||||
if (
|
||||
jobline.db_price &&
|
||||
jobline.act_price &&
|
||||
jobline.act_price > jobline.db_price
|
||||
) {
|
||||
log.info(
|
||||
"Act price higher than existing db price",
|
||||
jobline.line_desc,
|
||||
jobline.db_price,
|
||||
jobline.act_price
|
||||
);
|
||||
console.log(2, jobline.line_desc, jobline.db_price, jobline.act_price);
|
||||
jobline.db_price = jobline.act_price;
|
||||
}
|
||||
|
||||
delete jobline.glass_flag;
|
||||
return jobline;
|
||||
});
|
||||
|
||||
return { joblines: { data: joblines } };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Store = require("electron-store");
|
||||
|
||||
const store = new Store({ defaults: { filePaths: [] } });
|
||||
const store = new Store({ defaults: { filePaths: [], accepted_ins_co: [] } });
|
||||
|
||||
exports.store = store;
|
||||
|
||||
@@ -3,7 +3,6 @@ const ipcTypes = require("../../src/ipc.types");
|
||||
const path = require("path");
|
||||
const { DecodeEstimate } = require("../decoder/decoder");
|
||||
const { BrowserWindow } = require("electron");
|
||||
const _ = require("lodash");
|
||||
const { store } = require("../electron-store");
|
||||
const {
|
||||
NewNotification,
|
||||
@@ -11,7 +10,7 @@ const {
|
||||
|
||||
var watcher;
|
||||
|
||||
function StartWatcher() {
|
||||
async function StartWatcher() {
|
||||
const filePaths =
|
||||
store.get("filePaths").map((fp) => path.join(fp, "**.[eE][nN][vV]")) || [];
|
||||
console.log("StartWatcher -> filePaths", filePaths);
|
||||
@@ -27,7 +26,9 @@ function StartWatcher() {
|
||||
if (watcher) {
|
||||
try {
|
||||
console.log("Trying to close watcher - it already existed.");
|
||||
watcher.close().then();
|
||||
await watcher.close();
|
||||
|
||||
console.log("Watcher closed successfully!");
|
||||
} catch (error) {
|
||||
console.log("Error trying to close Watcher.", error);
|
||||
}
|
||||
@@ -71,6 +72,7 @@ function StartWatcher() {
|
||||
// This event should be triggered everytime something happens.
|
||||
// console.log("Raw event info:", event, path, details);
|
||||
});
|
||||
|
||||
return filePaths;
|
||||
}
|
||||
|
||||
@@ -103,17 +105,21 @@ async function HandleNewFile(path) {
|
||||
const b = BrowserWindow.getAllWindows()[0];
|
||||
b.webContents.send(ipcTypes.default.estimate.toRenderer.estimateDecodeStart);
|
||||
const newJob = await DecodeEstimate(path);
|
||||
const newJobLow = _.transform(newJob, function (result, val, key) {
|
||||
result[key.toLowerCase()] = val;
|
||||
});
|
||||
|
||||
b.webContents.send(
|
||||
ipcTypes.default.estimate.toRenderer.estimateDecodeSuccess,
|
||||
newJobLow
|
||||
);
|
||||
if (newJob && !newJob.ERROR) {
|
||||
b.webContents.send(
|
||||
ipcTypes.default.estimate.toRenderer.estimateDecodeSuccess,
|
||||
newJob
|
||||
);
|
||||
|
||||
NewNotification({
|
||||
title: "Job Uploaded",
|
||||
body: "A new job has been uploaded.",
|
||||
}).show();
|
||||
NewNotification({
|
||||
title: "Job Uploaded",
|
||||
body: "A new job has been uploaded.",
|
||||
}).show();
|
||||
} else {
|
||||
NewNotification({
|
||||
title: "Job Ignored",
|
||||
body: newJob.ERROR,
|
||||
}).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const { ipcMain } = require("electron");
|
||||
const { default: ipcTypes } = require("../src/ipc.types");
|
||||
const { store } = require("./electron-store");
|
||||
const { mainWindow } = require("./main");
|
||||
//Import Ipc Handlers
|
||||
require("./file-watcher/file-watcher-ipc");
|
||||
@@ -11,3 +13,7 @@ ipcMain.on("test", async (event, object) => {
|
||||
console.log(mainWindow);
|
||||
event.reply("test-toRenderer", { status: 0, message: null });
|
||||
});
|
||||
|
||||
ipcMain.on(ipcTypes.app.toMain.setAcceptableInsCoNm, (event, insCos) => {
|
||||
store.set("accepted_ins_co", insCos);
|
||||
});
|
||||
|
||||
136
electron/main.js
136
electron/main.js
@@ -1,31 +1,91 @@
|
||||
const path = require("path");
|
||||
const { app, BrowserWindow, Tray, Menu, ipcMain } = require("electron");
|
||||
const {
|
||||
app,
|
||||
BrowserWindow,
|
||||
Tray,
|
||||
Menu,
|
||||
ipcMain,
|
||||
dialog,
|
||||
shell,
|
||||
globalShortcut,
|
||||
} = require("electron");
|
||||
const isDev = require("electron-is-dev");
|
||||
const { default: ipcTypes } = require("../src/ipc.types");
|
||||
const { store } = require("./electron-store");
|
||||
const { autoUpdater } = require("electron-updater");
|
||||
const log = require("electron-log");
|
||||
const { default: logger } = require("redux-logger");
|
||||
require("./ipc-main-handler");
|
||||
|
||||
autoUpdater.logger = log;
|
||||
autoUpdater.logger.transports.file.level = "info";
|
||||
log.info("App starting...");
|
||||
|
||||
// Conditionally include the dev tools installer to load React Dev Tools
|
||||
let installExtension, REACT_DEVELOPER_TOOLS;
|
||||
if (isDev) {
|
||||
const devTools = require("electron-devtools-installer");
|
||||
installExtension = devTools.default;
|
||||
REACT_DEVELOPER_TOOLS = devTools.REACT_DEVELOPER_TOOLS;
|
||||
}
|
||||
// if (isDev) {
|
||||
// const devTools = require("electron-devtools-installer");
|
||||
// installExtension = devTools.default;
|
||||
// REACT_DEVELOPER_TOOLS = devTools.REACT_DEVELOPER_TOOLS;
|
||||
// }
|
||||
|
||||
// Handle creating/removing shortcuts on Windows when installing/uninstalling
|
||||
if (require("electron-squirrel-startup")) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
console.log(`${__dirname}/preload.js`);
|
||||
var menu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: "File",
|
||||
submenu: [
|
||||
{
|
||||
label: "Relaunch",
|
||||
click() {
|
||||
app.exit();
|
||||
app.relaunch();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Clear Settings",
|
||||
click() {
|
||||
store.reset("filePaths");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Exit",
|
||||
click() {
|
||||
app.quit();
|
||||
},
|
||||
},
|
||||
],
|
||||
// Other code removed for brevity
|
||||
},
|
||||
{
|
||||
label: "Help",
|
||||
submenu: [
|
||||
{
|
||||
label: "Rescue",
|
||||
click() {
|
||||
shell.openExternal("http://imexrescue.com");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Check for Updates",
|
||||
click() {
|
||||
autoUpdater.checkForUpdatesAndNotify();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Open Log File",
|
||||
click() {
|
||||
shell.openPath(store.path);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
let mainWindow;
|
||||
let tray = null;
|
||||
function createWindow() {
|
||||
makeSingleInstance();
|
||||
// Create the browser window.
|
||||
|
||||
Menu.setApplicationMenu(menu);
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
@@ -34,6 +94,7 @@ function createWindow() {
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
enableRemoteModule: false,
|
||||
webSecurity: true,
|
||||
worldSafeExecuteJavaScript: true,
|
||||
contextIsolation: true,
|
||||
preload: path.join(__dirname, "preload.js"), // use a preload script
|
||||
@@ -44,7 +105,7 @@ function createWindow() {
|
||||
mainWindow.loadURL(
|
||||
isDev
|
||||
? "http://localhost:3000"
|
||||
: `file://${path.join(__dirname, "../build/index.html")}`
|
||||
: `file://${path.join(__dirname, "/../build/index.html")}`
|
||||
);
|
||||
|
||||
// mainWindow.on("close", function (event) {
|
||||
@@ -72,6 +133,11 @@ function createWindow() {
|
||||
}
|
||||
|
||||
mainWindow.maximize();
|
||||
autoUpdater.checkForUpdatesAndNotify();
|
||||
|
||||
globalShortcut.register("CommandOrControl+Shift+I", () => {
|
||||
mainWindow.webContents.toggleDevTools();
|
||||
});
|
||||
}
|
||||
|
||||
exports.mainWindow = mainWindow;
|
||||
@@ -83,6 +149,7 @@ app.whenReady().then(() => {
|
||||
|
||||
if (isDev) {
|
||||
console.log(`Path to Settings File: ${store.path}`);
|
||||
console.log(`Path to Log File: ${log.log}`);
|
||||
installExtension(REACT_DEVELOPER_TOOLS)
|
||||
.then((name) => console.log(`Added Extension: ${name}`))
|
||||
.catch((error) => console.log(`An error occurred: , ${error}`));
|
||||
@@ -95,6 +162,7 @@ app.whenReady().then(() => {
|
||||
});
|
||||
|
||||
if (isDev) app.setAppUserModelId(process.execPath);
|
||||
else app.setAppUserModelId("com.imex.rps");
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
@@ -152,3 +220,43 @@ function createTray() {
|
||||
appIcon.setContextMenu(contextMenu);
|
||||
return appIcon;
|
||||
}
|
||||
|
||||
autoUpdater.on("checking-for-update", () => {
|
||||
console.log("Checking for update...");
|
||||
});
|
||||
autoUpdater.on("update-available", (ev, info) => {
|
||||
console.log("Update available.");
|
||||
});
|
||||
autoUpdater.on("update-not-available", (ev, info) => {
|
||||
console.log("Update not available.");
|
||||
});
|
||||
autoUpdater.on("error", (ev, err) => {
|
||||
console.log("Error in auto-updater.");
|
||||
});
|
||||
autoUpdater.on("download-progress", (ev, progressObj) => {
|
||||
console.log("Download progress...");
|
||||
});
|
||||
autoUpdater.on("update-downloaded", (ev, info) => {
|
||||
console.log("Update downloaded; will install in 5 seconds");
|
||||
});
|
||||
autoUpdater.on("update-downloaded", (ev, info) => {
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
dialog.showMessageBox(
|
||||
{
|
||||
type: "info",
|
||||
title: "Found Updates",
|
||||
message: "Found updates, do you want update now?",
|
||||
buttons: ["Sure", "No"],
|
||||
},
|
||||
(buttonIndex) => {
|
||||
if (buttonIndex === 0) {
|
||||
const isSilent = true;
|
||||
const isForceRunAfter = true;
|
||||
autoUpdater.quitAndInstall(isSilent, isForceRunAfter);
|
||||
} else {
|
||||
logger.warn("Error");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ const path = require("path");
|
||||
|
||||
function NewNotification(config) {
|
||||
return Notification({
|
||||
|
||||
icon: path.join(__dirname, "../../src/assets/logo512.png"),
|
||||
...config,
|
||||
});
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
console.log("Running preloader!");
|
||||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
const log = require("electron-log");
|
||||
|
||||
//ipcRenderer.removeAllListeners();
|
||||
contextBridge.exposeInMainWorld("logger", {
|
||||
info: (...msg) => {
|
||||
log.info(...msg);
|
||||
},
|
||||
debug: (...msg) => {
|
||||
log.debug(...msg);
|
||||
},
|
||||
warn: (...msg) => {
|
||||
log.warn(...msg);
|
||||
},
|
||||
error: (...msg) => {
|
||||
log.error(...msg);
|
||||
},
|
||||
silly: (...msg) => {
|
||||
log.silly(...msg);
|
||||
},
|
||||
});
|
||||
|
||||
ipcRenderer.removeAllListeners();
|
||||
contextBridge.exposeInMainWorld("ipcRenderer", {
|
||||
send: (channel, data) => {
|
||||
// whitelist channels
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" DROP COLUMN "db_ref";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" ADD COLUMN "db_ref" text NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,35 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- act_price
|
||||
- db_price
|
||||
- part_qty
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_type
|
||||
- unq_seq
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- jobid
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,36 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,35 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- act_price
|
||||
- db_price
|
||||
- part_qty
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_type
|
||||
- unq_seq
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- jobid
|
||||
computed_fields: []
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,36 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,34 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- db_price
|
||||
- part_qty
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_type
|
||||
- unq_seq
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- jobid
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,35 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" DROP COLUMN "line_no";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" ADD COLUMN "line_no" numeric NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,36 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,36 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,35 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,36 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_delete_permission
|
||||
@@ -0,0 +1,15 @@
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_delete_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" DROP COLUMN "group";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" ADD COLUMN "group" text NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- id
|
||||
- bodyshopid
|
||||
- created_at
|
||||
- updated_at
|
||||
- ro_number
|
||||
- ins_co_nm
|
||||
- clm_no
|
||||
- clm_total
|
||||
- ownr_ln
|
||||
- ownr_fn
|
||||
- v_vin
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,38 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- clm_total
|
||||
- clm_no
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
- created_at
|
||||
- updated_at
|
||||
- bodyshopid
|
||||
- id
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,38 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,36 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- clm_total
|
||||
- clm_no
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
- created_at
|
||||
- updated_at
|
||||
- bodyshopid
|
||||
- id
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" DROP COLUMN "v_mileage";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" ADD COLUMN "v_mileage" numeric NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,38 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,38 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,38 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: DROP TABLE "public"."veh_groups";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,23 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
type: run_sql
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "CREATE TABLE \"public\".\"veh_groups\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
\"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz
|
||||
NOT NULL DEFAULT now(), \"make\" text NOT NULL, \"type\" text NOT NULL, \"group\"
|
||||
text NOT NULL, PRIMARY KEY (\"id\") );\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
|
||||
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
|
||||
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_veh_groups_updated_at\"\nBEFORE
|
||||
UPDATE ON \"public\".\"veh_groups\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
|
||||
ON TRIGGER \"set_public_veh_groups_updated_at\" ON \"public\".\"veh_groups\"
|
||||
\nIS 'trigger to set value of column \"updated_at\" to current timestamp on
|
||||
row update';"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: veh_groups
|
||||
schema: public
|
||||
type: add_existing_table_or_view
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: veh_groups
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
@@ -0,0 +1,19 @@
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
backend_only: false
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- make
|
||||
- type
|
||||
- group
|
||||
computed_fields: []
|
||||
filter: {}
|
||||
limit: null
|
||||
role: user
|
||||
table:
|
||||
name: veh_groups
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."veh_groups" ALTER COLUMN "type" SET NOT NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."veh_groups" ALTER COLUMN "type" DROP NOT NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" DROP COLUMN "v_age";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" ADD COLUMN "v_age" numeric NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,40 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,40 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,38 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" DROP COLUMN "asgn_date";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."jobs" ADD COLUMN "asgn_date" date NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,40 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,41 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- asgn_date
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,40 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,41 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: true
|
||||
columns:
|
||||
- asgn_date
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,40 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- asgn_date
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- created_at
|
||||
- group
|
||||
- id
|
||||
- ins_co_nm
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: alter table "public"."jobs" rename column "loss_date" to "asgn_date";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: alter table "public"."jobs" rename column "asgn_date" to "loss_date";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" DROP COLUMN "price_diff";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" ADD COLUMN "price_diff" numeric NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" DROP COLUMN "price_diff_pc";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."joblines" ADD COLUMN "price_diff_pc" numeric NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
20
hasura/migrations/1602875306082_run_sql_migration/up.yaml
Normal file
20
hasura/migrations/1602875306082_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
- args:
|
||||
cascade: true
|
||||
read_only: false
|
||||
sql: |-
|
||||
CREATE OR REPLACE FUNCTION public.calculate_job_line()
|
||||
RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."price_diff" = _new."db_price" - _new."act_price";
|
||||
_new."price_diff_pc" = (_new."db_price" - _new."act_price") / _new."db_price";
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$function$
|
||||
;
|
||||
type: run_sql
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,9 @@
|
||||
- args:
|
||||
cascade: true
|
||||
read_only: false
|
||||
sql: "CREATE OR REPLACE FUNCTION public.calculate_job_line()\n RETURNS trigger\n
|
||||
LANGUAGE plpgsql\nAS $function$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n
|
||||
_new.\"price_diff\" = _new.\"db_price\" - _new.\"act_price\";\n\nif _new.\"db_price\"
|
||||
> 0 then \n_new.\"price_diff_pc\" = (_new.\"db_price\" - _new.\"act_price\")
|
||||
/ _new.\"db_price\";\n\nend if;\n\n RETURN _new;\nEND;\n$function$\n;"
|
||||
type: run_sql
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,9 @@
|
||||
- args:
|
||||
cascade: true
|
||||
read_only: false
|
||||
sql: |-
|
||||
create trigger calculate_updated_job_line before
|
||||
update
|
||||
on
|
||||
public.joblines for each row execute procedure calculate_job_line();
|
||||
type: run_sql
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
check:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- price_diff
|
||||
- price_diff_pc
|
||||
- unq_seq
|
||||
- updated_at
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,37 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,39 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- price_diff
|
||||
- price_diff_pc
|
||||
- unq_seq
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,36 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- unq_seq
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,38 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- price_diff
|
||||
- price_diff_pc
|
||||
- unq_seq
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: DROP TABLE "public"."targets";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,23 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
type: run_sql
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "CREATE TABLE \"public\".\"targets\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
\"updated_at\" timestamptz NOT NULL DEFAULT now(), \"created_at\" timestamptz
|
||||
NOT NULL DEFAULT now(), \"label\" text NOT NULL, \"config\" jsonb NOT NULL DEFAULT
|
||||
jsonb_build_object(), \"start_date\" date NOT NULL, \"end_date\" date, PRIMARY
|
||||
KEY (\"id\") );\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
|
||||
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
|
||||
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_targets_updated_at\"\nBEFORE
|
||||
UPDATE ON \"public\".\"targets\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
|
||||
ON TRIGGER \"set_public_targets_updated_at\" ON \"public\".\"targets\" \nIS
|
||||
'trigger to set value of column \"updated_at\" to current timestamp on row update';"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: targets
|
||||
schema: public
|
||||
type: add_existing_table_or_view
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: targets
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
@@ -0,0 +1,20 @@
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
backend_only: false
|
||||
columns:
|
||||
- id
|
||||
- updated_at
|
||||
- created_at
|
||||
- label
|
||||
- config
|
||||
- start_date
|
||||
- end_date
|
||||
computed_fields: []
|
||||
filter: {}
|
||||
limit: null
|
||||
role: user
|
||||
table:
|
||||
name: targets
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: DROP TABLE "public"."targets";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "targets";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "targets" jsonb NULL DEFAULT
|
||||
jsonb_build_object();
|
||||
type: run_sql
|
||||
@@ -0,0 +1,25 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- shopname
|
||||
computed_fields: []
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,26 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- created_at
|
||||
- id
|
||||
- shopname
|
||||
- targets
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
@@ -0,0 +1,16 @@
|
||||
- args:
|
||||
permission:
|
||||
backend_only: false
|
||||
columns:
|
||||
- targets
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "accepted_ins_co";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "accepted_ins_co" jsonb NULL
|
||||
DEFAULT jsonb_build_array();
|
||||
type: run_sql
|
||||
@@ -0,0 +1,26 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- created_at
|
||||
- id
|
||||
- shopname
|
||||
- targets
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,27 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- created_at
|
||||
- id
|
||||
- shopname
|
||||
- targets
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,21 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- targets
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user