Skip to content

Conversation

@move-hoon
Copy link
Member

Related issue 🛠

Work Description ✏️

  • 공연 삭제가 안되는 문제를 해결하는 과정에서 조그마한 작업으로 가변 리스트를 불편 리스트로 처리했던 부분에서 문제가 생겼습니다.
  • 따라서 revert 후 가변 리스트로 재변경합니다.

Trouble Shooting ⚽️

Related ScreenShot 📷

Uncompleted Tasks 😅

To Reviewers 📢

@coderabbitai
Copy link

coderabbitai bot commented Jul 25, 2025

Summary by CodeRabbit

  • New Features

    • 예약 상태 필터링이 개선되어, 취소 또는 삭제된 예약을 제외한 활성 예약만 조회할 수 있도록 변경되었습니다.
  • Style

    • 리스트 변환 시 코드가 간결해져 가독성이 향상되었습니다.
  • Chores

    • 기본 Spring 프로필이 "local"에서 "dev"로 변경되었습니다.

Walkthrough

기존에 예약 존재 여부를 확인하던 메서드가 단일 취소 상태만 제외하던 방식에서, 여러 예약 상태를 제외할 수 있도록 일반화되었습니다. 이에 따라 서비스 계층에서 관련 메서드 호출부가 변경되었고, Java Stream의 리스트 변환 방식이 .collect(Collectors.toList())에서 .toList()로 간소화되었습니다. application.yml의 기본 프로필도 "local"에서 "dev"로 변경되었습니다.

Changes

파일/경로 변경 요약
.../booking/dao/BookingRepository.java 예약 존재 확인 메서드가 단일 상태 제외에서 다중 상태 제외로 시그니처 및 쿼리 변경, BookingStatus import 추가
.../performance/application/PerformanceManagementService.java 예약 체크 메서드 변경, Stream 리스트 변환 방식 .toList()로 변경, 변수명 일부 수정
.../performance/application/PerformanceModifyService.java 예약 체크 메서드 변경, Stream 리스트 변환 방식 .toList()로 변경
.../performance/application/PerformanceService.java 예약 체크 메서드 변경, Stream 리스트 변환 방식 .toList()로 변경, BookingStatus import 추가
src/main/resources/application.yml spring.profiles.active 기본값을 "local"에서 "dev"로 변경

Sequence Diagram(s)

sequenceDiagram
    participant Service as PerformanceService/ManagementService/ModifyService
    participant Repo as BookingRepository
    participant DB as Database

    Service->>Repo: existsActiveBookingByScheduleIds(scheduleIds, excludedStatuses)
    Repo->>DB: SELECT ... WHERE schedule_id IN (...) AND status NOT IN (excludedStatuses)
    DB-->>Repo: 결과 반환 (존재 여부)
    Repo-->>Service: true/false 반환
    Service->>Service: (존재 시) ForbiddenException 발생
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇
예약 상태 체크가 더 똑똑해졌지,
취소·삭제 모두 쏙 빼고 찾기!
.toList()로 코드는 더 깔끔,
dev 프로필로 시작도 산뜻함.
오늘도 토끼는 깡총, 버그를 이겼지! 🥕

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c72348 and 647593c.

📒 Files selected for processing (5)
  • src/main/java/com/beat/domain/booking/dao/BookingRepository.java (2 hunks)
  • src/main/java/com/beat/domain/performance/application/PerformanceManagementService.java (9 hunks)
  • src/main/java/com/beat/domain/performance/application/PerformanceModifyService.java (7 hunks)
  • src/main/java/com/beat/domain/performance/application/PerformanceService.java (7 hunks)
  • src/main/resources/application.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: dev-ci
🔇 Additional comments (9)
src/main/resources/application.yml (1)

3-3: 구성 변경 승인

기본 프로필을 "local"에서 "dev"로 변경하는 것은 적절한 환경 설정 업데이트입니다.

src/main/java/com/beat/domain/performance/application/PerformanceModifyService.java (2)

77-78: 예약 존재 확인 로직 개선 승인

취소된 예약과 삭제된 예약을 제외하고 활성 예약을 확인하는 로직이 올바르게 구현되었습니다.


153-153: 불변 리스트 변경 안전 검증 완료

메서드 내부와 이후 사용처에서 반환된 리스트에 대해 .add·.addAll·.remove·.clear 등의 변형 호출이 전혀 발견되지 않았습니다. 따라서 .toList()로 불변 리스트를 반환해도 문제없이 동작합니다.

src/main/java/com/beat/domain/performance/application/PerformanceService.java (3)

190-191: 예약 존재 확인 로직 개선 승인

취소된 예약과 삭제된 예약을 제외한 활성 예약 확인 로직이 올바르게 구현되었습니다.


155-155: positiveDueDates 가변성 처리 올바름

라인 155에서 positiveDueDates.collect(Collectors.toList())로 가변 리스트를 유지하고, 라인 162에서 positiveDueDates.addAll(negativeDueDates)를 통해 수정이 가능합니다. 이는 PR 목표인 "positiveDueDates를 가변리스트로 수정"과 정확히 일치합니다.

Also applies to: 162-162


80-80: 스트림 컬렉션 간소화 승인

이 위치들에서는 리스트가 읽기 전용으로 사용되므로 .toList()로 변경하여 불변 리스트를 생성하는 것이 적절합니다.

Also applies to: 88-88, 94-94, 100-100, 123-123, 150-150, 160-160, 208-208, 212-212, 217-217, 222-222

src/main/java/com/beat/domain/booking/dao/BookingRepository.java (1)

37-41: 저장소 메서드 개선 승인

기존의 단일 상태 제외 방식에서 여러 예약 상태를 제외할 수 있는 유연한 메서드로 개선되었습니다. 메서드명과 파라미터명이 명확하고, JPA 쿼리도 올바르게 작성되었습니다.

src/main/java/com/beat/domain/performance/application/PerformanceManagementService.java (2)

229-230: 예약 존재 확인 로직 개선 승인

취소된 예약과 삭제된 예약을 제외한 활성 예약 확인 로직으로 개선되었고, 변수명도 다른 서비스 클래스와 일관성 있게 isBookerExist로 통일되었습니다.

Also applies to: 232-232


99-99: 스트림 컬렉션 간소화 승인

생성 및 응답 매핑에 사용되는 리스트들은 읽기 전용이므로 .toList()를 사용한 불변 리스트 생성이 적절합니다.

Also applies to: 108-108, 119-119, 129-129, 137-137, 153-153, 162-162, 171-171, 178-178

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/#327

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@move-hoon move-hoon merged commit ff6b32c into develop Jul 25, 2025
1 of 2 checks passed
@move-hoon move-hoon deleted the bug/#327 branch July 25, 2025 07:33
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