Repository navigation
[Fix] memo/usageStorageInfo 필드 분리 — 사용자 메모와 복용·보관법 자동생성 정보 구분 - #58
Conversation
memo와 분리 — 복용법+보관법 자동 생성 전용 필드 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
복용법+보관법 자동 생성 제거, 사용자 자유 입력 전용으로 변경 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
useMethodQesitm + depositMethodQesitm 조합, OCR 등록 시 null Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughMedication 엔티티에 usageStorageInfo(TEXT) 컬럼과 생성자 파라미터가 추가되었습니다. 등록 서비스에서 DrugInfo의 사용법/보관법 정보를 조합해 저장하며, 응답 DTO와 컨버터에 새 필드가 노출됩니다. memo 필드의 Swagger 설명 문구도 변경되었습니다. ChangesMedication usageStorageInfo 필드 도입
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant MedicationCommandService
participant DrugInfo
participant Medication
participant MedicationConverter
participant MedicationGroupItemResponse
MedicationCommandService->>DrugInfo: useMethodQesitm, depositMethodQesitm 조회
MedicationCommandService->>MedicationCommandService: buildUsageStorageInfo(drugInfo) 실행
MedicationCommandService->>Medication: builder().usageStorageInfo(값) 설정 및 저장
MedicationConverter->>Medication: getUsageStorageInfo() 호출
MedicationConverter->>MedicationGroupItemResponse: usageStorageInfo 포함 생성
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java (1)
109-118: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
buildUsageStorageInfo를static으로 전환을 제안합니다.이 메서드는 인스턴스 상태를 전혀 사용하지 않는 순수 함수입니다.
static으로 선언하면 의존성이 없음을 명시적으로 표현할 수 있습니다.♻️ 제안: static 메서드 전환
- private String buildUsageStorageInfo(DrugInfo drugInfo) { + private static String buildUsageStorageInfo(DrugInfo drugInfo) { if (drugInfo == null) return null;🤖 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/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java` around lines 109 - 118, Make buildUsageStorageInfo in MedicationCommandService static because it only derives a value from the DrugInfo argument and does not use any instance state. Update the method declaration to static and ensure any call sites within MedicationCommandService still compile by invoking it in a static-compatible way.
🤖 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.
Nitpick comments:
In
`@src/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java`:
- Around line 109-118: Make buildUsageStorageInfo in MedicationCommandService
static because it only derives a value from the DrugInfo argument and does not
use any instance state. Update the method declaration to static and ensure any
call sites within MedicationCommandService still compile by invoking it in a
static-compatible way.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 83e45488-445f-4c08-b08b-33f9d430d44d
📒 Files selected for processing (5)
src/main/java/com/piuda/callcare/domain/medication/converter/MedicationConverter.javasrc/main/java/com/piuda/callcare/domain/medication/dto/request/MedicationCreateRequest.javasrc/main/java/com/piuda/callcare/domain/medication/dto/response/MedicationGroupItemResponse.javasrc/main/java/com/piuda/callcare/domain/medication/entity/Medication.javasrc/main/java/com/piuda/callcare/domain/medication/service/command/MedicationCommandService.java
🔍️ 작업 내용
✨ 상세 설명
문제
useMethodQesitm+depositMethodQesitm을 합쳐서memo에 그대로 담아 전송memo공간이 시스템 자동생성 텍스트로 오염됨해결
memo— 항상 빈 값으로 시작, 사용자 전용 자유 입력 공간으로 유지usageStorageInfo— 신규 필드, 복용법/보관법 정보를 담당useMethodQesitm+depositMethodQesitm조합으로 자동 생성변경 사항
Medication엔티티에usageStorageInfo필드 추가 + DB 컬럼 추가MedicationCommandService— DrugInfo 연결 시에만usageStorageInfo자동 생성 로직 추가MedicationGroupItemResponse에usageStorageInfo필드 추가MedicationCreateRequest—memo는 사용자 입력값 그대로 저장, 프론트에서 보내던 자동합성 로직 제거🛠️ 추후 리팩토링 및 고도화 계획
drug_info_id자동 매핑이 붙으면usageStorageInfo자동생성 확대 검토📸 스크린샷 (선택)
💬 리뷰 요구사항
memo와usageStorageInfo필드 분리 방향이 기획 의도(PM 협의 내용)와 맞는지 확인 부탁usageStorageInfonull 처리가 프론트 쪽 렌더링과 잘 맞는지 확인 필요Summary by CodeRabbit