<?hh // strict

namespace App\Models;

use DateTime;

class User
{
    private int $id;
    private string $email;
    private string $name;
    private string $role; // 'job_seeker' or 'job_provider'
    private string $tenantId;
    private DateTime $createdAt;
    private DateTime $updatedAt;
    
    public function __construct(
        int $id,
        string $email,
        string $name,
        string $role,
        string $tenantId
    ) {
        $this->id = $id;
        $this->email = $email;
        $this->name = $name;
        $this->role = $role;
        $this->tenantId = $tenantId;
        $this->createdAt = new DateTime();
        $this->updatedAt = new DateTime();
    }
    
    // Getters
    public function getId(): int
    {
        return $this->id;
    }
    
    public function getEmail(): string
    {
        return $this->email;
    }
    
    public function getName(): string
    {
        return $this->name;
    }
    
    public function getRole(): string
    {
        return $this->role;
    }
    
    public function getTenantId(): string
    {
        return $this->tenantId;
    }
    
    public function getCreatedAt(): DateTime
    {
        return $this->createdAt;
    }
    
    public function getUpdatedAt(): DateTime
    {
        return $this->updatedAt;
    }
    
    // Setters
    public function setEmail(string $email): void
    {
        $this->email = $email;
        $this->updatedAt = new DateTime();
    }
    
    public function setName(string $name): void
    {
        $this->name = $name;
        $this->updatedAt = new DateTime();
    }
    
    public function setRole(string $role): void
    {
        $this->role = $role;
        $this->updatedAt = new DateTime();
    }
}