<?php

namespace App\Models;
use App\Models\ValidationModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class SlaLog extends ValidationModel
{
    /**
     *	Database table that maps to.
     */
    protected $table = 'sla_logs';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['task_id', 'type', 'missed', 'duration'];

    /**
     * Array of validation rules.
     *
     * @var  array
     */
    protected static $rules = [
        'task_id' => 'required',
        'type'    => 'required',
    ];

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