<?php

namespace App\Models;

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

class EmployeeAttendance extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id',
        'employee_id',
        'attendance_date',
        'attendance_type',
        'day_status',
        'overtime_hours',
        'roz_value',
        'note',
    ];

    protected $casts = [
        'attendance_date' => 'date',
        'overtime_hours'  => 'decimal:2',
        'roz_value'       => 'decimal:1',
    ];

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

    public function employee()
    {
        return $this->belongsTo(Employee::class);
    }
}