<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Symfony\Bundle\Form\Site\Security\Model;

use Symfony\Component\Validator\Constraints as Assert;

#[Assert\Expression(
    'this.getPlainPassword() === this.getPasswordConfirmation()',
    message: 'security.password_confirmation.mismatch'
)]
final class ResetPasswordRequest
{
    #[Assert\NotBlank(message: 'security.password.required_new')]
    #[Assert\Length(
        min: 8,
        minMessage: 'security.password.min_length'
    )]
    private ?string $plainPassword = null;

    #[Assert\NotBlank(message: 'security.password_confirmation.required')]
    private ?string $passwordConfirmation = null;

    public function getPlainPassword(): ?string
    {
        return $this->plainPassword;
    }

    public function setPlainPassword(?string $plainPassword): void
    {
        $this->plainPassword = $plainPassword;
    }

    public function getPasswordConfirmation(): ?string
    {
        return $this->passwordConfirmation;
    }

    public function setPasswordConfirmation(?string $passwordConfirmation): void
    {
        $this->passwordConfirmation = $passwordConfirmation;
    }
}
