package pl.hycom.pip.messanger.controller.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * Created by Piotr on 03.06.2017.
 */
@Data
@NoArgsConstructor
public class ResetPassword {

    @NotNull
    @NotEmpty
    private String resetToken;

    @NotNull
    @Size(min = 6, max = 40, message = "{validation.error.email.size}")
    @Pattern(regexp = "^[a-zA-Z0-9_!#$%&’*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$", message = "{validation.error.email.format}")
    private String userMail;

    @Size(min = 6, max = 64)
    @Pattern(regexp = "(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\\S+$).{6,}")
    private String newPassword;
}

@@ -47,115 +47,8 @@
 l;%0A%0A
-import lombok.Data;%0Aimport lombok.NoArgsConstructor;%0Aimport org.hibernate.validator.constraints.NotEmpty;%0A%0A
 impo
@@ -176,16 +176,124 @@
 .Size;%0A%0A
+import org.hibernate.validator.constraints.NotEmpty;%0A%0Aimport lombok.Data;%0Aimport lombok.NoArgsConstructor;%0A%0A
 /**%0A * C
@@ -728,16 +728,17 @@
 gexp = %22
+%5E
 (?=.*%5B0-
@@ -792,16 +792,65 @@
 +$).%7B6,%7D
+$%22, message = %22%7Bvalidation.error.password.format%7D
 %22)%0A    p

fix patternu