Skip to content

Conversation

@move-hoon
Copy link
Member

Related issue 🛠

Work Description ✏️

  • 활성 예약 검증 로직에서 예매 삭제 상태(BOOKING_DELETED)도 제외하도록 수정했습니다.
  • 따라서 예약자 count 시에 제외되는 상태는 예매 삭제 상태(BOOKING_DELETED), 예매 취소 상태(BOOKING_CANCELLED)입니다.

Trouble Shooting ⚽️

Related ScreenShot 📷

Uncompleted Tasks 😅

To Reviewers 📢

@move-hoon move-hoon self-assigned this Jul 25, 2025
@move-hoon move-hoon linked an issue Jul 25, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jul 25, 2025

Summary by CodeRabbit

  • New Features

    • 예약 상태를 여러 개 제외하여 예약 존재 여부를 확인하는 기능이 추가되었습니다.
  • Refactor

    • 스트림 결과 리스트 변환 시 .collect(Collectors.toList())를 .toList()로 간소화하였습니다.
    • 예약 존재 여부 확인 로직이 취소 또는 삭제된 예약을 제외하도록 개선되었습니다.
  • Chores

    • 애플리케이션 기본 프로필이 "local"에서 "dev"로 변경되었습니다.

Walkthrough

예약 관련 로직에서 예약 존재 여부를 확인할 때, 기존에는 취소된 예약(BOOKING_CANCELLED)만 제외하고 확인하던 것을 삭제된 예약(BOOKING_DELETED)도 함께 제외하도록 BookingRepository의 메서드 시그니처 및 사용처를 전반적으로 수정했습니다. 또한, Java Stream의 리스트 수집 방식이 .collect(Collectors.toList())에서 .toList()로 일괄 변경되었습니다. application.yml의 기본 Spring profile도 "local"에서 "dev"로 변경되었습니다.

Changes

파일/경로 변경 요약
src/main/java/com/beat/domain/booking/dao/BookingRepository.java 예약 존재 확인 메서드가 단일 상태 제외에서 다중 상태 제외로 시그니처 변경 및 BookingStatus import 추가
src/main/java/com/beat/domain/performance/application/PerformanceManagementService.java
src/main/java/com/beat/domain/performance/application/PerformanceModifyService.java
src/main/java/com/beat/domain/performance/application/PerformanceService.java
예약 존재 확인 로직을 새로운 메서드로 교체, Stream 리스트 수집을 .toList()로 변경, 불필요 import 제거
src/main/resources/application.yml spring.profiles.active 기본값을 "local"에서 "dev"로 변경

Sequence Diagram(s)

sequenceDiagram
    participant Service as PerformanceService/ManagementService/ModifyService
    participant BookingRepo as BookingRepository

    Service->>BookingRepo: existsActiveBookingByScheduleIds(scheduleIds, [BOOKING_CANCELLED, BOOKING_DELETED])
    BookingRepo-->>Service: boolean (active bookings exist?)
    Service->>Service: 예약 존재 여부에 따라 로직 분기 (삭제/수정/조회 등)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰
예약의 상태를 꼼꼼히 살펴,
삭제와 취소는 이제 안 셀 거야!
Stream도 짧게, 코드도 산뜻,
프로필은 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 12b0062 and 4c6b78b.

📒 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 (6 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 (12)
src/main/resources/application.yml (1)

3-3: 환경 설정 변경 확인 필요

기본 Spring profile이 "local"에서 "dev"로 변경되었습니다. 이 변경이 의도적인 것인지 확인해 주세요. 만약 이것이 실수라면, 다른 개발자들의 로컬 환경에 영향을 줄 수 있습니다.

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

13-13: import 추가 확인

BookingStatus import가 추가되어 새로운 예약 상태 검증 로직에 사용되고 있습니다.


77-78: 활성 예약 검증 로직 개선

예약 존재 여부 확인 로직이 개선되어 취소된 예약(BOOKING_CANCELLED)과 삭제된 예약(BOOKING_DELETED) 모두를 제외하도록 변경되었습니다. 이는 PR 목표와 정확히 일치하는 핵심 변경사항입니다.


153-153: Stream API 개선

.collect(Collectors.toList())를 더 간결한 .toList()로 변경한 것은 Java 16+에서 사용 가능한 좋은 개선사항입니다. 코드가 더 읽기 쉬워졌습니다.

Also applies to: 172-172, 176-176, 196-196, 208-208, 414-414

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

13-13: import 추가 확인

BookingStatus import가 올바르게 추가되었습니다.


189-190: 예약 검증 로직 일관성 유지

다른 서비스 클래스들과 동일하게 삭제된 예약도 제외하도록 로직이 개선되었습니다. 전체 시스템에서 일관된 예약 상태 처리가 이루어지고 있습니다.


79-79: Stream API 최신화

모든 .collect(Collectors.toList()) 호출이 .toList()로 일관되게 변경되었습니다.

Also applies to: 87-87, 93-93, 99-99, 122-122, 149-149, 154-154, 159-159, 207-207, 211-211, 216-216, 221-221

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

11-11: import 추가 확인

BookingStatus import가 새로운 메서드 매개변수에 필요하여 올바르게 추가되었습니다.


37-41: 새로운 메서드 구현 검증

새로운 existsActiveBookingByScheduleIds 메서드가 올바르게 구현되었습니다. JPQL 쿼리는 지정된 스케줄 ID들에서 제외할 상태 목록에 포함되지 않은 예약이 존재하는지 확인합니다. 이는 PR의 핵심 요구사항을 정확히 구현합니다.

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

12-12: import 추가 확인

BookingStatus import가 올바르게 추가되었습니다.


229-232: 성능 삭제 시 예약 검증 로직 개선

성능 삭제 시에도 활성 예약만을 확인하도록 로직이 개선되었습니다. 취소되거나 삭제된 예약은 성능 삭제를 방해하지 않도록 하는 것이 합리적입니다. 변수명도 isBookerExist로 변경되어 의미가 더 명확해졌습니다.


99-99: Stream API 현대화

모든 스트림 수집 작업이 최신 .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 4c72348 into develop Jul 25, 2025
2 checks passed
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