-
Notifications
You must be signed in to change notification settings - Fork 0
Style/#39 캘린더 #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "style/#39-\uCE98\uB9B0\uB354"
Style/#39 캘린더 #70
Changes from all commits
172f819
e0c5a26
f4b0f5b
c7683c9
4f32eab
3d550a6
0f67b57
34116d9
71796e5
25c9cdf
d695b1c
44cc400
bcb66a3
87e9a3b
bbbcb6c
ac539de
fd3b812
4556388
a686431
71fd7c9
aa33cb9
67e2024
c27eb9f
d40f3c1
892897c
3f9f88c
128b93e
279251b
82f09c0
8e0c0b8
e828e9d
9bc58f9
31d4059
579ce19
284abac
4157d00
4d0617c
3c1bf91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "colors" : [ | ||
| { | ||
| "color" : { | ||
| "color-space" : "display-p3", | ||
| "components" : { | ||
| "alpha" : "0.000", | ||
| "blue" : "0xFF", | ||
| "green" : "0xFF", | ||
| "red" : "0xFF" | ||
| } | ||
| }, | ||
| "idiom" : "universal" | ||
| }, | ||
| { | ||
| "appearances" : [ | ||
| { | ||
| "appearance" : "luminosity", | ||
| "value" : "dark" | ||
| } | ||
| ], | ||
| "color" : { | ||
| "color-space" : "display-p3", | ||
| "components" : { | ||
| "alpha" : "0.000", | ||
| "blue" : "0xFF", | ||
| "green" : "0xFF", | ||
| "red" : "0xFF" | ||
| } | ||
| }, | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "illustration_noschedule.svg", | ||
| "idiom" : "universal" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // | ||
| // CalendarDailyResponseDTO.swift | ||
| // Cherrish-iOS | ||
| // | ||
| // Created by 이나연 on 1/15/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct CalendarDailyResponseDTO: Decodable { | ||
| let eventCount: Int | ||
| let events: [EventResponseDTO] | ||
| } | ||
|
|
||
| struct EventResponseDTO: Decodable { | ||
| let type: String | ||
| let id: Int | ||
| let procedureId: Int | ||
| let name: String | ||
| let scheduledAt: String | ||
| let downtimeDays: Int | ||
| let sensitiveDays: [String] | ||
| let cautionDays: [String] | ||
| let recoveryDays: [String] | ||
| } | ||
|
|
||
| extension CalendarDailyResponseDTO { | ||
| func toEntity() { | ||
|
|
||
| } | ||
|
Comment on lines
+27
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
현재는 호출해도 아무 동작을 하지 않습니다. 실제 변환 로직을 구현하거나, 아직 미사용이라면 제거/ 🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| // | ||
| // CalendarRepository.swift | ||
| // Cherrish-iOS | ||
| // | ||
| // Created by 이나연 on 1/13/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct DefaultCalendarRepository: CalendarInterface { | ||
| func fetchProcedureCountOfMonth(year: Int, month: Int) -> [Int : Int] { | ||
| return [:] | ||
| } | ||
|
|
||
| func fetchTodayProcedureList(date: String) -> [ProcedureEntity] { | ||
| return [] | ||
| } | ||
| } | ||
|
|
||
| struct MockCalendarRepository: CalendarInterface { | ||
| func fetchProcedureCountOfMonth(year: Int, month: Int) -> [Int : Int] { | ||
| return [ | ||
| 1: 2, | ||
| 7: 5, | ||
| 15: 1, | ||
| 23: 3, | ||
| 31: 6 | ||
| ] | ||
|
Comment on lines
+21
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. month 파라미터 무시로 잘못된 날짜 카운트가 표시될 수 있습니다. 항상 31일을 포함하는 고정 딕셔너리는 30일/2월 같은 달에서 존재하지 않는 날짜에 카운트를 표시할 수 있습니다. 🐛 제안 수정 func fetchProcedureCountOfMonth(year: Int, month: Int) -> [Int : Int] {
- return [
+ let base: [Int: Int] = [
]
+ let calendar = Calendar.current
+ let date = calendar.date(from: DateComponents(year: year, month: month)) ?? Date()
+ let range = calendar.range(of: .day, in: .month, for: date) ?? 1..<32
+ return base.filter { range.contains($0.key) }
}🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| func fetchTodayProcedureList(date: String) -> [ProcedureEntity] { | ||
| return [ | ||
| ProcedureEntity( | ||
| procedureId: 1, | ||
| name: "레이저 토닝", | ||
| downtimeDays: 7, | ||
| sensitiveDays: [ | ||
| "2026-01-15", | ||
| "2026-01-16", | ||
| "2026-01-17" | ||
| ], | ||
| cautionDays: [ | ||
| "2026-01-18", | ||
| "2026-01-19" | ||
| ], | ||
| recoveryDays: [ | ||
| "2026-01-20", | ||
| "2026-01-21" | ||
| ] | ||
| ), | ||
| ProcedureEntity( | ||
| procedureId: 2, | ||
| name: "보톡스", | ||
| downtimeDays: 3, | ||
| sensitiveDays: [ | ||
| "2026-01-15" | ||
| ], | ||
| cautionDays: [ | ||
| "2026-01-16" | ||
| ], | ||
| recoveryDays: [ | ||
| "2026-01-17" | ||
| ] | ||
| ), | ||
| ProcedureEntity( | ||
| procedureId: 3, | ||
| name: "필러", | ||
| downtimeDays: 5, | ||
| sensitiveDays: [ | ||
| "2026-01-15", | ||
| "2026-01-16" | ||
| ], | ||
| cautionDays: [ | ||
| "2026-01-17", | ||
| "2026-01-18" | ||
| ], | ||
| recoveryDays: [ | ||
| "2026-01-19" | ||
| ] | ||
| ), | ||
| ProcedureEntity( | ||
| procedureId: 4, | ||
| name: "IPL 레이저", | ||
| downtimeDays: 2, | ||
| sensitiveDays: [ | ||
| "2026-01-15" | ||
| ], | ||
| cautionDays: [ | ||
| "2026-01-16" | ||
| ], | ||
| recoveryDays: [] | ||
| ), | ||
| ProcedureEntity( | ||
| procedureId: 5, | ||
| name: "윤곽 주사", | ||
| downtimeDays: 4, | ||
| sensitiveDays: [ | ||
| "2026-01-15", | ||
| "2026-01-16" | ||
| ], | ||
| cautionDays: [ | ||
| "2026-01-17" | ||
| ], | ||
| recoveryDays: [ | ||
| "2026-01-18" | ||
| ] | ||
| ), | ||
| ProcedureEntity( | ||
| procedureId: 6, | ||
| name: "피부 스케일링", | ||
| downtimeDays: 0, | ||
| sensitiveDays: [ | ||
| "2026-01-15" | ||
| ], | ||
| cautionDays: [], | ||
| recoveryDays: [] | ||
| ) | ||
| ] | ||
|
Comment on lines
+31
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. date 파라미터를 무시해 어떤 날짜에서도 동일 목록이 반환됩니다. 현재 구현은 선택 날짜와 무관하게 항상 동일한 시술 목록을 반환합니다. 캘린더 UI 테스트 시에도 날짜별 상태를 구분할 수 없으므로, 날짜에 따라 필터링하거나 date→list 매핑을 쓰는 방식이 안전합니다. 🐛 제안 수정 func fetchTodayProcedureList(date: String) -> [ProcedureEntity] {
- return [
+ let all: [ProcedureEntity] = [
ProcedureEntity(
procedureId: 1,
name: "레이저 토닝",
downtimeDays: 7,
sensitiveDays: [
"2026-01-15",
"2026-01-16",
"2026-01-17"
],
cautionDays: [
"2026-01-18",
"2026-01-19"
],
recoveryDays: [
"2026-01-20",
"2026-01-21"
]
),
// ... 이하 동일
ProcedureEntity(
procedureId: 6,
name: "피부 스케일링",
downtimeDays: 0,
sensitiveDays: [
"2026-01-15"
],
cautionDays: [],
recoveryDays: []
)
]
+ return all.filter {
+ $0.sensitiveDays.contains(date)
+ || $0.cautionDays.contains(date)
+ || $0.recoveryDays.contains(date)
+ }
}🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,12 +17,12 @@ final class DomainDependencyAssembler: DependencyAssembler { | |
| func assemble() { | ||
| preAssembler.assemble() | ||
|
|
||
| guard let testRepository = DIContainer.shared.resolve(type: TestInterface.self) else { | ||
| guard let calendarRepository = DIContainer.shared.resolve(type: CalendarInterface.self) else { | ||
| return | ||
| } | ||
|
Comment on lines
+20
to
22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial CalendarInterface 해결 실패 시 조용히 반환됨
♻️ 제안하는 수정- guard let calendarRepository = DIContainer.shared.resolve(type: CalendarInterface.self) else {
+ guard let calendarRepository = DIContainer.shared.resolve(type: CalendarInterface.self) else {
+ CherrishLogger.error("Failed to resolve CalendarInterface")
return
}🤖 Prompt for AI Agents |
||
|
|
||
| DIContainer.shared.register(type: TestUseCase.self) { | ||
| return DefaultTestUseCase(repository: testRepository) | ||
| DIContainer.shared.register(type: FetchProcedureCountOfMonth.self) { | ||
| return DefaultFetchProcedureCountOfMonth(repository: calendarRepository) | ||
| } | ||
|
Comment on lines
+24
to
26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 등록 시점에 캡처된 calendarRepository는 stale 상태가 될 수 있습니다.
♻️ Lazy resolve 패턴 적용- guard let calendarRepository = DIContainer.shared.resolve(type: CalendarInterface.self) else {
- return
- }
-
DIContainer.shared.register(type: FetchProcedureCountOfMonth.self) {
+ guard let calendarRepository = DIContainer.shared.resolve(type: CalendarInterface.self) else {
+ CherrishLogger.error(CherrishError.DIFailedError)
+ fatalError("CalendarInterface DI resolve failed")
+ }
return DefaultFetchProcedureCountOfMonth(repository: calendarRepository)
}
// ... homeRepository 처리 ...
DIContainer.shared.register(type: FetchTodayProcedureList.self) {
+ guard let calendarRepository = DIContainer.shared.resolve(type: CalendarInterface.self) else {
+ CherrishLogger.error(CherrishError.DIFailedError)
+ fatalError("CalendarInterface DI resolve failed")
+ }
return DefaultFetchTodayProcedure(repository: calendarRepository)
}Also applies to: 36-38 🤖 Prompt for AI Agents |
||
|
|
||
| guard let homeRepository = DIContainer.shared.resolve(type: HomeInterface.self) else { | ||
|
|
@@ -32,5 +32,9 @@ final class DomainDependencyAssembler: DependencyAssembler { | |
| DIContainer.shared.register(type: FetchDashboardData.self) { | ||
| return DefaultFetchDashboardData(repository: homeRepository) | ||
| } | ||
|
|
||
| DIContainer.shared.register(type: FetchTodayProcedureList.self) { | ||
| return DefaultFetchTodayProcedure(repository: calendarRepository) | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||||||||||||||
| // | ||||||||||||||||||
| // CalendarInterface.swift | ||||||||||||||||||
| // Cherrish-iOS | ||||||||||||||||||
| // | ||||||||||||||||||
| // Created by 이나연 on 1/13/26. | ||||||||||||||||||
| // | ||||||||||||||||||
|
|
||||||||||||||||||
| import Foundation | ||||||||||||||||||
|
|
||||||||||||||||||
| protocol CalendarInterface { | ||||||||||||||||||
| func fetchProcedureCountOfMonth(year: Int, month: Int) -> [Int : Int] | ||||||||||||||||||
| func fetchTodayProcedureList(date: String) -> [ProcedureEntity] | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 인터페이스와 유스케이스 간 async/throws 시그니처 불일치
♻️ 비동기 호출이 필요한 경우 인터페이스 수정안 protocol CalendarInterface {
- func fetchProcedureCountOfMonth(year: Int, month: Int) -> [Int : Int]
- func fetchTodayProcedureList(date: String) -> [ProcedureEntity]
+ func fetchProcedureCountOfMonth(year: Int, month: Int) async throws -> [Int : Int]
+ func fetchTodayProcedureList(date: String) async throws -> [ProcedureEntity]
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mock 레포지토리가 항상 주입되어 실제 데이터 경로가 차단됩니다.
현재 구성은 릴리즈에서도 목 데이터가 노출될 수 있습니다. 빌드 설정이나 플래그로 분기해 주세요.
🐛 제안 수정
DIContainer.shared.register(type: CalendarInterface.self) { - return MockCalendarRepository() + `#if` DEBUG + return MockCalendarRepository() + `#else` + return DefaultCalendarRepository() + `#endif` }🤖 Prompt for AI Agents