<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\BetProvider;

final class BetProviderSeeder extends Seeder
{
    public function run(): void
    {
        $rows = [
            ['code' => 'SG', 'name' => 'Singapore', 'short_code' => 'S', 'sort_order' => 10],
            ['code' => 'MY', 'name' => 'Malaysia', 'short_code' => 'M', 'sort_order' => 20],
            ['code' => 'TH', 'name' => 'Thailand', 'short_code' => 'T', 'sort_order' => 30],
        ];

        foreach ($rows as $row) {
            BetProvider::query()->updateOrCreate(
                ['code' => $row['code']],
                [
                    'name' => $row['name'],
                    'short_code' => $row['short_code'],
                    'is_enabled' => true,
                    'sort_order' => $row['sort_order'],
                ],
            );
        }
    }
}
