Skip to content

Conversation

@Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Sep 12, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 새로 구현된 도메인 서비스로 변경했습니다.

📝 참고사항

📚 기타

Summary by CodeRabbit

  • 리팩터링

    • 이벤트 참가 신청의 요청 형식이 온라인 전용으로 이름이 변경되었습니다(엔드포인트 경로와 응답 동작은 변경 없음).
    • 서비스 호출 명칭이 갱신되어 온라인 신청 흐름을 명확히 구분합니다.
  • 스타일

    • 사소한 공백/서식 정리를 통해 코드 일관성을 개선했습니다.

@Sangwook02 Sangwook02 self-assigned this Sep 12, 2025
@Sangwook02 Sangwook02 requested a review from a team as a code owner September 12, 2025 15:17
@coderabbitai
Copy link

coderabbitai bot commented Sep 12, 2025

📝 Walkthrough

Walkthrough

컨트롤러·서비스·DTO의 이벤트 신청 API 명칭과 타입이 변경되었습니다: EventApplyRequestEventApplyOnlineRequest, 서비스 메서드 applyEventParticipation(...)applyOnline(...). 내부 로직과 멤버 조회 흐름은 유지됩니다. (≤50단어)

Changes

Cohort / File(s) Summary
Service: 메서드 이름/시그니처 변경
src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java
applyEventParticipation(EventApplyRequest)applyOnline(EventApplyOnlineRequest)로 메서드명·파라미터 타입 변경; 요청에서 Participant 추출, memberRepository.findByStudentId(...).orElse(null) 조회, EventParticipationDomainService.applyOnline(...) 호출 및 저장 로직 유지.
Controller: 요청 타입 및 위임 변경
src/main/java/com/gdschongik/gdsc/domain/event/api/ParticipantEventParticipationController.java
엔드포인트 요청 바디 타입을 EventApplyRequestEventApplyOnlineRequest로 변경하고, 서비스 호출을 eventParticipationService.applyOnline(request)로 대체(경로/응답 상태 unchanged).
DTO: 레코드명 변경
src/main/java/com/gdschongik/gdsc/domain/event/dto/request/EventApplyOnlineRequest.java
레코드명 EventApplyRequestEventApplyOnlineRequest로 리네임(필드 및 검증 어노테이션 동일).

Sequence Diagram(s)

sequenceDiagram
    participant Client as 클라이언트
    participant Controller as ParticipantEventParticipationController
    participant Service as EventParticipationService
    participant Domain as EventParticipationDomainService
    participant MemberRepo as MemberRepository

    Client->>Controller: POST /event-participations/apply\n(EventApplyOnlineRequest)
    Controller->>Service: applyOnline(request)
    Service->>MemberRepo: findByStudentId(participant.studentId)
    MemberRepo-->>Service: Member? (or null)
    Service->>Domain: applyOnline(participant, member, afterPartyStatus, event, now)
    Domain-->>Service: EventParticipation
    Service->>Service: save(EventParticipation)
    Service-->>Controller: void
    Controller-->>Client: 200 OK
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

