Almost matching export.

This commit is contained in:
Patrick Fic
2025-03-20 12:50:47 -07:00
parent 2e5fe7c99d
commit 45209bd9e4
32 changed files with 490 additions and 120 deletions

View File

@@ -4,6 +4,7 @@ import _ from "lodash";
import deepLowerCaseKeys from "../../util/deepLowercaseKeys";
import { DecodedVeh, VehicleRecordInterface } from "./decode-veh.interface";
import errorTypeCheck from "../../util/errorTypeCheck";
import store from "../store/store";
const DecodeVeh = async (
extensionlessFilePath: string
@@ -85,10 +86,10 @@ const DecodeVeh = async (
delete rawVehData.paint_cd2;
delete rawVehData.paint_cd3;
rawVehData.shopid = "UUID"; //TODO: Pass down the shopid for generation.
rawVehData.shopid = store.get("app.bodyshop.id");
//Aggregate the vehicle data to be stamped onto the job record.
const jobVehiclData = {
const jobVehicleData: DecodedVeh = {
plate_no: rawVehData.plate_no,
plate_st: rawVehData.plate_st,
v_vin: rawVehData.v_vin,
@@ -97,14 +98,13 @@ const DecodeVeh = async (
v_model_desc: rawVehData.v_model_desc,
v_color: rawVehData.v_color,
kmin: rawVehData.v_mileage,
};
return {
...jobVehiclData,
area_of_damage: rawVehData.area_of_damage,
vehicle: {
data: rawVehData,
},
};
return jobVehicleData;
};
export default DecodeVeh;