import db from './src/database/models/index';
const { User } = db;

async function check() {
    try {
        const users = await User.findAll({
            attributes: ['id', 'roleCode', 'zoneId', 'regionId', 'areaId']
        });
        console.log('--- Database User Check ---');
        console.log('Users Data:', JSON.stringify(users, null, 2));
        
        const nbhUsers = users.filter((u: any) => u.roleCode === 'NBH');
        console.log('NBH Users count:', nbhUsers.length);
        
        const zmUsers = users.filter((u: any) => u.roleCode === 'DD-ZM');
        console.log('DD-ZM Users count:', zmUsers.length);

    } catch (error) {
        console.error('Check failed:', error);
    } finally {
        process.exit();
    }
}

check();
