package ee.tuleva.onboarding.user.command;

import ee.tuleva.onboarding.user.personalcode.PersonalCode;
import ee.tuleva.onboarding.user.personalcode.ValidPersonalCode;
import lombok.Data;
import org.hibernate.validator.constraints.Email;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Data
public class CreateUserCommand {

  @NotNull
  @Email
  private String email;

  @ValidPersonalCode
  private String personalCode;

  private String phoneNumber;

  @Min(18)
  private int getAge() {
    return PersonalCode.getAge(personalCode);
  }

}

@@ -37,16 +37,68 @@
 mmand;%0A%0A
+import com.fasterxml.jackson.annotation.JsonIgnore;%0A
 import e
@@ -554,23 +554,36 @@
 n(18)%0A  
-private
+@JsonIgnore%0A  public
  int get

Fix exception