diff --git a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockApi.java b/app-api/src/main/java/com/project/reactdashboard/application/stock/StockApi.java similarity index 68% rename from app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockApi.java rename to app-api/src/main/java/com/project/reactdashboard/application/stock/StockApi.java index dbb85f1..7678094 100644 --- a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockApi.java +++ b/app-api/src/main/java/com/project/reactdashboard/application/stock/StockApi.java @@ -1,6 +1,6 @@ -package com.project.reactdashboard.appplication.stock; +package com.project.reactdashboard.application.stock; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import java.util.List; diff --git a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockSpi.java b/app-api/src/main/java/com/project/reactdashboard/application/stock/StockSpi.java similarity index 73% rename from app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockSpi.java rename to app-api/src/main/java/com/project/reactdashboard/application/stock/StockSpi.java index 1cd64fb..cdb3989 100644 --- a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockSpi.java +++ b/app-api/src/main/java/com/project/reactdashboard/application/stock/StockSpi.java @@ -1,6 +1,6 @@ -package com.project.reactdashboard.appplication.stock; +package com.project.reactdashboard.application.stock; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import java.time.OffsetDateTime; import java.util.List; diff --git a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/mapper/StockApplicationMapper.java b/app-api/src/main/java/com/project/reactdashboard/application/stock/mapper/StockApplicationMapper.java similarity index 92% rename from app-api/src/main/java/com/project/reactdashboard/appplication/stock/mapper/StockApplicationMapper.java rename to app-api/src/main/java/com/project/reactdashboard/application/stock/mapper/StockApplicationMapper.java index 3def852..10004b6 100644 --- a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/mapper/StockApplicationMapper.java +++ b/app-api/src/main/java/com/project/reactdashboard/application/stock/mapper/StockApplicationMapper.java @@ -1,6 +1,6 @@ -package com.project.reactdashboard.appplication.stock.mapper; +package com.project.reactdashboard.application.stock.mapper; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import com.project.reactdashboard.infrastructure.stock.controllers.StockDto; import org.springframework.stereotype.Component; diff --git a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/model/StockApplication.java b/app-api/src/main/java/com/project/reactdashboard/application/stock/model/StockApplication.java similarity index 98% rename from app-api/src/main/java/com/project/reactdashboard/appplication/stock/model/StockApplication.java rename to app-api/src/main/java/com/project/reactdashboard/application/stock/model/StockApplication.java index bbd85ed..2610b9f 100644 --- a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/model/StockApplication.java +++ b/app-api/src/main/java/com/project/reactdashboard/application/stock/model/StockApplication.java @@ -1,4 +1,4 @@ -package com.project.reactdashboard.appplication.stock.model; +package com.project.reactdashboard.application.stock.model; import java.io.Serializable; import java.time.OffsetDateTime; diff --git a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/model/SymbolValuesApplication.java b/app-api/src/main/java/com/project/reactdashboard/application/stock/model/SymbolValuesApplication.java similarity index 94% rename from app-api/src/main/java/com/project/reactdashboard/appplication/stock/model/SymbolValuesApplication.java rename to app-api/src/main/java/com/project/reactdashboard/application/stock/model/SymbolValuesApplication.java index 4ce8f68..a87ee6b 100644 --- a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/model/SymbolValuesApplication.java +++ b/app-api/src/main/java/com/project/reactdashboard/application/stock/model/SymbolValuesApplication.java @@ -1,4 +1,4 @@ -package com.project.reactdashboard.appplication.stock.model; +package com.project.reactdashboard.application.stock.model; public class SymbolValuesApplication { diff --git a/app-api/src/main/java/com/project/reactdashboard/configuration/StockMarketConfiguration.java b/app-api/src/main/java/com/project/reactdashboard/configuration/StockMarketConfiguration.java new file mode 100644 index 0000000..4158da1 --- /dev/null +++ b/app-api/src/main/java/com/project/reactdashboard/configuration/StockMarketConfiguration.java @@ -0,0 +1,12 @@ +package com.project.reactdashboard.configuration; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; + +@Configuration +@ComponentScan( + basePackages = {"com.project.reactdashboard.domain.stock"}, + includeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {UseCase.class})}) +public class StockMarketConfiguration { +} diff --git a/app-api/src/main/java/com/project/reactdashboard/configuration/UseCase.java b/app-api/src/main/java/com/project/reactdashboard/configuration/UseCase.java new file mode 100644 index 0000000..98af768 --- /dev/null +++ b/app-api/src/main/java/com/project/reactdashboard/configuration/UseCase.java @@ -0,0 +1,8 @@ +package com.project.reactdashboard.configuration; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface UseCase { +} diff --git a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockService.java b/app-api/src/main/java/com/project/reactdashboard/domain/stock/StockService.java similarity index 78% rename from app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockService.java rename to app-api/src/main/java/com/project/reactdashboard/domain/stock/StockService.java index 9fc56d4..db730f7 100644 --- a/app-api/src/main/java/com/project/reactdashboard/appplication/stock/StockService.java +++ b/app-api/src/main/java/com/project/reactdashboard/domain/stock/StockService.java @@ -1,7 +1,9 @@ -package com.project.reactdashboard.appplication.stock; +package com.project.reactdashboard.domain.stock; -import com.project.reactdashboard.appplication.stock.model.StockApplication; -import org.springframework.stereotype.Service; +import com.project.reactdashboard.application.stock.StockApi; +import com.project.reactdashboard.application.stock.StockSpi; +import com.project.reactdashboard.application.stock.model.StockApplication; +import com.project.reactdashboard.configuration.UseCase; import java.time.OffsetDateTime; import java.time.ZoneOffset; @@ -9,7 +11,7 @@ import static com.project.reactdashboard.domain.stock.Date.lastWorkingDay; -@Service +@UseCase public class StockService implements StockApi { private final StockSpi stockSpi; diff --git a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/controllers/StockController.java b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/controllers/StockController.java index 2313a9e..0b10f6b 100644 --- a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/controllers/StockController.java +++ b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/controllers/StockController.java @@ -1,8 +1,8 @@ package com.project.reactdashboard.infrastructure.stock.controllers; -import com.project.reactdashboard.appplication.stock.StockApi; -import com.project.reactdashboard.appplication.stock.mapper.StockApplicationMapper; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.StockApi; +import com.project.reactdashboard.application.stock.mapper.StockApplicationMapper; +import com.project.reactdashboard.application.stock.model.StockApplication; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; diff --git a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceService.java b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceService.java index 71e6ff5..bdc670d 100644 --- a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceService.java +++ b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceService.java @@ -1,7 +1,7 @@ package com.project.reactdashboard.infrastructure.stock.persistence; -import com.project.reactdashboard.appplication.stock.StockSpi; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.StockSpi; +import com.project.reactdashboard.application.stock.model.StockApplication; import com.project.reactdashboard.infrastructure.stock.persistence.mapper.StockMapper; import com.project.reactdashboard.infrastructure.stock.persistence.entities.Stock; import org.springframework.stereotype.Service; diff --git a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapper.java b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapper.java index a55df25..e974c95 100644 --- a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapper.java +++ b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapper.java @@ -1,6 +1,6 @@ package com.project.reactdashboard.infrastructure.stock.persistence.mapper; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import com.project.reactdashboard.infrastructure.stock.persistence.entities.Stock; import org.springframework.stereotype.Component; diff --git a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapper.java b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapper.java index a311382..56806f3 100644 --- a/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapper.java +++ b/app-api/src/main/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapper.java @@ -1,6 +1,6 @@ package com.project.reactdashboard.infrastructure.stock.persistence.mapper; -import com.project.reactdashboard.appplication.stock.model.SymbolValuesApplication; +import com.project.reactdashboard.application.stock.model.SymbolValuesApplication; import com.project.reactdashboard.infrastructure.stock.persistence.entities.SymbolValues; import org.springframework.stereotype.Component; diff --git a/app-api/src/test/java/com/project/reactdashboard/ObjectRandomizer.java b/app-api/src/test/java/com/project/reactdashboard/ObjectRandomizer.java index f4998e1..a02e1a2 100644 --- a/app-api/src/test/java/com/project/reactdashboard/ObjectRandomizer.java +++ b/app-api/src/test/java/com/project/reactdashboard/ObjectRandomizer.java @@ -1,8 +1,8 @@ package com.project.reactdashboard; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import com.project.reactdashboard.infrastructure.stock.controllers.StockDto; -import com.project.reactdashboard.appplication.stock.model.SymbolValuesApplication; +import com.project.reactdashboard.application.stock.model.SymbolValuesApplication; import com.project.reactdashboard.infrastructure.stock.persistence.entities.Stock; import com.project.reactdashboard.infrastructure.stock.persistence.entities.SymbolValues; diff --git a/app-api/src/test/java/com/project/reactdashboard/appplication/stock/mapper/StockApplicationMapperTest.java b/app-api/src/test/java/com/project/reactdashboard/application/stock/mapper/StockApplicationMapperTest.java similarity index 92% rename from app-api/src/test/java/com/project/reactdashboard/appplication/stock/mapper/StockApplicationMapperTest.java rename to app-api/src/test/java/com/project/reactdashboard/application/stock/mapper/StockApplicationMapperTest.java index 2055843..91ee127 100644 --- a/app-api/src/test/java/com/project/reactdashboard/appplication/stock/mapper/StockApplicationMapperTest.java +++ b/app-api/src/test/java/com/project/reactdashboard/application/stock/mapper/StockApplicationMapperTest.java @@ -1,7 +1,6 @@ -package com.project.reactdashboard.appplication.stock.mapper; +package com.project.reactdashboard.application.stock.mapper; -import com.project.reactdashboard.appplication.stock.mapper.StockApplicationMapper; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import com.project.reactdashboard.infrastructure.stock.controllers.StockDto; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/app-api/src/test/java/com/project/reactdashboard/appplication/stock/StockServiceTest.java b/app-api/src/test/java/com/project/reactdashboard/domain/stock/StockServiceTest.java similarity index 88% rename from app-api/src/test/java/com/project/reactdashboard/appplication/stock/StockServiceTest.java rename to app-api/src/test/java/com/project/reactdashboard/domain/stock/StockServiceTest.java index 9321443..9f89c47 100644 --- a/app-api/src/test/java/com/project/reactdashboard/appplication/stock/StockServiceTest.java +++ b/app-api/src/test/java/com/project/reactdashboard/domain/stock/StockServiceTest.java @@ -1,8 +1,7 @@ -package com.project.reactdashboard.appplication.stock; +package com.project.reactdashboard.domain.stock; -import com.project.reactdashboard.appplication.stock.StockService; -import com.project.reactdashboard.appplication.stock.StockSpi; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.StockSpi; +import com.project.reactdashboard.application.stock.model.StockApplication; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/controllers/StockControllerTest.java b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/controllers/StockControllerTest.java index e8587af..ab3ec3f 100644 --- a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/controllers/StockControllerTest.java +++ b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/controllers/StockControllerTest.java @@ -5,11 +5,9 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.project.reactdashboard.appplication.stock.StockApi; -import com.project.reactdashboard.appplication.stock.mapper.StockApplicationMapper; -import com.project.reactdashboard.appplication.stock.model.StockApplication; -import com.project.reactdashboard.infrastructure.stock.controllers.StockController; -import com.project.reactdashboard.infrastructure.stock.controllers.StockDto; +import com.project.reactdashboard.application.stock.StockApi; +import com.project.reactdashboard.application.stock.mapper.StockApplicationMapper; +import com.project.reactdashboard.application.stock.model.StockApplication; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; diff --git a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceServiceTest.java b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceServiceTest.java index d15abdb..b3dea8d 100644 --- a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceServiceTest.java +++ b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/StockPersistenceServiceTest.java @@ -1,6 +1,6 @@ package com.project.reactdashboard.infrastructure.stock.persistence; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import com.project.reactdashboard.infrastructure.stock.persistence.mapper.StockMapper; import com.project.reactdashboard.infrastructure.stock.persistence.entities.Stock; import org.junit.jupiter.api.Test; diff --git a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapperTest.java b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapperTest.java index bdeb6f5..2dfa384 100644 --- a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapperTest.java +++ b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/StockMapperTest.java @@ -1,9 +1,7 @@ package com.project.reactdashboard.infrastructure.stock.persistence.mapper; -import com.project.reactdashboard.appplication.stock.model.StockApplication; +import com.project.reactdashboard.application.stock.model.StockApplication; import com.project.reactdashboard.infrastructure.stock.persistence.entities.Stock; -import com.project.reactdashboard.infrastructure.stock.persistence.mapper.StockMapper; -import com.project.reactdashboard.infrastructure.stock.persistence.mapper.SymbolValuesMapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapperTest.java b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapperTest.java index a905929..4efbf24 100644 --- a/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapperTest.java +++ b/app-api/src/test/java/com/project/reactdashboard/infrastructure/stock/persistence/mapper/SymbolValuesMapperTest.java @@ -1,8 +1,7 @@ package com.project.reactdashboard.infrastructure.stock.persistence.mapper; -import com.project.reactdashboard.appplication.stock.model.SymbolValuesApplication; +import com.project.reactdashboard.application.stock.model.SymbolValuesApplication; import com.project.reactdashboard.infrastructure.stock.persistence.entities.SymbolValues; -import com.project.reactdashboard.infrastructure.stock.persistence.mapper.SymbolValuesMapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test;