<?php

namespace App\Models;

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

class MatchPoint extends Model
{
    use HasFactory;

    protected $fillable = [
        'video_id',
        'match_round_id',
        'timestamp_seconds',
        'action',
        'points',
        'competitor',
        'notes',
        'score_blue',
        'score_red',
    ];

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

    public function round(): BelongsTo
    {
        return $this->belongsTo(MatchRound::class, 'match_round_id');
    }
}
