- 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
68 lines
2.3 KiB
JavaScript
68 lines
2.3 KiB
JavaScript
const { Pool } = require('pg');
|
||
|
||
const pool = new Pool({
|
||
connectionString: 'postgresql://postgres:password@localhost:5432/cim_processor'
|
||
});
|
||
|
||
async function checkEnhancedData() {
|
||
try {
|
||
console.log('🔍 Checking Enhanced BPCP CIM Review Template Data');
|
||
console.log('================================================');
|
||
|
||
// Find the STAX CIM document
|
||
const docResult = await pool.query(`
|
||
SELECT id, original_file_name, status, generated_summary, created_at, updated_at
|
||
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}`);
|
||
console.log(`📊 Status: ${document.status}`);
|
||
console.log(`📝 Generated Summary: ${document.generated_summary}`);
|
||
console.log(`📅 Created: ${document.created_at}`);
|
||
console.log(`📅 Updated: ${document.updated_at}`);
|
||
|
||
// Check if there's any additional analysis data stored
|
||
console.log('\n🔍 Checking for additional analysis data...');
|
||
|
||
// Check if there are any other columns that might store the enhanced data
|
||
const columnsResult = await pool.query(`
|
||
SELECT column_name, data_type
|
||
FROM information_schema.columns
|
||
WHERE table_name = 'documents'
|
||
ORDER BY ordinal_position
|
||
`);
|
||
|
||
console.log('\n📋 Available columns in documents table:');
|
||
columnsResult.rows.forEach(col => {
|
||
console.log(` - ${col.column_name}: ${col.data_type}`);
|
||
});
|
||
|
||
// Check if there's an analysis_data column or similar
|
||
const hasAnalysisData = columnsResult.rows.some(col =>
|
||
col.column_name.includes('analysis') ||
|
||
col.column_name.includes('template') ||
|
||
col.column_name.includes('review')
|
||
);
|
||
|
||
if (!hasAnalysisData) {
|
||
console.log('\n⚠️ No analysis_data column found. The enhanced template data may not be stored.');
|
||
console.log('💡 We need to add a column to store the full BPCP CIM Review Template data.');
|
||
}
|
||
|
||
} catch (error) {
|
||
console.error('❌ Error checking enhanced data:', error.message);
|
||
} finally {
|
||
await pool.end();
|
||
}
|
||
}
|
||
|
||
checkEnhancedData();
|