<?php

namespace App\Models;

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

/**
 * PRC-817 — Veri-merkezi (fiziksel sunucu lokasyon hiyerarşisinin kökü).
 */
class Datacenter extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'code',
        'address',
        'city',
        'country_code',
        'notes',
    ];

    public function racks(): HasMany
    {
        return $this->hasMany(Rack::class);
    }

    public function servers(): HasMany
    {
        return $this->hasMany(Server::class);
    }
}
