<?php

namespace App\Models\Hr;

use App\Models\User;
use App\Traits\BelongsToStore;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Schedule extends Model
{
    use BelongsToStore;

    const UPDATED_AT = null;

    protected $fillable = [
        'store_id', 'user_id', 'schedule_date', 'shift_type',
        'start_time', 'end_time',
    ];

    protected function casts(): array
    {
        return [
            'shift_type' => 'integer',
            'schedule_date' => 'date',
        ];
    }

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