Skip to content

Commit

Permalink
refactor(CC-113): adjust imports according to new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
luanavfg committed Dec 28, 2023
1 parent 500e837 commit 7ade19e
Show file tree
Hide file tree
Showing 70 changed files with 137 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Loading

0 comments on commit 7ade19e

Please sign in to comment.