깡충깡충 이름 바꿨어요, 새 길로 찬찬히
applyOnline로 폼을 맡기니 바람이 달라졌네
흐름은 그대로, 말만 바뀌었죠
당근 들고 토끼가 박수 쳐요 🐇🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Linked Issues Check ❓ Inconclusive PR은 이벤트 폼 제출 흐름을 새 도메인 서비스로 전환하고 요청 타입 및 서비스 메서드명을 갱신하는 변경을 포함하여 링크된 이슈 [#1218]의 목표인 "정책에 따라 변경"과 기술적으로 일치합니다; 그러나 해당 이슈에 구체적 수락 기준이나 정책 규칙의 상세가 기재되어 있지 않아 구현이 모든 요구사항을 충족하는지 완전하게 검증할 수 없습니다. 이슈 [#1218]에 적용해야 할 정책 규칙과 수락 기준을 명시하거나 PR에 정책별 동작을 검증하는 단위/통합 테스트와 예외 케이스를 추가하도록 요청해 주세요.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 제목 "feat: 이벤트 폼 제출 서비스를 정책에 따라 변경"은 PR의 주된 변경 사항(이벤트 폼 제출 서비스의 동작을 정책에 맞게 변경하고 새 도메인 서비스로 전환한 점)을 명확히 요약하고 있으며 불필요한 파일 목록이나 이모지 없이 간결하고 적절합니다.
Out of Scope Changes Check ✅ Passed 변경은 EventParticipationService, ParticipantEventParticipationController, EventApplyOnlineRequest 파일에 국한되며 모두 이벤트 폼 제출 흐름(요청 DTO, 컨트롤러 바인딩, 서비스 위임)과 직접 연관되어 있어 명백한 범위 외 변경은 발견되지 않습니다.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/1218-event-apply-service

📜 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 e7905af and bfa9d18.

📒 Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java
⏰ 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: build-test

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot changed the title feat: 이벤트 신청 서비스 수정 feat: 이벤트 폼 제출 서비스를 정책에 따라 변경 Sep 12, 2025
@github-actions
Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

@github-actions
Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java (1)

283-291: 빈 목록 처리 누락으로 인한 IndexOutOfBounds 위험

participations.get(0) 호출 전 빈 목록 체크가 없습니다. 요청이 비어도 서비스는 안전하게 no-op로 처리하는 편이 낫습니다.

     private void validateRequestParticipationsSameEvent(List<EventParticipation> participations) {
-        Event event = participations.get(0).getEvent();
+        if (participations.isEmpty()) {
+            return; // 빈 요청은 무해하게 무시
+        }
+        Event event = participations.get(0).getEvent();
         boolean hasDifferentEvent = participations.stream()
                 .anyMatch(participation -> !participation.getEvent().equals(event));
 
         if (hasDifferentEvent) {
             throw new CustomException(PARTICIPATION_NOT_UPDATABLE_DIFFERENT_EVENT);
         }
     }
🧹 Nitpick comments (2)
src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java (2)

321-323: null 허용 인자 처리 확인 + 시간 의존성 주입 제안

  • Domain 계층의 applyOnline(...)에서 member가 null일 수 있음을 전제로 방어 로직이 있는지 확인해 주세요. 없다면 NPE/분기 오류 위험이 있습니다. 가능하면 파라미터에 @Nullable 명시 또는 오버로드로 의도를 드러내세요.
  • 테스트 용이성을 위해 now() 대신 Clock 주입을 권장합니다.

패치 예시(해당 범위 내 변경):

-                participant, member, request.afterPartyApplicationStatus(), event, now());
+                participant, member, request.afterPartyApplicationStatus(), event, now(clock));

클래스 외부 변경(참고):

import java.time.Clock;
// ...
@RequiredArgsConstructor
public class EventParticipationService {
    private final Clock clock;
    // ...
}

추가로, 다음 케이스의 단위 테스트 2건을 권장합니다.

  • 회원 존재(member != null) + after party 신청 O/X
  • 회원 미존재(member == null) 흐름

243-249: 변수명 일관성 정리 제안

동일 패턴의 메서드에서 memberByParticipantmember로 통일하면 가독성이 좋아집니다.

-        Member memberByParticipant =
-                memberRepository.findByStudentId(participant.getStudentId()).orElse(null);
+        Member member =
+                memberRepository.findByStudentId(participant.getStudentId()).orElse(null);
 
-        EventParticipation participation =
-                eventParticipationDomainService.applyManual(participant, memberByParticipant, event);
+        EventParticipation participation =
+                eventParticipationDomainService.applyManual(participant, member, event);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98f1190 and 6cef51e.

