<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class AttendanceLog extends Model
{
    protected $fillable = [
        'pin',
        'employee_name',
        'logged_at',
        'verified',
        'status',
        'device_ip',
        'raw',
    ];

    protected $casts = [
        'logged_at' => 'datetime',
        'raw' => 'array',
    ];

    public function employee(): BelongsTo
    {
        return $this->belongsTo(AttendanceUser::class, 'pin', 'pin');
    }
}
