<?php

namespace App\Modules\HR\Organization\Models;

use App\Modules\Admin\Tenancy\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class WorkLocation extends Model
{
    use BelongsToTenant;

    protected $table = 'hr_work_locations';

    protected $fillable = ['tenant_id', 'code', 'name', 'branch_id', 'address', 'description', 'is_active'];

    protected function casts(): array
    {
        return ['is_active' => 'boolean'];
    }

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