Skip to content

Add email address to Person #11

Description

@Japoivvb

Describe the solution you'd like
Currently, the "Person" model lacks an email field and validation. To improve data handling, we should:

  • Add a new email field to the "Person" model.
  • Implement regex validation to ensure that the email format is correct.
  • Update the user interface to handle email input validation when adding or updating a person.

Additional context

  • Email Field:
    Add an email attribute to the "Person" class with appropriate getter and setter methods.

  • Regex Validation:
    Use the following regex pattern to validate email format:
    String emailRegex = "^[a-zA-Z0-9_+&-]+(?:\.[a-zA-Z0-9_+&-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$";

  • Menu or App Changes:
    Update the form or input pane in the app or menu to include the email field
    When adding or editing a person, validate the email using the regex. If the email is invalid, show an error message like "Invalid email format."

  • Error Handling in the App:
    If the email fails validation, prevent the user from saving or updating the record and display a message asking them to correct the email format.

Expected sample

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions