<?php

namespace App\Models;

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

class Shift extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'type',
        'start_time',
        'end_time',
        'flexible_hours',
        'grace_period',
        'is_night_shift',
        'overtime_allowed',
        'overtime_rate',
        'min_overtime_minutes',
        'max_overtime_minutes'
    ];

    protected $casts = [
        'overtime_allowed' => 'boolean',
        'is_night_shift' => 'boolean',
    ];

    public function schedules()
    {
        return $this->hasMany(Schedule::class);
    }
}
