<?php

namespace App\Models\Synapse;

use App\Models\Communication\Call;
use App\Models\Communication\Communication;
use App\Models\Communication\Recording;
use App\Models\Solicitor\Solicitor;
use App\Models\Task;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class DataProtectionAudit extends Model
{
    protected $fillable = [
        'solicitor_id',
        'recording_id',
        'communication_id',
        'call_id',
        'task_id',
        'status',
        'result',
        'number_of_checks_confirmed',
        'checks_confirmed',
        'completed_at_outset',
        'evidence',
        'reasoning',
        'raw_output',
        'error',
    ];

    protected $casts = [
        'checks_confirmed' => 'array',
        'completed_at_outset' => 'boolean',
        'evidence' => 'array',
    ];

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

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

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

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

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