Files
cim_summary/backend/check-analysis-content.js
Jon c67dab22b4 Add comprehensive CIM processing features and UI improvements
- Add new database migrations for analysis data and job tracking
- Implement enhanced document processing service with LLM integration
- Add processing progress and queue status components
- Create testing guides and utility scripts for CIM processing
- Update frontend components for better user experience
- Add environment configuration and backup files
- Implement job queue service and upload progress tracking
2025-07-27 20:25:46 -04:00

97 lines
4.3 KiB
JavaScript

const { Pool } = require('pg');
const pool = new Pool({
connectionString: 'postgresql://postgres:password@localhost:5432/cim_processor'
});
async function checkAnalysisContent() {
try {
console.log('🔍 Checking Analysis Data Content');
console.log('================================');
// Find the STAX CIM document with analysis_data
const docResult = await pool.query(`
SELECT id, original_file_name, analysis_data
FROM documents
WHERE original_file_name = 'stax-cim-test.pdf'
ORDER BY created_at DESC
LIMIT 1
`);
if (docResult.rows.length === 0) {
console.log('❌ No STAX CIM document found');
return;
}
const document = docResult.rows[0];
console.log(`📄 Document: ${document.original_file_name}`);
if (!document.analysis_data) {
console.log('❌ No analysis_data found');
return;
}
console.log('✅ Analysis data found!');
console.log('\n📋 BPCP CIM Review Template Data:');
console.log('==================================');
const analysis = document.analysis_data;
// Display Deal Overview
console.log('\n(A) Deal Overview:');
console.log(` Company: ${analysis.dealOverview?.targetCompanyName || 'N/A'}`);
console.log(` Industry: ${analysis.dealOverview?.industrySector || 'N/A'}`);
console.log(` Geography: ${analysis.dealOverview?.geography || 'N/A'}`);
console.log(` Transaction Type: ${analysis.dealOverview?.transactionType || 'N/A'}`);
console.log(` CIM Pages: ${analysis.dealOverview?.cimPageCount || 'N/A'}`);
// Display Business Description
console.log('\n(B) Business Description:');
console.log(` Core Operations: ${analysis.businessDescription?.coreOperationsSummary?.substring(0, 100)}...`);
console.log(` Key Products/Services: ${analysis.businessDescription?.keyProductsServices || 'N/A'}`);
console.log(` Value Proposition: ${analysis.businessDescription?.uniqueValueProposition || 'N/A'}`);
// Display Market Analysis
console.log('\n(C) Market & Industry Analysis:');
console.log(` Market Size: ${analysis.marketIndustryAnalysis?.estimatedMarketSize || 'N/A'}`);
console.log(` Growth Rate: ${analysis.marketIndustryAnalysis?.estimatedMarketGrowthRate || 'N/A'}`);
console.log(` Key Trends: ${analysis.marketIndustryAnalysis?.keyIndustryTrends || 'N/A'}`);
// Display Financial Summary
console.log('\n(D) Financial Summary:');
if (analysis.financialSummary?.financials) {
const financials = analysis.financialSummary.financials;
console.log(` FY-1 Revenue: ${financials.fy1?.revenue || 'N/A'}`);
console.log(` FY-1 EBITDA: ${financials.fy1?.ebitda || 'N/A'}`);
console.log(` LTM Revenue: ${financials.ltm?.revenue || 'N/A'}`);
console.log(` LTM EBITDA: ${financials.ltm?.ebitda || 'N/A'}`);
}
// Display Management Team
console.log('\n(E) Management Team Overview:');
console.log(` Key Leaders: ${analysis.managementTeamOverview?.keyLeaders || 'N/A'}`);
console.log(` Quality Assessment: ${analysis.managementTeamOverview?.managementQualityAssessment || 'N/A'}`);
// Display Investment Thesis
console.log('\n(F) Preliminary Investment Thesis:');
console.log(` Key Attractions: ${analysis.preliminaryInvestmentThesis?.keyAttractions || 'N/A'}`);
console.log(` Potential Risks: ${analysis.preliminaryInvestmentThesis?.potentialRisks || 'N/A'}`);
console.log(` Value Creation Levers: ${analysis.preliminaryInvestmentThesis?.valueCreationLevers || 'N/A'}`);
// Display Key Questions & Next Steps
console.log('\n(G) Key Questions & Next Steps:');
console.log(` Recommendation: ${analysis.keyQuestionsNextSteps?.preliminaryRecommendation || 'N/A'}`);
console.log(` Critical Questions: ${analysis.keyQuestionsNextSteps?.criticalQuestions || 'N/A'}`);
console.log(` Next Steps: ${analysis.keyQuestionsNextSteps?.proposedNextSteps || 'N/A'}`);
console.log('\n🎉 Full BPCP CIM Review Template data is available!');
console.log('📊 The frontend can now display this comprehensive analysis.');
} catch (error) {
console.error('❌ Error checking analysis content:', error.message);
} finally {
await pool.end();
}
}
checkAnalysisContent();