New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(server): Donation Status를 변경한다 #398
Conversation
WAITING_FOR_EXCHANGE, EXCHANGED 만 존재하도록 변경
|
나는 exchangablePoint의 네이밍을 currentPoint로 바꾸면 좀 더 좋을 듯? |
수리랑 조이 의견 반영해서 수정했어!! 시간될 때 다시 리뷰부탁해 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로키 확인 다 했다~! 앞에서 이미 한 차례 피드백 반영이 돼서 딱히 모난데가 없었던 것 같어~!
내거랑 충돌이 좀 생길 것 같은데 이 pr 머지시키고 내 브랜치에서 풀땡겨서 작업하면 될 것 같다!
로키 수고했으~!
@@ -140,7 +139,7 @@ private void validateExchangeable(Member member, Long exchangeablePoint) { | |||
if (exchangeRepository.existsByPageName(member.getPageName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 변경은 없는 부분인데 우리가 Exchange를 기존에는 처리하고 난 다음에 지워줬었는데, 이제 지우지 않고 내버려두는 방식으로 하게 된다면 이 부분 검증 로직이 바뀌어야 될 것 같네
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 내쪽에서 수정할게!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
내 쪽에서 exchangeRepository 수정하면서 로직, 테스트코드 바꾸고 있으니까 이런건 넘겨도 될듯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생했어 로키! 깔끔하게 리팩토링됐네! API문서 수정만 하면 될거같아.
private Long exchangedTotalPoint; | ||
|
||
public DetailedPointResponse(Long currentPoint, Long exchangeablePoint, Long exchangedTotalPoint) { | ||
public DetailedPointResponse(Long currentPoint, Long exchangedTotalPoint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
프론트에도 알려주고 API문서 수정해야할듯!
@@ -140,7 +139,7 @@ private void validateExchangeable(Member member, Long exchangeablePoint) { | |||
if (exchangeRepository.existsByPageName(member.getPageName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
내 쪽에서 exchangeRepository 수정하면서 로직, 테스트코드 바꾸고 있으니까 이런건 넘겨도 될듯
작업내용
DonationStatus
를 기존 4개(‘환불가능’, ‘정산가능’, ‘정산완료’, ‘취소됨’)에서 2개로 (WAITING_FOR_EXCHANGE
,EXCHANGED
) 변경Donation
의 DonationStatus를CANCELLED
,EXCHANGEABLE
로 변경하는 기능Donation.toCancelled()
,Donation.toExchangeable()
기능 제거WAITING_FOR_EXCHANGE
로 초기화findFirst5ByMemberAndStatusNotOrderByCreatedAtDesc()
기능 status로 필터링하지 않도록 변경고민되는 부분
DonationRepositoryImpl 클래스
DonationStatus가 2개로 변경되면서 QueryDsl로 작성한
exchangeablePoint
와currentPoint
가 동일한 로직으로 보임정산 가능
+정산 불가
를 합한 총 포인트정산 불가능한 포인트는 없다
.currentPoint
기능은 없어져야할 것 같음. (테스트도 같이)결론
DonationRepositoryImpl 클래스에
currentPoint(...)
삭제해도 되는지...? 🤔(삭제해도 된다고 하면 메서드 삭제 + 테스트 코드 삭제할 예정)
번외…
Closes #397