<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class TransitionPoint extends Model
{
	use SoftDeletes;
	
	protected $fillable = [
		'employee_id',
		'tenure_points',
		'level_points',
		'position_points',
		'note',
		'created_by'
	];
	
	protected $casts = [
		'tenure_points'   => 'decimal:2',
		'level_points'    => 'decimal:2',
		'position_points' => 'decimal:2',
	];
	
	public function employee()
	{
		return $this->belongsTo(Employee::class)->select('id', 'employee_code', 'full_name');
	}
	
	public function creator()
	{
		return $this->belongsTo(User::class, 'created_by');
	}
}