<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class ContentModerationActionLog extends Model
{
    protected $table = 'content_moderation_action_logs';

    public $timestamps = false;

    protected $fillable = [
        'finding_id',
        'target_type',
        'target_id',
        'action_type',
        'actor_type',
        'actor_id',
        'old_status',
        'new_status',
        'old_visibility',
        'new_visibility',
        'notes',
        'meta_json',
        'created_at',
    ];

    protected $casts = [
        'finding_id' => 'integer',
        'target_id' => 'integer',
        'actor_id' => 'integer',
        'meta_json' => 'array',
        'created_at' => 'datetime',
    ];

    public function finding(): BelongsTo
    {
        return $this->belongsTo(ContentModerationFinding::class, 'finding_id');
    }

    public function actor(): BelongsTo
    {
        return $this->belongsTo(User::class, 'actor_id');
    }
}