[FEAT] 대시보드 api 연동#23
Conversation
Walkthrough대시보드 기능이 새로 추가되고 AppDependencies에 대시보드 관련 컴포넌트와 Changes
Sequence Diagram(s)sequenceDiagram
participant V as DashboardView
participant VM as DashboardViewModel
participant O as GetOrderUseCase
participant D as GetDashboardUseCase
participant W as GetWeeklySummaryUseCase
V->>VM: onAppear / load event
VM->>VM: loadAll()
rect rgb(230,245,255)
par Orders
VM->>O: execute()
O-->>VM: orderList
and Dashboard
VM->>D: execute()
D-->>VM: dashboard
and WeeklySummary
VM->>W: execute()
W-->>VM: weeklySummary
end
end
VM->>V: uiState updated (orders, dashboard, weeklySummary)
Note right of V: 뷰 재렌더링
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes 검토 시 주의할 항목:
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)SampoomManagement/Features/Dashboard/UI/DashboardViewModel.swift (4)
🔇 Additional comments (2)
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.
Actionable comments posted: 3
🧹 Nitpick comments (4)
SampoomManagement/Features/Dashboard/Domain/Models/Dashboard.swift (1)
1-1: Foundation import가 필요하지 않을 수 있습니다.현재 파일에서 Foundation 프레임워크의 타입을 사용하지 않고 있습니다. 필요하지 않다면 제거를 고려해보세요.
SampoomManagement/Features/Dashboard/Data/Mappers/DashboardMappers.swift (1)
1-1: Foundation import 제거 고려.현재 파일에서 Foundation 프레임워크의 타입을 사용하지 않고 있습니다.
SampoomManagement/Features/Dashboard/Domain/Models/WeeklySummary.swift (1)
1-1: Foundation import 제거 고려.현재 파일에서 Foundation 프레임워크의 타입을 사용하지 않고 있습니다.
SampoomManagement/Features/Dashboard/Domain/Repository/DashboardRepository.swift (1)
1-1: Foundation import 제거 고려.현재 파일에서 Foundation 프레임워크의 타입을 사용하지 않고 있습니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
SampoomManagement/Resources/Assets.xcassets/block.imageset/block.svgis excluded by!**/*.svgSampoomManagement/Resources/Assets.xcassets/car.imageset/car.svgis excluded by!**/*.svg
📒 Files selected for processing (18)
SampoomManagement/App/ContentView.swift(1 hunks)SampoomManagement/Core/DI/AppDependencies.swift(3 hunks)SampoomManagement/Core/Resources/StringResources.swift(1 hunks)SampoomManagement/Features/Dashboard/Data/Mappers/DashboardMappers.swift(1 hunks)SampoomManagement/Features/Dashboard/Data/Remote/API/DashboardAPI.swift(1 hunks)SampoomManagement/Features/Dashboard/Data/Remote/DTO/DashboardResponseDTO.swift(1 hunks)SampoomManagement/Features/Dashboard/Data/Remote/DTO/WeeklySummaryResponseDTO.swift(1 hunks)SampoomManagement/Features/Dashboard/Data/Repository/DashboardRepositoryImpl.swift(1 hunks)SampoomManagement/Features/Dashboard/Domain/Models/Dashboard.swift(1 hunks)SampoomManagement/Features/Dashboard/Domain/Models/WeeklySummary.swift(1 hunks)SampoomManagement/Features/Dashboard/Domain/Repository/DashboardRepository.swift(1 hunks)SampoomManagement/Features/Dashboard/Domain/UseCase/GetDashboardUseCase.swift(1 hunks)SampoomManagement/Features/Dashboard/Domain/UseCase/GetWeeklySummaryUseCase.swift(1 hunks)SampoomManagement/Features/Dashboard/UI/DashboardUiState.swift(1 hunks)SampoomManagement/Features/Dashboard/UI/DashboardView.swift(4 hunks)SampoomManagement/Features/Dashboard/UI/DashboardViewModel.swift(1 hunks)SampoomManagement/Resources/Assets.xcassets/block.imageset/Contents.json(1 hunks)SampoomManagement/Resources/Assets.xcassets/car.imageset/Contents.json(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
SampoomManagement/Features/Dashboard/Domain/Repository/DashboardRepository.swift (2)
SampoomManagement/Features/Dashboard/Data/Remote/API/DashboardAPI.swift (2)
getDashboard(11-18)getWeeklySummary(20-27)SampoomManagement/Features/Dashboard/Data/Repository/DashboardRepositoryImpl.swift (2)
getDashboard(12-18)getWeeklySummary(20-26)
SampoomManagement/App/ContentView.swift (1)
SampoomManagement/Core/DI/AppDependencies.swift (1)
makeDashboardViewModel(240-247)
SampoomManagement/Features/Dashboard/Domain/UseCase/GetWeeklySummaryUseCase.swift (3)
SampoomManagement/Features/Dashboard/Domain/UseCase/GetDashboardUseCase.swift (1)
execute(10-12)SampoomManagement/Features/Dashboard/Data/Remote/API/DashboardAPI.swift (1)
getWeeklySummary(20-27)SampoomManagement/Features/Dashboard/Data/Repository/DashboardRepositoryImpl.swift (1)
getWeeklySummary(20-26)
SampoomManagement/Features/Dashboard/UI/DashboardViewModel.swift (4)
SampoomManagement/Features/Dashboard/UI/DashboardUiState.swift (1)
copy(31-45)SampoomManagement/Features/Dashboard/Domain/UseCase/GetDashboardUseCase.swift (1)
execute(10-12)SampoomManagement/Features/Dashboard/Domain/UseCase/GetWeeklySummaryUseCase.swift (1)
execute(10-12)SampoomManagement/Core/Utilities/GlobalMessageHandler.swift (1)
showMessage(21-30)
SampoomManagement/Features/Dashboard/Data/Repository/DashboardRepositoryImpl.swift (3)
SampoomManagement/Features/Dashboard/Data/Remote/API/DashboardAPI.swift (2)
getDashboard(11-18)getWeeklySummary(20-27)SampoomManagement/Features/Auth/Data/Local/Preferences/AuthPreferences.swift (1)
getStoredUser(75-116)SampoomManagement/Features/Dashboard/Data/Mappers/DashboardMappers.swift (2)
toModel(4-11)toModel(15-21)
SampoomManagement/Features/Dashboard/Data/Remote/API/DashboardAPI.swift (1)
SampoomManagement/Features/Dashboard/Data/Repository/DashboardRepositoryImpl.swift (2)
getDashboard(12-18)getWeeklySummary(20-26)
SampoomManagement/Features/Dashboard/Domain/UseCase/GetDashboardUseCase.swift (2)
SampoomManagement/Features/Dashboard/Data/Remote/API/DashboardAPI.swift (1)
getDashboard(11-18)SampoomManagement/Features/Dashboard/Data/Repository/DashboardRepositoryImpl.swift (1)
getDashboard(12-18)
🔇 Additional comments (21)
SampoomManagement/Features/Dashboard/Domain/Models/Dashboard.swift (1)
3-8: 구조가 깔끔하고 적절합니다!Domain model이 불변 프로퍼티로 구성되어 있고 Equatable을 준수하여 테스트와 상태 비교가 용이합니다.
SampoomManagement/App/ContentView.swift (1)
32-32: Factory method 패턴으로의 전환이 적절합니다!DI 컨테이너를 통한 DashboardViewModel 생성으로 의존성 관리가 개선되었고, 다른 ViewModel들과 일관된 패턴을 유지하고 있습니다.
SampoomManagement/Features/Dashboard/Data/Remote/DTO/WeeklySummaryResponseDTO.swift (1)
3-7: DTO 구조가 명확하고 적절합니다!Codable 준수로 API 응답을 자동으로 매핑할 수 있으며, 프로퍼티명이 의미를 잘 전달하고 있습니다.
SampoomManagement/Features/Dashboard/Domain/UseCase/GetDashboardUseCase.swift (1)
3-13: Use case 구현이 Clean Architecture 원칙을 잘 따르고 있습니다!Repository에 대한 의존성 주입과 단일 책임 원칙이 적절하게 적용되었습니다.
SampoomManagement/Features/Dashboard/Data/Mappers/DashboardMappers.swift (2)
3-12: Mapper 구현이 명확하고 적절합니다!DTO에서 domain model로의 변환이 직관적이며 모든 필드가 올바르게 매핑되었습니다.
14-22: WeeklySummary mapper도 잘 구현되었습니다!모든 프로퍼티가 적절하게 매핑되고 있습니다.
SampoomManagement/Features/Dashboard/Domain/Models/WeeklySummary.swift (1)
3-7: Domain model 구현이 적절합니다!불변 프로퍼티 구성과 Equatable 준수로 안정적인 구조를 유지하고 있습니다.
SampoomManagement/Core/Resources/StringResources.swift (1)
28-30: 문자열 리소스 추가가 적절합니다!Dashboard 기능을 위한 한글 localization이 명확하고 기존 패턴과 일관성을 유지하고 있습니다.
SampoomManagement/Features/Dashboard/Domain/Repository/DashboardRepository.swift (1)
3-6: Repository protocol이 잘 설계되었습니다!Clean Architecture의 원칙을 따르며, async/await를 사용한 비동기 처리가 적절합니다. 인터페이스가 명확하고 간결합니다.
SampoomManagement/Features/Dashboard/Domain/UseCase/GetWeeklySummaryUseCase.swift (1)
3-13: LGTM!Use case 구현이 깔끔하고 기존 패턴(GetDashboardUseCase)과 일관성 있게 작성되었습니다.
SampoomManagement/Features/Dashboard/UI/DashboardView.swift (2)
83-96: 대시보드 데이터 바인딩이 적절하게 구현되었습니다.옵셔널 체이닝과 nil 병합 연산자를 사용하여 안전하게 데이터를 표시하고 있습니다.
163-199: 주간 요약 섹션 구현이 깔끔합니다.입고/품절 데이터를 색상(green/red)으로 구분하여 시각적으로 명확하게 표현했습니다.
SampoomManagement/Features/Dashboard/Data/Remote/DTO/DashboardResponseDTO.swift (1)
3-8: LGTM!대시보드 응답 DTO가 간결하고 명확하게 정의되어 있습니다.
SampoomManagement/Features/Dashboard/UI/DashboardUiState.swift (1)
10-46: LGTM!UI State에 dashboard와 weeklySummary 옵셔널 프로퍼티가 적절하게 추가되었고, copy 메서드에서 이중 옵셔널 패턴을 올바르게 사용하고 있습니다.
SampoomManagement/Core/DI/AppDependencies.swift (3)
70-75: LGTM!대시보드 의존성이 기존 패턴과 일관되게 선언되었습니다.
150-154: LGTM!대시보드 관련 의존성이 올바르게 초기화되고 연결되었습니다.
240-247: LGTM!DashboardViewModel 팩토리가 필요한 모든 의존성을 적절하게 주입하고 있습니다.
SampoomManagement/Features/Dashboard/Data/Remote/API/DashboardAPI.swift (1)
4-28: LGTM!DashboardAPI 구현이 깔끔하고 기존 API 패턴과 일관성 있게 작성되었습니다.
SampoomManagement/Features/Dashboard/Data/Repository/DashboardRepositoryImpl.swift (1)
3-27: LGTM!Repository 구현이 적절한 에러 처리(unauthorized, serverError, noData)와 함께 깔끔하게 작성되었습니다. 인증 확인, API 호출, 응답 검증, 도메인 모델 매핑 순서가 일관되게 적용되어 있습니다.
SampoomManagement/Resources/Assets.xcassets/car.imageset/Contents.json (1)
1-12: 리뷰 댓글이 부정확합니다. 검증 결과 모든 요구사항이 충족되었습니다.
- ✓
car.svg파일이 실제로SampoomManagement/Resources/Assets.xcassets/car.imageset/디렉토리에 존재합니다.- ✓ 프로젝트의 iOS 배포 대상이 iOS 18.6 이상으로 설정되어 있으며, 이는 SVG가 지원되는 iOS 13 이상의 요구사항을 충족합니다.
SVG 호환성 문제는 없으므로, 추가 조치가 필요하지 않습니다.
Likely an incorrect or invalid review comment.
SampoomManagement/Resources/Assets.xcassets/block.imageset/Contents.json (1)
1-12: SVG 파일 및 배포 대상 호환성 확인 완료 - 문제 없음검증 결과:
block.svg파일이 올바른 위치에 존재함 ✓- 프로젝트의 iOS 배포 대상이 18.6과 26.0으로 설정되어 있으며, 둘 다 SVG 지원 최소 요구사항(iOS 13+)을 충족함 ✓
이 에셋 카탈로그 메타데이터 파일은 올바르게 구성되어 있습니다.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
SampoomManagement/Features/Dashboard/UI/DashboardViewModel.swift (1)
41-54: 여전히dashboardLoading경쟁 조건이 남아 있습니다.
이전 리뷰에서 지적됐듯이loadOrderList()성공 시dashboardLoading을false로 돌리면서, 동시에 진행 중인loadDashboard()의 로딩 표시가 중간에 꺼집니다. 현재 구현도 동일하게 남아 로딩 상태가 마지막으로 완료된 태스크에 따라 뒤집힙니다. 최소한 주문 목록 로직에서는dashboardLoading을 건드리지 말고 대시보드 로딩 흐름에서만 관리하도록 수정해 주세요.let orderList = try await getOrderUseCase.execute() uiState = uiState.copy( - orderList: Array(orderList.items.prefix(5)), - dashboardLoading: false + orderList: Array(orderList.items.prefix(5)) )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
SampoomManagement/Features/Dashboard/UI/DashboardUiState.swift(1 hunks)SampoomManagement/Features/Dashboard/UI/DashboardView.swift(5 hunks)SampoomManagement/Features/Dashboard/UI/DashboardViewModel.swift(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- SampoomManagement/Features/Dashboard/UI/DashboardView.swift
🧰 Additional context used
🧬 Code graph analysis (1)
SampoomManagement/Features/Dashboard/UI/DashboardViewModel.swift (4)
SampoomManagement/Features/Dashboard/Domain/UseCase/GetDashboardUseCase.swift (1)
execute(10-12)SampoomManagement/Features/Dashboard/Domain/UseCase/GetWeeklySummaryUseCase.swift (1)
execute(10-12)SampoomManagement/Features/Dashboard/UI/DashboardUiState.swift (1)
copy(37-55)SampoomManagement/Core/Utilities/GlobalMessageHandler.swift (1)
showMessage(21-30)
📝 Summary
🙏 Question & PR point
📬 Reference
Summary by CodeRabbit
새로운 기능
UI/디자인 개선
품질 개선
로컬라이제이션