Skip to content

Commit

Permalink
adjust(CC-119): adjust registry endpoint response
Browse files Browse the repository at this point in the history
  • Loading branch information
luanavfg committed Mar 4, 2024
1 parent 29d68a7 commit f7715dc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export class CreatePatientAppointmentRegistryController {
createPatientAppointmentRegistryDto: CreatePatientAppointmentRegistryControllerInputDto,
): Promise<CreatePatientAppointmentRegistryControllerOutputDto> {
try {
await this.createPatientAppointmentRegistryService.execute(
const patientAppointmentRegistry = await this.createPatientAppointmentRegistryService.execute(
createPatientAppointmentRegistryDto,
);

return { message: 'Appointment registry created successfully' };
return patientAppointmentRegistry
} catch (error: unknown) {
throw new GlobalAppHttpException(error);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import { IsString } from 'class-validator';
import { IsDate, IsObject, IsString } from 'class-validator';
import { Registry } from '../../../../../../core/domains/patient-appointment-registry/entities/registry/dto';

export class CreatePatientAppointmentRegistryControllerOutputDto {
@IsString()
message!: string;
id!: string;

@IsObject()
registry!: Registry;

@IsString()
psychologistId!: string;

@IsString()
patientId!: string;

@IsDate()
createdAt!: Date;

@IsDate()
updatedAt?: Date | null;
}

0 comments on commit f7715dc

Please sign in to comment.