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

@@ -3,11 +3,11 @@ import log from "electron-log/main";
import _ from "lodash";
import deepLowerCaseKeys from "../../util/deepLowercaseKeys";
import errorTypeCheck from "../../util/errorTypeCheck";
import { DecodedStl } from "./decode-stl.interface";
import { DecodedStl, DecodedStlLine } from "./decode-stl.interface";
const DecodeStl = async (
extensionlessFilePath: string
): Promise<DecodedStl[]> => {
): Promise<DecodedStl> => {
let dbf: DBFFile | null = null;
try {
dbf = await DBFFile.open(`${extensionlessFilePath}.STL`);
@@ -25,8 +25,8 @@ const DecodeStl = async (
//AD2 will always have only 1 row.
//Commented lines have been cross referenced with existing partner fields.
const rawStlData: DecodedStl[] = rawDBFRecord.map((record) => {
const singleLineData: DecodedStl = deepLowerCaseKeys(
const rawStlData: DecodedStlLine[] = rawDBFRecord.map((record) => {
const singleLineData: DecodedStlLine = deepLowerCaseKeys(
_.pick(record, [
//TODO: Add typings for EMS File Formats.
"TTL_TYPE",
@@ -57,6 +57,6 @@ const DecodeStl = async (
//Apply business logic transfomrations.
//We don't have an inspection date, we instead have `date_estimated`
return rawStlData;
return { cieca_stl: rawStlData };
};
export default DecodeStl;