Skip to content

♻️ 피드백 API의 Period를 AI 모듈 DTO에서 분리 - #50

Merged
s26059-maker merged 2 commits into
developfrom
feat/feedback-period-decouple
Oct 12, 2026
Merged

s26059-maker merged 2 commits into
developfrom
feat/feedback-period-decouple

Conversation

@s26059-maker

Copy link
Copy Markdown
Contributor

개요

피드백 API(GET /feedback/periodic)가 AI 모듈의 ai.dto.Period를 직접 쓰고 있어서 API 계층과 AI 모듈이 묶여 있었습니다.
처음에는 Period를 공통 패키지로 옮기려 했지만, 그러면 AI 모듈이 global에 의존하고 port 시그니처도 바뀌어서 이동 대신 분리로 처리했습니다.

변경 사항

  • 새 enum domain.feedback.FeedbackPeriod (ROUND, WEEKLY, MONTHLY)
  • FeedbackController, PeriodFeedbackResponse, FeedbackService가 FeedbackPeriod 사용
  • AI 패키지 변경 0건 (ai.dto.Period, port 시그니처 그대로)
방향 위치
FeedbackPeriod → ai.dto.Period FeedbackService.toAiPeriod()
ai.dto.Period → FeedbackPeriod (응답용) PeriodFeedbackResponse.fromAiPeriod()

응답의 period가 AI 결과값에서 나오기 때문에, 응답이 달라지지 않도록 역변환도 추가했습니다.

API 영향

없음. 요청과 응답 모두 ROUND / WEEKLY / MONTHLY 문자열 그대로입니다.
(기존 컨트롤러 테스트의 $.period 값 검증과 잘못된 값 400 검증 통과)

테스트

  • 매핑 테스트 8건 추가: 양방향 전수 매핑, 이름 일치, 왕복 변환, 두 enum의 값 집합 동일, AI 포트에 변환된 값이 전달되는지
  • 전체 223건, 실패 0건

리뷰 요청

  • @임서하: AI 모듈은 안 건드렸어. 나중에 ai.dto.Period에 값을 추가하면 매핑 테스트가 깨지니까, 그때 FeedbackPeriod도 같이 맞춰주면 돼.

s26059-maker and others added 2 commits October 12, 2026 08:07
- domain.feedback.FeedbackPeriod(ROUND, WEEKLY, MONTHLY) 신설. API 요청·응답 값(문자열)은 그대로
- FeedbackController, PeriodFeedbackResponse, FeedbackService는 FeedbackPeriod를 사용
- AI 호출 직전 FeedbackService.toAiPeriod()에서 ai.dto.Period로 switch 변환, 응답용 역변환은
  PeriodFeedbackResponse.fromAiPeriod()(둘 다 default 없는 exhaustive switch)
- ai.dto.Period와 AI 모듈 파일(port 시그니처 포함)은 수정하지 않음
- 테스트: 양방향 매핑 누락/이름 일치/왕복, AI 포트로 변환된 값이 전달되는지 검증

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@s26059-maker
s26059-maker merged commit bd2587d into develop Oct 12, 2026
1 check passed
@s26059-maker
s26059-maker deleted the feat/feedback-period-decouple branch October 12, 2026 11:32
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.

1 participant