<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class FeeStructure extends Model
{
    protected $fillable = [
        'school_id', 'school_class_id', 'term', 'academic_year', 'total_amount'
    ];

    public function school()
    {
        return $this->belongsTo(School::class);
    }

    public function schoolClass()
    {
        return $this->belongsTo(SchoolClass::class, 'school_class_id');
    }

    public function items()
    {
        return $this->hasMany(FeeItem::class);
    }

    public function invoices()
    {
        return $this->hasMany(Invoice::class);
    }
}
