import 'dotenv/config';
import db from './src/database/models/index.js';
const { Application } = (db as any).default || db;

const applicationId = '6139d6f9-f3c1-4e55-903b-3516d3a08955';

async function checkAppJson() {
    try {
        const application = await Application.findByPk(applicationId);

        if (application) {
            const docSize = application.documents ? JSON.stringify(application.documents).length : 0;
            const timelineSize = application.timeline ? JSON.stringify(application.timeline).length : 0;
            console.log(`Documents JSON size: ${Math.round(docSize / 1024)} KB`);
            console.log(`Timeline JSON size: ${Math.round(timelineSize / 1024)} KB`);
        } else {
            console.log('Application not found.');
        }

    } catch (error) {
        console.error('Error checking application JSON:', error);
    } finally {
        process.exit();
    }
}

checkAppJson();
