-
Notifications
You must be signed in to change notification settings - Fork 0
[#809] 개발 목표와 개발 기록의 Firestore 저장소를 구성한다 #838
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
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
39744d8
feat: Todo 목표 연결 저장 지원
opficdev bc2a5a3
feat: 개발 기록 Data 저장 계약 추가
opficdev fa5e13f
feat: 개발 목표 Data 저장 계약 추가
opficdev 9a7323d
feat: 개발 목표 Firestore 서비스 추가
opficdev 283112c
feat: 개발 기록 Firestore 서비스 추가
opficdev b6f4920
feat: 개발 목표·기록 저장소 DI 연결
opficdev ec88f7d
fix: Firestore 서비스 접근 수준 제한
opficdev a0c24ca
fix: 개발 목표 완료 저장 책임 분리
opficdev 5b1df0f
fix: 개발 기록 Draft 기준 버전 검증
opficdev 142071b
refactor: Todo 조회·명령 Firestore 서비스 분리
opficdev 71a7945
fix: Infra Test 실패 해결
opficdev 10c23c3
fix: 개발 목표 완료 취소 저장 허용
opficdev fc88302
refactor: 개발 목표 상태 변환 경계 분리
opficdev bf1bcda
fix: 개발 목표 제목 저장 전 검증
opficdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // | ||
| // DevelopmentGoalDTO.swift | ||
| // Data | ||
| // | ||
| // Created by opfic on 8/28/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public struct DevelopmentGoalCreateRequest: Encodable { | ||
| public let title: String | ||
| public let markdownDescription: String | ||
|
|
||
| public init(title: String, markdownDescription: String) { | ||
| self.title = title | ||
| self.markdownDescription = markdownDescription | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentGoalStatusRequest { | ||
| public let status: DevelopmentGoalStatus | ||
|
|
||
| public init(status: DevelopmentGoalStatus) { | ||
| self.status = status | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentGoalResponse { | ||
| public let id: String | ||
| public let title: String | ||
| public let markdownDescription: String | ||
| public let status: DevelopmentGoalStatus | ||
| public let createdAt: Date | ||
| public let updatedAt: Date | ||
| public let completedAt: Date? | ||
|
|
||
| public init( | ||
| id: String, | ||
| title: String, | ||
| markdownDescription: String, | ||
| status: DevelopmentGoalStatus, | ||
| createdAt: Date, | ||
| updatedAt: Date, | ||
| completedAt: Date? | ||
| ) { | ||
| self.id = id | ||
| self.title = title | ||
| self.markdownDescription = markdownDescription | ||
| self.status = status | ||
| self.createdAt = createdAt | ||
| self.updatedAt = updatedAt | ||
| self.completedAt = completedAt | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentGoalCompletionResponse { | ||
| public let goal: DevelopmentGoalResponse | ||
| public let records: [DevelopmentRecordResponse] | ||
|
|
||
| public init(goal: DevelopmentGoalResponse, records: [DevelopmentRecordResponse]) { | ||
| self.goal = goal | ||
| self.records = records | ||
| } | ||
| } |
140 changes: 140 additions & 0 deletions
140
Application/Data/Sources/DTO/DevelopmentRecordDTO.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| // | ||
| // DevelopmentRecordDTO.swift | ||
| // Data | ||
| // | ||
| // Created by opfic on 8/28/26. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public struct DevelopmentRecordDraftRequest: Encodable { | ||
| public let title: String | ||
| public let markdownContent: String | ||
| public let baseVersionId: String? | ||
|
|
||
| public init( | ||
| title: String, | ||
| markdownContent: String, | ||
| baseVersionId: String? | ||
| ) { | ||
| self.title = title | ||
| self.markdownContent = markdownContent | ||
| self.baseVersionId = baseVersionId | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentRecordCreateRequest: Encodable { | ||
| public let draft: DevelopmentRecordDraftRequest | ||
|
|
||
| public init(draft: DevelopmentRecordDraftRequest) { | ||
| self.draft = draft | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentRecordConfirmationRequest { | ||
| public let versionId: String | ||
| public let kind: String | ||
| public let sourceVersionId: String? | ||
|
|
||
| public init( | ||
| versionId: String, | ||
| kind: String, | ||
| sourceVersionId: String? | ||
| ) { | ||
| self.versionId = versionId | ||
| self.kind = kind | ||
| self.sourceVersionId = sourceVersionId | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentRecordRestoreRequest { | ||
| public let versionId: String | ||
| public let sourceVersionId: String | ||
|
|
||
| public init(versionId: String, sourceVersionId: String) { | ||
| self.versionId = versionId | ||
| self.sourceVersionId = sourceVersionId | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentRecordDraftResponse { | ||
| public let title: String | ||
| public let markdownContent: String | ||
| public let baseVersionId: String? | ||
| public let updatedAt: Date | ||
|
|
||
| public init( | ||
| title: String, | ||
| markdownContent: String, | ||
| baseVersionId: String?, | ||
| updatedAt: Date | ||
| ) { | ||
| self.title = title | ||
| self.markdownContent = markdownContent | ||
| self.baseVersionId = baseVersionId | ||
| self.updatedAt = updatedAt | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentRecordCurrentVersionResponse { | ||
| public let id: String | ||
| public let number: Int | ||
|
|
||
| public init(id: String, number: Int) { | ||
| self.id = id | ||
| self.number = number | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentRecordResponse { | ||
| public let id: String | ||
| public let goalId: String | ||
| public let currentVersion: DevelopmentRecordCurrentVersionResponse? | ||
| public let draft: DevelopmentRecordDraftResponse? | ||
| public let createdAt: Date | ||
|
|
||
| public init( | ||
| id: String, | ||
| goalId: String, | ||
| currentVersion: DevelopmentRecordCurrentVersionResponse?, | ||
| draft: DevelopmentRecordDraftResponse?, | ||
| createdAt: Date | ||
| ) { | ||
| self.id = id | ||
| self.goalId = goalId | ||
| self.currentVersion = currentVersion | ||
| self.draft = draft | ||
| self.createdAt = createdAt | ||
| } | ||
| } | ||
|
|
||
| public struct DevelopmentRecordVersionResponse { | ||
| public let id: String | ||
| public let recordId: String | ||
| public let number: Int | ||
| public let title: String | ||
| public let markdownContent: String | ||
| public let kind: String | ||
| public let sourceVersionId: String? | ||
| public let confirmedAt: Date | ||
|
|
||
| public init( | ||
| id: String, | ||
| recordId: String, | ||
| number: Int, | ||
| title: String, | ||
| markdownContent: String, | ||
| kind: String, | ||
| sourceVersionId: String?, | ||
| confirmedAt: Date | ||
| ) { | ||
| self.id = id | ||
| self.recordId = recordId | ||
| self.number = number | ||
| self.title = title | ||
| self.markdownContent = markdownContent | ||
| self.kind = kind | ||
| self.sourceVersionId = sourceVersionId | ||
| self.confirmedAt = confirmedAt | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
Application/Data/Sources/Mapper/DevelopmentGoalMapping.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // | ||
| // DevelopmentGoalMapping.swift | ||
| // Data | ||
| // | ||
| // Created by opfic on 8/28/26. | ||
| // | ||
|
|
||
| import Domain | ||
|
|
||
| public extension DevelopmentGoalQuery { | ||
| static func fromDomain(_ query: DevelopmentGoal.Query) -> Self { | ||
| Self(status: query.status.map(DevelopmentGoalStatus.fromDomain)) | ||
| } | ||
| } | ||
|
|
||
| public extension DevelopmentGoalResponse { | ||
| func toDomain() throws -> DevelopmentGoal { | ||
| try DevelopmentGoal( | ||
| id: id, | ||
| title: title, | ||
| description: markdownDescription, | ||
| status: status.toDomain(), | ||
| createdAt: createdAt, | ||
| updatedAt: updatedAt, | ||
| completedAt: completedAt | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| public extension DevelopmentGoalCompletionResponse { | ||
| func toDomain() throws -> DevelopmentGoal.CompletionSnapshot { | ||
| try DevelopmentGoal.CompletionSnapshot( | ||
| goal: goal.toDomain(), | ||
| records: records.map { try $0.toDomain() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| public extension DevelopmentGoalStatus { | ||
| static func fromDomain(_ status: DevelopmentGoal.Status) -> Self { | ||
| switch status { | ||
| case .inProgress: | ||
| .inProgress | ||
| case .completed: | ||
| .completed | ||
| case .archived: | ||
| .archived | ||
| } | ||
| } | ||
|
|
||
| func toDomain() -> DevelopmentGoal.Status { | ||
| switch self { | ||
| case .inProgress: | ||
| .inProgress | ||
| case .completed: | ||
| .completed | ||
| case .archived: | ||
| .archived | ||
| } | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.