Skip to content

[Feat/#225] AI 일기 요약 ON/OFF 설정 API 구현 - #226

Merged
yangwooyoung123 merged 7 commits into
developfrom
feat/#225
Aug 2, 2026
Merged

[Feat/#225] AI 일기 요약 ON/OFF 설정 API 구현#226
yangwooyoung123 merged 7 commits into
developfrom
feat/#225

Conversation

@yangwooyoung123

Copy link
Copy Markdown
Contributor

📌 관련 이슈번호

(Closes 키워드가 있어야 PR이 머지되었을 때 이슈가 자동으로 닫힌다)

📌 PR 유형

어떤 변경 사항이 있나요?

  • 새 기능 추가
  • 버그 수정
  • 리팩토링

📌 PR 요약

AI 일기 요약 ON/OFF 설정 API 구현

📌 작업 세부 내용

  1. User 엔티티의 isAiSummary 필드를 토글하는 PATCH /users/ai-summary API 추가
  2. UpdateAiSummaryDto 생성 및 @isboolean() 유효성 검증 적용
  3. 서비스 로직(updateAiSummary) 구현 및 Swagger 문서 추가

📸 스크린샷 (선택)

🔗 참고 자료

@yangwooyoung123 yangwooyoung123 self-assigned this Aug 2, 2026
@yangwooyoung123 yangwooyoung123 linked an issue Aug 2, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yangwooyoung123, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 22ff9bff-17db-4e10-8135-451715687df6

📥 Commits

Reviewing files that changed from the base of the PR and between a83846d and a4b5278.

📒 Files selected for processing (3)
  • deploy/nginx/dailog.conf
  • deploy/setup-ec2.sh
  • src/users/user.service.ts

Walkthrough

사용자별 AI 일기 요약 설정을 변경하는 PATCH /users/ai-summary API를 추가했습니다. 요청 DTO의 불리언 값을 검증하고, UserService가 사용자 설정을 저장한 뒤 결과를 반환합니다. Swagger 문서도 추가했습니다.

Changes

AI 요약 설정

Layer / File(s) Summary
AI 요약 설정 계약과 엔드포인트
src/users/users.dto.ts, src/users/users.controller.ts, src/users/users.swagger.ts
isAiSummary 요청·응답 DTO를 추가했습니다. 인증된 PATCH /users/ai-summary 엔드포인트와 Swagger 응답 정의를 추가했습니다.
사용자 설정 저장 처리
src/users/user.service.ts
사용자 존재 여부를 확인하고 isAiSummary 값을 저장합니다. 저장된 설정을 응답 DTO로 반환합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • TEAM-DAILOG/BE#108: user.service.ts와 사용자 엔터티를 함께 변경했지만, 사용자 설정 API와 가입 약관 기본값 처리를 별도로 다룹니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 AI 일기 요약 설정 API 추가라는 주요 변경 사항을 명확하게 설명합니다.
Description check ✅ Passed 설명은 API, DTO 검증, 서비스 로직, Swagger 문서 변경을 모두 관련 내용으로 설명합니다.
Linked Issues check ✅ Passed 변경 사항은 이슈 #225의 AI 일기 요약 ON/OFF 설정 API 구현 목표와 일치합니다.
Out of Scope Changes check ✅ Passed 코드 변경은 AI 일기 요약 설정 API와 관련된 컨트롤러, 서비스, DTO, Swagger 문서에 한정됩니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#225

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/users/user.service.ts (1)

298-298: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

DTO 전체를 엔터티에 복사하지 마세요.

Object.assignupdateAiSummaryDto의 열거 가능한 자체 속성을 모두 foundUser에 복사합니다. API 요청이 DTO를 기준으로 검증되지만 엔터티에는 허용되지 않는 추가 필드가 저장되지 않도록 explicit하게 foundUser.isAiSummary = updateAiSummaryDto.isAiSummary;만 업데이트하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/users/user.service.ts` at line 298, In the user update flow, replace the
broad Object.assign call on foundUser with an explicit update of only
foundUser.isAiSummary from updateAiSummaryDto.isAiSummary. Do not copy any other
DTO properties onto the entity.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/users/user.service.ts`:
- Around line 293-301: Update the user summary method around the current
userRepository.findOne/Object.assign/save flow to perform a partial
Repository.update using only isAiSummary from updateAiSummaryDto. Check the
update result’s affected count and throw NotFoundException when no user was
updated; otherwise return the requested isAiSummary value without saving or
overwriting unrelated UserEntity fields.

---

Nitpick comments:
In `@src/users/user.service.ts`:
- Line 298: In the user update flow, replace the broad Object.assign call on
foundUser with an explicit update of only foundUser.isAiSummary from
updateAiSummaryDto.isAiSummary. Do not copy any other DTO properties onto the
entity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 062db939-7e6b-48df-ad67-2cb5801840fa

📥 Commits

Reviewing files that changed from the base of the PR and between 615e2f4 and a83846d.

📒 Files selected for processing (6)
  • src/users/entities/refresh-token.entity.ts
  • src/users/entities/user-agreement.entity.ts
  • src/users/user.service.ts
  • src/users/users.controller.ts
  • src/users/users.dto.ts
  • src/users/users.swagger.ts
💤 Files with no reviewable changes (2)
  • src/users/entities/user-agreement.entity.ts
  • src/users/entities/refresh-token.entity.ts

Comment thread src/users/user.service.ts Outdated
@yangwooyoung123
yangwooyoung123 merged commit 18d71ce into develop Aug 2, 2026
2 checks passed
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.

[Feat] AI 일기 요약 ON/OFF 설정 API 구현

1 participant