<?hh // strict

namespace App\Models;

use DateTime;

class Tenant
{
    private string $id;
    private string $name;
    private string $subdomain;
    private bool $isActive;
    private DateTime $createdAt;
    private DateTime $updatedAt;
    
    public function __construct(
        string $id,
        string $name,
        string $subdomain,
        bool $isActive = true
    ) {
        $this->id = $id;
        $this->name = $name;
        $this->subdomain = $subdomain;
        $this->isActive = $isActive;
        $this->createdAt = new DateTime();
        $this->updatedAt = new DateTime();
    }
    
    // Getters
    public function getId(): string
    {
        return $this->id;
    }
    
    public function getName(): string
    {
        return $this->name;
    }
    
    public function getSubdomain(): string
    {
        return $this->subdomain;
    }
    
    public function getIsActive(): bool
    {
        return $this->isActive;
    }
    
    public function getCreatedAt(): DateTime
    {
        return $this->createdAt;
    }
    
    public function getUpdatedAt(): DateTime
    {
        return $this->updatedAt;
    }
    
    // Setters
    public function setName(string $name): void
    {
        $this->name = $name;
        $this->updatedAt = new DateTime();
    }
    
    public function setSubdomain(string $subdomain): void
    {
        $this->subdomain = $subdomain;
        $this->updatedAt = new DateTime();
    }
    
    public function setIsActive(bool $isActive): void
    {
        $this->isActive = $isActive;
        $this->updatedAt = new DateTime();
    }
}