<?php
namespace App\Models;

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

/**
 * Tabela: logs_qsos
 * Unique: (log_id, date_time, call_sent, call_rcvd)
 * FK: log_id → logs_cabecalhos.id (CASCADE DELETE)
 */
class LogQso extends Model
{
    protected $table      = 'logs_qsos';
    protected $primaryKey = 'id';
    public    $timestamps = false;
    protected $guarded    = [];

    protected $casts = [
        'date_time'  => 'datetime',
        'log_id'     => 'integer',
        'contest_id' => 'integer',
    ];

    public function cabecalho(): BelongsTo
    {
        return $this->belongsTo(LogCabecalho::class, 'log_id');
    }
}
