<?php

namespace Signteer\Core\Model;

class User
{
    private ?int $id = null;
    private string $title;
    private string $email;
    private string $phone;
    private string $stateId;

    public const STATE_ACTIVE = 'active';
    public const STATE_PENDING = 'pending';
    public const STATE_SUSPENDED = 'suspended';
    public const STATE_ARCHIVED = 'archived';

    public function __construct(
        ?int $id,
        string $title,
        string $email,
        string $phone,
        string $stateId = 'active'
    ) {
        $this->id = $id;
        $this->title = $title;
        $this->email = $email;
        $this->phone = $phone;
        $this->stateId = $stateId;
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function withId(int $v): self
    {
        $ret = clone $this;
        $ret->id = $v;

        return $ret;
    }

    public function getStateId(): string
    {
        return $this->stateId;
    }

    public function getTitle(): string
    {
        return $this->title;
    }

    public function getEmail(): string
    {
        return $this->email;
    }

    public function getPhone(): string
    {
        return $this->phone;
    }
}
