From 5d8eb42ae69c1943c7977363716a4c8d2c991b39 Mon Sep 17 00:00:00 2001 From: Gsk54 Date: Fri, 16 Dec 2022 17:31:08 +0100 Subject: [PATCH] updates --- .env | 2 +- .env.dist | 2 +- README.md | 2 +- src/modules/users/adapters/primaries/users.controller.ts | 8 ++++---- src/modules/users/commands/create-user.command.ts | 2 +- src/modules/users/commands/update-user.command.ts | 2 +- .../users/domain/{dto => dtos}/create-user.request.ts | 0 .../users/domain/{dto => dtos}/find-all-users.request.ts | 0 .../domain/{dto => dtos}/find-user-by-uuid.request.ts | 0 .../users/domain/{dto => dtos}/update-user.request.ts | 0 src/modules/users/domain/usecases/create-user.usecase.ts | 2 +- src/modules/users/domain/usecases/update-user.usecase.ts | 2 +- src/modules/users/mappers/user.profile.ts | 4 ++-- src/modules/users/queries/find-all-users.query.ts | 2 +- src/modules/users/tests/unit/create-user.usecase.spec.ts | 2 +- src/modules/users/tests/unit/update-user.usecase.spec.ts | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) rename src/modules/users/domain/{dto => dtos}/create-user.request.ts (100%) rename src/modules/users/domain/{dto => dtos}/find-all-users.request.ts (100%) rename src/modules/users/domain/{dto => dtos}/find-user-by-uuid.request.ts (100%) rename src/modules/users/domain/{dto => dtos}/update-user.request.ts (100%) diff --git a/.env b/.env index fbd4f0b..15ae154 100644 --- a/.env +++ b/.env @@ -4,7 +4,7 @@ SERVICE_URL=0.0.0.0 SERVICE_PORT=5001 # PRISMA -DATABASE_URL="postgresql://user:user@db:5432/user?schema=public" +DATABASE_URL="postgresql://user:user@v3-user-db:5432/user?schema=public" # POSTGRES POSTGRES_CONTAINER=v3-user-db diff --git a/.env.dist b/.env.dist index fbd4f0b..15ae154 100644 --- a/.env.dist +++ b/.env.dist @@ -4,7 +4,7 @@ SERVICE_URL=0.0.0.0 SERVICE_PORT=5001 # PRISMA -DATABASE_URL="postgresql://user:user@db:5432/user?schema=public" +DATABASE_URL="postgresql://user:user@v3-user-db:5432/user?schema=public" # POSTGRES POSTGRES_CONTAINER=v3-user-db diff --git a/README.md b/README.md index 35ddd21..f2f8a66 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Then execute : docker-compose up -d ``` -The app runs automatically on the port defined in `SERVICE_PORT` of `.env` file (default : _3001_). +The app runs automatically on the port defined in `SERVICE_PORT` of `.env` file (default : _5001_). You then need to set the appropriate rights for PGAdmin container : diff --git a/src/modules/users/adapters/primaries/users.controller.ts b/src/modules/users/adapters/primaries/users.controller.ts index cd09284..1500b84 100644 --- a/src/modules/users/adapters/primaries/users.controller.ts +++ b/src/modules/users/adapters/primaries/users.controller.ts @@ -7,10 +7,10 @@ import { DatabaseException } from 'src/modules/database/src/exceptions/DatabaseE import { CreateUserCommand } from '../../commands/create-user.command'; import { DeleteUserCommand } from '../../commands/delete-user.command'; import { UpdateUserCommand } from '../../commands/update-user.command'; -import { CreateUserRequest } from '../../domain/dto/create-user.request'; -import { FindAllUsersRequest } from '../../domain/dto/find-all-users.request'; -import { FindUserByUuidRequest } from '../../domain/dto/find-user-by-uuid.request'; -import { UpdateUserRequest } from '../../domain/dto/update-user.request'; +import { CreateUserRequest } from '../../domain/dtos/create-user.request'; +import { FindAllUsersRequest } from '../../domain/dtos/find-all-users.request'; +import { FindUserByUuidRequest } from '../../domain/dtos/find-user-by-uuid.request'; +import { UpdateUserRequest } from '../../domain/dtos/update-user.request'; import { User } from '../../domain/entities/user'; import { FindAllUsersQuery } from '../../queries/find-all-users.query'; import { FindUserByUuidQuery } from '../../queries/find-user-by-uuid.query'; diff --git a/src/modules/users/commands/create-user.command.ts b/src/modules/users/commands/create-user.command.ts index 60c7160..70444d5 100644 --- a/src/modules/users/commands/create-user.command.ts +++ b/src/modules/users/commands/create-user.command.ts @@ -1,4 +1,4 @@ -import { CreateUserRequest } from '../domain/dto/create-user.request'; +import { CreateUserRequest } from '../domain/dtos/create-user.request'; export class CreateUserCommand { readonly createUserRequest: CreateUserRequest; diff --git a/src/modules/users/commands/update-user.command.ts b/src/modules/users/commands/update-user.command.ts index 434e83b..a65617f 100644 --- a/src/modules/users/commands/update-user.command.ts +++ b/src/modules/users/commands/update-user.command.ts @@ -1,4 +1,4 @@ -import { UpdateUserRequest } from '../domain/dto/update-user.request'; +import { UpdateUserRequest } from '../domain/dtos/update-user.request'; export class UpdateUserCommand { readonly updateUserRequest: UpdateUserRequest; diff --git a/src/modules/users/domain/dto/create-user.request.ts b/src/modules/users/domain/dtos/create-user.request.ts similarity index 100% rename from src/modules/users/domain/dto/create-user.request.ts rename to src/modules/users/domain/dtos/create-user.request.ts diff --git a/src/modules/users/domain/dto/find-all-users.request.ts b/src/modules/users/domain/dtos/find-all-users.request.ts similarity index 100% rename from src/modules/users/domain/dto/find-all-users.request.ts rename to src/modules/users/domain/dtos/find-all-users.request.ts diff --git a/src/modules/users/domain/dto/find-user-by-uuid.request.ts b/src/modules/users/domain/dtos/find-user-by-uuid.request.ts similarity index 100% rename from src/modules/users/domain/dto/find-user-by-uuid.request.ts rename to src/modules/users/domain/dtos/find-user-by-uuid.request.ts diff --git a/src/modules/users/domain/dto/update-user.request.ts b/src/modules/users/domain/dtos/update-user.request.ts similarity index 100% rename from src/modules/users/domain/dto/update-user.request.ts rename to src/modules/users/domain/dtos/update-user.request.ts diff --git a/src/modules/users/domain/usecases/create-user.usecase.ts b/src/modules/users/domain/usecases/create-user.usecase.ts index b37c600..3f25c57 100644 --- a/src/modules/users/domain/usecases/create-user.usecase.ts +++ b/src/modules/users/domain/usecases/create-user.usecase.ts @@ -3,7 +3,7 @@ import { InjectMapper } from '@automapper/nestjs'; import { CommandHandler } from '@nestjs/cqrs'; import { UsersRepository } from '../../adapters/secondaries/users.repository'; import { CreateUserCommand } from '../../commands/create-user.command'; -import { CreateUserRequest } from '../dto/create-user.request'; +import { CreateUserRequest } from '../dtos/create-user.request'; import { User } from '../entities/user'; @CommandHandler(CreateUserCommand) diff --git a/src/modules/users/domain/usecases/update-user.usecase.ts b/src/modules/users/domain/usecases/update-user.usecase.ts index 3605913..10637da 100644 --- a/src/modules/users/domain/usecases/update-user.usecase.ts +++ b/src/modules/users/domain/usecases/update-user.usecase.ts @@ -3,7 +3,7 @@ import { InjectMapper } from '@automapper/nestjs'; import { CommandHandler } from '@nestjs/cqrs'; import { UsersRepository } from '../../adapters/secondaries/users.repository'; import { UpdateUserCommand } from '../../commands/update-user.command'; -import { UpdateUserRequest } from '../dto/update-user.request'; +import { UpdateUserRequest } from '../dtos/update-user.request'; import { User } from '../entities/user'; @CommandHandler(UpdateUserCommand) diff --git a/src/modules/users/mappers/user.profile.ts b/src/modules/users/mappers/user.profile.ts index b681625..8247598 100644 --- a/src/modules/users/mappers/user.profile.ts +++ b/src/modules/users/mappers/user.profile.ts @@ -2,8 +2,8 @@ import { createMap, forMember, ignore, Mapper } from '@automapper/core'; import { AutomapperProfile, InjectMapper } from '@automapper/nestjs'; import { Injectable } from '@nestjs/common'; import { UserPresenter } from '../adapters/primaries/user.presenter'; -import { CreateUserRequest } from '../domain/dto/create-user.request'; -import { UpdateUserRequest } from '../domain/dto/update-user.request'; +import { CreateUserRequest } from '../domain/dtos/create-user.request'; +import { UpdateUserRequest } from '../domain/dtos/update-user.request'; import { User } from '../domain/entities/user'; @Injectable() diff --git a/src/modules/users/queries/find-all-users.query.ts b/src/modules/users/queries/find-all-users.query.ts index f33ecb8..66e5483 100644 --- a/src/modules/users/queries/find-all-users.query.ts +++ b/src/modules/users/queries/find-all-users.query.ts @@ -1,4 +1,4 @@ -import { FindAllUsersRequest } from '../domain/dto/find-all-users.request'; +import { FindAllUsersRequest } from '../domain/dtos/find-all-users.request'; export class FindAllUsersQuery { page: number; diff --git a/src/modules/users/tests/unit/create-user.usecase.spec.ts b/src/modules/users/tests/unit/create-user.usecase.spec.ts index 749a703..ec1b9ea 100644 --- a/src/modules/users/tests/unit/create-user.usecase.spec.ts +++ b/src/modules/users/tests/unit/create-user.usecase.spec.ts @@ -3,7 +3,7 @@ import { AutomapperModule } from '@automapper/nestjs'; import { Test, TestingModule } from '@nestjs/testing'; import { UsersRepository } from '../../adapters/secondaries/users.repository'; import { CreateUserCommand } from '../../commands/create-user.command'; -import { CreateUserRequest } from '../../domain/dto/create-user.request'; +import { CreateUserRequest } from '../../domain/dtos/create-user.request'; import { User } from '../../domain/entities/user'; import { CreateUserUseCase } from '../../domain/usecases/create-user.usecase'; import { UserProfile } from '../../mappers/user.profile'; diff --git a/src/modules/users/tests/unit/update-user.usecase.spec.ts b/src/modules/users/tests/unit/update-user.usecase.spec.ts index 140d340..0c631db 100644 --- a/src/modules/users/tests/unit/update-user.usecase.spec.ts +++ b/src/modules/users/tests/unit/update-user.usecase.spec.ts @@ -3,7 +3,7 @@ import { AutomapperModule } from '@automapper/nestjs'; import { Test, TestingModule } from '@nestjs/testing'; import { UsersRepository } from '../../adapters/secondaries/users.repository'; import { UpdateUserCommand } from '../../commands/update-user.command'; -import { UpdateUserRequest } from '../../domain/dto/update-user.request'; +import { UpdateUserRequest } from '../../domain/dtos/update-user.request'; import { User } from '../../domain/entities/user'; import { UpdateUserUseCase } from '../../domain/usecases/update-user.usecase'; import { UserProfile } from '../../mappers/user.profile';