Initial working ATA scrubbing.

This commit is contained in:
Patrick Fic
2025-07-11 16:13:45 -07:00
parent a1dfcf4457
commit dcc59ab2fe
5 changed files with 20 additions and 13 deletions

View File

@@ -287,7 +287,7 @@ async function DecodeVehFile(extensionlessFilePath) {
// "V_ENGINE",
// "V_COLOR",
// "V_TONE",
"V_STAGE",
"V_STAGE",
// "PAINT_CD1",
// "PAINT_CD2",
// "PAINT_CD3",
@@ -400,7 +400,7 @@ async function DecodePflFile(extensionlessFilePath,) {
let dbf = await DBFFile.open(`${extensionlessFilePath}.PFL`);
let records = await dbf.readRecords();
let pflLines = records.map((record) => {
return _.transform(
return (
_.pick(record, [
"LBR_TYPE", "LBR_DESC", "LBR_RATE"
])
@@ -415,7 +415,7 @@ async function DecodeStlFile(extensionlessFilePath,) {
let dbf = await DBFFile.open(`${extensionlessFilePath}.STL`);
let records = await dbf.readRecords();
let pflLines = records.map((record) => {
return _.transform(
return (
_.pick(record, [
"TTL_TYPECD", "T_AMT", 'T_HRS', "NT_HRS"
])
@@ -431,7 +431,7 @@ async function DecodePfmFile(extensionlessFilePath,) {
let dbf = await DBFFile.open(`${extensionlessFilePath}.PFM`);
let records = await dbf.readRecords();
let pflLines = records.map((record) => {
return _.transform(
return (
_.pick(record, [
"MAT_TYPE", "CAL_PRETHR"
])

View File

@@ -8,7 +8,6 @@ const axios = require("axios");
const TestJson = require("./A.json");
const { BrowserWindow } = require("electron");
async function ScrubEstimate({ job }) {
//TODO: Fetch these from ImEX Online API.
const basicAuthUser = "Imex";
@@ -26,12 +25,14 @@ async function ScrubEstimate({ job }) {
job.sending_entity_id = sendingEntityId;
job.sending_entity_accept_terms_of_use = true;
job.association_switch = "ATAM";
job.rf_ph1 = "R0G 1Z0";
job.rf_zip = "2043792253";
job.rf_zip = "R0G 1Z0";
job.rf_ph1 = "2043792253";
job.g_ttl_amt = job.clm_total;
delete job.clm_total;
console.log("*** ~ ScrubEstimate ~ job:", job);
log.debug("Estimate Scrubber Job Data:", job);
//Build the JSON Form Data
const fileName = `RPSTest-${job.id}-${Date.now()}`;
const formData = new FormData();
@@ -45,11 +46,10 @@ async function ScrubEstimate({ job }) {
},
headers: formData.getHeaders ? formData.getHeaders() : {}
});
console.log("*** ~ handleScrub ~ result:", result.data);
const resultPDFUrl = result?.data?.[0] || `https://www.insurtechtoolkit.com/analysis/${fileName}.pdf`;
console.log("*** ~ handleScrub ~ resultPDFUrl:", resultPDFUrl);
log.debug("Estimate Scrubber Result:", result.data, resultPDFUrl);
const pdfWindow = new BrowserWindow({
webPreferences: {