<?php
require 'vendor/autoload.php';
$app = require_once 'bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();

use App\Models\ShippingMethod;
use App\Models\BdDistrict;

// Test with district_id = 13 (Dhaka) and 20 (some outside district)
foreach ([1, 13, 20] as $did) {
    $district = BdDistrict::find($did);
    if (!$district) continue;
    
    $zone = (strtolower($district->name) === 'dhaka') ? 'inside_dhaka' : 'outside_dhaka';
    $methods = ShippingMethod::where('zone', $zone)->where('is_active', true)->where('pricing_type', 'flat')->get();
    
    echo "District: {$district->name} (ID: {$did}) → Zone: {$zone}\n";
    if ($methods->isEmpty()) {
        echo "  ❌ No active flat shipping methods found for zone: {$zone}\n";
    } else {
        foreach ($methods as $m) {
            echo "  ✓ {$m->name}: ৳{$m->cost}\n";
        }
    }
    echo "\n";
}
