<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Consent extends Model
{
    use HasFactory, SoftDeletes;
    protected $fillable = ['case_id','subject_name','subject_document','consent_type','scope_text','collected_by','granted_at','revoked_at','ip_address','proof_file_path'];
    public function caseFile(): BelongsTo { return $this->belongsTo(CaseFile::class, 'case_id'); }
    public function collector(): BelongsTo { return $this->belongsTo(User::class, 'collected_by'); }
}
