fix: inactive carriers show yellow warning instead of green, even if FMCSA says 'allowed'
This commit is contained in:
parent
18fb45dba0
commit
2b8e2cf7ea
1 changed files with 7 additions and 3 deletions
|
|
@ -98,12 +98,16 @@ router.get("/api/v1/dot/lookup", async (req, res) => {
|
||||||
C: "Cancelled",
|
C: "Cancelled",
|
||||||
};
|
};
|
||||||
const statusLabel = statusLabels[statusCode] || statusCode;
|
const statusLabel = statusLabels[statusCode] || statusCode;
|
||||||
|
const isInactive = statusCode === "I" || statusCode === "S" || statusCode === "C";
|
||||||
|
const effectiveStatus = allowed && !isInactive ? "green" : isInactive && allowed ? "yellow" : "red";
|
||||||
checks.push({
|
checks.push({
|
||||||
id: "operating_status",
|
id: "operating_status",
|
||||||
label: "Operating Status",
|
label: "Operating Status",
|
||||||
status: allowed ? "green" : "red",
|
status: effectiveStatus,
|
||||||
detail: allowed
|
detail: effectiveStatus === "green"
|
||||||
? `Authorized to operate (${statusLabel}).`
|
? `Active and authorized to operate.`
|
||||||
|
: effectiveStatus === "yellow"
|
||||||
|
? `USDOT status is ${statusLabel}, but FMCSA still shows as authorized. This may indicate your registration needs to be updated or reactivated. Contact FMCSA at (800) 832-5660 if this is incorrect.`
|
||||||
: `NOT authorized to operate — ${statusLabel}. ${
|
: `NOT authorized to operate — ${statusLabel}. ${
|
||||||
statusCode === "I" ? "This USDOT number is inactive. You may need to reactivate it before operating."
|
statusCode === "I" ? "This USDOT number is inactive. You may need to reactivate it before operating."
|
||||||
: statusCode === "N" ? "This carrier is not authorized. Operating authority may be required."
|
: statusCode === "N" ? "This carrier is not authorized. Operating authority may be required."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue