Fix compliance checker: include structured_checks + pdf_checks from audit
Was only reading pdf_checks, missing structured_checks. Also skip minor-only issues — show major/critical that match email campaign data. This fixes the "clean" result for carriers our audit flagged as deficient. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9c1b1387cb
commit
b5282f5e00
1 changed files with 5 additions and 2 deletions
|
|
@ -291,8 +291,11 @@ router.get("/api/v1/fcc/lookup", async (req, res) => {
|
|||
);
|
||||
if (auditRow.rows.length > 0) {
|
||||
const audit = auditRow.rows[0] as Record<string, unknown>;
|
||||
const pChecks = (audit.pdf_checks as Array<{ label: string; severity: string }>) || [];
|
||||
for (const pc of pChecks) {
|
||||
// Merge both structured and PDF audit checks
|
||||
const pChecks = (audit.pdf_checks as Array<{ id?: string; label: string; severity: string }>) || [];
|
||||
const sChecks = (audit.structured_checks as Array<{ id?: string; label: string; severity: string }>) || [];
|
||||
for (const pc of [...sChecks, ...pChecks]) {
|
||||
if (pc.severity === "minor") continue; // only show major/critical
|
||||
if (pc.label && !rmdIssues.some(i => i.label === pc.label)) {
|
||||
rmdIssues.push(pc);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue