Add re-queue findings from rejected FP submissions

New feature: users can re-queue findings from a rejected FP submission
back into the Ivanti todo queue under a different workflow type (FP,
Archer, CARD, GRANITE, or DECOM). Primary use case is when an FP is
rejected with a recommendation to submit an Archer risk acceptance.

Backend:
- New migration: add requeued_at column to ivanti_fp_submissions
- New endpoint: POST /api/ivanti/fp-workflow/submissions/:id/requeue
  - Validates workflow_type and vendor (required for FP/Archer/DECOM)
  - Creates new pending queue items from original finding data
  - Marks submission as requeued (prevents double re-queue)
  - Audit logs the action

Frontend (ReportingPage.js):
- RequeueConfirmDialog component with workflow type selector and vendor input
- Re-queue Findings button in Edit FP Modal header (rejected submissions only)
- Already re-queued label when submission.requeued_at is set
- Success notification on completion
This commit is contained in:
Jordan Ramos
2026-05-13 16:46:49 -06:00
parent 828e7cc45d
commit 0fefd2a707
4 changed files with 635 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
// Migration: Add requeued_at column to ivanti_fp_submissions table
const pool = require('../db');
async function run() {
console.log('Starting FP submissions requeued_at migration...');
try {
await pool.query(`ALTER TABLE ivanti_fp_submissions ADD COLUMN IF NOT EXISTS requeued_at TIMESTAMPTZ DEFAULT NULL`);
console.log('✓ requeued_at column added (or already exists)');
} catch (err) {
console.error('Error adding requeued_at column:', err.message);
process.exit(1);
}
console.log('Migration complete.');
process.exit(0);
}
run();

View File

@@ -16,6 +16,7 @@ const MIGRATIONS_DIR = __dirname;
const POSTGRES_MIGRATIONS = [
'add_decom_workflow_type.js',
'add_fp_submissions_dismissed.js',
'add_fp_submissions_requeued_at.js',
'add_vcl_reporting_columns.js',
'add_vcl_vertical_metadata.js',
];