Refactor decode to match existing partner.

This commit is contained in:
Patrick Fic
2025-03-20 13:44:23 -07:00
parent 45209bd9e4
commit 4310b3779a
10 changed files with 83 additions and 7 deletions

View File

@@ -19,5 +19,5 @@ export interface DecodedStlLine {
ttl_amt?: number;
}
export interface DecodedStl {
cieca_stl: DecodedStlLine[];
cieca_stl: { data: DecodedStlLine[] };
}

View File

@@ -57,6 +57,6 @@ const DecodeStl = async (
//Apply business logic transfomrations.
//We don't have an inspection date, we instead have `date_estimated`
return { cieca_stl: rawStlData };
return { cieca_stl: { data: rawStlData } };
};
export default DecodeStl;

View File

@@ -25,7 +25,7 @@ export interface VehicleRecordInterface {
impact2?: string;
};
// Paint code information
paint_codes: {
v_paint_codes: {
paint_cd1: string;
paint_cd2: string;
paint_cd3: string;

View File

@@ -77,7 +77,7 @@ const DecodeVeh = async (
delete rawVehData.impact_2;
//Consolidate Paint Code information.
rawVehData.paint_codes = {
rawVehData.v_paint_codes = {
paint_cd1: rawVehData.paint_cd1 ?? "",
paint_cd2: rawVehData.paint_cd2 ?? "",
paint_cd3: rawVehData.paint_cd3 ?? "",