diff --git a/electron/estimate-scrubber/estimate-scrubber.js b/electron/estimate-scrubber/estimate-scrubber.js index feb6820..5c028bf 100644 --- a/electron/estimate-scrubber/estimate-scrubber.js +++ b/electron/estimate-scrubber/estimate-scrubber.js @@ -2,6 +2,7 @@ const log = require("electron-log"); const axios = require("axios"); const { path } = require("path"); const { BrowserWindow } = require("electron"); +const { default: ipcTypes } = require("../../src/ipc.types.commonjs"); // Function to write job object to logs subfolder async function writeJobToLogsFolder(job, fileName) { @@ -30,7 +31,7 @@ async function writeJobToLogsFolder(job, fileName) { async function ScrubEstimate({ job }) { //These are hard coded as they are not secure values and checking happens based on other values. //No secret or private information is exposed. - const basicAuthUser = "Imex"; + const basicAuthUser = "Imex2"; const basicAuthpassword = "Patrick"; const estimateScrubberUrl = "https://insurtechtoolkit.com/api/sendems"; const sendingEntityId = '87330f61-412b-4251-baaa-d026565b23c5' @@ -103,10 +104,17 @@ async function ScrubEstimate({ job }) { }, headers: formData.getHeaders ? formData.getHeaders() : {} }); + console.log("*** ~ ScrubEstimate ~ result:", result); - const resultPDFUrl = result?.data?.[0] || `https://www.insurtechtoolkit.com/analysis/${fileName}.pdf`; + const resultPDFUrl = result?.data?.report_link log.log("Estimate Scrubber Result:", result.data, resultPDFUrl); + const b = BrowserWindow.getAllWindows()[0]; + b.webContents.send(ipcTypes.app.toRenderer.scrubResults, { + jobid: job.id, + items: result.data?.identified_item + }); + const pdfWindow = new BrowserWindow({ webPreferences: { diff --git a/package.json b/package.json index 3286f41..a1d8e92 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "ImEX RPS", "author": "ImEX Systems Inc. ", "description": "ImEX RPS", - "version": "1.4.2-alpha.6", + "version": "1.4.2-alpha.7", "main": "electron/main.js", "homepage": "./", "dependencies": { diff --git a/src/ipc.types.json b/src/ipc.types.json index a7e9894..f3be029 100644 --- a/src/ipc.types.json +++ b/src/ipc.types.json @@ -30,7 +30,8 @@ "downloadProgress": "app_downloadProgress", "signOut": "app_signOut", "setReleaseNotes": "app_setReleaseNotes", - "appVersion": "app_appVersion" + "appVersion": "app_appVersion", + "scrubResults": "app_scrubResults" } }, "store": {