Skip to content

[BE-226] bug: 주차권 이벤트가 끝나지 않았을 때 이메일 전송 api 요청이 성공하는 오류 #477

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

Merged
merged 5 commits into from
Mar 8, 2025

Conversation

xxbeann
Copy link
Collaborator

@xxbeann xxbeann commented Mar 5, 2025

주요 변경사항

현재 주차권 이벤트가 CLOSED 상태가 아님에도 수동으로 메일 전송 버튼을 눌렀을 때, 전송을 성공했습니다.
이를 주차권 이벤트가 CLOSED 상태에만 수동으로 이메일 전송 요청을 보낼 수 있게 수정했습니다.
CLOSED 상태가 아닐경우 에러를 던지게 끔 수정했습니다.

리뷰어에게...

eventId에 해당하는 EventStatusCLOSED일 때만 요청이 가게끔 코드를 수정하려했습니다.
이를 위해 eventId로 해당 EventStatus를 가져오려 했는데, 이 때 eventAdaptorfindById를 사용했습니다.
이 방법이 유효한지 확인부탁드립니다.

관련 이슈

closes #474

체크리스트

  • reviewers 설정
  • label 설정
  • milestone 설정

@xxbeann xxbeann added the 뜨거운 감자 앗 뜨거!! 긴급한 수정이 필요할 때 label Mar 5, 2025
@xxbeann xxbeann self-assigned this Mar 5, 2025
@pyg410
Copy link
Collaborator

pyg410 commented Mar 5, 2025

📝 테스트 커버리지 리포트입니다

File Coverage [58.02%]
CouncilUseCase.java 58.02%
Total Project Coverage 41.31% 🍏

@westzeroright
Copy link
Collaborator

api 테스트해보셨나요? 급한 이슈가 아니라면 하나의 pr에 테스트코드 작성해주셨으면 좋겠습니다.

api 테스트해보셨냐는 말은 지금은 테스트코드가 없으니 스웨거 혹은 포스트맨으로 요청을 해보셨는지를 여쭈어보는 겁니다.

Comment on lines +55 to +60
Event event = eventAdaptor.findById(eventId);

if (event.getEventStatus() != EventStatus.CLOSED) {
throw StillOpenEventException.EXCEPTION;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 조금 헷갈리는 부분이 있는데 예외 메세지가 != EventStatus.CLOSED 보다 좁은 의미를 나타내고 있습니다. 수정해주세요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 수정하겠습니다.

@xxbeann
Copy link
Collaborator Author

xxbeann commented Mar 6, 2025

우선 급한이슈이고, 테스트코드는 추후에 작성해서 올리도록 하겠습니다.
api테스트의 경우 스웨거로 진행하려 했으나, 이벤트 발행 자체가 안되더라구요?(학생회 권한이 아니라고 에러가 뜨던데)
혹시 이럴 때 해결 방안이 있나요? 포스트맨으로 api테스트는 진행해보겠습니다.

Comment on lines +55 to +60
Event event = eventAdaptor.findById(eventId);

if (event.getEventStatus() != EventStatus.CLOSED) {
throw StillOpenEventException.EXCEPTION;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 조금 헷갈리는 부분이 있는데 예외 메세지가 != EventStatus.CLOSED 보다 좁은 의미를 나타내고 있습니다. 수정해주세요!

@westzeroright
Copy link
Collaborator

우선 급한이슈이고, 테스트코드는 추후에 작성해서 올리도록 하겠습니다. api테스트의 경우 스웨거로 진행하려 했으나, 이벤트 발행 자체가 안되더라구요?(학생회 권한이 아니라고 에러가 뜨던데) 혹시 이럴 때 해결 방안이 있나요? 포스트맨으로 api테스트는 진행해보겠습니다.

근데 로컬에서 테스트해보는 거 스웨러랑 포스트맨이랑 둘 다 똑같은데
db단에서 역할을 수정해야하지 않을까요?

@xxbeann
Copy link
Collaborator Author

xxbeann commented Mar 6, 2025

네 역할 수정해서 api 테스트 진행해보겠습니다~

@pyg410
Copy link
Collaborator

pyg410 commented Mar 6, 2025

📝 테스트 커버리지 리포트입니다

File Coverage [58.02%]
CouncilUseCase.java 58.02%
Total Project Coverage 41.31% 🍏

Copy link

sonarqubecloud bot commented Mar 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@xxbeann xxbeann requested a review from LJH098 March 7, 2025 04:13
@aiaiaiai1 aiaiaiai1 merged commit 3689660 into dev Mar 8, 2025
4 of 5 checks passed
@xxbeann xxbeann deleted the bug-#226 branch March 8, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
뜨거운 감자 앗 뜨거!! 긴급한 수정이 필요할 때
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE-226] bug: 주차권 이벤트가 끝나지 않았을 때 이메일 전송 api 요청이 성공하는 오류
5 participants