<?php

namespace Database\Seeders;

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

class ChartOfAccountsSeeder extends Seeder
{
    public function run(): void
    {
        $accounts = [
            // Assets
            ['code' => '1000', 'name' => 'Cash', 'type' => 'asset', 'category' => 'current_asset'],
            ['code' => '1010', 'name' => 'Bank Account', 'type' => 'asset', 'category' => 'current_asset'],
            ['code' => '1100', 'name' => 'Accounts Receivable', 'type' => 'asset', 'category' => 'current_asset'],
            
            // Income
            ['code' => '4000', 'name' => 'Treatment Revenue', 'type' => 'income', 'category' => 'revenue'],
            ['code' => '4010', 'name' => 'Consultation Revenue', 'type' => 'income', 'category' => 'revenue'],
            ['code' => '4020', 'name' => 'Product Sales', 'type' => 'income', 'category' => 'revenue'],
            
            // Expenses
            ['code' => '5000', 'name' => 'Rent Expense', 'type' => 'expense', 'category' => 'operating_expense'],
            ['code' => '5010', 'name' => 'Utilities Expense', 'type' => 'expense', 'category' => 'operating_expense'],
            ['code' => '5020', 'name' => 'Salaries Expense', 'type' => 'expense', 'category' => 'operating_expense'],
            ['code' => '5030', 'name' => 'Medical Supplies', 'type' => 'expense', 'category' => 'operating_expense'],
            ['code' => '5040', 'name' => 'Equipment Maintenance', 'type' => 'expense', 'category' => 'operating_expense'],
        ];

        foreach ($accounts as $account) {
            ChartOfAccount::create($account);
        }
    }
}
