App\User\Entity\User:

  constraints:
    - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
        fields: usernameCanonical
        errorPath: username
        message: fos_user.username.already_used
        groups: [Profile]

    - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
        fields: emailCanonical
        errorPath: email
        message: fos_user.email.already_used
        groups: [AppRegistration, Profile]

  properties:

    username:
      - NotBlank:
          message: fos_user.username.blank
          groups: [AppRegistration, Profile]
      - Length:
          min: 2
          minMessage: fos_user.username.short
          max: 180
          maxMessage: fos_user.username.long
          groups: [AppRegistration, Profile]

    email:
      - NotBlank:
          message: fos_user.email.blank
          groups: [AppRegistration, Profile]
      - Length:
          min: 2
          minMessage: fos_user.email.short
          max: 180
          maxMessage: fos_user.email.long
          groups: [AppRegistration, Profile]
      - Email:
          message: fos_user.email.invalid
          groups: [AppRegistration, Profile]

    plainPassword:
      - App\User\Validator\PasswordConstraint:
          groups: ["AppRegistration", "AppResetPassword", "AppChangePassword"]



