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

[DDING-000] 동아리 지원하기 - File Type 답변 로직 추가 #257

Merged
merged 5 commits into from
Feb 12, 2025

Conversation

5uhwann
Copy link
Collaborator

@5uhwann 5uhwann commented Feb 11, 2025

🚀 작업 내용

  • 동아리 지원하기 기능 로직 추가
    • File 타입 FieldAnswer 시 누락된 FileMetaData 관련 로직 추가

🤔 고민했던 내용

💬 리뷰 중점사항

Summary by CodeRabbit

  • 새로운 기능
    • 폼 응답 관련 파일 지원 범위가 확장되어, 새로운 파일 형식이 추가되었습니다.
    • 파일 관련 폼 응답 처리 시 자동으로 상태 업데이트하는 기능이 도입되어 처리 정확성이 향상되었습니다.
    • 폼 삭제 시 관련 파일 메타데이터 상태가 자동으로 업데이트되도록 기능이 추가되었습니다.

@5uhwann 5uhwann added 🎯리팩토링 리팩토링 및 고도화 이슈 D-1 labels Feb 11, 2025
@5uhwann 5uhwann self-assigned this Feb 11, 2025
Copy link

coderabbitai bot commented Feb 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

이번 변경 사항은 DomainType 열거형에 FORM_FILE 상수를 추가하여 도메인 유형의 범위를 확장합니다. 또한, FacadeUserFormApplicationServiceImpl 클래스에 FileMetaDataService 인스턴스를 추가하고, createFormApplication 메서드에서 파일 관련 답안의 상태를 업데이트하는 로직을 추가하였습니다. FacadeCentralFormServiceImpl 클래스에서는 폼 삭제 시 파일 메타데이터 상태를 업데이트하는 로직이 통합되었습니다.

Changes

파일 변경 요약
src/main/java/ddingdong/.../DomainType.java DomainType 열거형에 FORM_FILE 상수 추가
src/main/java/ddingdong/.../FacadeUserFormApplicationServiceImpl.java FileMetaDataService 인스턴스 추가 및 createFormApplication 메서드에서 파일 관련 답안에 대해 updateFileMetaDataStatusToCoupled 호출 로직 추가
src/main/java/ddingdong/.../FacadeCentralFormServiceImpl.java FileMetaDataService 인스턴스 추가 및 deleteForm 메서드에서 파일 메타데이터 상태 업데이트 로직 추가

Sequence Diagram(s)

sequenceDiagram
    participant Service as FacadeUserFormApplicationServiceImpl
    participant Metadata as FileMetaDataService
    participant Answer as FormAnswer
    participant Form as Form
    Service->>Answer: 폼 답안 처리
    alt FieldType이 FILE인 경우
        Service->>Metadata: updateStatusToCoupled(answerValue, FORM_FILE, formId)
    end
Loading

Possibly related PRs

Suggested labels

🛠️버그

Suggested reviewers

  • wonjunYou
  • 5uhwann

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43e2b49 and f20478f.

📒 Files selected for processing (3)
  • src/main/java/ddingdong/ddingdongBE/domain/filemetadata/entity/DomainType.java (1 hunks)
  • src/main/java/ddingdong/ddingdongBE/domain/form/service/FacadeCentralFormServiceImpl.java (3 hunks)
  • src/main/java/ddingdong/ddingdongBE/domain/formapplication/service/FacadeUserFormApplicationServiceImpl.java (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

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.

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 (1)
src/main/java/ddingdong/ddingdongBE/domain/formapplication/service/FacadeUserFormApplicationServiceImpl.java (1)

47-58: 파일 상태 업데이트 시 예외 처리 로직 추가를 고려해보세요.

파일 메타데이터 상태 업데이트 시 발생할 수 있는 예외 상황(예: 파일이 존재하지 않는 경우)에 대한 처리가 필요해 보입니다.

다음과 같은 예외 처리 로직 추가를 제안드립니다:

 if (formAnswer.getFormField().getFieldType() == FieldType.FILE) {
+    try {
         fileMetaDataService.updateStatusToCoupled(
                 formAnswer.getValue(),
                 FORM_ANSWER_FILE,
                 formAnswer.getId()
         );
+    } catch (FileNotFoundException e) {
+        throw new BusinessException(ErrorCode.FILE_NOT_FOUND);
+    } catch (Exception e) {
+        throw new BusinessException(ErrorCode.FILE_PROCESSING_ERROR);
+    }
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between accfe45 and 43e2b49.

📒 Files selected for processing (2)
  • src/main/java/ddingdong/ddingdongBE/domain/filemetadata/entity/DomainType.java (1 hunks)
  • src/main/java/ddingdong/ddingdongBE/domain/formapplication/service/FacadeUserFormApplicationServiceImpl.java (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and analyze
🔇 Additional comments (2)
src/main/java/ddingdong/ddingdongBE/domain/filemetadata/entity/DomainType.java (1)

19-20: 구현이 적절해 보입니다!

FORM_ANSWER_FILE 상수가 기존 도메인 타입들과 일관된 네이밍 패턴을 따르고 있으며, 열거형 상수 목록의 마지막에 적절하게 배치되었습니다.

src/main/java/ddingdong/ddingdongBE/domain/formapplication/service/FacadeUserFormApplicationServiceImpl.java (1)

3-28: 의존성 주입이 깔끔하게 구현되었습니다!

FileMetaDataServiceFORM_ANSWER_FILE 상수의 import가 명확하게 되어있고, 의존성 주입이 @RequiredArgsConstructor를 통해 적절하게 처리되었습니다.

Copy link
Collaborator

@Seooooo24 Seooooo24 left a comment

Choose a reason for hiding this comment

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

확인했습니다! 고생 많으셨습니다

@github-actions github-actions bot added D-0 and removed D-1 labels Feb 12, 2025
@KoSeonJe KoSeonJe merged commit ae1314b into develop Feb 12, 2025
1 of 2 checks passed
@KoSeonJe KoSeonJe deleted the refactor/DDING-000 branch February 12, 2025 17:05
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
13.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-0 🎯리팩토링 리팩토링 및 고도화 이슈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants