Merge branch 'master-AIO' into feature/IO-2776-cdk-fortellis

This commit is contained in:
Patrick Fic
2025-09-11 14:40:20 -07:00
19 changed files with 128 additions and 66 deletions

View File

@@ -88,7 +88,7 @@ const partsManagementDeprovisioning = async (req, res) => {
const { logger } = req;
const { shopId } = req.body;
if (process.env.NODE_ENV === "production") {
if (process.env.NODE_ENV === "production" || process.env.HOSTNAME?.endsWith("compute.internal")) {
return res.status(403).json({ error: "Deprovisioning not allowed in production environment." });
}

View File

@@ -91,7 +91,8 @@ const extractUpdatedJobLines = (addsChgs = {}, jobId, currentJobLineNotes = {})
unq_seq: parseInt(line.UniqueSequenceNum || 0, 10),
status: line.LineStatusCode || null,
line_desc: line.LineDesc || null,
manual_line: line.ManualLineInd !== undefined ? coerceManual(line.ManualLineInd) : null
manual_line: false
// manual_line: line.ManualLineInd !== undefined ? coerceManual(line.ManualLineInd) : null
};
const lineOut = { ...base };

View File

@@ -1,5 +1,6 @@
const express = require("express");
const router = express.Router();
const logger = require("../../server/utils/logger");
// Pull secrets from env
const { VSSTA_INTEGRATION_SECRET, PARTS_MANAGEMENT_INTEGRATION_SECRET } = process.env;
@@ -11,7 +12,7 @@ if (typeof VSSTA_INTEGRATION_SECRET === "string" && VSSTA_INTEGRATION_SECRET.len
router.post("/vssta", vsstaMiddleware, vsstaIntegration);
} else {
console.warn("VSSTA_INTEGRATION_SECRET is not set — skipping /vssta integration route");
logger.logger.warn("VSSTA_INTEGRATION_SECRET is not set — skipping /vssta integration route");
}
// Only load Parts Management routes if that secret is set
@@ -45,14 +46,17 @@ if (typeof PARTS_MANAGEMENT_INTEGRATION_SECRET === "string" && PARTS_MANAGEMENT_
);
// Deprovisioning route
router.post("/parts-management/deprovision", partsManagementIntegrationMiddleware, partsManagementDeprovisioning);
if (process.env.NODE_ENV !== "production" && !process.env.HOSTNAME?.endsWith("compute.internal")) {
logger.logger.warn("Parts Management Deprovisioning route has been loaded.");
router.post("/parts-management/deprovision", partsManagementIntegrationMiddleware, partsManagementDeprovisioning);
}
/**
* Route to handle Parts Management Provisioning
*/
router.post("/parts-management/provision", partsManagementIntegrationMiddleware, partsManagementProvisioning);
} else {
console.warn("PARTS_MANAGEMENT_INTEGRATION_SECRET is not set — skipping /parts-management/provision route");
logger.logger.warn("PARTS_MANAGEMENT_INTEGRATION_SECRET is not set — skipping /parts-management/provision route");
}
module.exports = router;