release/2024-11-01 - Misc fixes
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -15,7 +15,7 @@ const jobUpdated = async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
logger.log("job-update", "INFO", req.user?.email, null, {
|
||||
logger.log("job-update", "DEBUG", req.user?.email, null, {
|
||||
message: `Job updated event received from Hasura`,
|
||||
jobid: req?.body?.event?.data?.new?.id
|
||||
});
|
||||
|
||||
@@ -9,11 +9,9 @@ require("dotenv").config({
|
||||
});
|
||||
|
||||
exports.mixdataUpload = async (req, res) => {
|
||||
const { bodyshopid } = req.body;
|
||||
|
||||
const client = req.userGraphQLClient;
|
||||
|
||||
logger.log("job-mixdata-upload", "DEBUG", req.user.email, null, null);
|
||||
logger.log("job-mixdata-upload", "DEBUG", req?.user?.email, null, null);
|
||||
|
||||
try {
|
||||
for (const element of req.files) {
|
||||
@@ -23,7 +21,7 @@ exports.mixdataUpload = async (req, res) => {
|
||||
explicitArray: false
|
||||
});
|
||||
|
||||
logger.log("job-mixdata-parse", "DEBUG", req.user.email, inboundRequest);
|
||||
logger.log("job-mixdata-parse", "DEBUG", req?.user?.email, null, { inboundRequest });
|
||||
|
||||
const ScaleType = DetermineScaleType(inboundRequest);
|
||||
const RoNumbersFromInboundRequest = GetListOfRos(inboundRequest, ScaleType);
|
||||
@@ -70,7 +68,7 @@ function DetermineScaleType(inboundRequest) {
|
||||
const ret = { type: "", verson: 0 };
|
||||
|
||||
//PPG Mix Data
|
||||
if (inboundRequest.PPG && inboundRequest.PPG.Header.Protocol.Name === "PPG") {
|
||||
if (inboundRequest?.PPG?.Header?.Protocol?.Name === "PPG") {
|
||||
return {
|
||||
type: inboundRequest.PPG.Header.Protocol.Name,
|
||||
company: "PPG",
|
||||
@@ -80,13 +78,13 @@ function DetermineScaleType(inboundRequest) {
|
||||
}
|
||||
|
||||
function GetListOfRos(inboundRequest, ScaleType) {
|
||||
if (ScaleType.company === "PPG" && ScaleType.version === "1.3.0") {
|
||||
if (ScaleType?.company === "PPG" && ScaleType?.version === "1.3.0") {
|
||||
return inboundRequest.PPG.MixDataInterface.ROData.RepairOrders.RO.map((r) => r.RONumber);
|
||||
}
|
||||
}
|
||||
|
||||
function GenerateMixDataArray(inboundRequest, ScaleType, jobHash) {
|
||||
if (ScaleType.company === "PPG" && ScaleType.version === "1.3.0") {
|
||||
if (ScaleType?.company === "PPG" && ScaleType?.version === "1.3.0") {
|
||||
return inboundRequest.PPG.MixDataInterface.ROData.RepairOrders.RO.map((r) => {
|
||||
return {
|
||||
jobid: jobHash[r.RONumber]?.jobid,
|
||||
|
||||
Reference in New Issue
Block a user