Add initial serverless setup.
This commit is contained in:
@@ -188,8 +188,8 @@ export interface ESJobObject extends Omit<
|
||||
close_date: string | null;
|
||||
created_at: string;
|
||||
id: string;
|
||||
group: string;
|
||||
group_verified: boolean;
|
||||
group?: string;
|
||||
group_verified?: boolean;
|
||||
updated_at: string;
|
||||
v_age: number;
|
||||
v_type: string;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { RawJobDataObject } from "../decoder/decoder";
|
||||
import { ESJobObject } from "./es-job-object.interface";
|
||||
import _ from "lodash";
|
||||
|
||||
import dayjas from "dayjs";
|
||||
import dayjs from "dayjs";
|
||||
import axios from "axios";
|
||||
const sendingEntityId = "87330f61-412b-4251-baaa-d026565b23c5";
|
||||
|
||||
function TransformJobForEstimateScrubber(job: RawJobDataObject): ESJobObject {
|
||||
async function TransformJobForEstimateScrubber(
|
||||
job: RawJobDataObject,
|
||||
): Promise<ESJobObject> {
|
||||
//Take the job object and strip off everything we don't need.
|
||||
const omittedJob = _.omit(job, [
|
||||
"cat_no",
|
||||
@@ -190,17 +194,23 @@ function TransformJobForEstimateScrubber(job: RawJobDataObject): ESJobObject {
|
||||
|
||||
//Add the ES Objects.
|
||||
|
||||
const vehType: string = (
|
||||
await axios.post(`https://api.test.imex.online/es/vehicletype`, {
|
||||
model: job.v_model_desc,
|
||||
})
|
||||
).data?.type;
|
||||
|
||||
return {
|
||||
//TODO: Remove hard coded values
|
||||
...omittedJob,
|
||||
impact_1: job.area_of_damage?.impact1,
|
||||
impact_2: job.area_of_damage?.impact2,
|
||||
close_date: null,
|
||||
created_at: "2025-12-11T18:09:14.085604+00:00",
|
||||
created_at: dayjs().toISOString(),
|
||||
id: "c478593b-58a2-4bab-b7c7-2df19a257b2b",
|
||||
group: "Group 10",
|
||||
group_verified: false,
|
||||
updated_at: "2025-12-11T18:09:14.085604+00:00",
|
||||
// group: "Group 10",
|
||||
// group_verified: false,
|
||||
updated_at: dayjs().toISOString(),
|
||||
v_age: 20, //Needed? RPS calc.
|
||||
v_type: "PC", // need to get from API.
|
||||
v_makedesc: job.v_make_desc,
|
||||
|
||||
@@ -47,7 +47,7 @@ async function ScrubEstimate({
|
||||
|
||||
//Scrub Estimate Transformer. Original schema kept to keep data in line with ImEX standards.
|
||||
|
||||
const transformedJob = TransformJobForEstimateScrubber(job);
|
||||
const transformedJob = await TransformJobForEstimateScrubber(job);
|
||||
const basicAuthUser = "Imex2";
|
||||
const basicAuthpassword = "Patrick";
|
||||
const currentChannel = autoUpdater.channel;
|
||||
|
||||
Reference in New Issue
Block a user