Represents user input for updating an existing user. This class is used to validate the data before updating the user in the database.
email
firstname
lastname
role
Roles
The class uses the following decorators:
@Field()
@IsEmail()
@Length()
@IsOptional()
@IsIn()
Optional
Represents user input for updating an existing user. This class is used to validate the data before updating the user in the database.
email
: The user's email address (optional, must be valid if provided).firstname
: The user's first name (optional, must be between 2 and 100 characters if provided).lastname
: The user's last name (optional, must be between 2 and 100 characters if provided).role
: the user's role, must be one of the valid roles defined in theRoles
enum (optional).The class uses the following decorators:
@Field()
: Exposes the property in the GraphQL schema (via type-graphql).@IsEmail()
: Ensures the email is valid (only if the email is provided).@Length()
: Ensures the string length is within the specified bounds (forfirstname
,lastname
).@IsOptional()
: Indicates that the field is optional.@IsIn()
: ensures therole
is a valid role as defined in theRoles
enum (optional).