package ru.ulstu.user.model;

import org.hibernate.validator.constraints.NotEmpty;
import ru.ulstu.configuration.Constants;

import javax.validation.constraints.Size;
import java.util.Objects;

public class UserResetPasswordDto {
    @NotEmpty
    @Size(min = Constants.MIN_PASSWORD_LENGTH, max = 50)
    private String password;
    @NotEmpty
    @Size(min = Constants.MIN_PASSWORD_LENGTH, max = 50)
    private String passwordConfirm;

    public String getPassword() {
        return password;
    }

    public String getPasswordConfirm() {
        return passwordConfirm;
    }

    public boolean isPasswordsValid() {
        return Objects.equals(password, passwordConfirm);
    }
}
