<?php

declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

final class Tenant extends Model
{
    protected $table = 'tenants';
    protected $fillable = [
        'name', 'timezone', 'is_active', 'location_label',
        'latitude', 'longitude', 'federal_state',
    ];
    protected $casts = [
        'is_active' => 'integer',
        'latitude' => 'float',
        'longitude' => 'float',
    ];

    public function users(): HasMany
    {
        return $this->hasMany(User::class, 'tenant_id');
    }

    public function students(): HasMany
    {
        return $this->hasMany(Student::class, 'tenant_id');
    }

    public function instructors(): HasMany
    {
        return $this->hasMany(Instructor::class, 'tenant_id');
    }
}