IO-117 WIP PBS

This commit is contained in:
Patrick Fic
2021-11-10 15:30:07 -08:00
parent d50e845ba0
commit 7e1431d65e
3 changed files with 173 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ const CdkCalculateAllocations =
require("../cdk/cdk-calculate-allocations").default;
const { isArray } = require("lodash");
const logger = require("../utils/logger");
const PbsExportJob = require("../accounting/pbs/pbs-job-export").default;
const {default: PbsExportJob, PbsSelectedCustomer} = require("../accounting/pbs/pbs-job-export");
io.use(function (socket, next) {
try {
@@ -113,6 +113,15 @@ io.on("connection", (socket) => {
socket.on("pbs-export-job", (jobid) => {
PbsExportJob(socket, jobid);
});
socket.on("pbs-selected-customer", (selectedCustomerId) => {
createLogEvent(
socket,
"DEBUG",
`User selected customer ID ${selectedCustomerId}`
);
socket.selectedCustomerId = selectedCustomerId;
PbsSelectedCustomer(socket, selectedCustomerId);
});
//End PBS
socket.on("disconnect", () => {