import db from '../src/database/models/index.js';

async function check() {
    try {
        const app = await (db as any).Application.findOne({
            where: { email: 'test-dealer-tumkur@example.com' },
            include: [{ model: (db as any).District, as: 'district' }]
        });

        if (app) {
            console.log('Application Found:');
            console.log('ID:', app.applicationId);
            console.log('District Name:', app.district ? app.district.name : 'NULL');
            console.log('District ID:', app.districtId);
            console.log('Is Opportunity Available (Status):', app.overallStatus);
        } else {
            console.log('Application not found.');
        }
        process.exit(0);
    } catch (err) {
        console.error(err);
        process.exit(1);
    }
}

check();
