<?php

namespace App\Models;

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

class ReportCondition extends Model
{
    protected $fillable = [
        'report_id',
        'column',
        'operator',
        'value_type',
        'value',
        'filter_key',
        'logical_operator',
        'group_id',
        'order',
        'enabled',
    ];

    protected $casts = [
        'enabled' => 'boolean',
        'order' => 'integer',
        'group_id' => 'integer',
    ];

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