Skip to content

Commit

Permalink
adjust(CC-119): adjust dto names
Browse files Browse the repository at this point in the history
  • Loading branch information
italorockenbachamaral committed Apr 22, 2024
1 parent 097cf73 commit 5dde3b5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IsEnum, IsMobilePhone, IsOptional, IsString, IsUUID } from 'class-validator';
import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments';

export class UpdatePatientControllerReqBodyInputDto {
export class UpdatePatientControllerBodyInputDto {
@IsOptional()
@IsString()
name?: string;
Expand All @@ -27,7 +27,7 @@ export class UpdatePatientControllerReqBodyInputDto {
clinicId?: string;
}

export class UpdatePatientControllerReqParamsInputDto {
export class UpdatePatientControllerParamsInputDto {
@IsUUID()
id!: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { patchMethodDocs } from './docs';

import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import {
UpdatePatientControllerReqBodyInputDto,
UpdatePatientControllerReqParamsInputDto,
UpdatePatientControllerBodyInputDto,
UpdatePatientControllerParamsInputDto,
} from './input-dto';
import { NestjsUpdatePatientService } from './nestjs-update-patient.service';
import { UpdatePatientControllerOutputDto } from './output.dto';
Expand All @@ -21,8 +21,8 @@ export class UpdatePatientController {
@Patch(':id/update')
@ApiOperation(patchMethodDocs)
async execute(
@Param() { id }: UpdatePatientControllerReqParamsInputDto,
@Body() updatePsychologistDto: UpdatePatientControllerReqBodyInputDto,
@Param() { id }: UpdatePatientControllerParamsInputDto,
@Body() updatePsychologistDto: UpdatePatientControllerBodyInputDto,
): Promise<UpdatePatientControllerOutputDto> {
try {
const isReqBodyEmpty = Object.keys(updatePsychologistDto).length === 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Encrypter } from '../../../../../../core/shared/cryptography/repository
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';

import { Public } from '../../../../../auth/public';
import { AuthenticatePsychologistControllerInputDto } from './input.dto';
import { ControllerBodyInputDto } from './input.dto';
import { NestjsAuthenticatePsychologistService } from './nestjs-authenticate-psychologist.service';
import { AuthenticatePsychologistControllerOutputDto } from './output.dto';

Expand All @@ -22,7 +22,7 @@ export class AuthenticatePsychologistController {
@Post('login')
@Public()
async execute(
@Body() psychologistLoginDto: AuthenticatePsychologistControllerInputDto,
@Body() psychologistLoginDto: ControllerBodyInputDto,
): Promise<AuthenticatePsychologistControllerOutputDto> {
try {
const { id, name, email } =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsString } from 'class-validator';

export class AuthenticatePsychologistControllerInputDto {
export class ControllerBodyInputDto {
@IsString()
email!: string;

Expand Down

0 comments on commit 5dde3b5

Please sign in to comment.