IO-233 Beging get vehicle makes

This commit is contained in:
Patrick Fic
2021-08-11 11:08:03 -07:00
parent 6b64499e24
commit fd7c907b8f
13 changed files with 408 additions and 75 deletions

View File

@@ -9,6 +9,7 @@ require("dotenv").config({
const { io } = require("../../server");
const { admin } = require("../firebase/firebase-handler");
const CdkJobExport = require("../cdk/cdk-job-export").default;
const CdkGetMakes = require("../cdk/cdk-get-makes").default;
const CdkCalculateAllocations =
require("../cdk/cdk-calculate-allocations").default;
const { isArray } = require("lodash");
@@ -62,6 +63,11 @@ io.on("connection", (socket) => {
//CdkJobExport(socket, jobid);
});
socket.on("cdk-get-makes", async (cdk_dealerid, callback) => {
const makes = await CdkGetMakes(socket, cdk_dealerid);
callback(makes);
});
socket.on("cdk-calculate-allocations", async (jobid, callback) => {
const allocations = await CdkCalculateAllocations(socket, jobid);
createLogEvent(socket, "DEBUG", `Allocations calculated.`);