forked from fga-eps-mds/2024.1-CALCULUS-UserService
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from fga-eps-mds/qas
[RELEASE] Introduz correções gerais no backend
- Loading branch information
Showing
14 changed files
with
251 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,33 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEmail, IsEnum, IsNotEmpty, IsOptional } from 'class-validator'; | ||
import { UserRole } from './user-role.enum'; | ||
import { IsEmail, IsNotEmpty } from 'class-validator'; | ||
|
||
export class CreateUserDto { | ||
@ApiProperty({ | ||
example: 'Nome', | ||
required: true | ||
}) | ||
required: true, | ||
}) | ||
@IsNotEmpty() | ||
name: string; | ||
|
||
@ApiProperty({ | ||
example: 'nome@dominio.com', | ||
required: true | ||
}) | ||
required: true, | ||
}) | ||
@IsEmail() | ||
@IsNotEmpty() | ||
email: string; | ||
|
||
@ApiProperty({ | ||
example: 'Username', | ||
required: true | ||
}) | ||
required: true, | ||
}) | ||
@IsNotEmpty() | ||
username: string; | ||
|
||
@ApiProperty({ | ||
example: 'Senha123', | ||
required: true | ||
}) | ||
required: true, | ||
}) | ||
@IsNotEmpty() | ||
password: string; | ||
|
||
@ApiProperty({ | ||
example: 'aluno', | ||
required: false | ||
}) | ||
@IsOptional() | ||
@IsEnum(UserRole) | ||
role?: UserRole; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,36 @@ | ||
import { PartialType } from '@nestjs/mapped-types'; | ||
import { CreateUserDto } from './create-user.dto'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsBoolean, IsEmail, IsOptional, IsString, MinLength } from 'class-validator'; | ||
|
||
export class UpdateUserDto extends PartialType(CreateUserDto) {} | ||
export class UpdateUserDto { | ||
|
||
@ApiProperty({ | ||
example: 'Nome', | ||
required: false | ||
}) | ||
@IsString() | ||
@MinLength(3) | ||
@IsOptional() | ||
name?: string | ||
|
||
@ApiProperty({ | ||
example: 'Username', | ||
required: false | ||
}) | ||
@IsString() | ||
@MinLength(3) | ||
@IsOptional() | ||
username?: string | ||
|
||
@ApiProperty({ | ||
example: 'email@email.com', | ||
required: false | ||
}) | ||
@IsEmail() | ||
@IsOptional() | ||
email?: string | ||
|
||
@IsBoolean() | ||
@IsOptional() | ||
isVerified?: boolean | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.