diff --git a/src/flight/src/aircraft/features/v1/create-aircraft/create-aircraft.ts b/src/flight/src/aircraft/features/v1/create-aircraft/create-aircraft.ts index 4e6f944..cd40ba7 100644 --- a/src/flight/src/aircraft/features/v1/create-aircraft/create-aircraft.ts +++ b/src/flight/src/aircraft/features/v1/create-aircraft/create-aircraft.ts @@ -1,6 +1,5 @@ import Joi from 'joi'; import {IAircraftRepository} from '../../../../data/repositories/aircraftRepository'; -import mapper from '../../../mappings'; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Body, ConflictException, Controller, HttpStatus, Inject, Post, Res, UseGuards} from "@nestjs/common"; import {AircraftDto} from "../../../dtos/aircraft.dto"; @@ -10,6 +9,7 @@ import {Aircraft} from "../../../entities/aircraft.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; import {AircraftCreated} from "building-blocks/contracts/flight.contract"; +import mapper from "../../../mappings"; export class CreateAircraft { model: string; diff --git a/src/flight/src/airport/features/v1/create-airport/create-airport.ts b/src/flight/src/airport/features/v1/create-airport/create-airport.ts index cafc3a7..1691cd1 100644 --- a/src/flight/src/airport/features/v1/create-airport/create-airport.ts +++ b/src/flight/src/airport/features/v1/create-airport/create-airport.ts @@ -1,6 +1,5 @@ import Joi from 'joi'; import {IAirportRepository} from '../../../../data/repositories/airportRepository'; -import mapper from '../../../../aircraft/mappings'; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Body, ConflictException, Controller, HttpStatus, Inject, Post, Res, UseGuards} from "@nestjs/common"; import {CommandBus, CommandHandler, ICommandHandler} from "@nestjs/cqrs"; @@ -10,6 +9,7 @@ import {Airport} from "../../../entities/airport.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; import {AirportCreated} from "building-blocks/contracts/flight.contract"; +import mapper from "../../../mappings"; export class CreateAirport { code: string; diff --git a/src/flight/src/flight/features/v1/create-flight/create-flight.ts b/src/flight/src/flight/features/v1/create-flight/create-flight.ts index 7534435..b898acc 100644 --- a/src/flight/src/flight/features/v1/create-flight/create-flight.ts +++ b/src/flight/src/flight/features/v1/create-flight/create-flight.ts @@ -1,5 +1,4 @@ import Joi from 'joi'; -import mapper from '../../../../aircraft/mappings'; import {FlightDto} from '../../../dtos/flight.dto'; import {IFlightRepository} from '../../../../data/repositories/flightRepository'; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; @@ -11,6 +10,7 @@ import {Flight} from "../../../entities/flight.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; import {FlightCreated} from "building-blocks/contracts/flight.contract"; +import mapper from "../../../mappings"; export class CreateFlight { flightNumber: string; diff --git a/src/flight/src/flight/features/v1/get-flight-by-id/get-flight-by-id.ts b/src/flight/src/flight/features/v1/get-flight-by-id/get-flight-by-id.ts index dc6a614..fadffc6 100644 --- a/src/flight/src/flight/features/v1/get-flight-by-id/get-flight-by-id.ts +++ b/src/flight/src/flight/features/v1/get-flight-by-id/get-flight-by-id.ts @@ -1,13 +1,13 @@ import Joi from 'joi'; import {FlightDto} from '../../../dtos/flight.dto'; import {IFlightRepository} from '../../../../data/repositories/flightRepository'; -import mapper from '../../../mappings'; import {ApiBearerAuth, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Controller, Get, Inject, NotFoundException, Query, UseGuards} from "@nestjs/common"; import {IQueryHandler, QueryBus, QueryHandler} from "@nestjs/cqrs"; import {Flight} from "../../../entities/flight.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; +import mapper from "../../../mappings"; export class GetFlightById { id: number; diff --git a/src/flight/src/seat/features/v1/create-seat/create-seat.ts b/src/flight/src/seat/features/v1/create-seat/create-seat.ts index 70613d5..80d97bf 100644 --- a/src/flight/src/seat/features/v1/create-seat/create-seat.ts +++ b/src/flight/src/seat/features/v1/create-seat/create-seat.ts @@ -1,5 +1,4 @@ import Joi from 'joi'; -import mapper from '../../../../aircraft/mappings'; import {ISeatRepository} from '../../../../data/repositories/seatRepository'; import {IFlightRepository} from '../../../../data/repositories/flightRepository'; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; @@ -13,6 +12,7 @@ import {Seat} from "../../../entities/seat.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; import {SeatCreated} from "building-blocks/contracts/flight.contract"; +import mapper from "../../../mappings"; export class CreateSeat { seatNumber: string; diff --git a/src/flight/src/seat/features/v1/get-available-seats/get-available-seats.ts b/src/flight/src/seat/features/v1/get-available-seats/get-available-seats.ts index 594f6fd..eaff9c1 100644 --- a/src/flight/src/seat/features/v1/get-available-seats/get-available-seats.ts +++ b/src/flight/src/seat/features/v1/get-available-seats/get-available-seats.ts @@ -1,5 +1,4 @@ import Joi from 'joi'; -import mapper from '../../../mappings'; import { ISeatRepository } from '../../../../data/repositories/seatRepository'; import {ApiBearerAuth, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Controller, Get, Inject, Post, Query, UseGuards} from "@nestjs/common"; @@ -8,6 +7,7 @@ import {SeatDto} from "../../../dtos/seat.dto"; import {Seat} from "../../../entities/seat.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; +import mapper from "../../../mappings"; export class GetAvailableSeats { flightId: number; diff --git a/src/flight/src/seat/features/v1/reserve-seat/reserve-seat.ts b/src/flight/src/seat/features/v1/reserve-seat/reserve-seat.ts index e0b6e6e..eeb7aa8 100644 --- a/src/flight/src/seat/features/v1/reserve-seat/reserve-seat.ts +++ b/src/flight/src/seat/features/v1/reserve-seat/reserve-seat.ts @@ -1,12 +1,10 @@ import Joi from 'joi'; -import mapper from '../../../../aircraft/mappings'; import {ISeatRepository} from '../../../../data/repositories/seatRepository'; import {IFlightRepository} from '../../../../data/repositories/flightRepository'; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Body, Controller, HttpStatus, Inject, NotFoundException, Post, Res, UseGuards} from "@nestjs/common"; import {Response} from "express"; import {CommandBus, CommandHandler, ICommandHandler} from "@nestjs/cqrs"; -import {SeatDto} from "../../../dtos/seat.dto"; import {Seat} from "../../../entities/seat.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; diff --git a/src/identity/src/auth/auth.module.ts b/src/identity/src/auth/auth.module.ts index 3cb4ddd..68bdaa0 100644 --- a/src/identity/src/auth/auth.module.ts +++ b/src/identity/src/auth/auth.module.ts @@ -5,9 +5,9 @@ import {Token} from "../auth/entities/token.entity"; import {AuthRepository} from "../data/repositories/auth.repository"; import {LoginController, LoginHandler} from "./features/v1/login/login"; import {LogoutController, LogoutHandler} from "./features/v1/logout/logout"; -import {RefreshTokenController, RefreshTokenHandler} from "./features/v1/refreshToken/refresh-token"; -import {GenerateTokenHandler} from "./features/v1/generateToken/generate-token"; -import {ValidateTokenHandler} from "./features/v1/validateToken/validate-token"; +import {RefreshTokenController, RefreshTokenHandler} from "./features/v1/refresh-token/refresh-token"; +import {GenerateTokenHandler} from "./features/v1/generate-token/generate-token"; +import {ValidateTokenHandler} from "./features/v1/validate-token/validate-token"; import {User} from "../user/entities/user.entity"; import {UserRepository} from "../data/repositories/user.repository"; import {RabbitmqModule} from "building-blocks/rabbitmq/rabbitmq.module"; diff --git a/src/identity/src/auth/features/v1/generateToken/generate-token.ts b/src/identity/src/auth/features/v1/generate-token/generate-token.ts similarity index 100% rename from src/identity/src/auth/features/v1/generateToken/generate-token.ts rename to src/identity/src/auth/features/v1/generate-token/generate-token.ts diff --git a/src/identity/src/auth/features/v1/login/login.ts b/src/identity/src/auth/features/v1/login/login.ts index 8b927f4..78e58c6 100644 --- a/src/identity/src/auth/features/v1/login/login.ts +++ b/src/identity/src/auth/features/v1/login/login.ts @@ -1,5 +1,5 @@ import Joi from 'joi'; -import {GenerateToken} from '../generateToken/generate-token'; +import {GenerateToken} from '../generate-token/generate-token'; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Body, Controller, Get, HttpStatus, Inject, Post, UseGuards} from "@nestjs/common"; import {AuthDto} from "../../../dtos/auth.dto"; diff --git a/src/identity/src/auth/features/v1/refreshToken/refresh-token.ts b/src/identity/src/auth/features/v1/refresh-token/refresh-token.ts similarity index 95% rename from src/identity/src/auth/features/v1/refreshToken/refresh-token.ts rename to src/identity/src/auth/features/v1/refresh-token/refresh-token.ts index b27391c..eea5673 100644 --- a/src/identity/src/auth/features/v1/refreshToken/refresh-token.ts +++ b/src/identity/src/auth/features/v1/refresh-token/refresh-token.ts @@ -1,5 +1,5 @@ import Joi from 'joi'; -import {GenerateToken} from '../generateToken/generate-token'; +import {GenerateToken} from '../generate-token/generate-token'; import {ApiBearerAuth, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Body, Controller, Inject, Post, Query, UnauthorizedException} from "@nestjs/common"; import {CommandBus, CommandHandler, ICommandHandler} from "@nestjs/cqrs"; @@ -7,7 +7,7 @@ import {AuthDto} from "../../../dtos/auth.dto"; import {IAuthRepository} from "../../../../data/repositories/auth.repository"; import {IUserRepository} from "../../../../data/repositories/user.repository"; import {TokenType} from "../../../enums/token-type.enum"; -import {ValidateToken} from "../validateToken/validate-token"; +import {ValidateToken} from "../validate-token/validate-token"; export class RefreshToken { refreshToken: string; diff --git a/src/identity/src/auth/features/v1/validateToken/validate-token.ts b/src/identity/src/auth/features/v1/validate-token/validate-token.ts similarity index 100% rename from src/identity/src/auth/features/v1/validateToken/validate-token.ts rename to src/identity/src/auth/features/v1/validate-token/validate-token.ts diff --git a/src/identity/src/user/features/v1/createUser/create-user.ts b/src/identity/src/user/features/v1/create-user/create-user.ts similarity index 98% rename from src/identity/src/user/features/v1/createUser/create-user.ts rename to src/identity/src/user/features/v1/create-user/create-user.ts index c4751f8..89d01a4 100644 --- a/src/identity/src/user/features/v1/createUser/create-user.ts +++ b/src/identity/src/user/features/v1/create-user/create-user.ts @@ -1,5 +1,4 @@ import {UserDto} from '../../../dtos/user.dto'; -import mapper from '../../../mapping'; import {Role} from "../../../enums/role.enum"; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Body, ConflictException, Controller, HttpStatus, Inject, Post, Res, UseGuards} from "@nestjs/common"; @@ -13,6 +12,7 @@ import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; import {password} from "building-blocks/utils/validation"; import {UserCreated} from "building-blocks/contracts/identity.contract"; import {encryptPassword} from "building-blocks/utils/encryption"; +import mapper from "../../../mapping"; export class CreateUser { email: string; diff --git a/src/identity/src/user/features/v1/deleteUserById/delete-user-by-id.ts b/src/identity/src/user/features/v1/delete-user-by-id/delete-user-by-id.ts similarity index 98% rename from src/identity/src/user/features/v1/deleteUserById/delete-user-by-id.ts rename to src/identity/src/user/features/v1/delete-user-by-id/delete-user-by-id.ts index a28e482..77ff31d 100644 --- a/src/identity/src/user/features/v1/deleteUserById/delete-user-by-id.ts +++ b/src/identity/src/user/features/v1/delete-user-by-id/delete-user-by-id.ts @@ -1,6 +1,5 @@ import {UserDto} from '../../../dtos/user.dto'; import Joi from 'joi'; -import mapper from '../../../mapping'; import {ApiBearerAuth, ApiResponse, ApiTags} from "@nestjs/swagger"; import {CommandBus, CommandHandler, ICommandHandler} from "@nestjs/cqrs"; import {Controller, Delete, HttpStatus, Inject, NotFoundException, Query, Res, UseGuards} from "@nestjs/common"; @@ -10,6 +9,7 @@ import {User} from "../../../entities/user.entity"; import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; import {UserDeleted} from "building-blocks/contracts/identity.contract"; +import mapper from "../../../mapping"; export class DeleteUserById { id: number; diff --git a/src/identity/src/user/features/v1/getUserById/get-user-by-id.ts b/src/identity/src/user/features/v1/get-user-by-id/get-user-by-id.ts similarity index 98% rename from src/identity/src/user/features/v1/getUserById/get-user-by-id.ts rename to src/identity/src/user/features/v1/get-user-by-id/get-user-by-id.ts index 395dff9..d9c93c2 100644 --- a/src/identity/src/user/features/v1/getUserById/get-user-by-id.ts +++ b/src/identity/src/user/features/v1/get-user-by-id/get-user-by-id.ts @@ -1,12 +1,12 @@ import {UserDto} from '../../../dtos/user.dto'; import Joi from 'joi'; -import mapper from '../../../mapping'; import {ApiBearerAuth, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Controller, Get, Inject, NotFoundException, Param, Query, UseGuards} from "@nestjs/common"; import {IQueryHandler, QueryBus, QueryHandler} from "@nestjs/cqrs"; import {IUserRepository} from "../../../../data/repositories/user.repository"; import {User} from "../../../entities/user.entity"; import {JwtGuard} from "../../../../../../building-blocks/passport/jwt.guard"; +import mapper from "../../../mapping"; export class GetUserById { id: number; diff --git a/src/identity/src/user/features/v1/getUsers/get-users.ts b/src/identity/src/user/features/v1/get-users/get-users.ts similarity index 98% rename from src/identity/src/user/features/v1/getUsers/get-users.ts rename to src/identity/src/user/features/v1/get-users/get-users.ts index ded2715..e6bed48 100644 --- a/src/identity/src/user/features/v1/getUsers/get-users.ts +++ b/src/identity/src/user/features/v1/get-users/get-users.ts @@ -1,6 +1,5 @@ import {UserDto} from '../../../dtos/user.dto'; import Joi from 'joi'; -import mapper from '../../../mapping'; import {ApiBearerAuth, ApiQuery, ApiResponse, ApiTags} from "@nestjs/swagger"; import {Controller, Get, Inject, ParseBoolPipe, Query, UseGuards} from "@nestjs/common"; import {IQueryHandler, QueryBus, QueryHandler} from "@nestjs/cqrs"; @@ -8,6 +7,7 @@ import {IUserRepository} from "../../../../data/repositories/user.repository"; import {User} from "../../../entities/user.entity"; import {JwtGuard} from "../../../../../../building-blocks/passport/jwt.guard"; import {PagedResult} from "building-blocks/types/pagination/paged-result"; +import mapper from "../../../mapping"; export class GetUsers { page = 1; diff --git a/src/identity/src/user/features/v1/updateUser/update-user.ts b/src/identity/src/user/features/v1/update-user/update-user.ts similarity index 97% rename from src/identity/src/user/features/v1/updateUser/update-user.ts rename to src/identity/src/user/features/v1/update-user/update-user.ts index 8bbe271..0c3f9cf 100644 --- a/src/identity/src/user/features/v1/updateUser/update-user.ts +++ b/src/identity/src/user/features/v1/update-user/update-user.ts @@ -1,5 +1,3 @@ -import {UserDto} from '../../../dtos/user.dto'; -import mapper from '../../../mapping'; import Joi from 'joi'; import {Role} from "../../../enums/role.enum"; import {ApiBearerAuth, ApiProperty, ApiResponse, ApiTags} from "@nestjs/swagger"; @@ -11,7 +9,6 @@ import { NotFoundException, Param, Put, - Query, Res, UseGuards } from "@nestjs/common"; diff --git a/src/identity/src/user/user.module.ts b/src/identity/src/user/user.module.ts index f30e5c9..9534cc5 100644 --- a/src/identity/src/user/user.module.ts +++ b/src/identity/src/user/user.module.ts @@ -2,15 +2,15 @@ import {Module} from '@nestjs/common'; import {CqrsModule} from '@nestjs/cqrs'; import {TypeOrmModule} from '@nestjs/typeorm'; import {User} from "../user/entities/user.entity"; -import {CreateUserController, CreateUserHandler} from "./features/v1/createUser/create-user"; +import {CreateUserController, CreateUserHandler} from "./features/v1/create-user/create-user"; import {UserRepository} from "../data/repositories/user.repository"; import { DeleteUserByIdController, DeleteUserByIdHandler -} from "./features/v1/deleteUserById/delete-user-by-id"; -import {UpdateUserController, UpdateUserHandler} from "./features/v1/updateUser/update-user"; -import {GetUsersController, GetUsersHandler} from "./features/v1/getUsers/get-users"; -import {GetUserByIdController, GetUserByIdHandler} from "./features/v1/getUserById/get-user-by-id"; +} from "./features/v1/delete-user-by-id/delete-user-by-id"; +import {UpdateUserController, UpdateUserHandler} from "./features/v1/update-user/update-user"; +import {GetUsersController, GetUsersHandler} from "./features/v1/get-users/get-users"; +import {GetUserByIdController, GetUserByIdHandler} from "./features/v1/get-user-by-id/get-user-by-id"; import {Token} from "../auth/entities/token.entity"; import {AuthRepository} from "../data/repositories/auth.repository"; import {RabbitmqModule} from "building-blocks/rabbitmq/rabbitmq.module"; diff --git a/src/identity/test/shared/fakes/user/fake-create-user-request.dto.ts b/src/identity/test/shared/fakes/user/fake-create-user-request.dto.ts index f062414..dbdbc3b 100644 --- a/src/identity/test/shared/fakes/user/fake-create-user-request.dto.ts +++ b/src/identity/test/shared/fakes/user/fake-create-user-request.dto.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker'; import {Role} from "../../../../src/user/enums/role.enum"; -import {CreateUserRequestDto} from "../../../../src/user/features/v1/createUser/create-user"; +import {CreateUserRequestDto} from "../../../../src/user/features/v1/create-user/create-user"; export class FakeCreateUserRequestDto { static generate(): CreateUserRequestDto { diff --git a/src/identity/test/shared/fakes/user/fake-create-user.ts b/src/identity/test/shared/fakes/user/fake-create-user.ts index 3401c13..afce57c 100644 --- a/src/identity/test/shared/fakes/user/fake-create-user.ts +++ b/src/identity/test/shared/fakes/user/fake-create-user.ts @@ -1,7 +1,7 @@ import { faker } from '@faker-js/faker'; import {User} from "../../../../src/user/entities/user.entity"; import {Role} from "../../../../src/user/enums/role.enum"; -import {CreateUser} from "../../../../src/user/features/v1/createUser/create-user"; +import {CreateUser} from "../../../../src/user/features/v1/create-user/create-user"; export class FakeCreateUser { static generate(user?: User): CreateUser { diff --git a/src/identity/test/unit-test/user/features/create-user.test.ts b/src/identity/test/unit-test/user/features/create-user.test.ts index 1af6211..9020a55 100644 --- a/src/identity/test/unit-test/user/features/create-user.test.ts +++ b/src/identity/test/unit-test/user/features/create-user.test.ts @@ -7,7 +7,7 @@ import {IUserRepository} from "../../../../src/data/repositories/user.repository import {UserDto} from "../../../../src/user/dtos/user.dto"; import {FakeCreateUser} from "../../../shared/fakes/user/fake-create-user"; import {IRabbitmqPublisher} from "building-blocks/rabbitmq/rabbitmq-publisher"; -import {CreateUserHandler} from "../../../../src/user/features/v1/createUser/create-user"; +import {CreateUserHandler} from "../../../../src/user/features/v1/create-user/create-user"; describe('unit test for create user', () => { let createUserHandler: CreateUserHandler; diff --git a/src/passenger/src/passenger/features/v1/get-passengers/get-passengers.ts b/src/passenger/src/passenger/features/v1/get-passengers/get-passengers.ts index 22b16fd..3824cde 100644 --- a/src/passenger/src/passenger/features/v1/get-passengers/get-passengers.ts +++ b/src/passenger/src/passenger/features/v1/get-passengers/get-passengers.ts @@ -6,8 +6,8 @@ import {JwtGuard} from "building-blocks/passport/jwt.guard"; import {PassengerDto} from "../../../dtos/passenger.dto"; import {IPassengerRepository} from "../../../../data/repositories/passenger.repository"; import {PagedResult} from "building-blocks/types/pagination/paged-result"; -import mapper from "../../../mappings"; import {Passenger} from "../../../entities/passenger.entity"; +import mapper from "../../../mappings"; export class GetPassengers { page = 1;