require('dotenv').config();
const mikrotik = require('./services/mikrotikService');

async function test() {
    console.log("Fetching Active PPPoE Users...");
    try {
        const users = await mikrotik.getActivePppoe();
        console.log(`Found ${users.length} active users.`);

        if (users.length > 0) {
            console.log("Sample User Data:");
            console.log(users[0]);

            // check if specific user exists (mocking the user request)
            const target = users.find(u => u.name === '2000109' || u.name.includes('2000109'));
            if (target) {
                console.log("\nTarget User (2000109) Found:");
                console.log(target);
            }
        }
    } catch (error) {
        console.error("Test Failed:", error);
    }
}

test();
