ita-social-projects/WhatBackend

Add validators

Closed this issue · 0 comments

You need to add additional validation for First name, Last name and Email of users.

First name: lowercase and uppercase latin letters, special characters (only space and hyphen, not at the beginning and not at the end), from 2 to 50 characters.
Last name: lowercase and uppercase latin letters, special characters (only space and hyphen, not at the beginning and not at the end), from 2 to 50 characters.
Email:

  • Latin letters in upper and / or lower case (A-Z, a-z);
  • numbers (from 0 to 9);
  • special characters like #! % $ '& + * - / =? ^ _`. {| } ~. The dot (.) character can only be used in the local part of an address if it is not at the beginning or end of the address. In addition, you cannot use two points in a row.

All these validators you should add to: AccountDTO, MentorDto, SecretaryDto and StudentDto.

Also you need to add additional validation for Type, Interval, DaysOfWeek and Index in ScheduledDTO.
Update the documentation after the changes have been made : https://github.com/ita-social-projects/WhatBackend/wiki/Validators
Do research and add necessary validators to other DTOs.