refactor: 서비스 계층의 DTO 변환 로직 위임을 위한 HomeMapper 구현 #201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Desc
HomeReportService에 비대하게 섞여 있던 데이터 변환(DTO 생성) 및 비즈니스 계산 로직을 분리하기 위해HomeMapper클래스를 신설했습니다.HomeMapper신설: 기존 서비스 코드에 있던stream기반의 DTO 변환 로직, 다음 복약 시간 계산(calculateNextTime), 그리고 데이터 부재 시의 빈 응답 생성 로직(mapToEmptyHomeReport)을 이관논의 사항
매퍼 도입 후 서비스와 컨트롤러를 오케스트레이션 구조로 변경하려 했으나, 메서드 시그니처와 반환 타입(DTO -> Entity)이 변경되면서 HomeControllerTest를 포함한 기존 테스트들이 컴파일 에러로 실패하는 상황입니다.
설계 구조 확인: 제가 이해하고 적용하려는 아래의 역할 분담이 우리 팀의 리팩토링 컨벤션과 일치하는지 확인받고 싶습니다.
매퍼 클래스 자체를 검증하는 단위 테스트도 추가해야 할까요?