<?php
require __DIR__ . '/vendor/autoload.php';

$app = require_once __DIR__ . '/bootstrap/app.php';
$kernel = $app->make(\Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();

$user = auth()->user() ?? \App\Models\User::first();
echo "User: " . ($user ? $user->email : 'None') . "\n";
if ($user) {
    echo "Bank Accounts: " . $user->bankAccounts()->count() . "\n";
    echo "Digital Payments: " . $user->digitalPayments()->count() . "\n";
    echo "\nBank Accounts:\n";
    $user->bankAccounts()->get()->each(function ($b) {
        echo "  - ID: {$b->id}, Bank: {$b->bank_name}, Active: " . ($b->is_active ? 'YES' : 'NO') . "\n";
    });
    echo "\nDigital Payments:\n";
    $user->digitalPayments()->get()->each(function ($d) {
        echo "  - ID: {$d->id}, Provider: {$d->provider}, Active: " . ($d->is_active ? 'YES' : 'NO') . "\n";
    });
}
