Skip to content

Commit

Permalink
refactor(CC-119): change folders path in adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
luana-v-santos committed Apr 25, 2024
1 parent c246ec0 commit 6096b58
Show file tree
Hide file tree
Showing 99 changed files with 207 additions and 207 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';

import { AuthModule } from '../auth/auth.module';
import { CryptographyModule } from '../cryptography/cryptography.module';
import { envSchema } from '../env/env';
import { EnvModule } from '../env/env.module';
import { AuthModule } from './auth/auth.module';
import { CryptographyModule } from './cryptography/cryptography.module';
import { envSchema } from './env/env';
import { EnvModule } from './env/env.module';

import { BcryptHasherService } from '../../core/shared/cryptography/use-cases/bcrypt-hasher.service';
import { PostgreSqlPrismaOrmService } from '../database/infra/prisma/prisma.service';
import { DatabaseRepositoriesModule } from '../database/repositories/repositories.module';
import { BcryptHasherService } from '../core/shared/cryptography/use-cases/bcrypt-hasher.service';
import { PostgreSqlPrismaOrmService } from './database/infra/prisma/prisma.service';
import { DatabaseRepositoriesModule } from './database/repositories/repositories.module';

import { NestjsCreateAppointmentService } from './routes/v1/appointment/create-appointment/nestjs-create-appointment.service';
import { DeleteAppointmentController } from './routes/v1/appointment/delete-appointment/delete-appointment.controller';
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import { ExecutionContext, createParamDecorator } from '@nestjs/common';
import { TokenPayload } from '../../auth/jwt.strategy';
import { TokenPayload } from '../auth/jwt.strategy';

