Conversation
Contributor
chaiminwoo0223
left a comment
There was a problem hiding this comment.
고생하셨습니다.
2가지 개선 가능한 부분이 보여 코드 리뷰 남겼습니다. 확인 부탁드려요.
src/main/java/com/ject/studytrip/stamp/application/service/StampService.java
Show resolved
Hide resolved
chaiminwoo0223
approved these changes
Jul 15, 2025
Contributor
chaiminwoo0223
left a comment
There was a problem hiding this comment.
변경된 내용 모두 확인했습니다. 머지 부탁드려요!
* feat: 특정 여행의 스탬프 생성 기능 구현 * feat: 스탬프 이름 및 마감일 수정 기능 구현 * feat: 스탬프 순서 변경 기능 구현 * feat: 스탬프 삭제 기능 구현 * feat: 여행별 스탬프 목록 조회 기능 구현 * feat: 스탬프 조회 및 해당 스탬프의 미션 목록 조회 기능 구현 * feat: 스탬프 등록, 삭제에 따라 여행의 총 스탬프 수를 업데이트하는 로직 추가 * feat: 특정 스탬프의 미션 목록 조회 로직 추가 * feat: 검증된 Trip 정보를 조회하는 로직 추가 * test: TripServiceTest에 총 스탬프 수 증가, 감소 테스트 추가 * test: StampTestHelper 클래스 추가 * test: UpdateStampRequestFixture 클래스 추가 * test: StampFixture.createStampWithId 메서드 추가 * test: StampControllerIntegrationTest - 통합 테스트 추가 * test: StampServiceTest - 단위 테스트 추가
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 작업 내용 및 특이사항
✅ Stamp 관련 기능 구현
totalStamps필드 값을+1처리하도록 구성deletedAt필드를 현재 시간으로 업데이트해서 soft delete 방식을 적용Stamp의deletedAt필드만 업데이트하도록 구성했는데, 삭제 로직은 더 구상을 해보고 추후 업데이트할 예정입니다stampOrder보다 큰 순서를 가진 스탬프들을 조회해 -1씩 재정렬하도록 구성 ->StampQueryRepository.findStampsToShiftAfterOrder()totalStamps필드 값을-1감소 처리deletedAt IS NULL조건으로 삭제되지 않은 스탬프만 조회되도록 구성StampId로 해당 스탬프를 조회하고, 해당 스탬프에 속한 모든 미션 목록도 함께 조회되도록 구성✅ Trip Service 로직 추가
TripService.getValidTrip()메서드를 추가해, 여행 소유자 검증 및 삭제 검증을 수행하고 유효한Trip을 조회할 수 있도록 구성: PR을 병합한 이후에
TripService또는 Trip 정보를 사용하는 영역에 기존getTrip()메서드를 호출하는 부분을getValidTrip()메서드로 교체할 예정입니다TripService에totalStamps필드 값을 증가시키는increaseTotalStamps()와 감소시키는decreaseTotalStamps()메서드 추가✅ Mission 관련 로직 추가
MissionService.getMissionsByStamp()메서드 추가mission.application.dto.MissionInfo를 구성해Mission도메인 정보를 응답하도록 구성✅ 테스트 추가
TripServiceTest에 총 스탬프 수 증가/감소 기능 단위 테스트 추가Stamp를 생성하는StampTestHelper클래스 추가StampFixture에 임의의 ID를 지정할 수 있는createStampWithId()메서드 추가StampServiceTest단위 테스트 구성StampControllerIntegrationTest통합 테스트 구성🌱 관련 이슈
🔍 참고사항(선택)
📚 기타(선택)
soft delete방식으로 처리되고 있어서 하나의 엔티티를 삭제할 때 연관된 다른 엔티티들도 어떻게 함께 삭제 처리할지에 대해 조금 더 고민이 필요할 것 같아요. 우선은 주요CRU(생성, 수정, 조회)로직을 먼저 구현하고 이후에 삭제 로직을 구상해 완성해나가는 것이 좋을 것 같아요.