<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class FeeStructure extends Model
{
    protected $fillable = ['school_id', 'term_id', 'class_id', 'name', 'amount', 'is_mandatory'];
    protected $casts = ['amount' => 'decimal:2', 'is_mandatory' => 'boolean'];

    public function school() { return $this->belongsTo(School::class); }
    public function term() { return $this->belongsTo(Term::class); }
    public function schoolClass() { return $this->belongsTo(SchoolClass::class, 'class_id'); }
}
