<?php

namespace App\Models;

use App\Models\BaseModel;

class EarlyDismissalSignature extends BaseModel
{
    protected $table = 'early_dismissal_signatures';

    // ✅ CI: timestamps enabled (created_at/updated_at)
    public $timestamps = true;

    protected $fillable = [
        'report_date',
        'school_year',
        'semester',
        'filename',
        'original_name',
        'mime_type',
        'file_size',
        'uploaded_by',
        'created_at',
        'updated_at',
    ];

    protected $casts = [
        // report_date is stored as Y-m-d in CI validation; keep as date
        'report_date' => 'date',

        'file_size'   => 'integer',
        'uploaded_by' => 'integer',
    ];

    /* Optional relationship */
    public function uploader()
    {
        return $this->belongsTo(User::class, 'uploaded_by');
    }
}