<?php

namespace App\Models;

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

class BioTimeAttendanceLog extends Model
{
    use HasFactory;

    protected $fillable = [
        'employee_id',
        'biotime_log_id',
        'emp_code',
        'device_user_id',
        'punch_time',
        'punch_state',
        'verify_type',
        'terminal_sn',
        'raw',
        'synced_at',
    ];

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

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

    public function area(): BelongsTo
    {
        return $this->belongsTo(Area::class);
    }
}
