<?php

namespace App\Models;

use App\Models\Sprint;
use App\Models\Requirement;
use App\Models\NonFunctionalRequirement;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class SprintBacklog extends Pivot
{
    use HasFactory;

    protected $table = 'sprint_backlogs';

    protected $fillable = [
        'r_id',
        'nfu_id',
        'sprint_id',
        'project_id',
        'status'
    ];

    public function requirement()
    {
        return $this->belongsTo(Requirement::class, 'r_id');
    }

    public function nonFunctionalRequirement()
    {
        return $this->belongsTo(NonFunctionalRequirement::class, 'nfu_id');
    }

    public function sprint()
    {
        return $this->belongsTo(Sprint::class);
    }

    public function project()
    {
        return $this->belongsTo(Project::class);
    }
}