<?php

require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();

use App\Models\ImmigoProSubscription;

$sub = ImmigoProSubscription::orderBy('id', 'desc')->first();

if (!$sub) {
    echo "No subscription found\n";
    exit;
}

echo "\n========================================\n";
echo "CURRENT SUBSCRIPTION STATUS\n";
echo "========================================\n";
echo "ID: " . $sub->id . "\n";
echo "Package: " . $sub->package_name . "\n";
echo "Payment Plan: " . $sub->payment_plan . "\n";
echo "Status: " . $sub->status . "\n";
echo "Paid Installments: " . $sub->paid_installments . "/" . $sub->installments . "\n";
echo "Monthly Amount: $" . $sub->monthly_amount . "\n";
echo "Next Charge Date: " . ($sub->next_charge_date ? $sub->next_charge_date->format('Y-m-d H:i:s') : 'N/A') . "\n";
echo "Payment Method: " . ($sub->stripe_payment_method_id ? 'Stored (' . $sub->stripe_payment_method_id . ')' : 'Missing') . "\n";
echo "========================================\n\n";
