[refactor] 엑세스 토큰 시간 변경 및 여행 조회 로직 수정 #156
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.
#️⃣연관된 이슈
📝작업 내용
1️⃣ 현재 진행 중인 투표 조회 로직 수정 (getOngoingVoteRooms)
기존 로직에서는 ONGOING 상태의 여행만 조회했지만,
투표가 종료되지 않은 SCHEDULE 여행과 예정이 확정된 COURSE 여행도 함께 조회하도록 개선
✅ 변경 사항:
ONGOING 상태의 여행을 조회
COURSE 여행은 상태가 예정이 확정되어도 유지
SCHEDULE 여행은 투표 제한시간이 지나지 않은 경우에만 조회 상 보여지지 않도록 수정
🔹 이전: ONGOING 상태의 여행만 조회
🔹 이후: ONGOING + COMPLETED (COURSE만) 유지
✅ 결과:
진행 중인 SCHEDULE 여행은 투표 제한 시간이 지나면 조회되지 않음
진행 중인 COURSE 여행은 제한시간과 무관하게 조회됨
2️⃣ 예정된 여행 조회 로직 수정 (getFutureVoteBasedTrips)
이전의 API는 GET 요청을 받을 때마다 내부 로직을 통해서 COURSE는 자동으로 제한시간을 계산하고 COMPLETED 상태로 바뀌거나, SCHEDULE은 투표 확정 로직을 통해서 예정된 여행으로 바뀌지 않았음.
✅ 변경 사항:
위의 요구 사항을 모두 구현하였고 또한 여행계획이 끝나는 일보다 현재 날짜가 작은 경우이고 COMPLETED인 경우만 예정된 여행으로 조회되도록 수정
✅ 결과:
예정된 COURSE 여행이 제한시간이 지나면 자동으로 COMPLETED로 변경.
SCHEDULE 여행은 투표 실패 시 제거됨
3️⃣ COURSE 로직 개선
기존 로직에서는 COURSE 여행이 투표를 받아서 투표를 통해서 여행계획이 확정됨.
✅ 변경 사항:
투표가 필요없음에 따라서 COURSE 여행계획을 만들 때에는 voteRoom을 동시에 생성하지 않도록 변경.
✅ 결과:
COURSE 여행은 제한 시간이 지나면 자동 COMPLETED 전환
스크린샷 (선택)
위 사진과 같이 COURSE가 제한시간이 지난 상태로 GET 요청을 받게되더라도 진행 중인 투표 API와 예정된 여행계획 조회 API에서 모두 조회되도록 수정하였습니다.
💬리뷰 요구사항(선택)