Fraud Detection Dashboard
Priority Queue (Highest Value)
Open Cases by Flag Reason
No open cases in the queue.
';
return;
}
container.innerHTML = sortedByValue.map(c => `
${c.ID} - ${c.Reason}
${c.Timestamp.replace('T', ' ')} • Analyst: ${c.Analyst}
${formatCurrency(c.Amount)}
`).join('');
}
function renderCasesTable() {
const table = document.getElementById('cases-table');
const headers = ['Case ID', 'Timestamp', 'Amount ($)', 'Flagged Reason', 'Status', 'Analyst'];
table.innerHTML = `
${headers.map(h=>`| ${h} | `).join('')}Actions |
${casesData.sort((a,b) => new Date(b.Timestamp) - new Date(a.Timestamp)).map(c => `
|
|
|
|
|
|
|
`).join('')}
`;
}
window.fdd2_updateCase = (id, key, value) => {
const caseItem = casesData.find(c => c.id === id);
if(caseItem) caseItem[key] = (typeof caseItem[key] === 'number') ? parseFloat(value) || 0 : value;
renderAll();
};
window.fdd2_addCase = () => {
const newId = `CASE-${Math.floor(10000 + Math.random() * 90000)}`;
casesData.unshift({
id: Date.now(), ID: newId, Timestamp: new Date().toISOString().substring(0, 16),
Amount: 0, Reason: 'Manual Flag', Status: 'Open', Analyst: ANALYSTS[0]
});
renderAll();
};
window.fdd2_removeCase = (id) => {
casesData = casesData.filter(c => c.id !== id);
renderAll();
};
function initialize() {
const now = new Date("2025-06-30T14:30:00");
const createTimestamp = (hoursAgo) => {
const date = new Date(now);
date.setHours(now.getHours() - hoursAgo);
return date.toISOString().substring(0, 16);
};
casesData = [
{ id: 1, ID: 'CASE-83491', Timestamp: createTimestamp(0.2), Amount: 12500.50, Reason: 'High Value Transaction', Status: 'Open', Analyst: 'Anna' },
{ id: 2, ID: 'CASE-83490', Timestamp: createTimestamp(0.5), Amount: 250.00, Reason: 'Unusual Location', Status: 'Open', Analyst: 'Ben' },
{ id: 3, ID: 'CASE-83489', Timestamp: createTimestamp(1.1), Amount: 89.99, Reason: 'Velocity Check', Status: 'In Review', Analyst: 'Carla' },
{ id: 4, ID: 'CASE-83488', Timestamp: createTimestamp(2.5), Amount: 5230.00, Reason: 'Account Takeover Signals', Status: 'Closed - Fraud', Analyst: 'David' },
{ id: 5, ID: 'CASE-83487', Timestamp: createTimestamp(3.0), Amount: 15.25, Reason: 'High Value Transaction', Status: 'Closed - Not Fraud', Analyst: 'Anna' },
{ id: 6, ID: 'CASE-83486', Timestamp: createTimestamp(4.8), Amount: 3450.00, Reason: 'High Value Transaction', Status: 'In Review', Analyst: 'Ben' }
];
renderAll();
}
initialize();
});