온보딩 Domain User 계약 추가 - #16
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughAuth 세션 계약과 의존성 클라이언트를 추가했습니다. User 모델, 오류 타입, 온보딩 클라이언트를 추가했습니다. 모델의 동등성 및 Codable 동작과 테스트 의존성 기본값을 검증했습니다. ChangesDomain 포트 확장
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@Projects/Domain/Tests/User/UserClientTests.swift`:
- Around line 5-9: The test contract is inconsistent with the documented
behavior: update Projects/Domain/Tests/User/UserClientTests.swift lines 5-9 by
renaming the Korean test to clearly describe UserClient.testValue creation,
correcting the comment to identify its actual declaration source, and removing
the meaningless XCTAssertTrue(true) or replacing it with a meaningful assertion;
update Projects/Domain/README.md lines 35-39 to document only
UserClient.testValue creation verification unless the test is expanded to
exercise unimplemented endpoint behavior.
In `@Projects/Domain/Tests/User/UserModelTests.swift`:
- Around line 5-10: Update the Gender tests around test_성별_rawValue와_동등성 to
verify its Codable contract with JSON encode/decode round-trip coverage,
matching the existing Interest and UserProfile test patterns. Preserve the
current rawValue and equality assertions while confirming each Gender case
survives encoding and decoding.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 76d7bfed-0f34-4980-bf79-7dc11ee20ec5
📒 Files selected for processing (13)
Projects/Domain/README.mdProjects/Domain/Sources/Auth/Client/AuthClient.swiftProjects/Domain/Sources/Auth/Error/AuthError.swiftProjects/Domain/Sources/Auth/Model/AuthProvider.swiftProjects/Domain/Sources/Auth/Model/AuthSession.swiftProjects/Domain/Sources/User/Client/UserClient.swiftProjects/Domain/Sources/User/Error/UserError.swiftProjects/Domain/Sources/User/Model/Gender.swiftProjects/Domain/Sources/User/Model/Interest.swiftProjects/Domain/Sources/User/Model/OnboardingDraft.swiftProjects/Domain/Sources/User/Model/UserProfile.swiftProjects/Domain/Tests/User/UserClientTests.swiftProjects/Domain/Tests/User/UserModelTests.swift
| func test_UserClient_testValue는_빈_클라이언트로_생성() { | ||
| // @DependencyClient 는 testValue = UserClient() 를 기본 제공한다. | ||
| // 미구현 endpoint 호출 시 issue를 내므로, 생성 가능성만 검증한다. | ||
| _ = UserClient.testValue | ||
| XCTAssertTrue(true) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
UserClient.testValue의 검증 계약을 실제 테스트와 일치시키세요.
현재 테스트는 UserClient.testValue 생성만 확인합니다. README는 unimplemented endpoint 동작까지 검증한다고 설명합니다. Line 6의 주석도 testValue의 선언 주체를 잘못 설명합니다.
Projects/Domain/Tests/User/UserClientTests.swift#L5-L9: 테스트 주석과 이름을 생성 가능성 검증으로 명확히 하고, 불필요한XCTAssertTrue(true)를 제거하거나 실제 검증으로 교체하세요.Projects/Domain/README.md#L35-L39: 테스트 포인트를 “UserClient.testValue생성 가능성 검증”으로 수정하거나 실제 unimplemented 동작 검증을 추가하세요.
As per coding guidelines: “테스트는 한국어 이름의 test_상황_기대결과 형식으로 작성하고, 모델 계약의 Equatable/Codable 및 Client testValue 동작을 검증한다.”
📍 Affects 2 files
Projects/Domain/Tests/User/UserClientTests.swift#L5-L9(this comment)Projects/Domain/README.md#L35-L39
🤖 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 `@Projects/Domain/Tests/User/UserClientTests.swift` around lines 5 - 9, The
test contract is inconsistent with the documented behavior: update
Projects/Domain/Tests/User/UserClientTests.swift lines 5-9 by renaming the
Korean test to clearly describe UserClient.testValue creation, correcting the
comment to identify its actual declaration source, and removing the meaningless
XCTAssertTrue(true) or replacing it with a meaningful assertion; update
Projects/Domain/README.md lines 35-39 to document only UserClient.testValue
creation verification unless the test is expanded to exercise unimplemented
endpoint behavior.
Source: Coding guidelines
| func test_성별_rawValue와_동등성() { | ||
| XCTAssertEqual(Gender.male.rawValue, "male") | ||
| XCTAssertEqual(Gender.female.rawValue, "female") | ||
| XCTAssertEqual(Gender.other.rawValue, "other") | ||
| XCTAssertEqual(Gender.male, Gender.male) | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Gender의 Codable 계약을 검증하세요.
Gender는 Codable을 공개하지만 현재 테스트는 rawValue와 Equatable만 검증합니다. Interest 및 UserProfile과 같이 JSON 인코드·디코드 왕복 테스트를 추가하세요.
수정 예시
+ func test_성별_codable_왕복() throws {
+ let data = try JSONEncoder().encode(Gender.other)
+ let decoded = try JSONDecoder().decode(Gender.self, from: data)
+ XCTAssertEqual(decoded, .other)
+ }As per coding guidelines, "모델 계약의 Equatable/Codable 및 Client testValue 동작을 검증한다."
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| func test_성별_rawValue와_동등성() { | |
| XCTAssertEqual(Gender.male.rawValue, "male") | |
| XCTAssertEqual(Gender.female.rawValue, "female") | |
| XCTAssertEqual(Gender.other.rawValue, "other") | |
| XCTAssertEqual(Gender.male, Gender.male) | |
| } | |
| func test_성별_rawValue와_동등성() { | |
| XCTAssertEqual(Gender.male.rawValue, "male") | |
| XCTAssertEqual(Gender.female.rawValue, "female") | |
| XCTAssertEqual(Gender.other.rawValue, "other") | |
| XCTAssertEqual(Gender.male, Gender.male) | |
| } | |
| func test_성별_codable_왕복() throws { | |
| let data = try JSONEncoder().encode(Gender.other) | |
| let decoded = try JSONDecoder().decode(Gender.self, from: data) | |
| XCTAssertEqual(decoded, .other) | |
| } |
🤖 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 `@Projects/Domain/Tests/User/UserModelTests.swift` around lines 5 - 10, Update
the Gender tests around test_성별_rawValue와_동등성 to verify its Codable contract
with JSON encode/decode round-trip coverage, matching the existing Interest and
UserProfile test patterns. Preserve the current rawValue and equality assertions
while confirming each Gender case survives encoding and decoding.
Source: Coding guidelines
📌 변경 요약
UserClient, model, error) 추가📌 변경 내용
Domain Auth
Sources/Auth파일을Model/Client/Error하위로 이동Domain User
UserClient.completeOnboarding(OnboardingDraft) -> AuthSession포트 추가Gender,Interest,UserProfile,OnboardingDraft,UserError최소 계약 추가profileCompleted유지Domain Tests / Docs
UserClient.testValue검증 추가