<?php

namespace Database\Seeders;

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

class BankAccountSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $bankAccounts = [
            ['account_name' => 'Main Business Account', 'account_number' => '****4521', 'bank_name' => 'Chase Bank', 'bank_code' => 'CHASUS33', 'swift_code' => 'CHASUS33XXX', 'branch_name' => 'Manhattan Branch', 'currency' => 'USD', 'opening_balance' => 100000.00, 'current_balance' => 125680.50, 'is_active' => true],
            ['account_name' => 'Payroll Account', 'account_number' => '****7823', 'bank_name' => 'Bank of America', 'bank_code' => 'BOFAUS3N', 'swift_code' => 'BOFAUS3NXXX', 'branch_name' => 'Corporate Center', 'currency' => 'USD', 'opening_balance' => 50000.00, 'current_balance' => 45230.00, 'is_active' => true],
            ['account_name' => 'EU Operations', 'account_number' => '****3456', 'bank_name' => 'Deutsche Bank', 'bank_code' => 'DEUTDEFF', 'swift_code' => 'DEUTDEFFXXX', 'branch_name' => 'Frankfurt Main', 'currency' => 'EUR', 'opening_balance' => 75000.00, 'current_balance' => 89450.75, 'is_active' => true],
            ['account_name' => 'UK Branch', 'account_number' => '****9012', 'bank_name' => 'Barclays', 'bank_code' => 'BARCGB22', 'swift_code' => 'BARCGB22XXX', 'branch_name' => 'London Central', 'currency' => 'GBP', 'opening_balance' => 30000.00, 'current_balance' => 34560.25, 'is_active' => true],
            ['account_name' => 'Savings Reserve', 'account_number' => '****5678', 'bank_name' => 'Wells Fargo', 'bank_code' => 'WFBIUS6S', 'swift_code' => 'WFBIUS6SXXX', 'branch_name' => 'San Francisco', 'currency' => 'USD', 'opening_balance' => 200000.00, 'current_balance' => 250000.00, 'is_active' => true],
            ['account_name' => 'Operating Expenses', 'account_number' => '****2345', 'bank_name' => 'Citibank', 'bank_code' => 'CITIUS33', 'swift_code' => 'CITIUS33XXX', 'branch_name' => 'New York HQ', 'currency' => 'USD', 'opening_balance' => 25000.00, 'current_balance' => 18750.30, 'is_active' => true],
            ['account_name' => 'Canada Office', 'account_number' => '****6789', 'bank_name' => 'TD Bank', 'bank_code' => 'TDOMCATTTOR', 'swift_code' => 'TDOMCATTTORX', 'branch_name' => 'Toronto Downtown', 'currency' => 'CAD', 'opening_balance' => 60000.00, 'current_balance' => 67890.45, 'is_active' => true],
            ['account_name' => 'Australia Branch', 'account_number' => '****1234', 'bank_name' => 'ANZ Bank', 'bank_code' => 'ANZBAU3M', 'swift_code' => 'ANZBAU3MXXX', 'branch_name' => 'Sydney CBD', 'currency' => 'AUD', 'opening_balance' => 45000.00, 'current_balance' => 54320.80, 'is_active' => true],
            ['account_name' => 'Emergency Fund', 'account_number' => '****4567', 'bank_name' => 'HSBC', 'bank_code' => 'HSBCUS33', 'swift_code' => 'HSBCUS33XXX', 'branch_name' => 'Global Finance', 'currency' => 'USD', 'opening_balance' => 100000.00, 'current_balance' => 100000.00, 'is_active' => true],
            ['account_name' => 'Tax Reserve', 'account_number' => '****8901', 'bank_name' => 'PNC Bank', 'bank_code' => 'PNCCUS33', 'swift_code' => 'PNCCUS33XXX', 'branch_name' => 'Pittsburgh HQ', 'currency' => 'USD', 'opening_balance' => 75000.00, 'current_balance' => 75000.00, 'is_active' => true],
            ['account_name' => 'Marketing Budget', 'account_number' => '****2468', 'bank_name' => 'Capital One', 'bank_code' => 'HIBKUS44', 'swift_code' => 'HIBKUS44XXX', 'branch_name' => 'McLean VA', 'currency' => 'USD', 'opening_balance' => 35000.00, 'current_balance' => 32150.60, 'is_active' => true],
            ['account_name' => 'R&D Allocation', 'account_number' => '****1357', 'bank_name' => 'US Bank', 'bank_code' => 'USBKUS44', 'swift_code' => 'USBKUS44IMT', 'branch_name' => 'Minneapolis', 'currency' => 'USD', 'opening_balance' => 50000.00, 'current_balance' => 48900.25, 'is_active' => true],
            ['account_name' => 'Asia Pacific', 'account_number' => '****9753', 'bank_name' => 'DBS Bank', 'bank_code' => 'DBSSSGSG', 'swift_code' => 'DBSSSGSGXXX', 'branch_name' => 'Singapore Main', 'currency' => 'SGD', 'opening_balance' => 100000.00, 'current_balance' => 112500.00, 'is_active' => true],
            ['account_name' => 'Swiss Holdings', 'account_number' => '****8642', 'bank_name' => 'UBS', 'bank_code' => 'UBSWCHZH', 'swift_code' => 'UBSWCHZH80A', 'branch_name' => 'Zurich', 'currency' => 'CHF', 'opening_balance' => 250000.00, 'current_balance' => 285000.50, 'is_active' => true],
            ['account_name' => 'Japan Office', 'account_number' => '****7531', 'bank_name' => 'MUFG Bank', 'bank_code' => 'BOTKJPJT', 'swift_code' => 'BOTKJPJTXXX', 'branch_name' => 'Tokyo Marunouchi', 'currency' => 'JPY', 'opening_balance' => 10000000, 'current_balance' => 15680000, 'is_active' => true],
            ['account_name' => 'India Operations', 'account_number' => '****6420', 'bank_name' => 'HDFC Bank', 'bank_code' => 'HDFCINBB', 'swift_code' => 'HDFCINBBXXX', 'branch_name' => 'Mumbai Main', 'currency' => 'INR', 'opening_balance' => 7500000, 'current_balance' => 8750000, 'is_active' => true],
            ['account_name' => 'Brazil Branch', 'account_number' => '****5319', 'bank_name' => 'Itaú Unibanco', 'bank_code' => 'ITAUBRSP', 'swift_code' => 'ITAUBRSPXXX', 'branch_name' => 'São Paulo Centro', 'currency' => 'BRL', 'opening_balance' => 400000.00, 'current_balance' => 425000.00, 'is_active' => true],
            ['account_name' => 'Mexico Office', 'account_number' => '****4208', 'bank_name' => 'BBVA Mexico', 'bank_code' => 'BCMRMXMM', 'swift_code' => 'BCMRMXMMXXX', 'branch_name' => 'Mexico City', 'currency' => 'MXN', 'opening_balance' => 1000000, 'current_balance' => 1250000, 'is_active' => true],
            ['account_name' => 'Middle East', 'account_number' => '****3197', 'bank_name' => 'Emirates NBD', 'bank_code' => 'EABORAEDXXX', 'swift_code' => 'EABORAEDXXX', 'branch_name' => 'Dubai Main', 'currency' => 'AED', 'opening_balance' => 350000.00, 'current_balance' => 367500.00, 'is_active' => true],
            ['account_name' => 'Petty Cash', 'account_number' => '****2086', 'bank_name' => 'Local Credit Union', 'bank_code' => 'LOCAL001', 'swift_code' => null, 'branch_name' => 'Main Office', 'currency' => 'USD', 'opening_balance' => 5000.00, 'current_balance' => 5000.00, 'is_active' => true],
        ];

        foreach ($bankAccounts as $account) {
            BankAccount::updateOrCreate(
                ['account_number' => $account['account_number']],
                $account
            );
        }
    }
}
