Skip to content

Refactor: 기업분석정보 조회 응답 수정#382

Merged
hyoinkang merged 1 commit intodevfrom
refactor/company-insight-status-#381
Apr 22, 2026
Merged

Refactor: 기업분석정보 조회 응답 수정#382
hyoinkang merged 1 commit intodevfrom
refactor/company-insight-status-#381

Conversation

@hyoinkang
Copy link
Copy Markdown
Contributor

@hyoinkang hyoinkang commented Apr 22, 2026

Summary

기업분석정보 진행중일 때 에러를 내리는 대신 status로 분기처리할 수 있도록 응답을 수정합니다.

Changes

  • 조회 로직 수정 : 에러 제거 및 응답에 status 추가

Type of Change

해당하는 항목에 체크해주세요:

  • Bug fix (기존 기능을 수정하는 변경)
  • New feature (새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 변경)
  • Refactoring (기능 변경 없이 코드 개선)
  • Documentation (문서 변경)
  • Chore (빌드, 설정 등)

Target Environment

배포 대상 브랜치를 선택해주세요:

  • Dev (dev)
  • Prod (main)

Related Issues

관련 이슈를 연결해주세요:

Testing

테스트 방법을 작성해주세요:

  • Postman/Swagger로 API 호출 확인
  • 단위 테스트 통과
  • E2E 테스트 통과

Checklist

PR 생성 전 확인사항:

  • 코드 컨벤션을 준수했습니다 (docs/development/CODE_STYLE.md)
  • Git 컨벤션을 준수했습니다 (docs/development/GIT_CONVENTIONS.md)
  • 네이밍 컨벤션을 준수했습니다 (docs/development/NAMING_CONVENTIONS.md)
  • 로컬에서 빌드가 성공합니다 (pnpm run build)
  • 로컬에서 린트가 통과합니다 (pnpm run lint)
  • (API 변경 시) Swagger 문서가 업데이트되었습니다
  • (필요 시) 테스트 코드를 작성했습니다

Screenshots (Optional)

UI 변경이 있다면 스크린샷을 첨부해주세요.

Additional Notes

리뷰어에게 전달할 추가 정보가 있다면 작성해주세요.

- 기업분석정보 진행중일 때 에러를 내리는 대신 status로 분기처리할 수 있도록 응답을 수정
@hyoinkang hyoinkang self-assigned this Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 16:18
@hyoinkang hyoinkang linked an issue Apr 22, 2026 that may be closed by this pull request
18 tasks
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

기업분석정보(company insight)가 아직 생성되지 않았을 때 COMPANY_INSIGHT_NOT_READY 예외를 던지는 대신, 응답에 status를 포함해 프론트에서 상태 기반 분기 처리가 가능하도록 조회 응답을 조정합니다.

Changes:

  • GET /:correctionId/company-insight에서 COMPANY_INSIGHT_NOT_READY 예외를 제거하고 항상 DTO 응답 반환
  • UpdateCompanyInsightResDTOstatus: CorrectionStatus 필드 추가
  • 관련 단위 테스트를 “throw” 기대에서 “status 포함 응답” 기대 형태로 수정

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/modules/portfolio-correction/presentation/portfolio-correction.controller.ts 기업분석정보 조회 API의 Swagger 에러 응답에서 COMPANY_INSIGHT_NOT_READY 제거
src/modules/portfolio-correction/application/services/portfolio-correction.service.ts 기업분석정보 조회 시 companyInsight === null일 때 예외 throw 제거
src/modules/portfolio-correction/application/services/portfolio-correction.service.spec.ts 조회 동작 변경에 맞춰 테스트를 “응답(status 포함) 반환”으로 업데이트
src/modules/portfolio-correction/application/dtos/company-insight.dto.ts 응답 DTO에 status를 추가하고 from() 매핑 반영

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hyoinkang hyoinkang merged commit 4a93ee4 into dev Apr 22, 2026
6 checks passed
@hyoinkang hyoinkang deleted the refactor/company-insight-status-#381 branch April 22, 2026 16:22
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

본 PR은 기업 분석 정보 조회 API의 응답 방식을 개선합니다. 기존에는 데이터가 준비되지 않았을 경우 에러를 반환했으나, 이를 상태값(status)을 포함한 정상 응답으로 변경함으로써 클라이언트 측에서 보다 유연하게 분기 처리를 할 수 있도록 설계했습니다.

