<?php

namespace Modules\Lpj\Models;

use Modules\Usermanagement\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\PenilaianTeamFactory;

class PenilaianTeam extends Base
{
    use HasFactory;

    protected $table = 'penilaian_team';
    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = ['penilaian_id', 'team_id', 'user_id', 'role'];


    public function userPenilaiTeam()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }

    public function team()
    {

        return $this->belongsTo(Teams::class, 'team_id', 'id');
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }

    public function penilaian()
    {

        return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id');
    }

    protected static function newFactory(): PenilaianTeamFactory
    {
        //return PenilaianTeamFactory::new();
    }
}
