src/user/dto/user.dto.ts
Properties |
| cpf |
Type : string
|
Decorators :
@Length(11, 11, {message: 'invalid_cpf_length'})
|
|
Defined in src/user/dto/user.dto.ts:66
|
Type : string
|
Decorators :
@IsNotEmpty()
|
|
Defined in src/user/dto/user.dto.ts:61
|
| fax |
Type : string
|
Decorators :
@ApiProperty({example: 'FAX'})
|
|
Defined in src/user/dto/user.dto.ts:78
|
| Optional jobPositionId |
Type : number
|
Decorators :
@ApiProperty({example: 100, type: 'int4', required: false})
|
|
Defined in src/user/dto/user.dto.ts:90
|
| name |
Type : string
|
Decorators :
@IsNotEmpty()
|
|
Defined in src/user/dto/user.dto.ts:57
|
| observation |
Type : string
|
Decorators :
@ApiProperty({example: 'Observação'})
|
|
Defined in src/user/dto/user.dto.ts:81
|
| ramal1 |
Type : number
|
Decorators :
@ApiProperty({example: 123, type: 'int4'})
|
|
Defined in src/user/dto/user.dto.ts:84
|
| ramal2 |
Type : number
|
Decorators :
@ApiProperty({example: 123, type: 'int4'})
|
|
Defined in src/user/dto/user.dto.ts:87
|
| telephone1 |
Type : string
|
Decorators :
@ApiProperty({example: 'Telefone 1'})
|
|
Defined in src/user/dto/user.dto.ts:72
|
| telephone2 |
Type : string
|
Decorators :
@ApiProperty({example: 'Telefone 2'})
|
|
Defined in src/user/dto/user.dto.ts:75
|
| userRole |
Type : string
|
Decorators :
@ApiProperty({example: 'Cargo do usuário'})
|
|
Defined in src/user/dto/user.dto.ts:69
|
import { ApiProperty } from '@nestjs/swagger';
import {
IsEmail,
IsNotEmpty,
IsOptional,
Length,
MaxLength,
} from 'class-validator';
export class UserCreateDTO {
@IsNotEmpty()
@ApiProperty({ example: 'User Test', required: true })
name: string;
@IsNotEmpty()
@ApiProperty({ example: 'test', required: true })
username: string;
@IsNotEmpty()
@IsEmail()
@ApiProperty({ example: 'test@test.com', required: true })
email: string;
@Length(11, 11, { message: 'invalid_cpf_length' })
@IsOptional()
@ApiProperty({ example: 'CPF' })
cpf: string;
@ApiProperty({ example: 'Cargo do usuário' })
userRole: string;
@ApiProperty({ example: 'Telefone 1' })
telephone1: string;
@ApiProperty({ example: 'Telefone 2' })
telephone2: string;
@ApiProperty({ example: 'FAX' })
fax: string;
@ApiProperty({ example: 'Observação' })
observation: string;
@ApiProperty({ example: 123, type: 'int4' })
ramal1: number;
@ApiProperty({ example: 123, type: 'int4' })
ramal2: number;
@ApiProperty({ example: 100, type: 'int4', required: false })
jobPositionId?: number;
}
export class UserUpdateDTO {
@IsNotEmpty()
@ApiProperty()
name: string;
@IsNotEmpty()
@ApiProperty()
email: string;
@Length(11, 11, { message: 'invalid_cpf_length' })
@IsOptional()
@ApiProperty({ example: 'CPF' })
cpf: string;
@ApiProperty({ example: 'Cargo do usuário' })
userRole: string;
@ApiProperty({ example: 'Telefone 1' })
telephone1: string;
@ApiProperty({ example: 'Telefone 2' })
telephone2: string;
@ApiProperty({ example: 'FAX' })
fax: string;
@ApiProperty({ example: 'Observação' })
observation: string;
@ApiProperty({ example: 123, type: 'int4' })
ramal1: number;
@ApiProperty({ example: 123, type: 'int4' })
ramal2: number;
@ApiProperty({ example: 100, type: 'int4', required: false })
jobPositionId?: number;
}
export class PaginateUserQueryDto {
@ApiProperty({ required: false })
name: string;
@ApiProperty({ required: false })
email: string;
@ApiProperty({ default: false })
onlyActive: string;
@ApiProperty({ default: 0 })
page: number;
@ApiProperty({ default: 10 })
size: number;
}
export class AddUserClientDTO {
@ApiProperty()
clientId: number;
@ApiProperty()
userId: number;
}