📒 Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java (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: build-test
🔇 Additional comments (2)
src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java (2)

318-318: 지역 변수명(member) 변경 깔끔합니다.

의도 전달이 더 명확해졌습니다.


319-320: participant.getStudentId()의 null 가능성 확인 필요

EventApplyRequest/Participant DTO에서 studentId가 Bean Validation(@NotBlank/@NotNull 등)으로 보장되는지 확인하세요. 보장되지 않으면 src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java (applyEventParticipation)에서 Assert.notNull(participant.getStudentId())를 추가하거나 DTO에 @NotBlank/@NotNull을 적용하세요.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/main/java/com/gdschongik/gdsc/domain/event/dto/request/EventApplyOnlineRequest.java (1)

8-11: @Valid 추가·도메인 엔티티 직접 노출 최소화 권장

  • participant에 @Valid 추가 권장 (Bean Validation cascade가 필요하면). 참고: 현재 Participant는 @JsonCreator로 생성되며 빌더 내부에서 CustomException으로 검증되므로 @Valid는 필수는 아님. 변경 예시:
 public record EventApplyOnlineRequest(
         @NotNull @Positive Long eventId,
-        @NotNull Participant participant,
+        @NotNull @Valid Participant participant,
         @NotNull AfterPartyApplicationStatus afterPartyApplicationStatus) {}

추가 import:

import jakarta.validation.Valid;
  • 요청 DTO가 도메인 엔티티 Participant를 직접 노출하고 있음 — 입력 허용 필드를 화이트리스트로 제한하는 전용 Request DTO(e.g. ParticipantRequest {name, studentId, phone})로 분리하고 컨트롤러/서비스에서 Participant.of(...)로 변환할 것. 위치: src/main/java/com/gdschongik/gdsc/domain/event/dto/request/EventApplyOnlineRequest.java, src/main/java/com/gdschongik/gdsc/domain/event/domain/Participant.java

  • AfterPartyApplicationStatus는 온라인 신청 흐름에서 클라이언트 입력으로 사용됨(검증: EventParticipationDomainService.applyOnline 및 validateAfterPartyApplicationStatus). 정책상 서버 결정값이어야 하면 API를 단순 플래그(e.g. willAttendAfterParty)로 바꾸고 서버에서 매핑할 것. 위치: src/main/java/com/gdschongik/gdsc/domain/event/domain/service/EventParticipationDomainService.java, src/main/java/com/gdschongik/gdsc/domain/event/domain/AfterPartyApplicationStatus.java

src/main/java/com/gdschongik/gdsc/domain/event/api/ParticipantEventParticipationController.java (2)

25-25: 엔드포인트 명세와 메서드 명이 ‘Online’ 정책을 드러내지 않음

외부 계약을 그대로 유지해야 하는 사유가 없다면, 메서드명(및 필요시 경로/문서화)에서 온라인 전용임을 드러내면 API 가독성이 좋아집니다.

권장(메서드명만 변경하는 최소 변경):

- public ResponseEntity<Void> applyEventParticipation(@Valid @RequestBody EventApplyOnlineRequest request) {
+ public ResponseEntity<Void> applyEventParticipationOnline(@Valid @RequestBody EventApplyOnlineRequest request) {

선택(경로/문서도 일치화):

  • @PostMapping("/apply/online")
  • @operation(summary = "온라인 이벤트 참여 신청 폼 제출", description = "온라인 이벤트 참여 신청 폼을 제출합니다.")

26-26: 중복 제출/예외 매핑 정책 확인

서비스로 위임만 하고 있어 컨트롤러 계층에서의 예외 → HTTP 상태 코드 매핑이 보이지 않습니다. 아래 항목이 전역 예외 처리(@ControllerAdvice)로 커버되는지 확인 부탁드립니다:

  • 존재하지 않는 이벤트/참가자: 404 Not Found
  • 정책 위반/중복 신청: 409 Conflict 또는 422 Unprocessable Entity
  • 권한 부족: 403 Forbidden

중복 제출 방지(예: Idempotency-Key 헤더 처리, 멱등 키 기반 저장) 여부도 정책과 일치하는지 확인해 주세요.

필요하시면 전역 예외 핸들러 스켈레톤과 멱등 처리 예시를 드리겠습니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6cef51e and e7905af.

📒 Files selected for processing (3)
  • src/main/java/com/gdschongik/gdsc/domain/event/api/ParticipantEventParticipationController.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/event/dto/request/EventApplyOnlineRequest.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/event/application/EventParticipationService.java
🔇 Additional comments (1)
src/main/java/com/gdschongik/gdsc/domain/event/api/ParticipantEventParticipationController.java (1)

4-4: DTO rename 반영 적절

새로운 요청 타입 import가 컨트롤러에 일관되게 반영되었습니다.

Copy link
Member

@kimsh1017 kimsh1017 left a comment

Choose a reason for hiding this comment

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

lgtm

@kckc0608
Copy link
Member

Lgtm

@Transactional
public void applyEventParticipation(EventApplyRequest request) {
// TODO: 메서드 및 DTO applyOnline으로 이름 변경
public void applyOnline(EventApplyOnlineRequest request) {
Copy link
Member

Choose a reason for hiding this comment

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

이거 변수명 의도한건데 체크좀요

Copy link
Member Author

Choose a reason for hiding this comment

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

memberByParticipant 말씀하시는건가요?

Copy link
Member

Choose a reason for hiding this comment

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

@github-actions
Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

lgtm

@Sangwook02 Sangwook02 merged commit 5d704dc into develop Sep 13, 2025
3 checks passed
@Sangwook02 Sangwook02 deleted the feature/1218-event-apply-service branch September 13, 2025 12:16
@sentry
Copy link

sentry bot commented Sep 17, 2025

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ 이벤트 폼 제출 서비스를 정책에 따라 변경

5 participants