<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class TestingReport extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'project_id','tester_id','report_date','total_test_cases','passed_cases','failed_cases','bugs_reported','qa_performance_score','summary'
    ];

    protected function casts(): array
    {
        return ['report_date' => 'date'];
    }

    public function project(): BelongsTo { return $this->belongsTo(Project::class); }
    public function tester(): BelongsTo { return $this->belongsTo(User::class, 'tester_id'); }
}
