<?php

namespace App\Models;

use App\Models\Concerns\BelongsToBranch;
use App\Models\Concerns\HasAuditColumns;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class FeeConcession extends Model
{
    use BelongsToBranch;
    use HasAuditColumns;

    protected $fillable = [
        'branch_id', 'student_id', 'fee_type_id', 'scholarship_type',
        'type', 'value', 'reason', 'is_active',
    ];

    protected function casts(): array
    {
        return ['value' => 'decimal:2', 'is_active' => 'boolean'];
    }

    public const SCHOLARSHIP_TYPES = ['merit', 'orphan', 'staff_child', 'need_based', 'custom'];

    public function student(): BelongsTo
    {
        return $this->belongsTo(Student::class);
    }

    public function feeType(): BelongsTo
    {
        return $this->belongsTo(FeeType::class);
    }
}
