From 7ade19e81a9860c27849054477d0ce44bf07d09c Mon Sep 17 00:00:00 2001 From: luanavfg Date: Thu, 28 Dec 2023 14:38:50 -0300 Subject: [PATCH] refactor(CC-113): adjust imports according to new structure --- .../src/app/adapters/controllers/api/api.module.ts | 2 +- .../create-patient/create-patient.controller.ts | 4 ++-- .../create-patient/create-patient.e2e-spec.ts | 6 +++--- .../create-patient/nestjs-create-patient.service.ts | 4 ++-- .../authenticate-psychologist.controller.ts | 6 +++--- .../authenticate-psychologist.e2e-spec.ts | 2 +- .../nestjs-authenticate-psychologist.service.ts | 4 ++-- .../create-psychologist.controller.ts | 6 +++--- .../create-psychologist.e2e-spec.ts | 4 ++-- .../nestjs-create-psychologist.service.ts | 4 ++-- .../delete-psychologist.controller.ts | 2 +- .../delete-psychologist.e2e-spec.ts | 4 ++-- .../psychologist/delete-psychologist/dto.ts | 2 +- .../nestjs-delete-psychologist.service.ts | 4 ++-- .../psychologist/update-psychologist/dto.ts | 2 +- .../nestjs-update-psychologist.service.ts | 4 ++-- .../update-psychologist.controller.ts | 4 ++-- .../update-psychologist.e2e-spec.ts | 2 +- .../adapters/cryptography/cryptography.module.ts | 2 +- .../src/app/adapters/cryptography/jwt-encrypter.ts | 2 +- .../mappers/postgresql-prisma-clinic-mapper.ts | 6 +++--- .../mappers/postgresql-prisma-patient-mapper.ts | 8 ++++---- .../postgresql-prisma-psychologist-mapper.ts | 11 ++++------- .../clinic/postgres-prisma-orm-clinic-repository.ts | 12 ++++++------ .../postgres-prisma-orm-patient-repository.ts | 10 +++++----- ...postgresql-prisma-orm-psychologist-repository.ts | 10 +++++----- .../database/repositories/repositories.module.ts | 6 +++--- .../domains/appointment/interfaces/appointment.ts | 2 +- .../repositories/database-in-memory-repository.ts | 2 +- .../create-single-appointment.service.ts | 4 ++-- .../delete-single-appointment.service.ts | 2 +- .../update-appointment-date.service.ts | 4 ++-- .../update-appointment-date.spec.ts | 2 +- .../update-appointment-info.service.ts | 4 ++-- .../update-appointment-info.spec.ts | 2 +- .../app/core/domains/clinic/interfaces/clinic.ts | 2 +- .../repositories/database-in-memory-repository.ts | 2 +- .../create-clinic/create-clinic.service.ts | 4 ++-- .../delete-clinic/delete-clinic.service.ts | 2 +- .../update-clinic/update-clinic.service.ts | 4 ++-- .../use-cases/update-clinic/update-clinic.spec.ts | 2 +- .../interfaces/registry.ts | 2 +- .../repositories/database-in-memory-repository.ts | 2 +- .../create-appointment-registry.service.ts | 6 +++--- .../create-appointment-registry.spec.ts | 6 +++--- .../delete-appointment-registry.service.ts | 4 ++-- .../delete-appointment-registry.spec.ts | 6 +++--- .../app/core/domains/patient/interfaces/patient.ts | 2 +- .../repositories/database-in-memory-repository.ts | 2 +- .../create-patient/create-patient.service.ts | 4 ++-- .../delete-patient/delete-patient.service.ts | 2 +- .../update-patient/update-patient.service.ts | 4 ++-- .../use-cases/update-patient/update-patient.spec.ts | 2 +- .../domains/psychologist/interfaces/psychologist.ts | 2 +- .../repositories/database-in-memory-repository.ts | 2 +- .../authenticate-psychologist.service.ts | 2 +- .../authenticate-psychologist.spec.ts | 2 +- .../create-psychologist.service.ts | 4 ++-- .../create-psychologist/create-psychologist.spec.ts | 2 +- .../delete-psychologist.service.ts | 2 +- .../delete-psychologist/delete-psychologist.spec.ts | 2 +- .../update-psychologist.service.ts | 4 ++-- .../update-psychologist/update-psychologist.spec.ts | 2 +- .../tests/cryptography/fake-encrypter.ts | 2 +- .../core-rest-api/tests/cryptography/fake-hasher.ts | 4 ++-- apps/core-rest-api/tests/factories/make-clinic.ts | 8 ++++---- apps/core-rest-api/tests/factories/make-patient.ts | 11 ++++++----- .../tests/factories/make-psychologist.ts | 13 +++++-------- apps/core-rest-api/tests/setup-e2e.ts | 2 +- scripts/setup/core-rest-api/run-prisma-setup.sh | 2 +- 70 files changed, 137 insertions(+), 142 deletions(-) diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/api.module.ts b/apps/core-rest-api/src/app/adapters/controllers/api/api.module.ts index 09b5a291..0db79067 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/api.module.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/api.module.ts @@ -7,7 +7,7 @@ import { envSchema } from '../../env/env'; import { EnvModule } from '../../env/env.module'; import { UpdatePsychologistController } from './use-cases/psychologist/update-psychologist/update-psychologist.controller'; -import { BcryptHasherService } from '@clinicControl/core-rest-api/core/src/shared/cryptography/use-cases/bcrypt-hasher.service'; +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'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.controller.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.controller.ts index 03df8366..f1212f1a 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.controller.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.controller.ts @@ -2,9 +2,9 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { postMethodDocs } from './docs'; -import { GlobalAppHttpException } from '@clinicControl/core-rest-api/core/src/shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; -import { CreatePatientDto } from '@clinicControl/core-rest-api/core/src/domains/patient/use-cases/create-patient/create-patient-dto'; +import { CreatePatientDto } from '../../../../../../core/domains/patient/use-cases/create-patient/create-patient-dto'; import { NestjsCreatePatientService } from './nestjs-create-patient.service'; @ApiTags('patient') diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.e2e-spec.ts index 6d65e66d..47bd6635 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/create-patient.e2e-spec.ts @@ -1,10 +1,10 @@ import request from 'supertest'; -import { PatientEntity } from '@clinicControl/core-rest-api/core/src/domains/patient/entities/patient/entity'; -import { CreatePatientDto } from '@clinicControl/core-rest-api/core/src/domains/patient/use-cases/create-patient/create-patient-dto'; import { INestApplication } from '@nestjs/common'; -import { makePatient } from '../../../../../../../../../tests/factories/make-patient'; +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 { CreatePatientDto } from '../../../../../../core/domains/patient/use-cases/create-patient/create-patient-dto'; import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; describe('[E2E] - Create New Patient', () => { diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/nestjs-create-patient.service.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/nestjs-create-patient.service.ts index e4a0dd95..e992207c 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/nestjs-create-patient.service.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/patient/create-patient/nestjs-create-patient.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { PatientDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/patient/repositories/database-repository'; -import { CreatePatientService } from '@clinicControl/core-rest-api/core/src/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/api/use-cases/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts index 2d313c9b..429c970c 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/authenticate-psychologist.controller.ts @@ -1,9 +1,9 @@ import { Body, Controller, Post } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { AuthenticatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist-dto'; -import { Encrypter } from '@clinicControl/core-rest-api/core/src/shared/cryptography/repository/encrypter-repository'; -import { GlobalAppHttpException } from '@clinicControl/core-rest-api/core/src/shared/errors/globalAppHttpException'; +import { AuthenticatePsychologistDto } from '../../../../../../core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist-dto'; +import { Encrypter } from '../../../../../../core/shared/cryptography/repository/encrypter-repository'; +import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; import { Public } from '../../../../../auth/public'; import { AuthenticatePsychologistControllerResponse } from './authenticate-psychologist.interface'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts index 8c3344ef..73029d45 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/authenticate-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/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 { PsychologistEntity } from '@clinicControl/core-rest-api/core/src/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/api/use-cases/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts index 5dd1c92e..e2afb374 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/authenticate-psychologist/nestjs-authenticate-psychologist.service.ts @@ -1,6 +1,6 @@ -import { PsychologistDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/psychologist/repositories/database-repository'; -import { AuthenticatePsychologistService } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.service'; 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'; @Injectable() export class NestjsAuthenticatePsychologistService extends AuthenticatePsychologistService { diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/create-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/create-psychologist.controller.ts index e663641f..1ec12b7d 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/create-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/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 { CreatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; -import { GlobalAppHttpException } from '@clinicControl/core-rest-api/core/src/shared/errors/globalAppHttpException'; -import { applicationValidateOrReject } from '@clinicControl/core-rest-api/core/src/shared/validators/validate-or-reject'; +import { CreatePsychologistDto } from '../../../../../../core/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; +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 { NestjsCreatePsychologistService } from './nestjs-create-psychologist.service'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/create-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/create-psychologist.e2e-spec.ts index 477a7851..ca210024 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/create-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/create-psychologist.e2e-spec.ts @@ -3,9 +3,9 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { PsychologistEntity } from '@clinicControl/core-rest-api/core/src/domains/psychologist/entities/psychologist/entity'; -import { makePsychologist } from '../../../../../../../../../tests/factories/make-psychologist'; +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', () => { diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/nestjs-create-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/nestjs-create-psychologist.service.ts index d0e8625a..2b3cab12 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/nestjs-create-psychologist.service.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/create-psychologist/nestjs-create-psychologist.service.ts @@ -1,6 +1,6 @@ -import { PsychologistDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/psychologist/repositories/database-repository'; -import { CreatePsychologistService } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/create-psychologist/create-psychologist.service'; 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 { diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.controller.ts index d022d81a..399ca9e6 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.controller.ts @@ -2,7 +2,7 @@ import { Controller, Delete, ForbiddenException, Param } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { patchMethodDocs } from './docs'; -import { GlobalAppHttpException } from '@clinicControl/core-rest-api/core/src/shared/errors/globalAppHttpException'; +import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; import { TokenPayload } from '../../../../../auth/jwt.strategy'; import { CurrentUser } from '../../../decorators/current-user.decorator'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts index c5937652..a2b6949b 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/delete-psychologist.e2e-spec.ts @@ -4,9 +4,9 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; -import { PsychologistEntity } from '@clinicControl/core-rest-api/core/src/domains/psychologist/entities/psychologist/entity'; +import { PsychologistEntity } from '../../../../../../core/domains/psychologist/entities/psychologist/entity'; -import { PsychologistFactory } from '../../../../../../../../../tests/factories/make-psychologist'; +import { PsychologistFactory } from '../../../../../../../../tests/factories/make-psychologist'; import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/dto.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/dto.ts index 55d775de..80ffc5ff 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/dto.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/dto.ts @@ -1,5 +1,5 @@ -import { AssociatedClinics } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/delete-psychologist/dto'; import { IsEmail } from 'class-validator'; +import { AssociatedClinics } from '../../../../../../core/domains/psychologist/use-cases/delete-psychologist/dto'; export class RouteParamsDto { @IsEmail() diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts index 58a13b4c..df922ec1 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/delete-psychologist/nestjs-delete-psychologist.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { PsychologistDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/psychologist/repositories/database-repository'; -import { DeletePsychologistService } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.service'; +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 { diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/dto.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/dto.ts index 69ba7b21..f73eba46 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/dto.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/dto.ts @@ -1,5 +1,5 @@ -import { Plan } from '@clinicControl/core-rest-api/core/src/shared/interfaces/payments'; import { IsEnum, IsNumber, IsOptional, IsString, Min } from 'class-validator'; +import { Plan } from '../../../../../../core/shared/interfaces/payments'; export class UpdatePsychologistControllerDto { @IsOptional() diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/nestjs-update-psychologist.service.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/nestjs-update-psychologist.service.ts index 77655396..a1ac8d14 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/nestjs-update-psychologist.service.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/nestjs-update-psychologist.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; -import { PsychologistDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/psychologist/repositories/database-repository'; -import { UpdatePsychologistService } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/update-psychologist/update-psychologist.service'; +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 { diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.controller.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.controller.ts index 0b2cfeb3..0ea092e3 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.controller.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.controller.ts @@ -2,8 +2,8 @@ import { BadRequestException, Body, Controller, Param, Patch } from '@nestjs/com import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { patchMethodDocs } from './docs'; -import { UpdatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; -import { GlobalAppHttpException } from '@clinicControl/core-rest-api/core/src/shared/errors/globalAppHttpException'; +import { UpdatePsychologistDto } from '../../../../../../core/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; +import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException'; import { UpdatePsychologistControllerDto } from './dto'; import { NestjsUpdatePsychologistService } from './nestjs-update-psychologist.service'; diff --git a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.e2e-spec.ts b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.e2e-spec.ts index 9ae171cf..5097aa38 100644 --- a/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.e2e-spec.ts +++ b/apps/core-rest-api/src/app/adapters/controllers/api/use-cases/psychologist/update-psychologist/update-psychologist.e2e-spec.ts @@ -2,7 +2,7 @@ import request from 'supertest'; import { INestApplication } from '@nestjs/common'; -import { PsychologistFactory } from '../../../../../../../../../tests/factories/make-psychologist'; +import { PsychologistFactory } from '../../../../../../../../tests/factories/make-psychologist'; import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup'; describe('[E2E] - Update Psychologist Account', () => { diff --git a/apps/core-rest-api/src/app/adapters/cryptography/cryptography.module.ts b/apps/core-rest-api/src/app/adapters/cryptography/cryptography.module.ts index a3c282f9..74ca8458 100644 --- a/apps/core-rest-api/src/app/adapters/cryptography/cryptography.module.ts +++ b/apps/core-rest-api/src/app/adapters/cryptography/cryptography.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; -import { Encrypter } from '@clinicControl/core-rest-api/core/src/shared/cryptography/repository/encrypter-repository'; +import { Encrypter } from '../../core/shared/cryptography/repository/encrypter-repository'; import { JwtEncrypter } from './jwt-encrypter'; @Module({ diff --git a/apps/core-rest-api/src/app/adapters/cryptography/jwt-encrypter.ts b/apps/core-rest-api/src/app/adapters/cryptography/jwt-encrypter.ts index 36533cf6..0098f87c 100644 --- a/apps/core-rest-api/src/app/adapters/cryptography/jwt-encrypter.ts +++ b/apps/core-rest-api/src/app/adapters/cryptography/jwt-encrypter.ts @@ -1,6 +1,6 @@ -import { Encrypter } from '@clinicControl/core-rest-api/core/src/shared/cryptography/repository/encrypter-repository'; import { Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; +import { Encrypter } from '../../core/shared/cryptography/repository/encrypter-repository'; @Injectable() export class JwtEncrypter implements Encrypter { diff --git a/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-clinic-mapper.ts b/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-clinic-mapper.ts index 0e12b823..112d5d28 100644 --- a/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-clinic-mapper.ts +++ b/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-clinic-mapper.ts @@ -1,10 +1,10 @@ -import { ClinicEntity } from '@clinicControl/core-rest-api/core/src/domains/clinic/entities/clinic/entity'; -import { CreateClinicDto } from '@clinicControl/core-rest-api/core/src/domains/clinic/use-cases/create-clinic/create-clinic-dto'; -import { UpdateClinicDto } from '@clinicControl/core-rest-api/core/src/domains/clinic/use-cases/update-clinic/update-clinic-dto'; import { Prisma, Clinic as PrismaClinicDto, } from '@prisma/client'; +import { ClinicEntity } from '../../../core/domains/clinic/entities/clinic/entity'; +import { CreateClinicDto } from '../../../core/domains/clinic/use-cases/create-clinic/create-clinic-dto'; +import { UpdateClinicDto } from '../../../core/domains/clinic/use-cases/update-clinic/update-clinic-dto'; export class PostgresqlPrismaClinicMapper { static toDomain(raw: PrismaClinicDto): ClinicEntity { diff --git a/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-patient-mapper.ts b/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-patient-mapper.ts index 3a4df6bd..77e95d0a 100644 --- a/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-patient-mapper.ts +++ b/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-patient-mapper.ts @@ -4,10 +4,10 @@ import { PaymentMethod as PrismaPaymentMethod, } from '@prisma/client'; -import { PatientEntity } from '@clinicControl/core-rest-api/core/src/domains/patient/entities/patient/entity'; -import { CreatePatientDto } from '@clinicControl/core-rest-api/core/src/domains/patient/use-cases/create-patient/create-patient-dto'; -import { UpdatePatientDto } from '@clinicControl/core-rest-api/core/src/domains/patient/use-cases/update-patient/update-patient-dto'; -import { PaymentMethod } from '@clinicControl/core-rest-api/core/src/shared/interfaces/payments'; +import { PatientEntity } from '../../../core/domains/patient/entities/patient/entity'; +import { CreatePatientDto } from '../../../core/domains/patient/use-cases/create-patient/create-patient-dto'; +import { UpdatePatientDto } from '../../../core/domains/patient/use-cases/update-patient/update-patient-dto'; +import { PaymentMethod } from '../../../core/shared/interfaces/payments'; export class PostgresqlPrismaPatientMapper { static toDomain(raw: PrismaPatientDto): PatientEntity { diff --git a/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-psychologist-mapper.ts b/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-psychologist-mapper.ts index 7e55e4ee..10acd968 100644 --- a/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-psychologist-mapper.ts +++ b/apps/core-rest-api/src/app/adapters/database/mappers/postgresql-prisma-psychologist-mapper.ts @@ -1,16 +1,13 @@ -import { PsychologistEntity } from '@clinicControl/core-rest-api/core/src/domains/psychologist/entities/psychologist/entity'; -import { CreatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; -import { UpdatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; -import { - Plan, - Role, -} from '@clinicControl/core-rest-api/core/src/shared/interfaces/payments'; import { Prisma, Plan as PrismaPlan, Psychologist as PrismaPsychologistDto, Role as PrismaRole, } from '@prisma/client'; +import { PsychologistEntity } from '../../../core/domains/psychologist/entities/psychologist/entity'; +import { CreatePsychologistDto } from '../../../core/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; +import { UpdatePsychologistDto } from '../../../core/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; +import { Plan, Role } from '../../../core/shared/interfaces/payments'; export class PostgresqlPrismaPsychologistMapper { static toDomain(raw: PrismaPsychologistDto): PsychologistEntity { diff --git a/apps/core-rest-api/src/app/adapters/database/repositories/clinic/postgres-prisma-orm-clinic-repository.ts b/apps/core-rest-api/src/app/adapters/database/repositories/clinic/postgres-prisma-orm-clinic-repository.ts index dc87bce3..0d369e40 100644 --- a/apps/core-rest-api/src/app/adapters/database/repositories/clinic/postgres-prisma-orm-clinic-repository.ts +++ b/apps/core-rest-api/src/app/adapters/database/repositories/clinic/postgres-prisma-orm-clinic-repository.ts @@ -1,10 +1,10 @@ -import { ClinicEntity } from '@clinicControl/core-rest-api/core/src/domains/clinic/entities/clinic/entity'; -import { ClinicDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/clinic/repositories/database-repository'; -import { CreateClinicDto } from '@clinicControl/core-rest-api/core/src/domains/clinic/use-cases/create-clinic/create-clinic-dto'; -import { DeletedClinicInfo } from '@clinicControl/core-rest-api/core/src/domains/clinic/use-cases/delete-clinic/dto'; -import { UpdateClinicDto } from '@clinicControl/core-rest-api/core/src/domains/clinic/use-cases/update-clinic/update-clinic-dto'; -import { CLINIC_ERROR_MESSAGES } from '@clinicControl/core-rest-api/core/src/shared/errors/error-messages'; import { ConflictException, Injectable } from '@nestjs/common'; +import { ClinicEntity } from '../../../../core/domains/clinic/entities/clinic/entity'; +import { ClinicDatabaseRepository } from '../../../../core/domains/clinic/repositories/database-repository'; +import { CreateClinicDto } from '../../../../core/domains/clinic/use-cases/create-clinic/create-clinic-dto'; +import { DeletedClinicInfo } from '../../../../core/domains/clinic/use-cases/delete-clinic/dto'; +import { UpdateClinicDto } from '../../../../core/domains/clinic/use-cases/update-clinic/update-clinic-dto'; +import { CLINIC_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { PostgreSqlPrismaOrmService } from '../../../database/infra/prisma/prisma.service'; import { PostgresqlPrismaClinicMapper } from '../../mappers/postgresql-prisma-clinic-mapper'; diff --git a/apps/core-rest-api/src/app/adapters/database/repositories/patient/postgres-prisma-orm-patient-repository.ts b/apps/core-rest-api/src/app/adapters/database/repositories/patient/postgres-prisma-orm-patient-repository.ts index 80864d41..959d339e 100644 --- a/apps/core-rest-api/src/app/adapters/database/repositories/patient/postgres-prisma-orm-patient-repository.ts +++ b/apps/core-rest-api/src/app/adapters/database/repositories/patient/postgres-prisma-orm-patient-repository.ts @@ -1,10 +1,10 @@ -import { PATIENT_ERROR_MESSAGES } from '@clinicControl/core-rest-api/core/src/shared/errors/error-messages'; import { ConflictException, Injectable } from '@nestjs/common'; +import { PATIENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { PatientEntity } from '@clinicControl/core-rest-api/core/src/domains/patient/entities/patient/entity'; -import { PatientDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/patient/repositories/database-repository'; -import { CreatePatientDto } from '@clinicControl/core-rest-api/core/src/domains/patient/use-cases/create-patient/create-patient-dto'; -import { UpdatePatientDto } from '@clinicControl/core-rest-api/core/src/domains/patient/use-cases/update-patient/update-patient-dto'; +import { PatientEntity } from '../../../../core/domains/patient/entities/patient/entity'; +import { PatientDatabaseRepository } from '../../../../core/domains/patient/repositories/database-repository'; +import { CreatePatientDto } from '../../../../core/domains/patient/use-cases/create-patient/create-patient-dto'; +import { UpdatePatientDto } from '../../../../core/domains/patient/use-cases/update-patient/update-patient-dto'; import { PostgreSqlPrismaOrmService } from '../../infra/prisma/prisma.service'; import { PostgresqlPrismaPatientMapper } from '../../mappers/postgresql-prisma-patient-mapper'; diff --git a/apps/core-rest-api/src/app/adapters/database/repositories/psychologist/postgresql-prisma-orm-psychologist-repository.ts b/apps/core-rest-api/src/app/adapters/database/repositories/psychologist/postgresql-prisma-orm-psychologist-repository.ts index d3bcab60..5433445d 100644 --- a/apps/core-rest-api/src/app/adapters/database/repositories/psychologist/postgresql-prisma-orm-psychologist-repository.ts +++ b/apps/core-rest-api/src/app/adapters/database/repositories/psychologist/postgresql-prisma-orm-psychologist-repository.ts @@ -1,9 +1,9 @@ -import { PsychologistEntity } from '@clinicControl/core-rest-api/core/src/domains/psychologist/entities/psychologist/entity'; -import { PsychologistDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/psychologist/repositories/database-repository'; -import { CreatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; -import { UpdatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '@clinicControl/core-rest-api/core/src/shared/errors/error-messages'; import { ConflictException, Injectable } from '@nestjs/common'; +import { PsychologistEntity } from '../../../../core/domains/psychologist/entities/psychologist/entity'; +import { PsychologistDatabaseRepository } from '../../../../core/domains/psychologist/repositories/database-repository'; +import { CreatePsychologistDto } from '../../../../core/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; +import { UpdatePsychologistDto } from '../../../../core/domains/psychologist/use-cases/update-psychologist/update-psychologist-dto'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { PostgreSqlPrismaOrmService } from '../../infra/prisma/prisma.service'; import { PostgresqlPrismaPsychologistMapper } from '../../mappers/postgresql-prisma-psychologist-mapper'; diff --git a/apps/core-rest-api/src/app/adapters/database/repositories/repositories.module.ts b/apps/core-rest-api/src/app/adapters/database/repositories/repositories.module.ts index 6983cd89..1b4b6a32 100644 --- a/apps/core-rest-api/src/app/adapters/database/repositories/repositories.module.ts +++ b/apps/core-rest-api/src/app/adapters/database/repositories/repositories.module.ts @@ -1,8 +1,8 @@ import { Module } from '@nestjs/common'; -import { ClinicDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/clinic/repositories/database-repository'; -import { PatientDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/patient/repositories/database-repository'; -import { PsychologistDatabaseRepository } from '@clinicControl/core-rest-api/core/src/domains/psychologist/repositories/database-repository'; +import { ClinicDatabaseRepository } from '../../../core/domains/clinic/repositories/database-repository'; +import { PatientDatabaseRepository } from '../../../core/domains/patient/repositories/database-repository'; +import { PsychologistDatabaseRepository } from '../../../core/domains/psychologist/repositories/database-repository'; import { PostgreSqlPrismaOrmService } from '../infra/prisma/prisma.service'; import { PostgresqlPrismaOrmClinicRepository } from './clinic/postgres-prisma-orm-clinic-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/appointment/interfaces/appointment.ts b/apps/core-rest-api/src/app/core/domains/appointment/interfaces/appointment.ts index dddea266..c1d5cda2 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/interfaces/appointment.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/interfaces/appointment.ts @@ -1,4 +1,4 @@ -import { Replace } from '../../../shared/utils'; +import { Replace } from '../../../../shared/utils'; import { AppointmentDto } from '../entities/appointment/dto'; import { CreateSingleAppointmentDto } from '../use-cases/create-single-appointment/create-single-appointment-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/appointment/repositories/database-in-memory-repository.ts b/apps/core-rest-api/src/app/core/domains/appointment/repositories/database-in-memory-repository.ts index 721db403..d9a4b841 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/repositories/database-in-memory-repository.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/repositories/database-in-memory-repository.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { APPOINTMENT_ERROR_MESSAGES } from '../../../shared/errors/error-messages'; +import { APPOINTMENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { AppointmentEntity } from '../entities/appointment/entity'; import { CreateSingleAppointmentDto } from '../use-cases/create-single-appointment/create-single-appointment-dto'; import { UpdatedAppointmentDateDto } from '../use-cases/update-appointment-date/update-appointment-date-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/create-single-appointment/create-single-appointment.service.ts b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/create-single-appointment/create-single-appointment.service.ts index 7cf2998f..cf4b6a62 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/create-single-appointment/create-single-appointment.service.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/create-single-appointment/create-single-appointment.service.ts @@ -1,8 +1,8 @@ /* eslint-disable @nx/enforce-module-boundaries */ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { APPOINTMENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +import { APPOINTMENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { AppointmentEntity } from '../../entities/appointment/entity'; import { ICreateAppointmentServiceProps } from '../../interfaces/appointment'; import { AppointmentDatabaseRepository } from '../../repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/delete-single-appointment/delete-single-appointment.service.ts b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/delete-single-appointment/delete-single-appointment.service.ts index 6306a5ac..c93594fc 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/delete-single-appointment/delete-single-appointment.service.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/delete-single-appointment/delete-single-appointment.service.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { APPOINTMENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { APPOINTMENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { AppointmentDatabaseRepository } from '../../repositories/database-repository'; export class DeleteSingleAppointmentService { diff --git a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.service.ts b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.service.ts index c1195e8e..f428f590 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.service.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.service.ts @@ -1,7 +1,7 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { APPOINTMENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +import { APPOINTMENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { AppointmentDatabaseRepository } from '../../repositories/database-repository'; import { UpdatedAppointmentDateDto } from './update-appointment-date-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.spec.ts b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.spec.ts index b0da7dd8..ecdcef25 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-date/update-appointment-date.spec.ts @@ -1,7 +1,7 @@ import { faker } from '@faker-js/faker'; import { ConflictException } from '@nestjs/common'; import { randomUUID } from 'crypto'; -import { APPOINTMENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { APPOINTMENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { PaymentMethod } from '../../../../shared/interfaces/payments'; import { InMemoryAppointmentDatabaseRepository } from '../../repositories/database-in-memory-repository'; import { AppointmentDatabaseRepository } from '../../repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.service.ts b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.service.ts index 3e968544..67df1167 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.service.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.service.ts @@ -1,7 +1,7 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { APPOINTMENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +import { APPOINTMENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { AppointmentDatabaseRepository } from '../../repositories/database-repository'; import { UpdatedAppointmentInfoDto } from './update-appointment-info-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.spec.ts b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.spec.ts index 157a6a14..9884d71c 100644 --- a/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/appointment/use-cases/update-appointment-info/update-appointment-info.spec.ts @@ -1,7 +1,7 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { ConflictException } from '@nestjs/common'; import { randomUUID } from 'crypto'; -import { APPOINTMENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { APPOINTMENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { PaymentMethod } from '../../../../shared/interfaces/payments'; import { InMemoryAppointmentDatabaseRepository } from '../../repositories/database-in-memory-repository'; import { AppointmentDatabaseRepository } from '../../repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/clinic/interfaces/clinic.ts b/apps/core-rest-api/src/app/core/domains/clinic/interfaces/clinic.ts index 9e05aad3..19c44dd2 100644 --- a/apps/core-rest-api/src/app/core/domains/clinic/interfaces/clinic.ts +++ b/apps/core-rest-api/src/app/core/domains/clinic/interfaces/clinic.ts @@ -1,4 +1,4 @@ -import { Replace } from '../../../shared/utils'; +import { Replace } from '../../../../shared/utils'; import { ClinicDto } from '../entities/clinic/dto'; import { CreateClinicDto } from '../use-cases/create-clinic/create-clinic-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/clinic/repositories/database-in-memory-repository.ts b/apps/core-rest-api/src/app/core/domains/clinic/repositories/database-in-memory-repository.ts index 211bd4ea..44743c48 100644 --- a/apps/core-rest-api/src/app/core/domains/clinic/repositories/database-in-memory-repository.ts +++ b/apps/core-rest-api/src/app/core/domains/clinic/repositories/database-in-memory-repository.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { CLINIC_ERROR_MESSAGES } from '../../../shared/errors/error-messages'; +import { CLINIC_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { ClinicEntity } from '../entities/clinic/entity'; import { CreateClinicDto } from '../use-cases/create-clinic/create-clinic-dto'; import { DeletedClinicInfo } from '../use-cases/delete-clinic/dto'; diff --git a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/create-clinic/create-clinic.service.ts b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/create-clinic/create-clinic.service.ts index a355c681..7d8cce60 100644 --- a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/create-clinic/create-clinic.service.ts +++ b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/create-clinic/create-clinic.service.ts @@ -1,7 +1,7 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { CLINIC_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +import { CLINIC_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { ClinicEntity } from '../../entities/clinic/entity'; import { ICreateClinicServiceProps } from '../../interfaces/clinic'; import { ClinicDatabaseRepository } from '../../repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/delete-clinic/delete-clinic.service.ts b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/delete-clinic/delete-clinic.service.ts index 3ee180ef..80803cb3 100644 --- a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/delete-clinic/delete-clinic.service.ts +++ b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/delete-clinic/delete-clinic.service.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { CLINIC_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { CLINIC_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { ClinicDatabaseRepository } from '../../repositories/database-repository'; import { DeletedClinicInfo } from './dto'; diff --git a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.service.ts b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.service.ts index 757d5a71..ac2cd1fd 100644 --- a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.service.ts +++ b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.service.ts @@ -1,7 +1,7 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { CLINIC_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +import { CLINIC_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { ClinicDatabaseRepository } from '../../repositories/database-repository'; import { UpdateClinicDto } from './update-clinic-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.spec.ts b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.spec.ts index 069c6179..0997162a 100644 --- a/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/clinic/use-cases/update-clinic/update-clinic.spec.ts @@ -1,7 +1,7 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { ConflictException } from '@nestjs/common'; import { randomUUID } from 'crypto'; -import { CLINIC_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { CLINIC_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { InMemoryClinicDatabaseRepository } from '../../repositories/database-in-memory-repository'; import { ClinicDatabaseRepository } from '../../repositories/database-repository'; import { CreateClinicDto } from '../create-clinic/create-clinic-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/interfaces/registry.ts b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/interfaces/registry.ts index 69db263a..fdbaa13c 100644 --- a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/interfaces/registry.ts +++ b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/interfaces/registry.ts @@ -1,4 +1,4 @@ -import { Replace } from '../../../shared/utils'; +import { Replace } from '../../../../shared/utils'; import { PatientAppointmentRegistryDto, Registry } from '../entities/registry/dto'; export type IPatientAppointmentRegistryProps = Replace< diff --git a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/repositories/database-in-memory-repository.ts b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/repositories/database-in-memory-repository.ts index 969838be..1fa333a7 100644 --- a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/repositories/database-in-memory-repository.ts +++ b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/repositories/database-in-memory-repository.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { PATIENT_ERROR_MESSAGES } from '../../../shared/errors/error-messages'; +import { PATIENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { PatientAppointmentRegistryEntity } from '../entities/registry/entity'; import { ICreatePatientAppointmentRegistry, diff --git a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.service.ts b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.service.ts index 083276e2..b9048c7a 100644 --- a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.service.ts +++ b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.service.ts @@ -1,12 +1,12 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { DataEncrypterService } from '../../../../shared/cryptography/use-cases/data-encrypter.service'; import { PATIENT_ERROR_MESSAGES, PSYCHOLOGIST_ERROR_MESSAGES, -} from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +} from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; +import { DataEncrypterService } from '../../../../shared/cryptography/use-cases/data-encrypter.service'; import { PatientDatabaseRepository } from '../../../patient/repositories/database-repository'; import { PsychologistDatabaseRepository } from '../../../psychologist/repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.spec.ts b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.spec.ts index 5677f7b2..e0a974e7 100644 --- a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/create-appointment-registry/create-appointment-registry.spec.ts @@ -5,7 +5,7 @@ import { randomUUID } from 'crypto'; import { PATIENT_ERROR_MESSAGES, PSYCHOLOGIST_ERROR_MESSAGES, -} from '../../../../shared/errors/error-messages'; +} from '../../../../../shared/errors/error-messages'; import { PaymentMethod, Plan, Role } from '../../../../shared/interfaces/payments'; import { ClinicDatabaseRepository } from '../../../clinic/repositories/database-repository'; @@ -30,8 +30,8 @@ describe('[registry] - Create Patient Appointment Registry Service', () => { const fakePatient: CreatePatientDto = { name: faker.person.fullName(), email: faker.internet.email(), - CPF: faker.number.int({ min: 0, max: 10000000000 }).toString(), - phone: '+55 11 911111111', + cpf: faker.number.int({ min: 0, max: 10000000000 }).toString(), + telephone: '+55 11 911111111', paymentMethod: PaymentMethod.CREDIT_CARD, psychologistId: randomUUID(), clinicId: randomUUID(), diff --git a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.service.ts b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.service.ts index 9f9df63b..c479d0c3 100644 --- a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.service.ts +++ b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.service.ts @@ -2,8 +2,8 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; import { PATIENT_APPOINTMENT_REGISTRY_MESSAGES -} from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +} from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { PatientAppointmentRegistryDatabaseRepository } from '../../repositories/database-repository'; import { DeletePatientAppointmentRegistryDto } from './delete-appointment-registry-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.spec.ts b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.spec.ts index 165f1382..645b2f11 100644 --- a/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/patient-appointment-registry/use-cases/delete-appointment-registry/delete-appointment-registry.spec.ts @@ -16,7 +16,7 @@ import { InMemoryPatientAppointmentRegistryDatabaseRepository } from '../../repo import { DeletePatientAppointmentRegistryService } from './delete-appointment-registry.service'; import { ConflictException } from '@nestjs/common'; -import { PATIENT_APPOINTMENT_REGISTRY_MESSAGES } from '../../../../shared/errors/error-messages'; +import { PATIENT_APPOINTMENT_REGISTRY_MESSAGES } from '../../../../../shared/errors/error-messages'; import { PatientEntity } from '../../../patient/entities/patient/entity'; import { CreatePatientDto } from '../../../patient/use-cases/create-patient/create-patient-dto'; import { PsychologistEntity } from '../../../psychologist/entities/psychologist/entity'; @@ -27,8 +27,8 @@ describe('[registry] - Create Patient Appointment Registry Service', () => { const fakePatient: CreatePatientDto = { name: faker.person.fullName(), email: faker.internet.email(), - CPF: faker.number.int({ min: 0, max: 10000000000 }).toString(), - phone: '+55 11 911111111', + cpf: faker.number.int({ min: 0, max: 10000000000 }).toString(), + telephone: '+55 11 911111111', paymentMethod: PaymentMethod.CREDIT_CARD, psychologistId: randomUUID(), clinicId: randomUUID(), diff --git a/apps/core-rest-api/src/app/core/domains/patient/interfaces/patient.ts b/apps/core-rest-api/src/app/core/domains/patient/interfaces/patient.ts index 81e00e00..43244a67 100644 --- a/apps/core-rest-api/src/app/core/domains/patient/interfaces/patient.ts +++ b/apps/core-rest-api/src/app/core/domains/patient/interfaces/patient.ts @@ -1,4 +1,4 @@ -import { Replace } from '../../../shared/utils'; +import { Replace } from '../../../../shared/utils'; import { PatientDto } from '../entities/patient/dto'; import { CreatePatientDto } from '../use-cases/create-patient/create-patient-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/patient/repositories/database-in-memory-repository.ts b/apps/core-rest-api/src/app/core/domains/patient/repositories/database-in-memory-repository.ts index fffbde6b..84862937 100644 --- a/apps/core-rest-api/src/app/core/domains/patient/repositories/database-in-memory-repository.ts +++ b/apps/core-rest-api/src/app/core/domains/patient/repositories/database-in-memory-repository.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { PATIENT_ERROR_MESSAGES } from '../../../shared/errors/error-messages'; +import { PATIENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { PatientEntity } from '../entities/patient/entity'; import { CreatePatientDto } from '../use-cases/create-patient/create-patient-dto'; import { UpdatePatientDto } from '../use-cases/update-patient/update-patient-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/patient/use-cases/create-patient/create-patient.service.ts b/apps/core-rest-api/src/app/core/domains/patient/use-cases/create-patient/create-patient.service.ts index f3f1a567..eed30f4c 100644 --- a/apps/core-rest-api/src/app/core/domains/patient/use-cases/create-patient/create-patient.service.ts +++ b/apps/core-rest-api/src/app/core/domains/patient/use-cases/create-patient/create-patient.service.ts @@ -1,8 +1,8 @@ /* eslint-disable @nx/enforce-module-boundaries */ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { PATIENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +import { PATIENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { PatientEntity } from '../../entities/patient/entity'; import { ICreatePatientServiceProps } from '../../interfaces/patient'; import { PatientDatabaseRepository } from '../../repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/patient/use-cases/delete-patient/delete-patient.service.ts b/apps/core-rest-api/src/app/core/domains/patient/use-cases/delete-patient/delete-patient.service.ts index b184c5c2..83bc56dd 100644 --- a/apps/core-rest-api/src/app/core/domains/patient/use-cases/delete-patient/delete-patient.service.ts +++ b/apps/core-rest-api/src/app/core/domains/patient/use-cases/delete-patient/delete-patient.service.ts @@ -1,6 +1,6 @@ /* eslint-disable @nx/enforce-module-boundaries */ import { ConflictException } from '@nestjs/common'; -import { PATIENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { PATIENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { PatientDatabaseRepository } from '../../repositories/database-repository'; export class DeletePatientService { diff --git a/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.service.ts b/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.service.ts index d3648756..6d7a8640 100644 --- a/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.service.ts +++ b/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.service.ts @@ -1,7 +1,7 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; -import { PATIENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; +import { PATIENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { PatientDatabaseRepository } from '../../repositories/database-repository'; import { UpdatePatientDto } from './update-patient-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.spec.ts b/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.spec.ts index ba8e6597..a6d96fc0 100644 --- a/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/patient/use-cases/update-patient/update-patient.spec.ts @@ -1,7 +1,7 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { ConflictException } from '@nestjs/common'; import { randomUUID } from 'crypto'; -import { PATIENT_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { PATIENT_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { PaymentMethod } from '../../../../shared/interfaces/payments'; import { InMemoryPatientDatabaseRepository } from '../../repositories/database-in-memory-repository'; import { PatientDatabaseRepository } from '../../repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/interfaces/psychologist.ts b/apps/core-rest-api/src/app/core/domains/psychologist/interfaces/psychologist.ts index 3d6659f7..07342717 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/interfaces/psychologist.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/interfaces/psychologist.ts @@ -1,4 +1,4 @@ -import { Replace } from '../../../shared/utils'; +import { Replace } from '../../../../shared/utils'; import { PsychologistDto } from '../entities/psychologist/dto'; export type IPsychologistProps = Replace< diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/repositories/database-in-memory-repository.ts b/apps/core-rest-api/src/app/core/domains/psychologist/repositories/database-in-memory-repository.ts index e6875359..27c60825 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/repositories/database-in-memory-repository.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/repositories/database-in-memory-repository.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../shared/errors/error-messages'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { ClinicDatabaseRepository } from '../../clinic/repositories/database-repository'; import { PsychologistEntity } from '../entities/psychologist/entity'; import { CreatePsychologistDto } from '../use-cases/create-psychologist/create-psychologist-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.service.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.service.ts index 847feabf..6e8ffd68 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.service.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.service.ts @@ -1,7 +1,7 @@ import { UnauthorizedException } from '@nestjs/common'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { BcryptHasherService } from '../../../../shared/cryptography/use-cases/bcrypt-hasher.service'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { PsychologistEntity } from '../../entities/psychologist/entity'; import { PsychologistDatabaseRepository } from '../../repositories/database-repository'; import { AuthenticatePsychologistDto } from './authenticate-psychologist-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.spec.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.spec.ts index 470f6385..52aece0c 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/authenticate-psychologist/authenticate-psychologist.spec.ts @@ -1,7 +1,7 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { ConflictException } from '@nestjs/common'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { Plan, Role } from '../../../../shared/interfaces/payments'; import { InMemoryClinicDatabaseRepository } from '../../../clinic/repositories/database-in-memory-repository'; import { ClinicDatabaseRepository } from '../../../clinic/repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.service.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.service.ts index 756c09be..c317af2e 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.service.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.service.ts @@ -1,8 +1,8 @@ import { ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { BcryptHasherService } from '../../../../shared/cryptography/use-cases/bcrypt-hasher.service'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; import { PsychologistEntity } from '../../entities/psychologist/entity'; import { PsychologistDatabaseRepository } from '../../repositories/database-repository'; import { CreatePsychologistDto } from './create-psychologist-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.spec.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.spec.ts index 65af20d1..7182faa4 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist.spec.ts @@ -1,7 +1,7 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { ConflictException } from '@nestjs/common'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { Plan, Role } from '../../../../shared/interfaces/payments'; import { InMemoryClinicDatabaseRepository } from '../../../clinic/repositories/database-in-memory-repository'; import { ClinicDatabaseRepository } from '../../../clinic/repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.service.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.service.ts index 15efb349..11e8a46a 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.service.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.service.ts @@ -1,5 +1,5 @@ import { ConflictException } from '@nestjs/common'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { PsychologistDatabaseRepository } from '../../repositories/database-repository'; import { DeletedPsychologistInfo } from './dto'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.spec.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.spec.ts index 616bdbff..5a42d394 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/delete-psychologist/delete-psychologist.spec.ts @@ -1,6 +1,6 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { ConflictException } from '@nestjs/common'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { Plan, Role } from '../../../../shared/interfaces/payments'; import { InMemoryClinicDatabaseRepository } from '../../../clinic/repositories/database-in-memory-repository'; import { ClinicDatabaseRepository } from '../../../clinic/repositories/database-repository'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.service.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.service.ts index 4e7274a8..50e42e9e 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.service.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.service.ts @@ -1,9 +1,9 @@ import { BadRequestException, ConflictException } from '@nestjs/common'; import { plainToInstance } from 'class-transformer'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; +import { applicationValidateOrReject } from '../../../../../shared/validators/validate-or-reject'; import { BcryptHasherService } from '../../../../shared/cryptography/use-cases/bcrypt-hasher.service'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; -import { applicationValidateOrReject } from '../../../../shared/validators/validate-or-reject'; import { PsychologistDatabaseRepository } from '../../repositories/database-repository'; import { UpdatePsychologistDto } from './update-psychologist-dto'; diff --git a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.spec.ts b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.spec.ts index 6b10c746..9d909d0a 100644 --- a/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.spec.ts +++ b/apps/core-rest-api/src/app/core/domains/psychologist/use-cases/update-psychologist/update-psychologist.spec.ts @@ -1,8 +1,8 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { BadRequestException, ConflictException } from '@nestjs/common'; +import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../../shared/errors/error-messages'; import { BcryptHasherService } from '../../../../shared/cryptography/use-cases/bcrypt-hasher.service'; -import { PSYCHOLOGIST_ERROR_MESSAGES } from '../../../../shared/errors/error-messages'; import { Plan, Role } from '../../../../shared/interfaces/payments'; import { InMemoryClinicDatabaseRepository } from '../../../clinic/repositories/database-in-memory-repository'; import { ClinicDatabaseRepository } from '../../../clinic/repositories/database-repository'; diff --git a/apps/core-rest-api/tests/cryptography/fake-encrypter.ts b/apps/core-rest-api/tests/cryptography/fake-encrypter.ts index a06db452..a2a976e3 100644 --- a/apps/core-rest-api/tests/cryptography/fake-encrypter.ts +++ b/apps/core-rest-api/tests/cryptography/fake-encrypter.ts @@ -3,7 +3,7 @@ Esta classe é um mock para ser usada exclusivamente nos testes. */ -import { Encrypter } from '@clinicControl/core-rest-api/core/src/shared/cryptography/repository/encrypter-repository'; +import { Encrypter } from '../../src/app/core/shared/cryptography/repository/encrypter-repository'; export class FakeEncrypter implements Encrypter { async encrypt(payload: Record): Promise { diff --git a/apps/core-rest-api/tests/cryptography/fake-hasher.ts b/apps/core-rest-api/tests/cryptography/fake-hasher.ts index ef160850..c8bec903 100644 --- a/apps/core-rest-api/tests/cryptography/fake-hasher.ts +++ b/apps/core-rest-api/tests/cryptography/fake-hasher.ts @@ -4,8 +4,8 @@ Esta classe é um mock para ser usada exclusivamente nos testes. */ -import { HashComparer } from '@clinicControl/core-rest-api/core/src/shared/cryptography/repository/hash-comparer-repository'; -import { HashGenerator } from '@clinicControl/core-rest-api/core/src/shared/cryptography/repository/hash-generator-repository'; +import { HashComparer } from '../../src/app/core/shared/cryptography/repository/hash-comparer-repository'; +import { HashGenerator } from '../../src/app/core/shared/cryptography/repository/hash-generator-repository'; export class FakeHasher implements HashGenerator, HashComparer { async hash(plain: string): Promise { diff --git a/apps/core-rest-api/tests/factories/make-clinic.ts b/apps/core-rest-api/tests/factories/make-clinic.ts index 4c88efcf..2fc15b35 100644 --- a/apps/core-rest-api/tests/factories/make-clinic.ts +++ b/apps/core-rest-api/tests/factories/make-clinic.ts @@ -1,10 +1,10 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { Injectable } from '@nestjs/common'; -import { ClinicEntity } from '@clinicControl/core-rest-api/core/src/domains/clinic/entities/clinic/entity'; -import { CreateClinicDto } from '@clinicControl/core-rest-api/core/src/domains/clinic/use-cases/create-clinic/create-clinic-dto'; -import { PostgreSqlPrismaOrmService } from '../../src/database/infra/prisma/prisma.service'; -import { PostgresqlPrismaClinicMapper } from '../../src/database/mappers/postgresql-prisma-clinic-mapper'; +import { PostgreSqlPrismaOrmService } from '../../src/app/adapters/database/infra/prisma/prisma.service'; +import { PostgresqlPrismaClinicMapper } from '../../src/app/adapters/database/mappers/postgresql-prisma-clinic-mapper'; +import { ClinicEntity } from '../../src/app/core/domains/clinic/entities/clinic/entity'; +import { CreateClinicDto } from '../../src/app/core/domains/clinic/use-cases/create-clinic/create-clinic-dto'; /* Creating a factory for the Clinic entity, which will be used to create tests for the domain's use cases diff --git a/apps/core-rest-api/tests/factories/make-patient.ts b/apps/core-rest-api/tests/factories/make-patient.ts index 3e7c1ec2..6b964df5 100644 --- a/apps/core-rest-api/tests/factories/make-patient.ts +++ b/apps/core-rest-api/tests/factories/make-patient.ts @@ -1,11 +1,12 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { Injectable } from '@nestjs/common'; -import { PatientEntity } from '@clinicControl/core-rest-api/core/src/domains/patient/entities/patient/entity'; -import { CreatePatientDto } from '@clinicControl/core-rest-api/core/src/domains/patient/use-cases/create-patient/create-patient-dto'; -import { PaymentMethod } from '@clinicControl/core-rest-api/core/src/shared/interfaces/payments'; -import { PostgreSqlPrismaOrmService } from '../../src/database/infra/prisma/prisma.service'; -import { PostgresqlPrismaPatientMapper } from '../../src/database/mappers/postgresql-prisma-patient-mapper'; +import { PostgreSqlPrismaOrmService } from '../../src/app/adapters/database/infra/prisma/prisma.service'; +import { PostgresqlPrismaPatientMapper } from '../../src/app/adapters/database/mappers/postgresql-prisma-patient-mapper'; + +import { PatientEntity } from '../../src/app/core/domains/patient/entities/patient/entity'; +import { CreatePatientDto } from '../../src/app/core/domains/patient/use-cases/create-patient/create-patient-dto'; +import { PaymentMethod } from '../../src/app/core/shared/interfaces/payments'; export function makePatient(override: Partial = {}): PatientEntity { const newPatient = new PatientEntity({ diff --git a/apps/core-rest-api/tests/factories/make-psychologist.ts b/apps/core-rest-api/tests/factories/make-psychologist.ts index b621b54e..8c900324 100644 --- a/apps/core-rest-api/tests/factories/make-psychologist.ts +++ b/apps/core-rest-api/tests/factories/make-psychologist.ts @@ -1,14 +1,11 @@ import { fakerPT_BR as faker } from '@faker-js/faker'; import { Injectable } from '@nestjs/common'; -import { PsychologistEntity } from '@clinicControl/core-rest-api/core/src/domains/psychologist/entities/psychologist/entity'; -import { CreatePsychologistDto } from '@clinicControl/core-rest-api/core/src/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; -import { - Plan, - Role, -} from '@clinicControl/core-rest-api/core/src/shared/interfaces/payments'; -import { PostgreSqlPrismaOrmService } from '../../src/database/infra/prisma/prisma.service'; -import { PostgresqlPrismaPsychologistMapper } from '../../src/database/mappers/postgresql-prisma-psychologist-mapper'; +import { PostgreSqlPrismaOrmService } from '../../src/app/adapters/database/infra/prisma/prisma.service'; +import { PostgresqlPrismaPsychologistMapper } from '../../src/app/adapters/database/mappers/postgresql-prisma-psychologist-mapper'; +import { PsychologistEntity } from '../../src/app/core/domains/psychologist/entities/psychologist/entity'; +import { CreatePsychologistDto } from '../../src/app/core/domains/psychologist/use-cases/create-psychologist/create-psychologist-dto'; +import { Plan, Role } from '../../src/app/core/shared/interfaces/payments'; /* Creating a factory for the Psychologist entity, which will be used to create tests for the domain's use cases diff --git a/apps/core-rest-api/tests/setup-e2e.ts b/apps/core-rest-api/tests/setup-e2e.ts index 3b361bd1..28f36589 100644 --- a/apps/core-rest-api/tests/setup-e2e.ts +++ b/apps/core-rest-api/tests/setup-e2e.ts @@ -36,7 +36,7 @@ beforeAll(async () => { console.log('databaseURL', databaseURL); console.log('connecting test e2e database...'); execSync( - 'pnpm prisma migrate deploy --schema=./libs/core-rest-api/adapters/src/database/infra/prisma/postgresql.schema.prisma' + 'pnpm prisma migrate deploy --schema=./apps/core-rest-api/src/app/adapters/database/infra/prisma/postgresql.schema.prisma' ); }); diff --git a/scripts/setup/core-rest-api/run-prisma-setup.sh b/scripts/setup/core-rest-api/run-prisma-setup.sh index faee02ec..2f1c97d5 100644 --- a/scripts/setup/core-rest-api/run-prisma-setup.sh +++ b/scripts/setup/core-rest-api/run-prisma-setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -SCHEMA_PATH="./libs/core-rest-api/adapters/src/database/infra/prisma/postgresql.schema.prisma" +SCHEMA_PATH="./apps/core-rest-api/src/app/adapters/database/infra/prisma/postgresql.schema.prisma" # Analisamos todos os argumentos fornecidos for arg in "$@"; do