-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-fixed-analysis.js
More file actions
40 lines (31 loc) · 1.86 KB
/
Copy pathrun-fixed-analysis.js
File metadata and controls
40 lines (31 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { BankStatementAnalyzer } from './analyzer.js';
import { ReportGenerator } from './report-generator.js';
async function runFixedAnalysis() {
console.log('🚀 Running FIXED analysis of Account_Statement_8234.pdf');
console.log('=' .repeat(60));
const analyzer = new BankStatementAnalyzer();
try {
const analysis = await analyzer.processStatementFile('Account_Statement_8234.pdf');
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
const reportId = `fixed-8234-${timestamp}`;
await analyzer.saveAnalysis(analysis, `reports/${reportId}.json`);
await ReportGenerator.saveHTMLReport(analysis, `${reportId}-report.html`);
console.log('\n📊 FIXED ANALYSIS COMPLETE');
console.log('=' .repeat(60));
console.log(`🏦 Account: ${analysis.accountOverview?.accountHolder || 'N/A'}`);
console.log(`💰 Opening: ₦${(analysis.accountOverview?.openingBalance || 0).toLocaleString()}`);
console.log(`💰 Closing: ₦${(analysis.accountOverview?.closingBalance || 0).toLocaleString()}`);
console.log(`📈 Inflows: ₦${(analysis.accountOverview?.totalInflows || 0).toLocaleString()}`);
console.log(`📉 Outflows: ₦${(analysis.accountOverview?.totalOutflows || 0).toLocaleString()}`);
console.log(`🎰 Gambling Loss: ₦${(analysis.gamblingAnalysis?.netGamblingLoss || 0).toLocaleString()}`);
console.log(`💰 Outstanding Loans: ₦${(analysis.loanAnalysis?.outstandingLoans || 0).toLocaleString()}`);
console.log(`⚠️ Risk Level: ${analysis.riskAssessment?.overallRiskLevel || 'N/A'}`);
console.log('\n✅ REPORTS GENERATED:');
console.log(`📄 HTML: ${reportId}-report.html`);
console.log(`📊 JSON: reports/${reportId}.json`);
console.log('=' .repeat(60));
} catch (error) {
console.error('❌ Analysis failed:', error.message);
}
}
runFixedAnalysis();