<?php

declare(strict_types=1);

namespace App\ApiResources\Organization;

use App\Enum\Core\FileTypeEnum;
use App\Enum\Person\GenderEnum;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Requête de création d'un nouvel access.
 */
class OrganizationMemberCreationRequest
{
    #[Assert\Type(type: FileTypeEnum::class)]
    private GenderEnum $gender = GenderEnum::MISTER;

    #[Assert\Regex(pattern: '/^[a-z0-9\-]{3,}$/')]
    private ?string $username = null;

    #[Assert\Length(
        min: 1,
        minMessage: 'Name must be at least {{ limit }} characters long',
    )]
    private string $name;

    #[Assert\Length(
        min: 1,
        minMessage: 'Given name must be at least {{ limit }} characters long',
    )]
    private string $givenName;

    #[Assert\Length(
        min: 1,
        minMessage: 'Street address must be at least {{ limit }} characters long',
    )]
    private string $streetAddress1;

    private ?string $streetAddress2 = null;

    private ?string $streetAddress3 = null;

    #[Assert\Length(
        min: 3,
        minMessage: 'Postal code must be at least {{ limit }} characters long',
    )]
    private string $postalCode;

    #[Assert\Length(
        min: 1,
        minMessage: 'City must be at least {{ limit }} characters long',
    )]
    private string $city;

    private int $countryId = 72; // France's id

    #[Assert\Length(
        min: 10,
        minMessage: 'Phone number must be at least {{ limit }} characters long',
    )]
    private ?string $phone = null;

    #[Assert\Length(
        min: 10,
        minMessage: 'Mobile phone number must be at least {{ limit }} characters long',
    )]
    private ?string $mobile = null;

    #[Assert\Email(
        message: 'The email {{ value }} is not a valid email.',
    )]
    private string $email;

    public function getUsername(): ?string
    {
        return $this->username;
    }

    public function setUsername(?string $username): self
    {
        $this->username = $username;

        return $this;
    }

    public function getGender(): GenderEnum
    {
        return $this->gender;
    }

    public function setGender(GenderEnum $gender): self
    {
        $this->gender = $gender;

        return $this;
    }

    public function getName(): string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }

    public function getGivenName(): string
    {
        return $this->givenName;
    }

    public function setGivenName(string $givenName): self
    {
        $this->givenName = $givenName;

        return $this;
    }

    public function getStreetAddress1(): string
    {
        return $this->streetAddress1;
    }

    public function setStreetAddress1(string $streetAddress1): self
    {
        $this->streetAddress1 = $streetAddress1;

        return $this;
    }

    public function getStreetAddress2(): ?string
    {
        return $this->streetAddress2;
    }

    public function setStreetAddress2(?string $streetAddress2): self
    {
        $this->streetAddress2 = $streetAddress2;

        return $this;
    }

    public function getStreetAddress3(): ?string
    {
        return $this->streetAddress3;
    }

    public function setStreetAddress3(?string $streetAddress3): self
    {
        $this->streetAddress3 = $streetAddress3;

        return $this;
    }

    public function getPostalCode(): string
    {
        return $this->postalCode;
    }

    public function setPostalCode(string $postalCode): self
    {
        $this->postalCode = $postalCode;

        return $this;
    }

    public function getCity(): string
    {
        return $this->city;
    }

    public function setCity(string $city): self
    {
        $this->city = $city;

        return $this;
    }

    public function getCountryId(): int
    {
        return $this->countryId;
    }

    public function setCountryId(int $countryId): self
    {
        $this->countryId = $countryId;

        return $this;
    }

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

    public function setPhone(?string $phone): self
    {
        $this->phone = $phone;

        return $this;
    }

    public function getMobile(): ?string
    {
        return $this->mobile;
    }

    public function setMobile(?string $mobile): self
    {
        $this->mobile = $mobile;

        return $this;
    }

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

    public function setEmail(string $email): self
    {
        $this->email = $email;

        return $this;
    }
}
