<?php

namespace Database\Seeders;

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

class AccountTypeSeeder extends Seeder
{
    public function run(): void
    {
        $now = now();

        $rows = [
            ['name' => 'Receivables', 'description' => 'Standard receivable account'],
            ['name' => 'Payables',    'description' => 'Standard payable account'],
            ['name' => 'Loan',        'description' => 'Loan and credit account'],
            ['name' => 'Savings',     'description' => 'Savings account type'],
            ['name' => 'Current',     'description' => 'Current/operational account'],
        ];

        foreach ($rows as $row) {
            AccountType::updateOrCreate(['name' => $row['name']], ['description' => $row['description']]);
        }
    }
}
