refactor: 스탬프 순서 저장 방식 리팩토링 (#88) #89
Merged
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.
📌 작업 내용 및 특이사항
✅ 스탬프 순서 지정 방식 변경
클라이언트에서 order 계산 후 요청, 서버에서 order 검증 -> 서버에서 특정 여행의 마지막 스탬프 order 값을 추출해 지정하는 방법으로 변경했습니다.
[ 리팩토링 전 ]
[ 리팩토링 후 ]
CreateStampRequest DTO에서 order 필드를 제거했습니다.findMaxStampOrderByTripId()쿼리 메서드를 추가했습니다.stamp_order필드에 코스형 여행일 경우에는findMaxStampOrderByTripId() + 1값을, 탐험형 여행일 경우에는0을 지정해 스탬프를 생성하도록 구현했습니다.order값을 검증하는StampPolicy.validateStampOrder메서드를 제거했습니다.서버에서 검증된 순서를 지정하고 직접 순서를 계산/추출하기때문에 검증까지 수행하지 않도록 구성했습니다.
StampCommandService.createStamp) 로직과 다중 스탬프 생성(StampCommandService.createStamps) 모두 변경사항을 반영했습니다.✅ 관련 테스트 코드 수정
StampControllerIntegrationTest에서 단일 스탬프 생성 테스트 코드의 스탬프 순서 관련 예외 반환 테스트를 제거했습니다.StampCommandServiceTest에서 단일 스탬프 생성, 다중 스탬프 생성 테스트 코드를 로직 변경에 맞게 수정했습니다.TripControllerIntegrationTest에서 여행 생성 테스트 코드의 스탬프 순서 관련 예외 반환 테스트를 제거했습니다.🌱 관련 이슈
🔍 참고사항(선택)
📚 기타(선택)