From 731d9aa73cdf0b35c94331e2bf82051e9dce70f0 Mon Sep 17 00:00:00 2001 From: sbriat Date: Thu, 29 Jun 2023 16:47:58 +0200 Subject: [PATCH] refactor application core --- src/modules/ad/ad.mapper.ts | 14 +++++++------- src/modules/ad/ad.module.ts | 8 ++++---- .../commands/create-ad/create-ad.command.ts | 2 +- .../commands/create-ad/create-ad.service.ts | 10 +++++----- ...sage-when-ad-is-created.domain-event-handler.ts | 2 +- ...sage-when-ad-is-created.domain-event-handler.ts | 2 +- .../{ => application}/ports/ad.repository.port.ts | 2 +- .../ports/default-params-provider.port.ts | 0 .../{ => application}/ports/default-params.type.ts | 0 .../{ => application}/ports/time-converter.port.ts | 0 .../ports/timezone-finder.port.ts | 0 .../find-ad-by-id/find-ad-by-id.query-handler.ts | 2 +- .../queries/find-ad-by-id/find-ad-by-id.query.ts | 0 .../ad/core/{ => application}/types/address.ts | 0 .../ad/core/{ => application}/types/coordinates.ts | 0 .../{ => application}/types/margin-durations.ts | 0 .../ad/core/{ => application}/types/schedule.ts | 0 .../ad/core/{ => application}/types/waypoint.ts | 0 src/modules/ad/core/{ => domain}/ad.entity.ts | 0 src/modules/ad/core/{ => domain}/ad.errors.ts | 0 src/modules/ad/core/{ => domain}/ad.types.ts | 0 .../events/ad-created.domain-events.ts | 0 .../value-objects/address.value-object.ts | 0 .../value-objects/coordinates.value-object.ts | 0 .../value-objects/margin-durations.value-object.ts | 0 .../value-objects/schedule.value-object.ts | 0 .../value-objects/waypoint.value-object.ts | 0 src/modules/ad/infrastructure/ad.repository.ts | 4 ++-- .../ad/infrastructure/default-params-provider.ts | 4 ++-- src/modules/ad/infrastructure/time-converter.ts | 2 +- src/modules/ad/infrastructure/timezone-finder.ts | 2 +- src/modules/ad/interface/dtos/ad.response.dto.ts | 2 +- .../grpc-controllers/create-ad.grpc.controller.ts | 4 ++-- .../grpc-controllers/dtos/create-ad.request.dto.ts | 2 +- .../dtos/transformers/int-to-frequency.ts | 2 +- .../find-ad-by-id.grpc.controller.ts | 4 ++-- src/modules/ad/tests/unit/ad.mapper.spec.ts | 10 +++++----- src/modules/ad/tests/unit/core/ad.entity.spec.ts | 8 ++++---- .../tests/unit/core/address.value-object.spec.ts | 2 +- .../unit/core/coordinates.value-object.spec.ts | 2 +- .../ad/tests/unit/core/create-ad.service.spec.ts | 12 ++++++------ .../unit/core/find-ad-by-id.query-handler.spec.ts | 12 ++++++------ .../core/margin-durations.value-object.spec.ts | 2 +- ...when-ad-is-created.domain-event-handler.spec.ts | 6 +++--- ...when-ad-is-created.domain-event-handler.spec.ts | 6 +++--- .../tests/unit/core/schedule.value-object.spec.ts | 2 +- .../tests/unit/core/waypoint.value-object.spec.ts | 2 +- .../unit/infrastructure/ad.repository.spec.ts | 6 +++--- .../infrastructure/default-param.provider.spec.ts | 2 +- .../interface/create-ad.grpc.controller.spec.ts | 4 ++-- .../find-ad-by-id.grpc.controller.spec.ts | 2 +- .../tests/unit/interface/int-to-frequency.spec.ts | 2 +- .../ports/check-repository.port.ts | 0 .../repositories.health-indicator.usecase.ts | 2 +- src/modules/health/health.module.ts | 2 +- .../grpc-controllers/health.grpc.controller.ts | 2 +- .../http-controllers/health.http.controller.ts | 2 +- .../tests/unit/health.grpc.controller.spec.ts | 2 +- .../tests/unit/health.http.controller.spec.ts | 2 +- .../repositories.health-indicator.usecase.spec.ts | 2 +- 60 files changed, 81 insertions(+), 81 deletions(-) rename src/modules/ad/core/{ => application}/commands/create-ad/create-ad.command.ts (95%) rename src/modules/ad/core/{ => application}/commands/create-ad/create-ad.service.ts (87%) rename src/modules/ad/core/{ => application}/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler.ts (88%) rename src/modules/ad/core/{ => application}/event-handlers/publish-message-when-ad-is-created.domain-event-handler.ts (88%) rename src/modules/ad/core/{ => application}/ports/ad.repository.port.ts (66%) rename src/modules/ad/core/{ => application}/ports/default-params-provider.port.ts (100%) rename src/modules/ad/core/{ => application}/ports/default-params.type.ts (100%) rename src/modules/ad/core/{ => application}/ports/time-converter.port.ts (100%) rename src/modules/ad/core/{ => application}/ports/timezone-finder.port.ts (100%) rename src/modules/ad/core/{ => application}/queries/find-ad-by-id/find-ad-by-id.query-handler.ts (92%) rename src/modules/ad/core/{ => application}/queries/find-ad-by-id/find-ad-by-id.query.ts (100%) rename src/modules/ad/core/{ => application}/types/address.ts (100%) rename src/modules/ad/core/{ => application}/types/coordinates.ts (100%) rename src/modules/ad/core/{ => application}/types/margin-durations.ts (100%) rename src/modules/ad/core/{ => application}/types/schedule.ts (100%) rename src/modules/ad/core/{ => application}/types/waypoint.ts (100%) rename src/modules/ad/core/{ => domain}/ad.entity.ts (100%) rename src/modules/ad/core/{ => domain}/ad.errors.ts (100%) rename src/modules/ad/core/{ => domain}/ad.types.ts (100%) rename src/modules/ad/core/{ => domain}/events/ad-created.domain-events.ts (100%) rename src/modules/ad/core/{ => domain}/value-objects/address.value-object.ts (100%) rename src/modules/ad/core/{ => domain}/value-objects/coordinates.value-object.ts (100%) rename src/modules/ad/core/{ => domain}/value-objects/margin-durations.value-object.ts (100%) rename src/modules/ad/core/{ => domain}/value-objects/schedule.value-object.ts (100%) rename src/modules/ad/core/{ => domain}/value-objects/waypoint.value-object.ts (100%) rename src/modules/health/core/{ => aplication}/ports/check-repository.port.ts (100%) rename src/modules/health/core/{ => aplication}/usecases/repositories.health-indicator.usecase.ts (94%) diff --git a/src/modules/ad/ad.mapper.ts b/src/modules/ad/ad.mapper.ts index 61f75d4..66ee22f 100644 --- a/src/modules/ad/ad.mapper.ts +++ b/src/modules/ad/ad.mapper.ts @@ -1,24 +1,24 @@ import { Mapper } from '@libs/ddd'; import { AdResponseDto } from './interface/dtos/ad.response.dto'; import { Inject, Injectable } from '@nestjs/common'; -import { AdEntity } from './core/ad.entity'; +import { AdEntity } from './core/domain/ad.entity'; import { AdWriteModel, AdReadModel, WaypointModel, } from './infrastructure/ad.repository'; -import { Frequency } from './core/ad.types'; -import { WaypointProps } from './core/value-objects/waypoint.value-object'; +import { Frequency } from './core/domain/ad.types'; +import { WaypointProps } from './core/domain/value-objects/waypoint.value-object'; import { v4 } from 'uuid'; import { PARAMS_PROVIDER, TIMEZONE_FINDER, TIME_CONVERTER, } from './ad.di-tokens'; -import { TimezoneFinderPort } from './core/ports/timezone-finder.port'; -import { DefaultParamsProviderPort } from './core/ports/default-params-provider.port'; -import { DefaultParams } from './core/ports/default-params.type'; -import { TimeConverterPort } from './core/ports/time-converter.port'; +import { TimezoneFinderPort } from './core/application/ports/timezone-finder.port'; +import { DefaultParamsProviderPort } from './core/application/ports/default-params-provider.port'; +import { DefaultParams } from './core/application/ports/default-params.type'; +import { TimeConverterPort } from './core/application/ports/time-converter.port'; /** * Mapper constructs objects that are used in different layers: diff --git a/src/modules/ad/ad.module.ts b/src/modules/ad/ad.module.ts index 5a5e3ce..163cdc9 100644 --- a/src/modules/ad/ad.module.ts +++ b/src/modules/ad/ad.module.ts @@ -16,14 +16,14 @@ import { AdRepository } from './infrastructure/ad.repository'; import { DefaultParamsProvider } from './infrastructure/default-params-provider'; import { MessagePublisher } from './infrastructure/message-publisher'; import { AdMapper } from './ad.mapper'; -import { CreateAdService } from './core/commands/create-ad/create-ad.service'; +import { CreateAdService } from './core/application/commands/create-ad/create-ad.service'; import { TimezoneFinder } from './infrastructure/timezone-finder'; import { PrismaService } from '@libs/db/prisma.service'; import { TimeConverter } from './infrastructure/time-converter'; import { FindAdByIdGrpcController } from './interface/grpc-controllers/find-ad-by-id.grpc.controller'; -import { FindAdByIdQueryHandler } from './core/queries/find-ad-by-id/find-ad-by-id.query-handler'; -import { PublishMessageWhenAdIsCreatedDomainEventHandler } from './core/event-handlers/publish-message-when-ad-is-created.domain-event-handler'; -import { PublishLogMessageWhenAdIsCreatedDomainEventHandler } from './core/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler'; +import { FindAdByIdQueryHandler } from './core/application/queries/find-ad-by-id/find-ad-by-id.query-handler'; +import { PublishMessageWhenAdIsCreatedDomainEventHandler } from './core/application/event-handlers/publish-message-when-ad-is-created.domain-event-handler'; +import { PublishLogMessageWhenAdIsCreatedDomainEventHandler } from './core/application/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler'; const grpcControllers = [CreateAdGrpcController, FindAdByIdGrpcController]; diff --git a/src/modules/ad/core/commands/create-ad/create-ad.command.ts b/src/modules/ad/core/application/commands/create-ad/create-ad.command.ts similarity index 95% rename from src/modules/ad/core/commands/create-ad/create-ad.command.ts rename to src/modules/ad/core/application/commands/create-ad/create-ad.command.ts index f67d0c4..b68de1b 100644 --- a/src/modules/ad/core/commands/create-ad/create-ad.command.ts +++ b/src/modules/ad/core/application/commands/create-ad/create-ad.command.ts @@ -1,8 +1,8 @@ import { Command, CommandProps } from '@libs/ddd'; -import { Frequency } from '@modules/ad/core/ad.types'; import { Schedule } from '../../types/schedule'; import { MarginDurations } from '../../types/margin-durations'; import { Waypoint } from '../../types/waypoint'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; export class CreateAdCommand extends Command { readonly userId: string; diff --git a/src/modules/ad/core/commands/create-ad/create-ad.service.ts b/src/modules/ad/core/application/commands/create-ad/create-ad.service.ts similarity index 87% rename from src/modules/ad/core/commands/create-ad/create-ad.service.ts rename to src/modules/ad/core/application/commands/create-ad/create-ad.service.ts index 1fc16fc..cfee514 100644 --- a/src/modules/ad/core/commands/create-ad/create-ad.service.ts +++ b/src/modules/ad/core/application/commands/create-ad/create-ad.service.ts @@ -1,15 +1,15 @@ import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; import { CreateAdCommand } from './create-ad.command'; -import { DefaultParams } from '@modules/ad/core/ports/default-params.type'; import { Inject } from '@nestjs/common'; import { AD_REPOSITORY, PARAMS_PROVIDER } from '@modules/ad/ad.di-tokens'; -import { AdRepositoryPort } from '@modules/ad/core/ports/ad.repository.port'; -import { DefaultParamsProviderPort } from '@modules/ad/core/ports/default-params-provider.port'; import { AggregateID } from '@libs/ddd'; -import { AdAlreadyExistsException } from '@modules/ad/core/ad.errors'; -import { AdEntity } from '@modules/ad/core/ad.entity'; +import { AdEntity } from '@modules/ad/core/domain/ad.entity'; import { ConflictException } from '@libs/exceptions'; import { Waypoint } from '../../types/waypoint'; +import { DefaultParams } from '../../ports/default-params.type'; +import { AdRepositoryPort } from '../../ports/ad.repository.port'; +import { DefaultParamsProviderPort } from '../../ports/default-params-provider.port'; +import { AdAlreadyExistsException } from '@modules/ad/core/domain/ad.errors'; @CommandHandler(CreateAdCommand) export class CreateAdService implements ICommandHandler { diff --git a/src/modules/ad/core/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler.ts b/src/modules/ad/core/application/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler.ts similarity index 88% rename from src/modules/ad/core/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler.ts rename to src/modules/ad/core/application/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler.ts index 7913c7b..0b14b4a 100644 --- a/src/modules/ad/core/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler.ts +++ b/src/modules/ad/core/application/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler.ts @@ -2,7 +2,7 @@ import { MessagePublisherPort } from '@libs/ports/message-publisher.port'; import { Inject, Injectable } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; import { MESSAGE_PUBLISHER } from '@src/app.constants'; -import { AdCreatedDomainEvent } from '../events/ad-created.domain-events'; +import { AdCreatedDomainEvent } from '../../domain/events/ad-created.domain-events'; @Injectable() export class PublishLogMessageWhenAdIsCreatedDomainEventHandler { diff --git a/src/modules/ad/core/event-handlers/publish-message-when-ad-is-created.domain-event-handler.ts b/src/modules/ad/core/application/event-handlers/publish-message-when-ad-is-created.domain-event-handler.ts similarity index 88% rename from src/modules/ad/core/event-handlers/publish-message-when-ad-is-created.domain-event-handler.ts rename to src/modules/ad/core/application/event-handlers/publish-message-when-ad-is-created.domain-event-handler.ts index 69e4d38..647af0b 100644 --- a/src/modules/ad/core/event-handlers/publish-message-when-ad-is-created.domain-event-handler.ts +++ b/src/modules/ad/core/application/event-handlers/publish-message-when-ad-is-created.domain-event-handler.ts @@ -2,7 +2,7 @@ import { MessagePublisherPort } from '@libs/ports/message-publisher.port'; import { Inject, Injectable } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; import { MESSAGE_PUBLISHER } from '@src/app.constants'; -import { AdCreatedDomainEvent } from '../events/ad-created.domain-events'; +import { AdCreatedDomainEvent } from '../../domain/events/ad-created.domain-events'; @Injectable() export class PublishMessageWhenAdIsCreatedDomainEventHandler { diff --git a/src/modules/ad/core/ports/ad.repository.port.ts b/src/modules/ad/core/application/ports/ad.repository.port.ts similarity index 66% rename from src/modules/ad/core/ports/ad.repository.port.ts rename to src/modules/ad/core/application/ports/ad.repository.port.ts index 93f8f77..43e00eb 100644 --- a/src/modules/ad/core/ports/ad.repository.port.ts +++ b/src/modules/ad/core/application/ports/ad.repository.port.ts @@ -1,4 +1,4 @@ import { RepositoryPort } from '@libs/ddd'; -import { AdEntity } from '../ad.entity'; +import { AdEntity } from '../../domain/ad.entity'; export type AdRepositoryPort = RepositoryPort; diff --git a/src/modules/ad/core/ports/default-params-provider.port.ts b/src/modules/ad/core/application/ports/default-params-provider.port.ts similarity index 100% rename from src/modules/ad/core/ports/default-params-provider.port.ts rename to src/modules/ad/core/application/ports/default-params-provider.port.ts diff --git a/src/modules/ad/core/ports/default-params.type.ts b/src/modules/ad/core/application/ports/default-params.type.ts similarity index 100% rename from src/modules/ad/core/ports/default-params.type.ts rename to src/modules/ad/core/application/ports/default-params.type.ts diff --git a/src/modules/ad/core/ports/time-converter.port.ts b/src/modules/ad/core/application/ports/time-converter.port.ts similarity index 100% rename from src/modules/ad/core/ports/time-converter.port.ts rename to src/modules/ad/core/application/ports/time-converter.port.ts diff --git a/src/modules/ad/core/ports/timezone-finder.port.ts b/src/modules/ad/core/application/ports/timezone-finder.port.ts similarity index 100% rename from src/modules/ad/core/ports/timezone-finder.port.ts rename to src/modules/ad/core/application/ports/timezone-finder.port.ts diff --git a/src/modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query-handler.ts b/src/modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query-handler.ts similarity index 92% rename from src/modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query-handler.ts rename to src/modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query-handler.ts index 547c572..b036085 100644 --- a/src/modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query-handler.ts +++ b/src/modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query-handler.ts @@ -3,7 +3,7 @@ import { FindAdByIdQuery } from './find-ad-by-id.query'; import { AD_REPOSITORY } from '@modules/ad/ad.di-tokens'; import { AdRepositoryPort } from '../../ports/ad.repository.port'; import { Inject } from '@nestjs/common'; -import { AdEntity } from '../../ad.entity'; +import { AdEntity } from '../../../domain/ad.entity'; @QueryHandler(FindAdByIdQuery) export class FindAdByIdQueryHandler implements IQueryHandler { diff --git a/src/modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query.ts b/src/modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query.ts similarity index 100% rename from src/modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query.ts rename to src/modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query.ts diff --git a/src/modules/ad/core/types/address.ts b/src/modules/ad/core/application/types/address.ts similarity index 100% rename from src/modules/ad/core/types/address.ts rename to src/modules/ad/core/application/types/address.ts diff --git a/src/modules/ad/core/types/coordinates.ts b/src/modules/ad/core/application/types/coordinates.ts similarity index 100% rename from src/modules/ad/core/types/coordinates.ts rename to src/modules/ad/core/application/types/coordinates.ts diff --git a/src/modules/ad/core/types/margin-durations.ts b/src/modules/ad/core/application/types/margin-durations.ts similarity index 100% rename from src/modules/ad/core/types/margin-durations.ts rename to src/modules/ad/core/application/types/margin-durations.ts diff --git a/src/modules/ad/core/types/schedule.ts b/src/modules/ad/core/application/types/schedule.ts similarity index 100% rename from src/modules/ad/core/types/schedule.ts rename to src/modules/ad/core/application/types/schedule.ts diff --git a/src/modules/ad/core/types/waypoint.ts b/src/modules/ad/core/application/types/waypoint.ts similarity index 100% rename from src/modules/ad/core/types/waypoint.ts rename to src/modules/ad/core/application/types/waypoint.ts diff --git a/src/modules/ad/core/ad.entity.ts b/src/modules/ad/core/domain/ad.entity.ts similarity index 100% rename from src/modules/ad/core/ad.entity.ts rename to src/modules/ad/core/domain/ad.entity.ts diff --git a/src/modules/ad/core/ad.errors.ts b/src/modules/ad/core/domain/ad.errors.ts similarity index 100% rename from src/modules/ad/core/ad.errors.ts rename to src/modules/ad/core/domain/ad.errors.ts diff --git a/src/modules/ad/core/ad.types.ts b/src/modules/ad/core/domain/ad.types.ts similarity index 100% rename from src/modules/ad/core/ad.types.ts rename to src/modules/ad/core/domain/ad.types.ts diff --git a/src/modules/ad/core/events/ad-created.domain-events.ts b/src/modules/ad/core/domain/events/ad-created.domain-events.ts similarity index 100% rename from src/modules/ad/core/events/ad-created.domain-events.ts rename to src/modules/ad/core/domain/events/ad-created.domain-events.ts diff --git a/src/modules/ad/core/value-objects/address.value-object.ts b/src/modules/ad/core/domain/value-objects/address.value-object.ts similarity index 100% rename from src/modules/ad/core/value-objects/address.value-object.ts rename to src/modules/ad/core/domain/value-objects/address.value-object.ts diff --git a/src/modules/ad/core/value-objects/coordinates.value-object.ts b/src/modules/ad/core/domain/value-objects/coordinates.value-object.ts similarity index 100% rename from src/modules/ad/core/value-objects/coordinates.value-object.ts rename to src/modules/ad/core/domain/value-objects/coordinates.value-object.ts diff --git a/src/modules/ad/core/value-objects/margin-durations.value-object.ts b/src/modules/ad/core/domain/value-objects/margin-durations.value-object.ts similarity index 100% rename from src/modules/ad/core/value-objects/margin-durations.value-object.ts rename to src/modules/ad/core/domain/value-objects/margin-durations.value-object.ts diff --git a/src/modules/ad/core/value-objects/schedule.value-object.ts b/src/modules/ad/core/domain/value-objects/schedule.value-object.ts similarity index 100% rename from src/modules/ad/core/value-objects/schedule.value-object.ts rename to src/modules/ad/core/domain/value-objects/schedule.value-object.ts diff --git a/src/modules/ad/core/value-objects/waypoint.value-object.ts b/src/modules/ad/core/domain/value-objects/waypoint.value-object.ts similarity index 100% rename from src/modules/ad/core/value-objects/waypoint.value-object.ts rename to src/modules/ad/core/domain/value-objects/waypoint.value-object.ts diff --git a/src/modules/ad/infrastructure/ad.repository.ts b/src/modules/ad/infrastructure/ad.repository.ts index 29a4dca..bd89fba 100644 --- a/src/modules/ad/infrastructure/ad.repository.ts +++ b/src/modules/ad/infrastructure/ad.repository.ts @@ -1,10 +1,10 @@ import { Injectable, Logger } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; -import { AdEntity } from '../core/ad.entity'; -import { AdRepositoryPort } from '../core/ports/ad.repository.port'; +import { AdEntity } from '../core/domain/ad.entity'; import { PrismaService } from '@libs/db/prisma.service'; import { AdMapper } from '../ad.mapper'; import { PrismaRepositoryBase } from '@libs/db/prisma-repository.base'; +import { AdRepositoryPort } from '../core/application/ports/ad.repository.port'; export type AdBaseModel = { uuid: string; diff --git a/src/modules/ad/infrastructure/default-params-provider.ts b/src/modules/ad/infrastructure/default-params-provider.ts index c27f5c1..58e8ca8 100644 --- a/src/modules/ad/infrastructure/default-params-provider.ts +++ b/src/modules/ad/infrastructure/default-params-provider.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; -import { DefaultParamsProviderPort } from '../core/ports/default-params-provider.port'; -import { DefaultParams } from '../core/ports/default-params.type'; +import { DefaultParamsProviderPort } from '../core/application/ports/default-params-provider.port'; +import { DefaultParams } from '../core/application/ports/default-params.type'; @Injectable() export class DefaultParamsProvider implements DefaultParamsProviderPort { diff --git a/src/modules/ad/infrastructure/time-converter.ts b/src/modules/ad/infrastructure/time-converter.ts index b94b14a..94de86f 100644 --- a/src/modules/ad/infrastructure/time-converter.ts +++ b/src/modules/ad/infrastructure/time-converter.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { TimeConverterPort } from '../core/ports/time-converter.port'; import { DateTime, TimeZone } from 'timezonecomplete'; +import { TimeConverterPort } from '../core/application/ports/time-converter.port'; @Injectable() export class TimeConverter implements TimeConverterPort { diff --git a/src/modules/ad/infrastructure/timezone-finder.ts b/src/modules/ad/infrastructure/timezone-finder.ts index be990b3..feb0b5a 100644 --- a/src/modules/ad/infrastructure/timezone-finder.ts +++ b/src/modules/ad/infrastructure/timezone-finder.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; -import { TimezoneFinderPort } from '../core/ports/timezone-finder.port'; import { find } from 'geo-tz'; +import { TimezoneFinderPort } from '../core/application/ports/timezone-finder.port'; @Injectable() export class TimezoneFinder implements TimezoneFinderPort { diff --git a/src/modules/ad/interface/dtos/ad.response.dto.ts b/src/modules/ad/interface/dtos/ad.response.dto.ts index 61ec321..6401451 100644 --- a/src/modules/ad/interface/dtos/ad.response.dto.ts +++ b/src/modules/ad/interface/dtos/ad.response.dto.ts @@ -1,5 +1,5 @@ import { ResponseBase } from '@libs/api/response.base'; -import { Frequency } from '@modules/ad/core/ad.types'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; export class AdResponseDto extends ResponseBase { userId: string; diff --git a/src/modules/ad/interface/grpc-controllers/create-ad.grpc.controller.ts b/src/modules/ad/interface/grpc-controllers/create-ad.grpc.controller.ts index 6a14291..215536f 100644 --- a/src/modules/ad/interface/grpc-controllers/create-ad.grpc.controller.ts +++ b/src/modules/ad/interface/grpc-controllers/create-ad.grpc.controller.ts @@ -2,12 +2,12 @@ import { Controller, UsePipes } from '@nestjs/common'; import { CommandBus } from '@nestjs/cqrs'; import { GrpcMethod, RpcException } from '@nestjs/microservices'; import { CreateAdRequestDto } from './dtos/create-ad.request.dto'; -import { CreateAdCommand } from '../../core/commands/create-ad/create-ad.command'; import { AggregateID } from '@libs/ddd'; -import { AdAlreadyExistsException } from '../../core/ad.errors'; import { IdResponse } from '@libs/api/id.response.dto'; import { RpcExceptionCode } from '@libs/exceptions/rpc-exception.codes.enum'; import { RpcValidationPipe } from '@libs/utils/pipes/rpc.validation-pipe'; +import { CreateAdCommand } from '@modules/ad/core/application/commands/create-ad/create-ad.command'; +import { AdAlreadyExistsException } from '@modules/ad/core/domain/ad.errors'; @UsePipes( new RpcValidationPipe({ diff --git a/src/modules/ad/interface/grpc-controllers/dtos/create-ad.request.dto.ts b/src/modules/ad/interface/grpc-controllers/dtos/create-ad.request.dto.ts index 6d07d97..005a44f 100644 --- a/src/modules/ad/interface/grpc-controllers/dtos/create-ad.request.dto.ts +++ b/src/modules/ad/interface/grpc-controllers/dtos/create-ad.request.dto.ts @@ -16,7 +16,7 @@ import { WaypointDto } from './waypoint.dto'; import { intToFrequency } from './transformers/int-to-frequency'; import { IsSchedule } from './validators/decorators/is-schedule.decorator'; import { HasValidPositionIndexes } from './validators/decorators/has-valid-position-indexes.decorator'; -import { Frequency } from '@modules/ad/core/ad.types'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; export class CreateAdRequestDto { @IsUUID(4) diff --git a/src/modules/ad/interface/grpc-controllers/dtos/transformers/int-to-frequency.ts b/src/modules/ad/interface/grpc-controllers/dtos/transformers/int-to-frequency.ts index 4ec6a89..bd707b7 100644 --- a/src/modules/ad/interface/grpc-controllers/dtos/transformers/int-to-frequency.ts +++ b/src/modules/ad/interface/grpc-controllers/dtos/transformers/int-to-frequency.ts @@ -1,4 +1,4 @@ -import { Frequency } from '@modules/ad/core/ad.types'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; export const intToFrequency = (frequencyAsInt: number): Frequency => { if (frequencyAsInt == 1) return Frequency.PUNCTUAL; diff --git a/src/modules/ad/interface/grpc-controllers/find-ad-by-id.grpc.controller.ts b/src/modules/ad/interface/grpc-controllers/find-ad-by-id.grpc.controller.ts index 37f937a..1862ea5 100644 --- a/src/modules/ad/interface/grpc-controllers/find-ad-by-id.grpc.controller.ts +++ b/src/modules/ad/interface/grpc-controllers/find-ad-by-id.grpc.controller.ts @@ -2,9 +2,9 @@ import { Controller, UsePipes } from '@nestjs/common'; import { QueryBus } from '@nestjs/cqrs'; import { GrpcMethod, RpcException } from '@nestjs/microservices'; import { FindAdByIdRequestDto } from './dtos/find-ad-by-id.request.dto'; -import { FindAdByIdQuery } from '@modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query'; +import { FindAdByIdQuery } from '@modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query'; import { AdResponseDto } from '../dtos/ad.response.dto'; -import { AdEntity } from '@modules/ad/core/ad.entity'; +import { AdEntity } from '@modules/ad/core/domain/ad.entity'; import { AdMapper } from '@modules/ad/ad.mapper'; import { NotFoundException } from '@libs/exceptions'; import { RpcExceptionCode } from '@libs/exceptions/rpc-exception.codes.enum'; diff --git a/src/modules/ad/tests/unit/ad.mapper.spec.ts b/src/modules/ad/tests/unit/ad.mapper.spec.ts index 2a6a13d..0a58eae 100644 --- a/src/modules/ad/tests/unit/ad.mapper.spec.ts +++ b/src/modules/ad/tests/unit/ad.mapper.spec.ts @@ -4,11 +4,11 @@ import { TIME_CONVERTER, } from '@modules/ad/ad.di-tokens'; import { AdMapper } from '@modules/ad/ad.mapper'; -import { AdEntity } from '@modules/ad/core/ad.entity'; -import { Frequency } from '@modules/ad/core/ad.types'; -import { DefaultParamsProviderPort } from '@modules/ad/core/ports/default-params-provider.port'; -import { TimeConverterPort } from '@modules/ad/core/ports/time-converter.port'; -import { TimezoneFinderPort } from '@modules/ad/core/ports/timezone-finder.port'; +import { AdEntity } from '@modules/ad/core/domain/ad.entity'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; +import { DefaultParamsProviderPort } from '@modules/ad/core/application/ports/default-params-provider.port'; +import { TimeConverterPort } from '@modules/ad/core/application/ports/time-converter.port'; +import { TimezoneFinderPort } from '@modules/ad/core/application/ports/timezone-finder.port'; import { AdReadModel, AdWriteModel, diff --git a/src/modules/ad/tests/unit/core/ad.entity.spec.ts b/src/modules/ad/tests/unit/core/ad.entity.spec.ts index 8d71ac6..66c6ee9 100644 --- a/src/modules/ad/tests/unit/core/ad.entity.spec.ts +++ b/src/modules/ad/tests/unit/core/ad.entity.spec.ts @@ -1,11 +1,11 @@ -import { AdEntity } from '@modules/ad/core/ad.entity'; +import { AdEntity } from '@modules/ad/core/domain/ad.entity'; import { CreateAdProps, DefaultAdProps, Frequency, -} from '@modules/ad/core/ad.types'; -import { MarginDurationsProps } from '@modules/ad/core/value-objects/margin-durations.value-object'; -import { WaypointProps } from '@modules/ad/core/value-objects/waypoint.value-object'; +} from '@modules/ad/core/domain/ad.types'; +import { MarginDurationsProps } from '@modules/ad/core/domain/value-objects/margin-durations.value-object'; +import { WaypointProps } from '@modules/ad/core/domain/value-objects/waypoint.value-object'; const originWaypointProps: WaypointProps = { position: 0, diff --git a/src/modules/ad/tests/unit/core/address.value-object.spec.ts b/src/modules/ad/tests/unit/core/address.value-object.spec.ts index 5475680..221ec9c 100644 --- a/src/modules/ad/tests/unit/core/address.value-object.spec.ts +++ b/src/modules/ad/tests/unit/core/address.value-object.spec.ts @@ -1,4 +1,4 @@ -import { Address } from '@modules/ad/core/value-objects/address.value-object'; +import { Address } from '@modules/ad/core/domain/value-objects/address.value-object'; describe('Address value object', () => { it('should create an address value object', () => { diff --git a/src/modules/ad/tests/unit/core/coordinates.value-object.spec.ts b/src/modules/ad/tests/unit/core/coordinates.value-object.spec.ts index 4718ac5..9b19366 100644 --- a/src/modules/ad/tests/unit/core/coordinates.value-object.spec.ts +++ b/src/modules/ad/tests/unit/core/coordinates.value-object.spec.ts @@ -1,4 +1,4 @@ -import { Coordinates } from '@modules/ad/core/value-objects/coordinates.value-object'; +import { Coordinates } from '@modules/ad/core/domain/value-objects/coordinates.value-object'; describe('Coordinates value object', () => { it('should create a coordinates value object', () => { diff --git a/src/modules/ad/tests/unit/core/create-ad.service.spec.ts b/src/modules/ad/tests/unit/core/create-ad.service.spec.ts index f2577f1..a86fb1e 100644 --- a/src/modules/ad/tests/unit/core/create-ad.service.spec.ts +++ b/src/modules/ad/tests/unit/core/create-ad.service.spec.ts @@ -1,15 +1,15 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { CreateAdService } from '@modules/ad/core/commands/create-ad/create-ad.service'; import { AD_REPOSITORY, PARAMS_PROVIDER } from '@modules/ad/ad.di-tokens'; -import { DefaultParamsProviderPort } from '@modules/ad/core/ports/default-params-provider.port'; import { WaypointDto } from '@modules/ad/interface/grpc-controllers/dtos/waypoint.dto'; import { CreateAdRequestDto } from '@modules/ad/interface/grpc-controllers/dtos/create-ad.request.dto'; -import { Frequency } from '@modules/ad/core/ad.types'; -import { CreateAdCommand } from '@modules/ad/core/commands/create-ad/create-ad.command'; import { AggregateID } from '@libs/ddd'; -import { AdAlreadyExistsException } from '@modules/ad/core/ad.errors'; -import { AdEntity } from '@modules/ad/core/ad.entity'; +import { AdEntity } from '@modules/ad/core/domain/ad.entity'; import { ConflictException } from '@libs/exceptions'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; +import { DefaultParamsProviderPort } from '@modules/ad/core/application/ports/default-params-provider.port'; +import { CreateAdService } from '@modules/ad/core/application/commands/create-ad/create-ad.service'; +import { CreateAdCommand } from '@modules/ad/core/application/commands/create-ad/create-ad.command'; +import { AdAlreadyExistsException } from '@modules/ad/core/domain/ad.errors'; const originWaypoint: WaypointDto = { position: 0, diff --git a/src/modules/ad/tests/unit/core/find-ad-by-id.query-handler.spec.ts b/src/modules/ad/tests/unit/core/find-ad-by-id.query-handler.spec.ts index 96bcabf..7fdf39a 100644 --- a/src/modules/ad/tests/unit/core/find-ad-by-id.query-handler.spec.ts +++ b/src/modules/ad/tests/unit/core/find-ad-by-id.query-handler.spec.ts @@ -1,14 +1,14 @@ import { AD_REPOSITORY } from '@modules/ad/ad.di-tokens'; -import { AdEntity } from '@modules/ad/core/ad.entity'; +import { AdEntity } from '@modules/ad/core/domain/ad.entity'; import { CreateAdProps, DefaultAdProps, Frequency, -} from '@modules/ad/core/ad.types'; -import { FindAdByIdQuery } from '@modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query'; -import { FindAdByIdQueryHandler } from '@modules/ad/core/queries/find-ad-by-id/find-ad-by-id.query-handler'; -import { MarginDurationsProps } from '@modules/ad/core/value-objects/margin-durations.value-object'; -import { WaypointProps } from '@modules/ad/core/value-objects/waypoint.value-object'; +} from '@modules/ad/core/domain/ad.types'; +import { FindAdByIdQuery } from '@modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query'; +import { FindAdByIdQueryHandler } from '@modules/ad/core/application/queries/find-ad-by-id/find-ad-by-id.query-handler'; +import { MarginDurationsProps } from '@modules/ad/core/domain/value-objects/margin-durations.value-object'; +import { WaypointProps } from '@modules/ad/core/domain/value-objects/waypoint.value-object'; import { Test, TestingModule } from '@nestjs/testing'; const originWaypointProps: WaypointProps = { diff --git a/src/modules/ad/tests/unit/core/margin-durations.value-object.spec.ts b/src/modules/ad/tests/unit/core/margin-durations.value-object.spec.ts index c7e99d4..41e30ef 100644 --- a/src/modules/ad/tests/unit/core/margin-durations.value-object.spec.ts +++ b/src/modules/ad/tests/unit/core/margin-durations.value-object.spec.ts @@ -1,4 +1,4 @@ -import { MarginDurations } from '@modules/ad/core/value-objects/margin-durations.value-object'; +import { MarginDurations } from '@modules/ad/core/domain/value-objects/margin-durations.value-object'; describe('Margin durations value object', () => { it('should create a margin durations value object', () => { diff --git a/src/modules/ad/tests/unit/core/publish-log-message-when-ad-is-created.domain-event-handler.spec.ts b/src/modules/ad/tests/unit/core/publish-log-message-when-ad-is-created.domain-event-handler.spec.ts index 2dc72fd..ec25078 100644 --- a/src/modules/ad/tests/unit/core/publish-log-message-when-ad-is-created.domain-event-handler.spec.ts +++ b/src/modules/ad/tests/unit/core/publish-log-message-when-ad-is-created.domain-event-handler.spec.ts @@ -1,6 +1,6 @@ -import { Frequency } from '@modules/ad/core/ad.types'; -import { PublishLogMessageWhenAdIsCreatedDomainEventHandler } from '@modules/ad/core/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler'; -import { AdCreatedDomainEvent } from '@modules/ad/core/events/ad-created.domain-events'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; +import { PublishLogMessageWhenAdIsCreatedDomainEventHandler } from '@modules/ad/core/application/event-handlers/publish-log-message-when-ad-is-created.domain-event-handler'; +import { AdCreatedDomainEvent } from '@modules/ad/core/domain/events/ad-created.domain-events'; import { Test, TestingModule } from '@nestjs/testing'; import { MESSAGE_PUBLISHER } from '@src/app.constants'; diff --git a/src/modules/ad/tests/unit/core/publish-message-when-ad-is-created.domain-event-handler.spec.ts b/src/modules/ad/tests/unit/core/publish-message-when-ad-is-created.domain-event-handler.spec.ts index d07fc97..12909b8 100644 --- a/src/modules/ad/tests/unit/core/publish-message-when-ad-is-created.domain-event-handler.spec.ts +++ b/src/modules/ad/tests/unit/core/publish-message-when-ad-is-created.domain-event-handler.spec.ts @@ -1,6 +1,6 @@ -import { Frequency } from '@modules/ad/core/ad.types'; -import { PublishMessageWhenAdIsCreatedDomainEventHandler } from '@modules/ad/core/event-handlers/publish-message-when-ad-is-created.domain-event-handler'; -import { AdCreatedDomainEvent } from '@modules/ad/core/events/ad-created.domain-events'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; +import { PublishMessageWhenAdIsCreatedDomainEventHandler } from '@modules/ad/core/application/event-handlers/publish-message-when-ad-is-created.domain-event-handler'; +import { AdCreatedDomainEvent } from '@modules/ad/core/domain/events/ad-created.domain-events'; import { Test, TestingModule } from '@nestjs/testing'; import { MESSAGE_PUBLISHER } from '@src/app.constants'; diff --git a/src/modules/ad/tests/unit/core/schedule.value-object.spec.ts b/src/modules/ad/tests/unit/core/schedule.value-object.spec.ts index b4d14bd..9992786 100644 --- a/src/modules/ad/tests/unit/core/schedule.value-object.spec.ts +++ b/src/modules/ad/tests/unit/core/schedule.value-object.spec.ts @@ -1,4 +1,4 @@ -import { Schedule } from '@modules/ad/core/value-objects/schedule.value-object'; +import { Schedule } from '@modules/ad/core/domain/value-objects/schedule.value-object'; describe('Schedule value object', () => { it('should create a schedule value object', () => { diff --git a/src/modules/ad/tests/unit/core/waypoint.value-object.spec.ts b/src/modules/ad/tests/unit/core/waypoint.value-object.spec.ts index ed4b842..10e0349 100644 --- a/src/modules/ad/tests/unit/core/waypoint.value-object.spec.ts +++ b/src/modules/ad/tests/unit/core/waypoint.value-object.spec.ts @@ -1,4 +1,4 @@ -import { Waypoint } from '@modules/ad/core/value-objects/waypoint.value-object'; +import { Waypoint } from '@modules/ad/core/domain/value-objects/waypoint.value-object'; describe('Waypoint value object', () => { it('should create a waypoint value object', () => { diff --git a/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts b/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts index 88b9e48..fc1c48b 100644 --- a/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts +++ b/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts @@ -5,9 +5,9 @@ import { TIME_CONVERTER, } from '@modules/ad/ad.di-tokens'; import { AdMapper } from '@modules/ad/ad.mapper'; -import { DefaultParamsProviderPort } from '@modules/ad/core/ports/default-params-provider.port'; -import { TimeConverterPort } from '@modules/ad/core/ports/time-converter.port'; -import { TimezoneFinderPort } from '@modules/ad/core/ports/timezone-finder.port'; +import { DefaultParamsProviderPort } from '@modules/ad/core/application/ports/default-params-provider.port'; +import { TimeConverterPort } from '@modules/ad/core/application/ports/time-converter.port'; +import { TimezoneFinderPort } from '@modules/ad/core/application/ports/timezone-finder.port'; import { AdRepository } from '@modules/ad/infrastructure/ad.repository'; import { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter'; import { Test, TestingModule } from '@nestjs/testing'; diff --git a/src/modules/ad/tests/unit/infrastructure/default-param.provider.spec.ts b/src/modules/ad/tests/unit/infrastructure/default-param.provider.spec.ts index 57ad3d8..2434a7d 100644 --- a/src/modules/ad/tests/unit/infrastructure/default-param.provider.spec.ts +++ b/src/modules/ad/tests/unit/infrastructure/default-param.provider.spec.ts @@ -1,4 +1,4 @@ -import { DefaultParams } from '@modules/ad/core/ports/default-params.type'; +import { DefaultParams } from '@modules/ad/core/application/ports/default-params.type'; import { DefaultParamsProvider } from '@modules/ad/infrastructure/default-params-provider'; import { ConfigService } from '@nestjs/config'; import { Test, TestingModule } from '@nestjs/testing'; diff --git a/src/modules/ad/tests/unit/interface/create-ad.grpc.controller.spec.ts b/src/modules/ad/tests/unit/interface/create-ad.grpc.controller.spec.ts index e0bc8e3..f4f5ac4 100644 --- a/src/modules/ad/tests/unit/interface/create-ad.grpc.controller.spec.ts +++ b/src/modules/ad/tests/unit/interface/create-ad.grpc.controller.spec.ts @@ -1,7 +1,7 @@ import { IdResponse } from '@libs/api/id.response.dto'; import { RpcExceptionCode } from '@libs/exceptions/rpc-exception.codes.enum'; -import { AdAlreadyExistsException } from '@modules/ad/core/ad.errors'; -import { Frequency } from '@modules/ad/core/ad.types'; +import { AdAlreadyExistsException } from '@modules/ad/core/domain/ad.errors'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; import { CreateAdGrpcController } from '@modules/ad/interface/grpc-controllers/create-ad.grpc.controller'; import { CreateAdRequestDto } from '@modules/ad/interface/grpc-controllers/dtos/create-ad.request.dto'; import { WaypointDto } from '@modules/ad/interface/grpc-controllers/dtos/waypoint.dto'; diff --git a/src/modules/ad/tests/unit/interface/find-ad-by-id.grpc.controller.spec.ts b/src/modules/ad/tests/unit/interface/find-ad-by-id.grpc.controller.spec.ts index b86dd3e..495e1eb 100644 --- a/src/modules/ad/tests/unit/interface/find-ad-by-id.grpc.controller.spec.ts +++ b/src/modules/ad/tests/unit/interface/find-ad-by-id.grpc.controller.spec.ts @@ -1,7 +1,7 @@ import { NotFoundException } from '@libs/exceptions'; import { RpcExceptionCode } from '@libs/exceptions/rpc-exception.codes.enum'; import { AdMapper } from '@modules/ad/ad.mapper'; -import { Frequency } from '@modules/ad/core/ad.types'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; import { FindAdByIdGrpcController } from '@modules/ad/interface/grpc-controllers/find-ad-by-id.grpc.controller'; import { QueryBus } from '@nestjs/cqrs'; import { RpcException } from '@nestjs/microservices'; diff --git a/src/modules/ad/tests/unit/interface/int-to-frequency.spec.ts b/src/modules/ad/tests/unit/interface/int-to-frequency.spec.ts index 08f2729..1f4a0d7 100644 --- a/src/modules/ad/tests/unit/interface/int-to-frequency.spec.ts +++ b/src/modules/ad/tests/unit/interface/int-to-frequency.spec.ts @@ -1,4 +1,4 @@ -import { Frequency } from '@modules/ad/core/ad.types'; +import { Frequency } from '@modules/ad/core/domain/ad.types'; import { intToFrequency } from '@modules/ad/interface/grpc-controllers/dtos/transformers/int-to-frequency'; describe('frequency mapping', () => { diff --git a/src/modules/health/core/ports/check-repository.port.ts b/src/modules/health/core/aplication/ports/check-repository.port.ts similarity index 100% rename from src/modules/health/core/ports/check-repository.port.ts rename to src/modules/health/core/aplication/ports/check-repository.port.ts diff --git a/src/modules/health/core/usecases/repositories.health-indicator.usecase.ts b/src/modules/health/core/aplication/usecases/repositories.health-indicator.usecase.ts similarity index 94% rename from src/modules/health/core/usecases/repositories.health-indicator.usecase.ts rename to src/modules/health/core/aplication/usecases/repositories.health-indicator.usecase.ts index 255263b..b842f9d 100644 --- a/src/modules/health/core/usecases/repositories.health-indicator.usecase.ts +++ b/src/modules/health/core/aplication/usecases/repositories.health-indicator.usecase.ts @@ -7,7 +7,7 @@ import { } from '@nestjs/terminus'; import { CheckRepositoryPort } from '../ports/check-repository.port'; import { AD_REPOSITORY } from '@modules/health/health.di-tokens'; -import { AdRepositoryPort } from '@modules/ad/core/ports/ad.repository.port'; +import { AdRepositoryPort } from '@modules/ad/core/application/ports/ad.repository.port'; import { MESSAGE_PUBLISHER } from '@src/app.constants'; import { LOGGING_AD_HEALTH_CRIT } from '@modules/health/health.constants'; import { MessagePublisherPort } from '@libs/ports/message-publisher.port'; diff --git a/src/modules/health/health.module.ts b/src/modules/health/health.module.ts index 988cd14..34e6148 100644 --- a/src/modules/health/health.module.ts +++ b/src/modules/health/health.module.ts @@ -4,7 +4,7 @@ import { TerminusModule } from '@nestjs/terminus'; import { MESSAGE_BROKER_PUBLISHER, MESSAGE_PUBLISHER } from 'src/app.constants'; import { MessageBrokerPublisher } from '@mobicoop/message-broker-module'; import { MessagePublisher } from './infrastructure/message-publisher'; -import { RepositoriesHealthIndicatorUseCase } from './core/usecases/repositories.health-indicator.usecase'; +import { RepositoriesHealthIndicatorUseCase } from './core/aplication/usecases/repositories.health-indicator.usecase'; import { AdRepository } from '../ad/infrastructure/ad.repository'; import { AD_REPOSITORY } from './health.di-tokens'; import { HealthGrpcController } from './interface/grpc-controllers/health.grpc.controller'; diff --git a/src/modules/health/interface/grpc-controllers/health.grpc.controller.ts b/src/modules/health/interface/grpc-controllers/health.grpc.controller.ts index f939dd2..4b1bfa3 100644 --- a/src/modules/health/interface/grpc-controllers/health.grpc.controller.ts +++ b/src/modules/health/interface/grpc-controllers/health.grpc.controller.ts @@ -1,6 +1,6 @@ import { Controller } from '@nestjs/common'; import { GrpcMethod } from '@nestjs/microservices'; -import { RepositoriesHealthIndicatorUseCase } from '../../core/usecases/repositories.health-indicator.usecase'; +import { RepositoriesHealthIndicatorUseCase } from '../../core/aplication/usecases/repositories.health-indicator.usecase'; export enum ServingStatus { UNKNOWN = 0, diff --git a/src/modules/health/interface/http-controllers/health.http.controller.ts b/src/modules/health/interface/http-controllers/health.http.controller.ts index 256dae5..77ca8b8 100644 --- a/src/modules/health/interface/http-controllers/health.http.controller.ts +++ b/src/modules/health/interface/http-controllers/health.http.controller.ts @@ -1,4 +1,4 @@ -import { RepositoriesHealthIndicatorUseCase } from '@modules/health/core/usecases/repositories.health-indicator.usecase'; +import { RepositoriesHealthIndicatorUseCase } from '@modules/health/core/aplication/usecases/repositories.health-indicator.usecase'; import { Controller, Get } from '@nestjs/common'; import { HealthCheckService, diff --git a/src/modules/health/tests/unit/health.grpc.controller.spec.ts b/src/modules/health/tests/unit/health.grpc.controller.spec.ts index 0157218..24ac94d 100644 --- a/src/modules/health/tests/unit/health.grpc.controller.spec.ts +++ b/src/modules/health/tests/unit/health.grpc.controller.spec.ts @@ -1,4 +1,4 @@ -import { RepositoriesHealthIndicatorUseCase } from '@modules/health/core/usecases/repositories.health-indicator.usecase'; +import { RepositoriesHealthIndicatorUseCase } from '@modules/health/core/aplication/usecases/repositories.health-indicator.usecase'; import { HealthGrpcController, ServingStatus, diff --git a/src/modules/health/tests/unit/health.http.controller.spec.ts b/src/modules/health/tests/unit/health.http.controller.spec.ts index 8982358..f7d2d24 100644 --- a/src/modules/health/tests/unit/health.http.controller.spec.ts +++ b/src/modules/health/tests/unit/health.http.controller.spec.ts @@ -1,4 +1,4 @@ -import { RepositoriesHealthIndicatorUseCase } from '@modules/health/core/usecases/repositories.health-indicator.usecase'; +import { RepositoriesHealthIndicatorUseCase } from '@modules/health/core/aplication/usecases/repositories.health-indicator.usecase'; import { HealthHttpController } from '@modules/health/interface/http-controllers/health.http.controller'; import { HealthCheckResult, HealthCheckService } from '@nestjs/terminus'; import { Test, TestingModule } from '@nestjs/testing'; diff --git a/src/modules/health/tests/unit/repositories.health-indicator.usecase.spec.ts b/src/modules/health/tests/unit/repositories.health-indicator.usecase.spec.ts index cf9a7fc..c0d5d78 100644 --- a/src/modules/health/tests/unit/repositories.health-indicator.usecase.spec.ts +++ b/src/modules/health/tests/unit/repositories.health-indicator.usecase.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { HealthCheckError, HealthIndicatorResult } from '@nestjs/terminus'; -import { RepositoriesHealthIndicatorUseCase } from '../../core/usecases/repositories.health-indicator.usecase'; +import { RepositoriesHealthIndicatorUseCase } from '../../core/aplication/usecases/repositories.health-indicator.usecase'; import { AD_REPOSITORY } from '@modules/health/health.di-tokens'; import { MESSAGE_PUBLISHER } from '@src/app.constants'; import { DatabaseErrorException } from '@libs/exceptions';