<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AttendanceLog extends Model
{
    protected $fillable = [
        'user_id',
        'employee_id',
        'type',
        'logged_at',
        'scheduled_attendance_time',
        'scheduled_departure_time',
        'early_minutes',
        'late_minutes',
        'attendance_status',
        'latitude',
        'longitude',
        'notes',
        'image_path',
        'device_name',
        'device_platform',
    ];

    protected $casts = [
        'user_id' => 'int',
        'employee_id' => 'int',
        'logged_at' => 'datetime',
        'early_minutes' => 'int',
        'late_minutes' => 'int',
        'latitude' => 'float',
        'longitude' => 'float',
    ];

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

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