Highlights

  • API 응답 구조 변경: 기업 분석 정보 조회 시 에러를 반환하는 대신, 응답 객체에 'status' 필드를 추가하여 상태를 클라이언트가 직접 처리할 수 있도록 변경했습니다.
  • 예외 처리 제거: 기업 분석 정보가 준비되지 않았을 때 발생하던 'COMPANY_INSIGHT_NOT_READY' 예외를 제거하고, 정상 응답으로 처리하도록 로직을 수정했습니다.
  • 테스트 코드 업데이트: 기존의 예외 발생 테스트 케이스를 상태값 확인 테스트로 변경하여 변경된 로직을 검증합니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the company insight retrieval process to return a status field instead of throwing an error when the insight is not ready. Key changes include adding the status field to the response DTO, updating the service logic to remove the exception, and adjusting the controller's error documentation and unit tests. Feedback was provided regarding the naming of UpdateCompanyInsightResDTO, suggesting a more generic name like CompanyInsightResDTO to better reflect its dual use for both retrieval and update operations.

Comment on lines +30 to +31
@ApiProperty({ enum: CorrectionStatus })
status: CorrectionStatus;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

❌ 문제: UpdateCompanyInsightResDTO 클래스명이 '수정' 응답임을 나타내고 있으나, 현재 '조회' API(getCompanyInsight)에서도 공통으로 사용되고 있습니다. status 필드가 추가되면서 단순 수정 결과 이상의 정보를 포함하게 되었으므로 네이밍이 부적절합니다.
✅ 제안: CompanyInsightResDTO와 같이 조회와 수정 시 공통으로 사용할 수 있는 범용적인 이름으로 변경하는 것을 권장합니다.

References
  1. 네이밍 컨벤션 준수 여부 확인 (우선순위 중간) (link)

hyoinkang added a commit that referenced this pull request Apr 22, 2026
- 기업분석정보 진행중일 때 에러를 내리는 대신 status로 분기처리할 수 있도록 응답을 수정
hyoinkang added a commit that referenced this pull request Apr 24, 2026
* Fix: 활동 블록 삭제 시 첨삭 연관 데이터를 정리하고 삭제하도록 로직 변경 (#377)

* refactor: 활동 블록 삭제 시 첨삭 연관 데이터를 정리하고 삭제하도록 로직 변경

- 활동 블록 삭제를 막는 기존 검증 로직을 수정함.

* refactor: 외부 포트폴리오 삭제 플로우 선검증/병렬삭제로 개선

- 제미나이 코드리뷰 반영

* Fix: 포트폴리오 조회 오류 해결 (#378)

* fix: 포트폴리오 목록 조회에서 external 항목 제외

* refactor: 내부 portfolio compat API 경로 및 변환 계층 제거

- 더이상 사용하지 않는 레거시 경로를 정리함

* fix: internal 포트폴리오 단건 조회에서 external 포트폴리오 응답 지원

* refactor: 메서드 네이밍 명확화

- 제미나이 코드리뷰 반영

* refactor: internal 첨삭 조회 조율을 파사드로 이관해 서비스 의존성 분리

- 제미나이 코드리뷰 반영
- 포폴 첨삭 서비스가 포트폴리오서비스를 직접 의존하던 구조 수정

* Feat: 외부 포트폴리오 조회 응답에 status 및 originalFileName 추가 (#380)

* fix: 외부 포트폴리오 조회 응답에 status 추가 및 스웨거 명세 정합화

- 기업정보분석 조회에 대해 409 응답 명세 누락 수정
- 외부 포트폴리오 조회 응답에 PdfExtractionStatus 추가

* feat: external-portfolio 파일명 저장/조회 로직 추가

- portfolio_correction에 파일이름 저장용 nullable 칼럼 추가
- 한글 파일명에 대한 인코딩/정규화 처리를 NFC로 통일

* refactor: 파일명 정규화 로직 유틸로 분리 및 정제 로직 추가

- 코파일럿 코드리뷰 반영

* Refactor: 기업분석정보 조회 응답 수정 (#382)

- 기업분석정보 진행중일 때 에러를 내리는 대신 status로 분기처리할 수 있도록 응답을 수정
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.

[Task] 기업 분석 정보 조회 API 응답 변경

2 participants