diff --git a/apps/core-rest-api/src/app/adapters/controllers/api.module.ts b/apps/core-rest-api/src/app/adapters/api.module.ts similarity index 92% rename from apps/core-rest-api/src/app/adapters/controllers/api.module.ts rename to apps/core-rest-api/src/app/adapters/api.module.ts index 606cd2ae..7e9d012e 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api.module.ts +++ b/apps/core-rest-api/src/app/adapters/api.module.ts @@ -1,14 +1,14 @@ import { Module } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; -import { AuthModule } from '../auth/auth.module'; -import { CryptographyModule } from '../cryptography/cryptography.module'; -import { envSchema } from '../env/env'; -import { EnvModule } from '../env/env.module'; +import { AuthModule } from './auth/auth.module'; +import { CryptographyModule } from './cryptography/cryptography.module'; +import { envSchema } from './env/env'; +import { EnvModule } from './env/env.module'; -import { BcryptHasherService } from '../../core/shared/cryptography/use-cases/bcrypt-hasher.service'; -import { PostgreSqlPrismaOrmService } from '../database/infra/prisma/prisma.service'; -import { DatabaseRepositoriesModule } from '../database/repositories/repositories.module'; +import { BcryptHasherService } from '../core/shared/cryptography/use-cases/bcrypt-hasher.service'; +import { PostgreSqlPrismaOrmService } from './database/infra/prisma/prisma.service'; +import { DatabaseRepositoriesModule } from './database/repositories/repositories.module'; import { NestjsCreateAppointmentService } from './routes/v1/appointment/create-appointment/nestjs-create-appointment.service'; import { DeleteAppointmentController } from './routes/v1/appointment/delete-appointment/delete-appointment.controller'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/nestjs-create-appointment.service.ts b/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/nestjs-create-appointment.service.ts deleted file mode 100644 index 2f83cc1d..00000000 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/nestjs-create-appointment.service.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import { AppointmentDatabaseRepository } from '../../../../../../core/domains/appointment/repositories/database-repository'; -import { CreateSingleAppointmentService } from '../../../../../../core/domains/appointment/use-cases/create-single-appointment/create-single-appointment.service'; - -@Injectable() -export class NestjsCreateAppointmentService extends CreateSingleAppointmentService { - constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) { - super(appointmentDatabaseRepository); - } -} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/nestjs-delete-appointment.service.ts b/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/nestjs-delete-appointment.service.ts deleted file mode 100644 index b9ae54c2..00000000 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/nestjs-delete-appointment.service.ts +++ /dev/null @@ -1,11 +0,0 @@ - -import { Injectable } from '@nestjs/common'; -import { AppointmentDatabaseRepository } from '../../../../../../core/domains/appointment/repositories/database-repository'; -import { DeleteSingleAppointmentService } from '../../../../../../core/domains/appointment/use-cases/delete-single-appointment/delete-single-appointment.service'; - -@Injectable() -export class NestjsDeleteAppointmentService extends DeleteSingleAppointmentService { - constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) { - super(appointmentDatabaseRepository); - } -} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/nestjs-update-appointment.service.ts b/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/nestjs-update-appointment.service.ts deleted file mode 100644 index 33a81a46..00000000 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/nestjs-update-appointment.service.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import { AppointmentDatabaseRepository } from '../../../../../../core/domains/appointment/repositories/database-repository'; -import { UpdateAppointmentService } from '../../../../../../core/domains/appointment/use-cases/update-single-appointment/update-appointment.service'; - -@Injectable() -export class NestjsUpdateAppointmentService extends UpdateAppointmentService { - constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) { - super(appointmentDatabaseRepository); - } -} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/nestjs-update-patient.service.ts b/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/nestjs-update-patient.service.ts deleted file mode 100644 index 94e6984d..00000000 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/nestjs-update-patient.service.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Injectable } from '@nestjs/common'; - -import { PatientDatabaseRepository } from '../../../../../../../app/core/domains/patient/repositories/database-repository'; -import { UpdatePatientService } from '../../../../../../../app/core/domains/patient/use-cases/update-patient/update-patient.service'; - -@Injectable() -export class NestjsUpdatePatientService extends UpdatePatientService { - constructor(patientDatabaseRepository: PatientDatabaseRepository) { - super(patientDatabaseRepository); - } -} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/nestjs-create-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/nestjs-create-psychologist.service.ts deleted file mode 100644 index 2b3cab12..00000000 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/nestjs-create-psychologist.service.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import { PsychologistDatabaseRepository } from '../../../../../../core/domains/psychologist/repositories/database-repository'; -import { CreatePsychologistService } from '../../../../../../core/domains/psychologist/use-cases/create-psychologist/create-psychologist.service'; - -@Injectable() -export class NestjsCreatePsychologistService extends CreatePsychologistService { - constructor(psychologistDatabaseRepository: PsychologistDatabaseRepository) { - super(psychologistDatabaseRepository); - } -} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts deleted file mode 100644 index df922ec1..00000000 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Injectable } from '@nestjs/common'; - -import { PsychologistDatabaseRepository } from '../../../../../../core/domains/psychologist/repositories/database-repository'; -import { DeletePsychologistService } from '../../../../../../core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.service'; - -@Injectable() -export class NestjsDeletePsychologistService extends DeletePsychologistService { - constructor(psychologistDatabaseRepository: PsychologistDatabaseRepository) { - super(psychologistDatabaseRepository); - } -} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/nestjs-update-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/nestjs-update-psychologist.service.ts deleted file mode 100644 index a1ac8d14..00000000 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/nestjs-update-psychologist.service.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Injectable } from '@nestjs/common'; - -import { PsychologistDatabaseRepository } from '../../../../../../core/domains/psychologist/repositories/database-repository'; -import { UpdatePsychologistService } from '../../../../../../core/domains/psychologist/use-cases/update-psychologist/update-psychologist.service'; - -@Injectable() -export class NestjsUpdatePsychologistService extends UpdatePsychologistService { - constructor(psychologistDatabaseRepository: PsychologistDatabaseRepository) { - super(psychologistDatabaseRepository); - } -} diff --git a/apps/core-rest-api/src/app/adapters/controllers/decorators/current-user.decorator.ts b/apps/core-rest-api/src/app/adapters/decorators/current-user.decorator.ts similarity index 94% rename from apps/core-rest-api/src/app/adapters/controllers/decorators/current-user.decorator.ts rename to apps/core-rest-api/src/app/adapters/decorators/current-user.decorator.ts index 5d462e09..1e3ba667 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/decorators/current-user.decorator.ts +++ b/apps/core-rest-api/src/app/adapters/decorators/current-user.decorator.ts @@ -9,7 +9,7 @@ */ import { ExecutionContext, createParamDecorator } from '@nestjs/common'; -import { TokenPayload } from '../../auth/jwt.strategy'; +import { TokenPayload } from '../auth/jwt.strategy'; export const CurrentUser = createParamDecorator((_: never, context: ExecutionContext) => { const request = context.switchToHttp().getRequest(); // usamos o switchToHttp para ter acesso ao request da requisição, e getRequest() para pegar o request (o request é um objeto que tem várias informações da requisição) diff --git a/apps/core-rest-api/src/app/adapters/controllers/guards/api-key.guard.ts b/apps/core-rest-api/src/app/adapters/guards/api-key.guard.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/guards/api-key.guard.ts rename to apps/core-rest-api/src/app/adapters/guards/api-key.guard.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/create-appointment.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/create-appointment.controller.ts similarity index 91% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/create-appointment.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/create-appointment.controller.ts index eb8a5830..b65a2d1c 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/create-appointment.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/create-appointment.controller.ts @@ -1,6 +1,6 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { CreateSingleAppointmentControllerBodyInputDto } from './input.dto'; import { NestjsCreateAppointmentService } from './nestjs-create-appointment.service'; import { CreateAppointmentControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/create-appointment.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/create-appointment.e2e-spec.ts similarity index 78% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/create-appointment.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/create-appointment.e2e-spec.ts index 5c20fbbc..69ecad0f 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/create-appointment.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/create-appointment.e2e-spec.ts @@ -1,11 +1,11 @@ import { faker } from "@faker-js/faker"; import { INestApplication } from "@nestjs/common"; import request from 'supertest'; -import { makeAppointment } from '../../../../../../../../tests/factories/make-appointment'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { AppointmentEntity } from '../../../../../../core/domains/appointment/entities/appointment/entity'; -import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { makeAppointment } from '../../../../../../../tests/factories/make-appointment'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { AppointmentEntity } from '../../../../../core/domains/appointment/entities/appointment/entity'; +import { PaymentMethod } from '../../../../../core/shared/interfaces/payments'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Create New Appointment', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/input.dto.ts similarity index 86% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/input.dto.ts index c644148a..112d5069 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/input.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/input.dto.ts @@ -1,5 +1,5 @@ import { IsBoolean, IsDate, IsEnum, IsOptional, IsString } from 'class-validator'; -import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments'; +import { PaymentMethod } from '../../../../../core/shared/interfaces/payments'; export class CreateSingleAppointmentControllerBodyInputDto { @IsString() diff --git a/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/nestjs-create-appointment.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/nestjs-create-appointment.service.ts new file mode 100644 index 00000000..87f5d74a --- /dev/null +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/nestjs-create-appointment.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@nestjs/common'; +import { AppointmentDatabaseRepository } from '../../../../../core/domains/appointment/repositories/database-repository'; +import { CreateSingleAppointmentService } from '../../../../../core/domains/appointment/use-cases/create-single-appointment/create-single-appointment.service'; + +@Injectable() +export class NestjsCreateAppointmentService extends CreateSingleAppointmentService { + constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) { + super(appointmentDatabaseRepository); + } +} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/create-appointment/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/create-appointment/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/delete-appointment.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/delete-appointment.controller.ts similarity index 90% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/delete-appointment.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/delete-appointment.controller.ts index aa8aacd3..238311e7 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/delete-appointment.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/delete-appointment.controller.ts @@ -1,6 +1,6 @@ import { Controller, Delete, Param } from '@nestjs/common'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { DeleteAppointmentControllerParamsInputDto } from './input.dto'; import { NestjsDeleteAppointmentService } from './nestjs-delete-appointment.service'; import { DeleteAppointmentOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/delete-appointment.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/delete-appointment.e2e-spec.ts similarity index 89% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/delete-appointment.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/delete-appointment.e2e-spec.ts index 022ae027..74eb6392 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/delete-appointment.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/delete-appointment.e2e-spec.ts @@ -1,9 +1,9 @@ import { faker } from '@faker-js/faker'; import { INestApplication } from '@nestjs/common'; import request from 'supertest'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { AppointmentEntity } from '../../../../../../core/domains/appointment/entities/appointment/entity'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { AppointmentEntity } from '../../../../../core/domains/appointment/entities/appointment/entity'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Delete Appointment', () => { let prisma: PostgreSqlPrismaOrmService; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/nestjs-delete-appointment.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/nestjs-delete-appointment.service.ts new file mode 100644 index 00000000..2daac676 --- /dev/null +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/nestjs-delete-appointment.service.ts @@ -0,0 +1,11 @@ + +import { Injectable } from '@nestjs/common'; +import { AppointmentDatabaseRepository } from '../../../../../core/domains/appointment/repositories/database-repository'; +import { DeleteSingleAppointmentService } from '../../../../../core/domains/appointment/use-cases/delete-single-appointment/delete-single-appointment.service'; + +@Injectable() +export class NestjsDeleteAppointmentService extends DeleteSingleAppointmentService { + constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) { + super(appointmentDatabaseRepository); + } +} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/delete-appointment/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/delete-appointment/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/input.dto.ts similarity index 90% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/input.dto.ts index 1329e617..4bde56c4 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/input.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/input.dto.ts @@ -1,5 +1,5 @@ import { IsBoolean, IsDate, IsEnum, IsOptional, IsString } from 'class-validator'; -import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments'; +import { PaymentMethod } from '../../../../../core/shared/interfaces/payments'; export class UpdateAppointmentControllerParamsInputDto { @IsString() diff --git a/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/nestjs-update-appointment.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/nestjs-update-appointment.service.ts new file mode 100644 index 00000000..f0a1cb4b --- /dev/null +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/nestjs-update-appointment.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@nestjs/common'; +import { AppointmentDatabaseRepository } from '../../../../../core/domains/appointment/repositories/database-repository'; +import { UpdateAppointmentService } from '../../../../../core/domains/appointment/use-cases/update-single-appointment/update-appointment.service'; + +@Injectable() +export class NestjsUpdateAppointmentService extends UpdateAppointmentService { + constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) { + super(appointmentDatabaseRepository); + } +} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/output.dto.ts similarity index 85% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/output.dto.ts index d381ea87..630a60b9 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/output.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/output.dto.ts @@ -24,22 +24,22 @@ class UpdatedAppointmentInfoOutputDto { confirmed!: boolean; @IsDate() - confirmationDate!: Date | null; + confirmationDate?: Date | null; @IsBoolean() cancelled!: boolean; @IsDate() - cancellationDate!: Date | null; + cancellationDate?: Date | null; @IsBoolean() done!: boolean | null; @IsBoolean() - missed!: boolean | null; + missed?: boolean | null; @IsBoolean() - paid!: boolean; + paid?: boolean; @IsEnum(PaymentMethod) paymentMethod!: PaymentMethod; @@ -48,7 +48,7 @@ class UpdatedAppointmentInfoOutputDto { createdAt!: Date; @IsDate() - updatedAt!: Date | null; + updatedAt?: Date | null; } export class UpdateAppointmentControllerOutputDto { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/update-appointment.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/update-appointment.controller.ts similarity index 87% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/update-appointment.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/update-appointment.controller.ts index df701628..49e062e1 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/update-appointment.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/update-appointment.controller.ts @@ -1,9 +1,9 @@ import { BadRequestException, Body, Controller, Param, Patch } from '@nestjs/common'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { - UpdateAppointmentControllerBodyInputDto, - UpdateAppointmentControllerParamsInputDto, + UpdateAppointmentControllerBodyInputDto, + UpdateAppointmentControllerParamsInputDto, } from './input.dto'; import { NestjsUpdateAppointmentService } from './nestjs-update-appointment.service'; import { UpdateAppointmentControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/update-appointment.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/update-appointment.e2e-spec.ts similarity index 94% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/update-appointment.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/update-appointment.e2e-spec.ts index 71eecf3e..bc5e1f89 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/appointment/update-appointment/update-appointment.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/appointment/update-appointment/update-appointment.e2e-spec.ts @@ -1,9 +1,9 @@ import { faker } from '@faker-js/faker'; import { INestApplication } from '@nestjs/common'; import request from 'supertest'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { Replace } from '../../../../../../../app/shared/utils'; -import { AppointmentEntity } from '../../../../../../core/domains/appointment/entities/appointment/entity'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { AppointmentEntity } from '../../../../../core/domains/appointment/entities/appointment/entity'; +import { Replace } from '../../../../../shared/utils'; import { UpdateAppointmentControllerBodyInputDto } from './input.dto'; describe('[E2E] - Update Appointment', () => { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/create-clinic.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/create-clinic.controller.ts similarity index 89% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/create-clinic.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/create-clinic.controller.ts index 35075fe1..5a36f0e1 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/create-clinic.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/create-clinic.controller.ts @@ -1,6 +1,6 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { CreateClinicControllerBodyInputDto } from './input.dto'; import { NestjsCreateClinicService } from './nestjs-create-clinic.service'; import { CreateClinicControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/create-clinic.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/create-clinic.e2e-spec.ts similarity index 89% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/create-clinic.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/create-clinic.e2e-spec.ts index 31e9457b..3c0370a9 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/create-clinic.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/create-clinic.e2e-spec.ts @@ -2,10 +2,10 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { makeClinic } from '../../../../../../../../tests/factories/make-clinic'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { ClinicEntity } from '../../../../../../core/domains/clinic/entities/clinic/entity'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { makeClinic } from '../../../../../../../tests/factories/make-clinic'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { ClinicEntity } from '../../../../../core/domains/clinic/entities/clinic/entity'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Create Clinic', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/nestjs-create-clinic.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/nestjs-create-clinic.service.ts similarity index 50% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/nestjs-create-clinic.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/nestjs-create-clinic.service.ts index 5b729d88..b317df51 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/nestjs-create-clinic.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/nestjs-create-clinic.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { ClinicDatabaseRepository } from '../../../../../../core/domains/clinic/repositories/database-repository'; -import { CreateClinicService } from '../../../../../../core/domains/clinic/use-cases/create-clinic/create-clinic.service'; +import { ClinicDatabaseRepository } from '../../../../../core/domains/clinic/repositories/database-repository'; +import { CreateClinicService } from '../../../../../core/domains/clinic/use-cases/create-clinic/create-clinic.service'; @Injectable() export class NestjsCreateClinicService extends CreateClinicService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/create-clinic/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/create-clinic/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/delete-clinic.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/delete-clinic.controller.ts similarity index 89% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/delete-clinic.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/delete-clinic.controller.ts index d1ef2348..802e332e 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/delete-clinic.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/delete-clinic.controller.ts @@ -1,6 +1,6 @@ import { Controller, Delete, Param } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { DeleteClinicControllerParamsInputDto } from './input.dto'; import { NestjsDeleteClinicService } from './nestjs-delete-clinic.service'; import { DeleteClinicControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/delete-clinic.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/delete-clinic.e2e-spec.ts similarity index 88% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/delete-clinic.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/delete-clinic.e2e-spec.ts index 38c74702..71c40897 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/delete-clinic.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/delete-clinic.e2e-spec.ts @@ -1,9 +1,9 @@ import { faker } from '@faker-js/faker'; import { INestApplication } from '@nestjs/common'; import request from 'supertest'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { ClinicEntity } from '../../../../../../core/domains/clinic/entities/clinic/entity'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { ClinicEntity } from '../../../../../core/domains/clinic/entities/clinic/entity'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Delete Clinic', () => { let prisma: PostgreSqlPrismaOrmService; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/nestjs-delete-clinic.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/nestjs-delete-clinic.service.ts similarity index 50% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/nestjs-delete-clinic.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/nestjs-delete-clinic.service.ts index 7281e7d9..70a45967 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/nestjs-delete-clinic.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/nestjs-delete-clinic.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { ClinicDatabaseRepository } from '../../../../../../core/domains/clinic/repositories/database-repository'; -import { DeleteClinicService } from '../../../../../../core/domains/clinic/use-cases/delete-clinic/delete-clinic.service'; +import { ClinicDatabaseRepository } from '../../../../../core/domains/clinic/repositories/database-repository'; +import { DeleteClinicService } from '../../../../../core/domains/clinic/use-cases/delete-clinic/delete-clinic.service'; @Injectable() export class NestjsDeleteClinicService extends DeleteClinicService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/delete-clinic/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/delete-clinic/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/nestjs-update-clinic.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/nestjs-update-clinic.service.ts similarity index 50% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/nestjs-update-clinic.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/nestjs-update-clinic.service.ts index c741af5c..d37247b2 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/nestjs-update-clinic.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/nestjs-update-clinic.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { ClinicDatabaseRepository } from '../../../../../../core/domains/clinic/repositories/database-repository'; -import { UpdateClinicService } from '../../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic.service'; +import { ClinicDatabaseRepository } from '../../../../../core/domains/clinic/repositories/database-repository'; +import { UpdateClinicService } from '../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic.service'; @Injectable() export class NestjsUpdateClinicService extends UpdateClinicService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/update-clinic.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/update-clinic.controller.ts similarity index 81% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/update-clinic.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/update-clinic.controller.ts index 46348d99..0127b9d8 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/update-clinic.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/update-clinic.controller.ts @@ -1,11 +1,11 @@ import { BadRequestException, Body, Controller, Param, Patch } from '@nestjs/common'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; -import { UpdateClinicInputDto } from '../../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic-dto'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { UpdateClinicInputDto } from '../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic-dto'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { - UpdateClinicControllerBodyInputDto, - UpdateClinicControllerParamsInputDto, + UpdateClinicControllerBodyInputDto, + UpdateClinicControllerParamsInputDto, } from './input.dto'; import { NestjsUpdateClinicService } from './nestjs-update-clinic.service'; import { UpdateClinicControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/update-clinic.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/update-clinic.e2e-spec.ts similarity index 94% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/update-clinic.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/update-clinic.e2e-spec.ts index 8be0a5e5..e64cd2c1 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/clinic/update-clinic/update-clinic.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/clinic/update-clinic/update-clinic.e2e-spec.ts @@ -2,8 +2,8 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { ClinicEntity } from '../../../../../../core/domains/clinic/entities/clinic/entity'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { ClinicEntity } from '../../../../../core/domains/clinic/entities/clinic/entity'; describe('[E2E] - Create Appointment', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.controller.ts similarity index 92% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.controller.ts index 41d5b779..0d3197d5 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.controller.ts @@ -1,6 +1,6 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { CreatePatientAppointmentRegistryControllerBodyInputDto } from './input.dto'; import { NestjsCreatePatientAppointmentRegistryService } from './nestjs-create-patient-appointment-registry.service'; import { CreatePatientAppointmentRegistryControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.e2e-spec.ts similarity index 86% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.e2e-spec.ts index 3df45a6e..f8b70adf 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/create-patient-appointment-registry.e2e-spec.ts @@ -2,11 +2,11 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { Registry } from '../../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; -import { CreatePatientAppointmentRegistryInputDto } from '../../../../../../core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry-dto'; -import { PatientEntity } from '../../../../../../core/domains/patient/entities/patient/entity'; -import { PsychologistEntity } from '../../../../../../core/domains/psychologist/entities/psychologist/entity'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { Registry } from '../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; +import { CreatePatientAppointmentRegistryInputDto } from '../../../../../core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry-dto'; +import { PatientEntity } from '../../../../../core/domains/patient/entities/patient/entity'; +import { PsychologistEntity } from '../../../../../core/domains/psychologist/entities/psychologist/entity'; describe('[E2E] - Create Appointment Registry', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/input.dto.ts similarity index 68% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/input.dto.ts index ee800ed6..bc0b071e 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/input.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/input.dto.ts @@ -1,5 +1,5 @@ import { IsObject, IsString } from 'class-validator'; -import { Registry } from '../../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; +import { Registry } from '../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; export class CreatePatientAppointmentRegistryControllerBodyInputDto { @IsObject() diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/nestjs-create-patient-appointment-registry.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/nestjs-create-patient-appointment-registry.service.ts similarity index 59% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/nestjs-create-patient-appointment-registry.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/nestjs-create-patient-appointment-registry.service.ts index 54740888..66af28da 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/nestjs-create-patient-appointment-registry.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/nestjs-create-patient-appointment-registry.service.ts @@ -1,8 +1,8 @@ import { Injectable } from '@nestjs/common'; -import { PatientAppointmentRegistryDatabaseRepository } from '../../../../../../core/domains/patient-appointment-registry/repositories/database-repository'; -import { CreatePatientAppointmentRegistryService } from '../../../../../../core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.service'; -import { PatientDatabaseRepository } from '../../../../../../core/domains/patient/repositories/database-repository'; -import { PsychologistDatabaseRepository } from '../../../../../../core/domains/psychologist/repositories/database-repository'; +import { PatientAppointmentRegistryDatabaseRepository } from '../../../../../core/domains/patient-appointment-registry/repositories/database-repository'; +import { CreatePatientAppointmentRegistryService } from '../../../../../core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.service'; +import { PatientDatabaseRepository } from '../../../../../core/domains/patient/repositories/database-repository'; +import { PsychologistDatabaseRepository } from '../../../../../core/domains/psychologist/repositories/database-repository'; @Injectable() export class NestjsCreatePatientAppointmentRegistryService extends CreatePatientAppointmentRegistryService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/output.dto.ts similarity index 76% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/output.dto.ts index acb05cf0..d4b24dc0 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/create-patient-appointment-registry/output.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/create-patient-appointment-registry/output.dto.ts @@ -1,5 +1,5 @@ import { IsDate, IsObject, IsString } from 'class-validator'; -import { Registry } from '../../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; +import { Registry } from '../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; export class CreatePatientAppointmentRegistryControllerOutputDto { @IsString() diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.controller.ts similarity index 91% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.controller.ts index b19794ad..c86d9635 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.controller.ts @@ -1,6 +1,6 @@ import { Controller, Delete, Param } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { DeletePatientAppointmentRegistryParamsInputDto } from './input.dto'; import { NestjsDeletePatientAppointmentRegistryService } from './nestjs-delete-patient-appointment-registry.service'; import { DeletePatientAppointmentRegistryControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.e2e-spec.ts similarity index 88% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.e2e-spec.ts index 79af47c3..6fb8e067 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/delete-patient-appointment-registry.e2e-spec.ts @@ -2,9 +2,9 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PatientAppointmentRegistryEntity } from '../../../../../../core/domains/patient-appointment-registry/entities/registry/entity'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PatientAppointmentRegistryEntity } from '../../../../../core/domains/patient-appointment-registry/entities/registry/entity'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Delete Appointment Registry', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/nestjs-delete-patient-appointment-registry.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/nestjs-delete-patient-appointment-registry.service.ts similarity index 68% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/nestjs-delete-patient-appointment-registry.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/nestjs-delete-patient-appointment-registry.service.ts index 7be3b96b..3432bb46 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/nestjs-delete-patient-appointment-registry.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/nestjs-delete-patient-appointment-registry.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { PatientAppointmentRegistryDatabaseRepository } from '../../../../../../core/domains/patient-appointment-registry/repositories/database-repository'; -import { DeletePatientAppointmentRegistryService } from '../../../../../../core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.service'; +import { PatientAppointmentRegistryDatabaseRepository } from '../../../../../core/domains/patient-appointment-registry/repositories/database-repository'; +import { DeletePatientAppointmentRegistryService } from '../../../../../core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.service'; @Injectable() export class NestjsDeletePatientAppointmentRegistryService extends DeletePatientAppointmentRegistryService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/delete-patient-appointment-registry/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/nestjs-update-patient-appointment-registry.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/nestjs-update-patient-appointment-registry.service.ts similarity index 68% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/nestjs-update-patient-appointment-registry.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/nestjs-update-patient-appointment-registry.service.ts index f9364409..071387e4 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/nestjs-update-patient-appointment-registry.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/nestjs-update-patient-appointment-registry.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { PatientAppointmentRegistryDatabaseRepository } from '../../../../../../core/domains/patient-appointment-registry/repositories/database-repository'; -import { UpdatePatientAppointmentRegistryService } from '../../../../../../core/domains/patient-appointment-registry/use-cases/update-appointment-registry/update-appointment-registry.service'; +import { PatientAppointmentRegistryDatabaseRepository } from '../../../../../core/domains/patient-appointment-registry/repositories/database-repository'; +import { UpdatePatientAppointmentRegistryService } from '../../../../../core/domains/patient-appointment-registry/use-cases/update-appointment-registry/update-appointment-registry.service'; @Injectable() export class NestjsUpdatePatientAppointmentRegistryService extends UpdatePatientAppointmentRegistryService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.controller.ts similarity index 84% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.controller.ts index a32c07d1..d25194e2 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.controller.ts @@ -1,7 +1,7 @@ import { Body, Controller, Param, Patch } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { Registry } from '../../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { Registry } from '../../../../../core/domains/patient-appointment-registry/entities/registry/dto'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { UpdatePatientAppointmentRegistryParamsInputDto } from './input.dto'; import { NestjsUpdatePatientAppointmentRegistryService } from './nestjs-update-patient-appointment-registry.service'; import { UpdatePatientAppointmentRegistryControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.e2e-spec.ts similarity index 91% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.e2e-spec.ts index e0615975..eaf50e5a 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient-appointment-registry/update-patient-appointment-registry/update-patient-appointment-registry.e2e-spec.ts @@ -2,8 +2,8 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PatientAppointmentRegistryEntity } from '../../../../../../core/domains/patient-appointment-registry/entities/registry/entity'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PatientAppointmentRegistryEntity } from '../../../../../core/domains/patient-appointment-registry/entities/registry/entity'; describe('[E2E] - Update Appointment Registry', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/create-patient.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/create-patient.controller.ts similarity index 90% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/create-patient.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/create-patient.controller.ts index eba23071..b1324788 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/create-patient.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/create-patient.controller.ts @@ -2,7 +2,7 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { postMethodDocs } from './docs'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { CreatePatientControllerBodyInputDto } from './input.dto'; import { NestjsCreatePatientService } from './nestjs-create-patient.service'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/create-patient.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/create-patient.e2e-spec.ts similarity index 85% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/create-patient.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/create-patient.e2e-spec.ts index 7b5cba11..3cd714d1 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/create-patient.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/create-patient.e2e-spec.ts @@ -1,11 +1,11 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { makePatient } from '../../../../../../../../tests/factories/make-patient'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PatientEntity } from '../../../../../../core/domains/patient/entities/patient/entity'; -import { CreatePatientInputDto } from '../../../../../../core/domains/patient/use-cases/create-patient/create-patient-dto'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { makePatient } from '../../../../../../../tests/factories/make-patient'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PatientEntity } from '../../../../../core/domains/patient/entities/patient/entity'; +import { CreatePatientInputDto } from '../../../../../core/domains/patient/use-cases/create-patient/create-patient-dto'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Create New Patient', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/docs.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/docs.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/docs.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/docs.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/input.dto.ts similarity index 82% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/input.dto.ts index 53379f52..eebbbb85 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/input.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/input.dto.ts @@ -1,5 +1,5 @@ import { IsEnum, IsMobilePhone, IsString } from 'class-validator'; -import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments'; +import { PaymentMethod } from '../../../../../core/shared/interfaces/payments'; export class CreatePatientControllerBodyInputDto { @IsString() diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/nestjs-create-patient.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/nestjs-create-patient.service.ts similarity index 50% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/nestjs-create-patient.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/nestjs-create-patient.service.ts index e992207c..6bda8907 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/nestjs-create-patient.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/nestjs-create-patient.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { PatientDatabaseRepository } from '../../../../../../core/domains/patient/repositories/database-repository'; -import { CreatePatientService } from '../../../../../../core/domains/patient/use-cases/create-patient/create-patient.service'; +import { PatientDatabaseRepository } from '../../../../../core/domains/patient/repositories/database-repository'; +import { CreatePatientService } from '../../../../../core/domains/patient/use-cases/create-patient/create-patient.service'; @Injectable() export class NestjsCreatePatientService extends CreatePatientService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/create-patient/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/create-patient/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/delete-patient.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/delete-patient.controller.ts similarity index 88% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/delete-patient.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/delete-patient.controller.ts index d1ec901c..05b7c07c 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/delete-patient.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/delete-patient.controller.ts @@ -2,9 +2,9 @@ import { Controller, Delete, Param } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { deleteMethodDocs } from './docs'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; -import { TokenPayload } from '../../../../../auth/jwt.strategy'; +import { TokenPayload } from '../../../../auth/jwt.strategy'; import { CurrentUser } from '../../../../decorators/current-user.decorator'; import { DeletePatientControllerParamsInputDto } from './input.dto'; import { NestjsDeletePatientService } from './nestjs-delete-patient.service'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/delete-patient.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/delete-patient.e2e-spec.ts similarity index 84% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/delete-patient.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/delete-patient.e2e-spec.ts index 0a9596f6..fce455fa 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/delete-patient.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/delete-patient.e2e-spec.ts @@ -2,13 +2,13 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { INestApplication } from '@nestjs/common'; import request from 'supertest'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; -import { PatientFactory } from '../../../../../../../../tests/factories/make-patient'; -import { PsychologistFactory } from '../../../../../../../../tests/factories/make-psychologist'; -import { ClinicEntity } from '../../../../../../core/domains/clinic/entities/clinic/entity'; -import { PatientEntity } from '../../../../../../core/domains/patient/entities/patient/entity'; +import { PatientFactory } from '../../../../../../../tests/factories/make-patient'; +import { PsychologistFactory } from '../../../../../../../tests/factories/make-psychologist'; +import { ClinicEntity } from '../../../../../core/domains/clinic/entities/clinic/entity'; +import { PatientEntity } from '../../../../../core/domains/patient/entities/patient/entity'; describe('[E2E] - Delete Patient', async () => { let prisma: PostgreSqlPrismaOrmService; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/docs.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/docs.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/docs.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/docs.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/nestjs-delete-patient.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/nestjs-delete-patient.service.ts similarity index 50% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/nestjs-delete-patient.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/nestjs-delete-patient.service.ts index b46d0be5..24f0e787 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/nestjs-delete-patient.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/nestjs-delete-patient.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { PatientDatabaseRepository } from '../../../../../../core/domains/patient/repositories/database-repository'; -import { DeletePatientService } from '../../../../../../core/domains/patient/use-cases/delete-patient/delete-patient.service'; +import { PatientDatabaseRepository } from '../../../../../core/domains/patient/repositories/database-repository'; +import { DeletePatientService } from '../../../../../core/domains/patient/use-cases/delete-patient/delete-patient.service'; @Injectable() export class NestjsDeletePatientService extends DeletePatientService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/delete-patient/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/delete-patient/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/docs.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/docs.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/docs.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/docs.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/input-dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/input-dto.ts similarity index 87% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/input-dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/input-dto.ts index 7a977097..b3f46113 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/input-dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/input-dto.ts @@ -1,5 +1,5 @@ import { IsEnum, IsMobilePhone, IsOptional, IsString, IsUUID } from 'class-validator'; -import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments'; +import { PaymentMethod } from '../../../../../core/shared/interfaces/payments'; export class UpdatePatientControllerBodyInputDto { @IsOptional() diff --git a/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/nestjs-update-patient.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/nestjs-update-patient.service.ts new file mode 100644 index 00000000..ff12e144 --- /dev/null +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/nestjs-update-patient.service.ts @@ -0,0 +1,11 @@ +import { Injectable } from '@nestjs/common'; + +import { PatientDatabaseRepository } from '../../../../../core/domains/patient/repositories/database-repository'; +import { UpdatePatientService } from '../../../../../core/domains/patient/use-cases/update-patient/update-patient.service'; + +@Injectable() +export class NestjsUpdatePatientService extends UpdatePatientService { + constructor(patientDatabaseRepository: PatientDatabaseRepository) { + super(patientDatabaseRepository); + } +} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/update-patient.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/update-patient.controller.ts similarity index 88% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/update-patient.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/update-patient.controller.ts index cdbca93f..fae89825 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/update-patient.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/update-patient.controller.ts @@ -2,10 +2,10 @@ import { BadRequestException, Body, Controller, Param, Patch } from '@nestjs/com import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { patchMethodDocs } from './docs'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { - UpdatePatientControllerBodyInputDto, - UpdatePatientControllerParamsInputDto, + UpdatePatientControllerBodyInputDto, + UpdatePatientControllerParamsInputDto, } from './input-dto'; import { NestjsUpdatePatientService } from './nestjs-update-patient.service'; import { UpdatePatientControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/update-patient.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/update-patient.e2e-spec.ts similarity index 95% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/update-patient.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/update-patient.e2e-spec.ts index 9b479ff2..288d3d28 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/patient/update-patient/update-patient.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/patient/update-patient/update-patient.e2e-spec.ts @@ -3,8 +3,8 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; import { faker } from '@faker-js/faker'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PatientEntity } from '../../../../../../core/domains/patient/entities/patient/entity'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PatientEntity } from '../../../../../core/domains/patient/entities/patient/entity'; describe('[E2E] - Update Patient', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts similarity index 81% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts index 5bfb25a4..c0850962 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts @@ -1,10 +1,10 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { Encrypter } from '../../../../../../core/shared/cryptography/repository/encrypter-repository'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { Encrypter } from '../../../../../core/shared/cryptography/repository/encrypter-repository'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; -import { Public } from '../../../../../auth/public'; +import { Public } from '../../../../auth/public'; import { ControllerBodyInputDto } from './input.dto'; import { NestjsAuthenticatePsychologistService } from './nestjs-authenticate-psychologist.service'; import { AuthenticatePsychologistControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts similarity index 89% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts index 73029d45..1d8e07b6 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts @@ -4,8 +4,8 @@ import { INestApplication } from '@nestjs/common'; import { fakerPT_BR as faker } from '@faker-js/faker'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PsychologistEntity } from '../../../../../../core/domains/psychologist/entities/psychologist/entity'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PsychologistEntity } from '../../../../../core/domains/psychologist/entities/psychologist/entity'; describe('[E2E] - Authenticate Psychologist', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/docs.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/docs.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/docs.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/docs.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts similarity index 60% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts index e2afb374..96d3a28d 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { PsychologistDatabaseRepository } from '../../../../../../core/domains/psychologist/repositories/database-repository'; -import { AuthenticatePsychologistService } from '../../../../../../core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.service'; +import { PsychologistDatabaseRepository } from '../../../../../core/domains/psychologist/repositories/database-repository'; +import { AuthenticatePsychologistService } from '../../../../../core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.service'; @Injectable() export class NestjsAuthenticatePsychologistService extends AuthenticatePsychologistService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/authenticate-psychologist/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/authenticate-psychologist/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/create-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/create-psychologist.controller.ts similarity index 84% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/create-psychologist.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/create-psychologist.controller.ts index 3a17b933..229263ff 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/create-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/create-psychologist.controller.ts @@ -2,9 +2,9 @@ import { Body, Controller, Post, UseGuards } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { plainToInstance } from 'class-transformer'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; -import { applicationValidateOrReject } from '../../../../../../shared/validators/validate-or-reject'; -import { Public } from '../../../../../auth/public'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; +import { Public } from '../../../../auth/public'; import { ApiKeyGuard } from '../../../../guards/api-key.guard'; import { CreatePsychologistControllerBodyInputDto } from './input.dto'; import { NestjsCreatePsychologistService } from './nestjs-create-psychologist.service'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/create-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/create-psychologist.e2e-spec.ts similarity index 84% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/create-psychologist.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/create-psychologist.e2e-spec.ts index ca210024..13cac212 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/create-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/create-psychologist.e2e-spec.ts @@ -3,10 +3,10 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { makePsychologist } from '../../../../../../../../tests/factories/make-psychologist'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PsychologistEntity } from '../../../../../../core/domains/psychologist/entities/psychologist/entity'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { makePsychologist } from '../../../../../../../tests/factories/make-psychologist'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PsychologistEntity } from '../../../../../core/domains/psychologist/entities/psychologist/entity'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Create Psychologist Account', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/docs.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/docs.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/docs.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/docs.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/input.dto.ts similarity index 77% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/input.dto.ts index 7211b6f9..77633add 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/input.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/input.dto.ts @@ -1,5 +1,5 @@ import { IsEnum, IsString } from 'class-validator'; -import { Plan, Role } from '../../../../../../core/shared/interfaces/payments'; +import { Plan, Role } from '../../../../../core/shared/interfaces/payments'; export class CreatePsychologistControllerBodyInputDto { @IsString() diff --git a/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/nestjs-create-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/nestjs-create-psychologist.service.ts new file mode 100644 index 00000000..cb86ae51 --- /dev/null +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/nestjs-create-psychologist.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@nestjs/common'; +import { PsychologistDatabaseRepository } from '../../../../../core/domains/psychologist/repositories/database-repository'; +import { CreatePsychologistService } from '../../../../../core/domains/psychologist/use-cases/create-psychologist/create-psychologist.service'; + +@Injectable() +export class NestjsCreatePsychologistService extends CreatePsychologistService { + constructor(psychologistDatabaseRepository: PsychologistDatabaseRepository) { + super(psychologistDatabaseRepository); + } +} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/output.dto.ts similarity index 87% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/output.dto.ts index ebc92e6e..a970a785 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/create-psychologist/output.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/create-psychologist/output.dto.ts @@ -1,5 +1,5 @@ import { IsDate, IsEnum, IsNumber, IsString, Min } from 'class-validator'; -import { Plan, Role } from '../../../../../../core/shared/interfaces/payments'; +import { Plan, Role } from '../../../../../core/shared/interfaces/payments'; export class CreatePsychologistControllerOutputDto { @IsString() diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/delete-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/delete-psychologist.controller.ts similarity index 88% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/delete-psychologist.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/delete-psychologist.controller.ts index 70898f21..fbeaf645 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/delete-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/delete-psychologist.controller.ts @@ -2,9 +2,9 @@ import { Controller, Delete, ForbiddenException, Param } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { patchMethodDocs } from './docs'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; -import { TokenPayload } from '../../../../../auth/jwt.strategy'; +import { TokenPayload } from '../../../../auth/jwt.strategy'; import { CurrentUser } from '../../../../decorators/current-user.decorator'; import { DeletePsychologistParamsInputDto } from './input.dto'; import { NestjsDeletePsychologistService } from './nestjs-delete-psychologist.service'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts similarity index 91% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts index 41d47a9b..0cc7a657 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts @@ -4,11 +4,11 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; -import { PsychologistEntity } from '../../../../../../core/domains/psychologist/entities/psychologist/entity'; +import { PsychologistEntity } from '../../../../../core/domains/psychologist/entities/psychologist/entity'; -import { PsychologistFactory } from '../../../../../../../../tests/factories/make-psychologist'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; -import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; +import { PsychologistFactory } from '../../../../../../../tests/factories/make-psychologist'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Delete Psychologist Account', () => { let prisma: PostgreSqlPrismaOrmService; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/docs.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/docs.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/docs.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/docs.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/input.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/input.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts new file mode 100644 index 00000000..cb6a3b0b --- /dev/null +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts @@ -0,0 +1,11 @@ +import { Injectable } from '@nestjs/common'; + +import { PsychologistDatabaseRepository } from '../../../../../core/domains/psychologist/repositories/database-repository'; +import { DeletePsychologistService } from '../../../../../core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.service'; + +@Injectable() +export class NestjsDeletePsychologistService extends DeletePsychologistService { + constructor(psychologistDatabaseRepository: PsychologistDatabaseRepository) { + super(psychologistDatabaseRepository); + } +} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/output.dto.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/delete-psychologist/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/delete-psychologist/output.dto.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/docs.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/docs.ts similarity index 100% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/docs.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/docs.ts diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/input.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/input.dto.ts similarity index 89% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/input.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/input.dto.ts index 65ba30f9..a109ae6c 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/input.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/input.dto.ts @@ -1,5 +1,5 @@ import { IsEnum, IsNumber, IsOptional, IsString, IsUUID, Min } from 'class-validator'; -import { Plan } from '../../../../../../core/shared/interfaces/payments'; +import { Plan } from '../../../../../core/shared/interfaces/payments'; export class UpdatePsychologistControllerBodyInputDto { @IsOptional() diff --git a/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/nestjs-update-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/nestjs-update-psychologist.service.ts new file mode 100644 index 00000000..64443107 --- /dev/null +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/nestjs-update-psychologist.service.ts @@ -0,0 +1,11 @@ +import { Injectable } from '@nestjs/common'; + +import { PsychologistDatabaseRepository } from '../../../../../core/domains/psychologist/repositories/database-repository'; +import { UpdatePsychologistService } from '../../../../../core/domains/psychologist/use-cases/update-psychologist/update-psychologist.service'; + +@Injectable() +export class NestjsUpdatePsychologistService extends UpdatePsychologistService { + constructor(psychologistDatabaseRepository: PsychologistDatabaseRepository) { + super(psychologistDatabaseRepository); + } +} diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/output.dto.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/output.dto.ts similarity index 90% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/output.dto.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/output.dto.ts index aff93c9e..58e7a967 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/output.dto.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/output.dto.ts @@ -1,5 +1,5 @@ import { IsDate, IsEnum, IsNumber, IsObject, IsString, Min } from 'class-validator'; -import { Plan, Role } from '../../../../../../core/shared/interfaces/payments'; +import { Plan, Role } from '../../../../../core/shared/interfaces/payments'; class UpdatePsychologistInfoOutputDto { @IsString() diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/update-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/update-psychologist.controller.ts similarity index 82% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/update-psychologist.controller.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/update-psychologist.controller.ts index 6fa18064..22b9bc4c 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/update-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/update-psychologist.controller.ts @@ -2,11 +2,11 @@ import { BadRequestException, Body, Controller, Param, Patch } from '@nestjs/com import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { patchMethodDocs } from './docs'; -import { UpdatePsychologistInputDto } from '../../../../../../core/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; -import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; +import { UpdatePsychologistInputDto } from '../../../../../core/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; +import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException'; import { - DeletePatientAppointmentRegistryParamsInputDto, - UpdatePsychologistControllerBodyInputDto, + DeletePatientAppointmentRegistryParamsInputDto, + UpdatePsychologistControllerBodyInputDto, } from './input.dto'; import { NestjsUpdatePsychologistService } from './nestjs-update-psychologist.service'; import { UpdatePsychologistControllerOutputDto } from './output.dto'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/update-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/update-psychologist.e2e-spec.ts similarity index 96% rename from apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/update-psychologist.e2e-spec.ts rename to apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/update-psychologist.e2e-spec.ts index 2fdba8dd..a7d8c41b 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/routes/v1/psychologist/update-psychologist/update-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/routes/v1/psychologist/update-psychologist/update-psychologist.e2e-spec.ts @@ -2,8 +2,8 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { PsychologistFactory } from '../../../../../../../../tests/factories/make-psychologist'; -import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; +import { PsychologistFactory } from '../../../../../../../tests/factories/make-psychologist'; +import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup'; describe('[E2E] - Update Psychologist Account', () => { let app: INestApplication; diff --git a/apps/core-rest-api/src/main.ts b/apps/core-rest-api/src/main.ts index 1e72f252..e0dadaba 100644 --- a/apps/core-rest-api/src/main.ts +++ b/apps/core-rest-api/src/main.ts @@ -7,7 +7,7 @@ import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { version } from '../package.json'; -import { ApiModule } from './app/adapters/controllers/api.module'; +import { ApiModule } from './app/adapters/api.module'; import { EnvService } from './app/adapters/env/env.service'; import { mainDescriptionMarkdown } from './main.docs'; diff --git a/apps/core-rest-api/tests/utils/e2e-tests-initial-setup.ts b/apps/core-rest-api/tests/utils/e2e-tests-initial-setup.ts index 4c69a0e8..aa3c0200 100644 --- a/apps/core-rest-api/tests/utils/e2e-tests-initial-setup.ts +++ b/apps/core-rest-api/tests/utils/e2e-tests-initial-setup.ts @@ -4,7 +4,7 @@ import { JwtService } from '@nestjs/jwt'; import { Test, TestingModule } from '@nestjs/testing'; import { BcryptHasherService } from '../../src/app/core/shared/cryptography/use-cases/bcrypt-hasher.service'; -import { ApiModule } from '../../src/app/adapters/controllers/api.module'; +import { ApiModule } from '../../src/app/adapters/api.module'; import { PostgreSqlPrismaOrmService } from '../../src/app/adapters/database/infra/prisma/prisma.service'; import { DatabaseRepositoriesModule } from '../../src/app/adapters/database/repositories/repositories.module';