<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class ChartOfAccount extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'code',
        'type', // income, expense, asset, liability, equity
        'description',
        'is_system'
    ];

    // --- ADD THIS RELATIONSHIP ---
    public function payments()
    {
        return $this->hasMany(Payment::class);
    }
}
