<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ExcelUploadLog extends Model
{
    use HasFactory;

    protected $table = 't_excel_upload_logs';

    protected $fillable = [
        'upload_type',
        'uploaded_file',
        'original_filename',
        'total_rows',
        'success_rows',
        'error_rows',
        'error_details',
        'status',
        'uploaded_by',
    ];

    protected $casts = [
        'total_rows' => 'integer',
        'success_rows' => 'integer',
        'error_rows' => 'integer',
    ];

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