<?php

namespace Database\Seeders;

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

class MasterBankAccountSeeder extends Seeder
{
    public function run(): void
    {
        $accounts = [
            [
                'bank_name' => 'BCA',
                'account_name' => 'Foodcourt Utama',
                'account_number' => '1234567890',
                'is_active' => true,
            ],
            [
                'bank_name' => 'Mandiri',
                'account_name' => 'Foodcourt Utama',
                'account_number' => '9876543210',
                'is_active' => true,
            ],
            [
                'bank_name' => 'BRI',
                'account_name' => 'Foodcourt Utama',
                'account_number' => '1122334455',
                'is_active' => true,
            ],
        ];

        foreach ($accounts as $account) {
            MasterBankAccount::query()->firstOrCreate(
                ['bank_name' => $account['bank_name'], 'account_number' => $account['account_number']],
                $account
            );
        }
    }
}
