<?php

namespace App\Models;

use App\Models\Concerns\BelongsToCompany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class WorkDuration extends Model
{
    use BelongsToCompany;

    protected $table = 'work_durations';

    protected $fillable = [
        'company_id',
        'attendance_id',
        'start_time',
        'end_time',
        'duration',
        'notes',
        'status',
    ];

    protected $casts = [
        'duration' => 'integer',
    ];

    public function attendance(): BelongsTo
    {
        return $this->belongsTo(Attendance::class);
    }
}
