<?php

namespace Database\Seeders;

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

class PaymentAccountSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $accounts = [
            // Bank Accounts
            [
                'name' => 'BCA Utama',
                'type' => PaymentAccount::TYPE_BANK,
                'provider' => 'BCA',
                'account_number' => '1234567890',
                'account_holder' => 'PT. Posgraf Indonesia',
                'is_active' => true,
            ],
            [
                'name' => 'Mandiri Cadangan',
                'type' => PaymentAccount::TYPE_BANK,
                'provider' => 'Mandiri',
                'account_number' => '0987654321',
                'account_holder' => 'PT. Posgraf Indonesia',
                'is_active' => true,
            ],
            [
                'name' => 'BRI Operasional',
                'type' => PaymentAccount::TYPE_BANK,
                'provider' => 'BRI',
                'account_number' => '1122334455',
                'account_holder' => 'PT. Posgraf Indonesia',
                'is_active' => true,
            ],

            // E-Wallet Accounts
            [
                'name' => 'DANA Toko',
                'type' => PaymentAccount::TYPE_EWALLET,
                'provider' => 'DANA',
                'account_number' => '081234567890',
                'account_holder' => 'Posgraf Official',
                'is_active' => true,
            ],
            [
                'name' => 'OVO Toko',
                'type' => PaymentAccount::TYPE_EWALLET,
                'provider' => 'OVO',
                'account_number' => '081234567890',
                'account_holder' => 'Posgraf',
                'is_active' => true,
            ],
            [
                'name' => 'GoPay Business',
                'type' => PaymentAccount::TYPE_EWALLET,
                'provider' => 'GoPay',
                'account_number' => '081234567890',
                'account_holder' => 'Posgraf Store',
                'is_active' => true,
            ],
            [
                'name' => 'QRIS Toko',
                'type' => PaymentAccount::TYPE_EWALLET,
                'provider' => 'QRIS',
                'account_number' => 'QRIS-12345678',
                'account_holder' => 'PT. Posgraf Indonesia',
                'is_active' => true,
            ],
        ];

        foreach ($accounts as $account) {
            PaymentAccount::firstOrCreate(
                [
                    'type' => $account['type'],
                    'provider' => $account['provider'],
                    'account_number' => $account['account_number'],
                ],
                $account
            );
        }
    }
}
