diff --git a/src/main/java/se/issuetrackingsystem/issue/service/IssueService.java b/src/main/java/se/issuetrackingsystem/issue/service/IssueService.java index 1634ea2..631efbe 100644 --- a/src/main/java/se/issuetrackingsystem/issue/service/IssueService.java +++ b/src/main/java/se/issuetrackingsystem/issue/service/IssueService.java @@ -11,9 +11,9 @@ import se.issuetrackingsystem.project.domain.Project; import se.issuetrackingsystem.project.repository.ProjectRepository; import se.issuetrackingsystem.user.domain.Dev; -import se.issuetrackingsystem.user.domain.ProjectContributor; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; import se.issuetrackingsystem.user.domain.User; -import se.issuetrackingsystem.user.repository.ProjectContributorRepository; +import se.issuetrackingsystem.projectContributor.repository.ProjectContributorRepository; import se.issuetrackingsystem.user.repository.UserRepository; import java.time.LocalDateTime; diff --git a/src/main/java/se/issuetrackingsystem/project/controller/ProjectController.java b/src/main/java/se/issuetrackingsystem/project/controller/ProjectController.java index 2734f27..952514a 100644 --- a/src/main/java/se/issuetrackingsystem/project/controller/ProjectController.java +++ b/src/main/java/se/issuetrackingsystem/project/controller/ProjectController.java @@ -4,7 +4,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import se.issuetrackingsystem.project.dto.ProjectContributorResponse; +import se.issuetrackingsystem.projectContributor.dto.ProjectContributorResponse; import se.issuetrackingsystem.project.dto.ProjectRequest; import se.issuetrackingsystem.project.dto.ProjectResponse; import se.issuetrackingsystem.project.service.ProjectService; diff --git a/src/main/java/se/issuetrackingsystem/project/domain/Project.java b/src/main/java/se/issuetrackingsystem/project/domain/Project.java index 8f88be1..a5c4d18 100644 --- a/src/main/java/se/issuetrackingsystem/project/domain/Project.java +++ b/src/main/java/se/issuetrackingsystem/project/domain/Project.java @@ -4,7 +4,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import se.issuetrackingsystem.user.domain.Admin; -import se.issuetrackingsystem.user.domain.ProjectContributor; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; import java.time.LocalDateTime; import java.util.ArrayList; diff --git a/src/main/java/se/issuetrackingsystem/project/service/ProjectService.java b/src/main/java/se/issuetrackingsystem/project/service/ProjectService.java index 0d1d431..36a0db6 100644 --- a/src/main/java/se/issuetrackingsystem/project/service/ProjectService.java +++ b/src/main/java/se/issuetrackingsystem/project/service/ProjectService.java @@ -6,18 +6,18 @@ import se.issuetrackingsystem.common.exception.CustomException; import se.issuetrackingsystem.common.exception.ErrorCode; import se.issuetrackingsystem.project.domain.Project; -import se.issuetrackingsystem.project.dto.ProjectContributorResponse; +import se.issuetrackingsystem.projectContributor.dto.ProjectContributorResponse; import se.issuetrackingsystem.project.dto.ProjectRequest; import se.issuetrackingsystem.project.dto.ProjectResponse; import se.issuetrackingsystem.project.repository.ProjectRepository; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributorPK; import se.issuetrackingsystem.user.domain.*; -import se.issuetrackingsystem.user.dto.UserResponse; -import se.issuetrackingsystem.user.repository.ProjectContributorRepository; +import se.issuetrackingsystem.projectContributor.repository.ProjectContributorRepository; import se.issuetrackingsystem.user.repository.UserRepository; import java.util.List; import java.util.Objects; -import java.util.stream.Collectors; @Service @RequiredArgsConstructor diff --git a/src/main/java/se/issuetrackingsystem/user/domain/ProjectContributor.java b/src/main/java/se/issuetrackingsystem/projectContributor/domain/ProjectContributor.java similarity index 88% rename from src/main/java/se/issuetrackingsystem/user/domain/ProjectContributor.java rename to src/main/java/se/issuetrackingsystem/projectContributor/domain/ProjectContributor.java index 5037919..ca57934 100644 --- a/src/main/java/se/issuetrackingsystem/user/domain/ProjectContributor.java +++ b/src/main/java/se/issuetrackingsystem/projectContributor/domain/ProjectContributor.java @@ -1,9 +1,10 @@ -package se.issuetrackingsystem.user.domain; +package se.issuetrackingsystem.projectContributor.domain; import jakarta.persistence.*; import lombok.Getter; import lombok.NoArgsConstructor; import se.issuetrackingsystem.project.domain.Project; +import se.issuetrackingsystem.user.domain.User; @Entity @Getter diff --git a/src/main/java/se/issuetrackingsystem/user/domain/ProjectContributorPK.java b/src/main/java/se/issuetrackingsystem/projectContributor/domain/ProjectContributorPK.java similarity index 83% rename from src/main/java/se/issuetrackingsystem/user/domain/ProjectContributorPK.java rename to src/main/java/se/issuetrackingsystem/projectContributor/domain/ProjectContributorPK.java index d0b2cf2..3ca7f04 100644 --- a/src/main/java/se/issuetrackingsystem/user/domain/ProjectContributorPK.java +++ b/src/main/java/se/issuetrackingsystem/projectContributor/domain/ProjectContributorPK.java @@ -1,8 +1,7 @@ -package se.issuetrackingsystem.user.domain; +package se.issuetrackingsystem.projectContributor.domain; import jakarta.persistence.Embeddable; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/src/main/java/se/issuetrackingsystem/project/dto/ProjectContributorResponse.java b/src/main/java/se/issuetrackingsystem/projectContributor/dto/ProjectContributorResponse.java similarity index 78% rename from src/main/java/se/issuetrackingsystem/project/dto/ProjectContributorResponse.java rename to src/main/java/se/issuetrackingsystem/projectContributor/dto/ProjectContributorResponse.java index 9607bf8..8106680 100644 --- a/src/main/java/se/issuetrackingsystem/project/dto/ProjectContributorResponse.java +++ b/src/main/java/se/issuetrackingsystem/projectContributor/dto/ProjectContributorResponse.java @@ -1,7 +1,7 @@ -package se.issuetrackingsystem.project.dto; +package se.issuetrackingsystem.projectContributor.dto; import lombok.Getter; -import se.issuetrackingsystem.user.domain.ProjectContributor; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; @Getter public class ProjectContributorResponse { diff --git a/src/main/java/se/issuetrackingsystem/user/repository/ProjectContributorRepository.java b/src/main/java/se/issuetrackingsystem/projectContributor/repository/ProjectContributorRepository.java similarity index 78% rename from src/main/java/se/issuetrackingsystem/user/repository/ProjectContributorRepository.java rename to src/main/java/se/issuetrackingsystem/projectContributor/repository/ProjectContributorRepository.java index 31a8313..e920789 100644 --- a/src/main/java/se/issuetrackingsystem/user/repository/ProjectContributorRepository.java +++ b/src/main/java/se/issuetrackingsystem/projectContributor/repository/ProjectContributorRepository.java @@ -1,9 +1,9 @@ -package se.issuetrackingsystem.user.repository; +package se.issuetrackingsystem.projectContributor.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import se.issuetrackingsystem.project.domain.Project; -import se.issuetrackingsystem.user.domain.ProjectContributor; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; import se.issuetrackingsystem.user.domain.User; import java.util.List; diff --git a/src/main/java/se/issuetrackingsystem/user/domain/User.java b/src/main/java/se/issuetrackingsystem/user/domain/User.java index 8c2fbe9..67592c9 100644 --- a/src/main/java/se/issuetrackingsystem/user/domain/User.java +++ b/src/main/java/se/issuetrackingsystem/user/domain/User.java @@ -2,6 +2,7 @@ import jakarta.persistence.*; import lombok.*; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; import java.time.LocalDateTime; import java.util.List; diff --git a/src/main/java/se/issuetrackingsystem/user/service/UserService.java b/src/main/java/se/issuetrackingsystem/user/service/UserService.java index 6afb388..e4d2b8a 100644 --- a/src/main/java/se/issuetrackingsystem/user/service/UserService.java +++ b/src/main/java/se/issuetrackingsystem/user/service/UserService.java @@ -7,14 +7,12 @@ import org.springframework.transaction.annotation.Transactional; import se.issuetrackingsystem.common.exception.CustomException; import se.issuetrackingsystem.common.exception.ErrorCode; -import se.issuetrackingsystem.project.domain.Project; import se.issuetrackingsystem.user.domain.*; import se.issuetrackingsystem.user.dto.LoginRequest; import se.issuetrackingsystem.user.dto.RegisterRequest; import se.issuetrackingsystem.user.dto.UserResponse; -import se.issuetrackingsystem.user.repository.ProjectContributorRepository; +import se.issuetrackingsystem.projectContributor.repository.ProjectContributorRepository; import se.issuetrackingsystem.user.repository.UserRepository; -import se.issuetrackingsystem.user.service.UserService; import java.util.List; import java.util.Optional; @@ -24,7 +22,6 @@ public class UserService { private final UserRepository userRepository; - private final ProjectContributorRepository projectContributorRepository; PasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); @Transactional diff --git a/src/test/java/se/issuetrackingsystem/IssueServiceTests.java b/src/test/java/se/issuetrackingsystem/IssueServiceTests.java index 791b7f8..cb954c8 100644 --- a/src/test/java/se/issuetrackingsystem/IssueServiceTests.java +++ b/src/test/java/se/issuetrackingsystem/IssueServiceTests.java @@ -12,8 +12,9 @@ import se.issuetrackingsystem.issue.service.IssueService; import se.issuetrackingsystem.project.domain.Project; import se.issuetrackingsystem.project.repository.ProjectRepository; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; import se.issuetrackingsystem.user.domain.*; -import se.issuetrackingsystem.user.repository.ProjectContributorRepository; +import se.issuetrackingsystem.projectContributor.repository.ProjectContributorRepository; import se.issuetrackingsystem.user.repository.UserRepository; import java.util.Arrays; diff --git a/src/test/java/se/issuetrackingsystem/project/service/ProjectServiceTest.java b/src/test/java/se/issuetrackingsystem/project/service/ProjectServiceTest.java index 71471fd..ba325fa 100644 --- a/src/test/java/se/issuetrackingsystem/project/service/ProjectServiceTest.java +++ b/src/test/java/se/issuetrackingsystem/project/service/ProjectServiceTest.java @@ -14,8 +14,9 @@ import se.issuetrackingsystem.project.dto.ProjectRequest; import se.issuetrackingsystem.project.dto.ProjectResponse; import se.issuetrackingsystem.project.repository.ProjectRepository; +import se.issuetrackingsystem.projectContributor.domain.ProjectContributor; import se.issuetrackingsystem.user.domain.*; -import se.issuetrackingsystem.user.repository.ProjectContributorRepository; +import se.issuetrackingsystem.projectContributor.repository.ProjectContributorRepository; import se.issuetrackingsystem.user.repository.UserRepository; import java.util.Arrays;