const mysql = require('mysql2/promise');

async function main() {
    const conn = await mysql.createConnection({
        host: '175.103.40.219',
        port: 3307,
        user: 'root',
        password: 'S@pAbadi**ICT',
        database: 'sapharmaco_sapps'
    });

    console.log('--- Checking Handover DocTypes ---');
    const [doctypes] = await conn.execute("SELECT id, name, display_name FROM doctypes WHERE name IN ('HandoverRequest', 'HandoverCompletion')");
    console.log(JSON.stringify(doctypes, null, 2));

    console.log('--- Checking Handover Menus ---');
    const [menus] = await conn.execute("SELECT id, name, title, url FROM menus WHERE name = 'handovers' OR url = '/apps/handovers'");
    console.log(JSON.stringify(menus, null, 2));

    await conn.end();
}

main().catch(console.error);
