Represents user input for creating a new user (SIGN UP). This class is used to validate the data before storing it in the database.
email
password
firstname
lastname
role
Roles
The class uses the following decorators:
@Field()
@IsEmail()
@IsStrongPassword()
@Length()
@IsIn()
Represents user input for creating a new user (SIGN UP). This class is used to validate the data before storing it in the database.
email
: the user's email address, must be valid.password
: the user's password, with specific requirements:firstname
: the user's first name, must be between 2 and 100 characters.lastname
: the user's last name, must be between 2 and 100 characters.role
: the user's role, must be one of the valid roles defined in theRoles
enum.The class uses the following decorators:
@Field()
: exposes the property in the GraphQL schema (via type-graphql).@IsEmail()
: ensures the email is valid.@IsStrongPassword()
: ensures the password meets strong security requirements.@Length()
: ensures the string length is within the specified bounds.@IsIn()
: ensures the role is a valid role as defined in theRoles
enum.