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

async function check() {
    try {
        const roles = await (db as any).Role.findAll();
        console.log('--- ROLES START ---');
        console.log(JSON.stringify(roles.map((r: any) => ({
            name: r.roleName,
            code: r.roleCode,
            id: r.id
        })), null, 2));
        console.log('--- ROLES END ---');
        process.exit(0);
    } catch (error) {
        console.error('Error listing roles:', error);
        process.exit(1);
    }
}

check();
