Almost matching export.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user