<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Term extends Model
{
    protected $fillable = ['academic_year_id', 'name', 'start_date', 'end_date', 'is_current'];
    protected $casts = ['is_current' => 'boolean', 'start_date' => 'date', 'end_date' => 'date'];

    public function academicYear() { return $this->belongsTo(AcademicYear::class); }
    public function exams() { return $this->hasMany(Exam::class); }
    public function timetables() { return $this->hasMany(Timetable::class); }
    public function feeStructures() { return $this->hasMany(FeeStructure::class); }
}