export const CurrentUser = createParamDecorator((_: never, context: ExecutionContext) => {
const request = context.switchToHttp().getRequest(); // usamos o switchToHttp para ter acesso ao request da requisição, e getRequest() para pegar o request (o request é um objeto que tem várias informações da requisição)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Body, Controller, Post } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException';
import { CreateSingleAppointmentControllerBodyInputDto } from './input.dto';
import { NestjsCreateAppointmentService } from './nestjs-create-appointment.service';
import { CreateAppointmentControllerOutputDto } from './output.dto';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { faker } from "@faker-js/faker";
import { INestApplication } from "@nestjs/common";
import request from 'supertest';
import { makeAppointment } from '../../../../../../../../tests/factories/make-appointment';
import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup';
import { AppointmentEntity } from '../../../../../../core/domains/appointment/entities/appointment/entity';
import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments';
import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service';
import { makeAppointment } from '../../../../../../../tests/factories/make-appointment';
import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup';
import { AppointmentEntity } from '../../../../../core/domains/appointment/entities/appointment/entity';
import { PaymentMethod } from '../../../../../core/shared/interfaces/payments';
import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service';

describe('[E2E] - Create New Appointment', () => {
let app: INestApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsBoolean, IsDate, IsEnum, IsOptional, IsString } from 'class-validator';
import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments';
import { PaymentMethod } from '../../../../../core/shared/interfaces/payments';

export class CreateSingleAppointmentControllerBodyInputDto {
@IsString()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@nestjs/common';
import { AppointmentDatabaseRepository } from '../../../../../core/domains/appointment/repositories/database-repository';
import { CreateSingleAppointmentService } from '../../../../../core/domains/appointment/use-cases/create-single-appointment/create-single-appointment.service';

@Injectable()
export class NestjsCreateAppointmentService extends CreateSingleAppointmentService {
constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) {
super(appointmentDatabaseRepository);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Controller, Delete, Param } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException';
import { DeleteAppointmentControllerParamsInputDto } from './input.dto';
import { NestjsDeleteAppointmentService } from './nestjs-delete-appointment.service';
import { DeleteAppointmentOutputDto } from './output.dto';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { faker } from '@faker-js/faker';
import { INestApplication } from '@nestjs/common';
import request from 'supertest';
import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup';
import { AppointmentEntity } from '../../../../../../core/domains/appointment/entities/appointment/entity';
import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service';
import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup';
import { AppointmentEntity } from '../../../../../core/domains/appointment/entities/appointment/entity';
import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service';

describe('[E2E] - Delete Appointment', () => {
let prisma: PostgreSqlPrismaOrmService;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import { Injectable } from '@nestjs/common';
import { AppointmentDatabaseRepository } from '../../../../../core/domains/appointment/repositories/database-repository';
import { DeleteSingleAppointmentService } from '../../../../../core/domains/appointment/use-cases/delete-single-appointment/delete-single-appointment.service';

@Injectable()
export class NestjsDeleteAppointmentService extends DeleteSingleAppointmentService {
constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) {
super(appointmentDatabaseRepository);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsBoolean, IsDate, IsEnum, IsOptional, IsString } from 'class-validator';
import { PaymentMethod } from '../../../../../../core/shared/interfaces/payments';
import { PaymentMethod } from '../../../../../core/shared/interfaces/payments';

export class UpdateAppointmentControllerParamsInputDto {
@IsString()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Injectable } from '@nestjs/common';
import { AppointmentDatabaseRepository } from '../../../../../core/domains/appointment/repositories/database-repository';
import { UpdateAppointmentService } from '../../../../../core/domains/appointment/use-cases/update-single-appointment/update-appointment.service';

@Injectable()
export class NestjsUpdateAppointmentService extends UpdateAppointmentService {
constructor(appointmentDatabaseRepository: AppointmentDatabaseRepository) {
super(appointmentDatabaseRepository);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ class UpdatedAppointmentInfoOutputDto {
confirmed!: boolean;

@IsDate()
confirmationDate!: Date | null;
confirmationDate?: Date | null;

@IsBoolean()
cancelled!: boolean;

@IsDate()
cancellationDate!: Date | null;
cancellationDate?: Date | null;

@IsBoolean()
done!: boolean | null;

@IsBoolean()
missed!: boolean | null;
missed?: boolean | null;

@IsBoolean()
paid!: boolean;
paid?: boolean;

@IsEnum(PaymentMethod)
paymentMethod!: PaymentMethod;
Expand All @@ -48,7 +48,7 @@ class UpdatedAppointmentInfoOutputDto {
createdAt!: Date;

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

export class UpdateAppointmentControllerOutputDto {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BadRequestException, Body, Controller, Param, Patch } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException';
import {
UpdateAppointmentControllerBodyInputDto,
UpdateAppointmentControllerParamsInputDto,
UpdateAppointmentControllerBodyInputDto,
UpdateAppointmentControllerParamsInputDto,
} from './input.dto';
import { NestjsUpdateAppointmentService } from './nestjs-update-appointment.service';
import { UpdateAppointmentControllerOutputDto } from './output.dto';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { faker } from '@faker-js/faker';
import { INestApplication } from '@nestjs/common';
import request from 'supertest';
import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup';
import { Replace } from '../../../../../../../app/shared/utils';
import { AppointmentEntity } from '../../../../../../core/domains/appointment/entities/appointment/entity';
import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup';
import { AppointmentEntity } from '../../../../../core/domains/appointment/entities/appointment/entity';
import { Replace } from '../../../../../shared/utils';
import { UpdateAppointmentControllerBodyInputDto } from './input.dto';

describe('[E2E] - Update Appointment', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Body, Controller, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException';
import { CreateClinicControllerBodyInputDto } from './input.dto';
import { NestjsCreateClinicService } from './nestjs-create-clinic.service';
import { CreateClinicControllerOutputDto } from './output.dto';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import request from 'supertest';

import { INestApplication } from '@nestjs/common';

import { makeClinic } from '../../../../../../../../tests/factories/make-clinic';
import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup';
import { ClinicEntity } from '../../../../../../core/domains/clinic/entities/clinic/entity';
import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service';
import { makeClinic } from '../../../../../../../tests/factories/make-clinic';
import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup';
import { ClinicEntity } from '../../../../../core/domains/clinic/entities/clinic/entity';
import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service';

describe('[E2E] - Create Clinic', () => {
let app: INestApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { ClinicDatabaseRepository } from '../../../../../../core/domains/clinic/repositories/database-repository';
import { CreateClinicService } from '../../../../../../core/domains/clinic/use-cases/create-clinic/create-clinic.service';
import { ClinicDatabaseRepository } from '../../../../../core/domains/clinic/repositories/database-repository';
import { CreateClinicService } from '../../../../../core/domains/clinic/use-cases/create-clinic/create-clinic.service';

@Injectable()
export class NestjsCreateClinicService extends CreateClinicService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Controller, Delete, Param } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException';
import { DeleteClinicControllerParamsInputDto } from './input.dto';
import { NestjsDeleteClinicService } from './nestjs-delete-clinic.service';
import { DeleteClinicControllerOutputDto } from './output.dto';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { faker } from '@faker-js/faker';
import { INestApplication } from '@nestjs/common';
import request from 'supertest';
import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup';
import { ClinicEntity } from '../../../../../../core/domains/clinic/entities/clinic/entity';
import { PostgreSqlPrismaOrmService } from '../../../../../database/infra/prisma/prisma.service';
import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup';
import { ClinicEntity } from '../../../../../core/domains/clinic/entities/clinic/entity';
import { PostgreSqlPrismaOrmService } from '../../../../database/infra/prisma/prisma.service';

describe('[E2E] - Delete Clinic', () => {
let prisma: PostgreSqlPrismaOrmService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { ClinicDatabaseRepository } from '../../../../../../core/domains/clinic/repositories/database-repository';
import { DeleteClinicService } from '../../../../../../core/domains/clinic/use-cases/delete-clinic/delete-clinic.service';
import { ClinicDatabaseRepository } from '../../../../../core/domains/clinic/repositories/database-repository';
import { DeleteClinicService } from '../../../../../core/domains/clinic/use-cases/delete-clinic/delete-clinic.service';

@Injectable()
export class NestjsDeleteClinicService extends DeleteClinicService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { ClinicDatabaseRepository } from '../../../../../../core/domains/clinic/repositories/database-repository';
import { UpdateClinicService } from '../../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic.service';
import { ClinicDatabaseRepository } from '../../../../../core/domains/clinic/repositories/database-repository';
import { UpdateClinicService } from '../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic.service';

@Injectable()
export class NestjsUpdateClinicService extends UpdateClinicService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BadRequestException, Body, Controller, Param, Patch } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';

import { UpdateClinicInputDto } from '../../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic-dto';
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import { UpdateClinicInputDto } from '../../../../../core/domains/clinic/use-cases/update-clinic/update-clinic-dto';
import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException';
import {
UpdateClinicControllerBodyInputDto,
UpdateClinicControllerParamsInputDto,
UpdateClinicControllerBodyInputDto,
UpdateClinicControllerParamsInputDto,
} from './input.dto';
import { NestjsUpdateClinicService } from './nestjs-update-clinic.service';
import { UpdateClinicControllerOutputDto } from './output.dto';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import request from 'supertest';

import { INestApplication } from '@nestjs/common';

import { setupE2ETest } from '../../../../../../../../tests/utils/e2e-tests-initial-setup';
import { ClinicEntity } from '../../../../../../core/domains/clinic/entities/clinic/entity';
import { setupE2ETest } from '../../../../../../../tests/utils/e2e-tests-initial-setup';
import { ClinicEntity } from '../../../../../core/domains/clinic/entities/clinic/entity';

describe('[E2E] - Create Appointment', () => {
let app: INestApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Body, Controller, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { GlobalAppHttpException } from '../../../../../../shared/errors/globalAppHttpException';
import { GlobalAppHttpException } from '../../../../../shared/errors/globalAppHttpException';
import { CreatePatientAppointmentRegistryControllerBodyInputDto } from './input.dto';
import { NestjsCreatePatientAppointmentRegistryService } from './nestjs-create-patient-appointment-registry.service';
import { CreatePatientAppointmentRegistryControllerOutputDto } from './output.dto';
Expand Down
Loading

0 comments on commit 6096b58

Please sign in to comment.