base con autenticacion, registro, modulo encuestas
This commit is contained in:
33
apps/api/src/features/users/dto/create-user.dto.ts
Normal file
33
apps/api/src/features/users/dto/create-user.dto.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEmail, IsInt, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class CreateUserDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
username: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fullname: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString({
|
||||
message: 'Phone must be a string',
|
||||
})
|
||||
@IsOptional()
|
||||
phone: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString({
|
||||
message: 'Password must be a string',
|
||||
})
|
||||
password: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsInt()
|
||||
role: number;
|
||||
}
|
||||
40
apps/api/src/features/users/dto/update-user.dto.ts
Normal file
40
apps/api/src/features/users/dto/update-user.dto.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger';
|
||||
import { CreateUserDto } from './create-user.dto';
|
||||
|
||||
// import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class UpdateUserDto extends PartialType(CreateUserDto) {
|
||||
// export class UpdateUserDto {
|
||||
@IsOptional()
|
||||
username: string;
|
||||
|
||||
@IsOptional()
|
||||
email: string;
|
||||
|
||||
@IsOptional()
|
||||
fullname: string;
|
||||
|
||||
@IsOptional()
|
||||
phone: string;
|
||||
|
||||
@IsOptional()
|
||||
password: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
isActive: string;
|
||||
|
||||
@IsOptional()
|
||||
state: string | number | null;
|
||||
|
||||
@IsOptional()
|
||||
municipality: string | number | null;
|
||||
|
||||
@IsOptional()
|
||||
parish: string | number | null;
|
||||
|
||||
@IsOptional()
|
||||
role: number;
|
||||
}
|
||||
Reference in New Issue
Block a user