package com.entity;

import com.constant.RegistrationErrorMsg;
import org.hibernate.validator.constraints.Email;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 *
 * Bean for sign up user.
 *
 * @author Laurentiu Marcut
 */
public class SignUpUser {

    @Size(min = 3, max = 25, message = RegistrationErrorMsg.FIRST_NAME_SIZE)
    private String firstName;

    @Size(min = 3, max = 25, message = RegistrationErrorMsg.LAST_NAME_SIZE)
    private String lastName;

    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
    @Past(message = RegistrationErrorMsg.BIRTH_DATE_PAST)
    private Date birthDate;

    @Size(min = 3, max = 25, message = RegistrationErrorMsg.EMAIL_INCORRECT)
    @Email(message = RegistrationErrorMsg.EMAIL_INCORRECT)
    private String email;

    @Size(min = 8, max = 25, message = RegistrationErrorMsg.PASSWORD_SIZE)
    private String password;

    @Size(min = 8, max = 25, message = RegistrationErrorMsg.PASSWORD_SIZE)
    private String repeatPassword;

    /**
     *
     * Getter first name.
     *
     * @return first name
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     *
     * Setter first name.
     *
     * @param firstName
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     *
     * Getter last name.
     *
     * @return last name
     */
    public String getLastName() {
        return lastName;
    }

    /**
     *
     * Setter last name
     *
     * @param lastName
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     *
     * Getter birthdate.
     *
     * @return birthdate
     */
    public Date getBirthDate() {
        return birthDate;
    }

    /**
     *
     * Setter birthdate.
     *
     * @param birthDate
     */
    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    /**
     *
     * Getter email.
     *
     * @return email
     */
    public String getEmail() {
        return email;
    }

    /**
     *
     * Setter email.
     *
     * @param email
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     *
     * Getter password.
     *
     * @return password
     */
    public String getPassword() {
        return password;
    }

    /**
     *
     * Setter password.
     *
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     *
     * Getter repeat password.
     *
     * @return repeat password
     */
    public String getRepeatPassword() {
        return repeatPassword;
    }

    /**
     *
     * Setter repeat password.
     *
     * @param repeatPassword
     */
    public void setRepeatPassword(String repeatPassword) {
        this.repeatPassword = repeatPassword;
    }
}
