Skip to content
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

[fix] #215 - 예매자 존재 여부 확인 로직 변경 #216

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

hyerinhwang-sailin
Copy link
Collaborator

@hyerinhwang-sailin hyerinhwang-sailin commented Sep 30, 2024

Related issue 🛠

Work Description ✏️

공연 삭제 시 예매자 존재 여부 확인 로직이 booking의 총 개수가 아닌 cancelled 된 booking을 제외한 총 개수로 판단하도록 쿼리문을 수정했습니다.

  • 기존 쿼리문
	@Query("SELECT COUNT(b) > 0 FROM Booking b WHERE b.schedule.id IN :scheduleIds")
	boolean existsByScheduleIdIn(@Param("scheduleIds") List<Long> scheduleIds);
  • 수정한 쿼리문
	@Query("SELECT COUNT(b) > 0 FROM Booking b WHERE b.schedule.id IN :scheduleIds AND b.bookingStatus != 'BOOKING_CANCELLED'")
	boolean existsByScheduleIdIn(@Param("scheduleIds") List<Long> scheduleIds);

Trouble Shooting ⚽️

Related ScreenShot 📷

image

기존 공연을 예매했습니다.

스크린샷 2024-09-30 오후 6 15 51

해당 공연을 삭제 시도하면 예매자가 존재하므로 에러를 반환합니다.

image

해당 예매를 취소(삭제)했습니다.

image

공연 삭제가 성공한 것을 확인했습니다.

Uncompleted Tasks 😅

To Reviewers 📢

Copy link
Member

@hoonyworld hoonyworld left a comment

Choose a reason for hiding this comment

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

엣지케이스의 달인!

너무 감사합니다 LGTM~

@hyerinhwang-sailin hyerinhwang-sailin merged commit 099dfcb into develop Sep 30, 2024
1 check passed
@hoonyworld hoonyworld deleted the fix/#215 branch October 2, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] 예매자 존재 여부 확인 로직 변경
2 participants