Skip to content

온보딩 Domain User 계약 추가 - #16

Open
gnoes-ios wants to merge 4 commits into
devfrom
chore/onboarding-domain-contract
Open

온보딩 Domain User 계약 추가#16
gnoes-ios wants to merge 4 commits into
devfrom
chore/onboarding-domain-contract

Conversation

@gnoes-ios

Copy link
Copy Markdown
Contributor

📌 변경 요약

  • Domain Auth 소스를 Model/Client/Error 구조로 정렬
  • 온보딩용 User Domain 계약(UserClient, model, error) 추가
  • User Domain 단위 테스트와 README 진입점 문서 갱신

📌 변경 내용

Domain Auth

  • Sources/Auth 파일을 Model / Client / Error 하위로 이동
  • 공개 타입 API 유지, 폴더 구조만 정리

Domain User

  • UserClient.completeOnboarding(OnboardingDraft) -> AuthSession 포트 추가
  • Gender, Interest, UserProfile, OnboardingDraft, UserError 최소 계약 추가
  • AuthClient와 책임 분리, 세션 게이트는 profileCompleted 유지

Domain Tests / Docs

  • User model 동등성/Codable, UserClient.testValue 검증 추가
  • Domain README 현재 상태/진입점/테스트 포인트 갱신

@gnoes-ios gnoes-ios added the feat 새로운 기능 label Aug 7, 2026
@gnoes-ios gnoes-ios self-assigned this Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • 새로운 기능

    • 카카오·애플 로그인을 지원하는 인증 모델과 세션 관리 기능을 추가했습니다.
    • 로그인 취소, 네트워크, 권한 부족 등 인증 오류 상태를 제공합니다.
    • 사용자 온보딩을 위한 프로필, 성별, 관심사 및 작성 초안 모델을 추가했습니다.
    • 온보딩 완료 처리를 위한 사용자 기능을 추가했습니다.
  • 테스트

    • 사용자 모델의 동등성 및 데이터 인코딩·복원 동작을 검증합니다.

Walkthrough

Auth 세션 계약과 의존성 클라이언트를 추가했습니다. User 모델, 오류 타입, 온보딩 클라이언트를 추가했습니다. 모델의 동등성 및 Codable 동작과 테스트 의존성 기본값을 검증했습니다.

Changes

Domain 포트 확장

Layer / File(s) Summary
Auth 계약과 의존성 등록
Projects/Domain/Sources/Auth/Model/*, Projects/Domain/Sources/Auth/Error/AuthError.swift, Projects/Domain/Sources/Auth/Client/AuthClient.swift
AuthProvider, AuthSession, AuthError, AuthClient를 추가했습니다. AuthClient는 세션 복원, 로그인, 로그아웃, 현재 세션 조회 API와 DependencyValues.authClient를 제공합니다.
User 모델과 오류 계약
Projects/Domain/Sources/User/Model/*, Projects/Domain/Sources/User/Error/UserError.swift, Projects/Domain/Tests/User/UserModelTests.swift
Gender, Interest, OnboardingDraft, UserProfile, UserError를 추가했습니다. 모델의 동등성, 원시값, Codable 왕복 동작을 테스트합니다.
UserClient 온보딩 포트
Projects/Domain/Sources/User/Client/UserClient.swift, Projects/Domain/Tests/User/UserClientTests.swift, Projects/Domain/README.md
UserClient.completeOnboardingDependencyValues.userClient를 추가했습니다. testValue 기본값과 Domain 포트 목록을 검증 및 문서화했습니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 온보딩용 User Domain 계약 추가라는 PR의 주요 변경 사항을 명확하고 간결하게 설명합니다.
Description check ✅ Passed 설명은 변경 요약, 변경 내용, 기타 참고 사항에 해당하는 핵심 내용을 충분히 포함합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b141bd5 and 7d36da0.

📒 Files selected for processing (13)
  • Projects/Domain/README.md
  • Projects/Domain/Sources/Auth/Client/AuthClient.swift
  • Projects/Domain/Sources/Auth/Error/AuthError.swift
  • Projects/Domain/Sources/Auth/Model/AuthProvider.swift
  • Projects/Domain/Sources/Auth/Model/AuthSession.swift
  • Projects/Domain/Sources/User/Client/UserClient.swift
  • Projects/Domain/Sources/User/Error/UserError.swift
  • Projects/Domain/Sources/User/Model/Gender.swift
  • Projects/Domain/Sources/User/Model/Interest.swift
  • Projects/Domain/Sources/User/Model/OnboardingDraft.swift
  • Projects/Domain/Sources/User/Model/UserProfile.swift
  • Projects/Domain/Tests/User/UserClientTests.swift
  • Projects/Domain/Tests/User/UserModelTests.swift

Comment on lines +5 to +9
func test_UserClient_testValue는_빈_클라이언트로_생성() {
// @DependencyClient 는 testValue = UserClient() 를 기본 제공한다.
// 미구현 endpoint 호출 시 issue를 내므로, 생성 가능성만 검증한다.
_ = UserClient.testValue
XCTAssertTrue(true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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

Comment on lines +5 to +10
func test_성별_rawValue와_동등성() {
XCTAssertEqual(Gender.male.rawValue, "male")
XCTAssertEqual(Gender.female.rawValue, "female")
XCTAssertEqual(Gender.other.rawValue, "other")
XCTAssertEqual(Gender.male, Gender.male)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

GenderCodable 계약을 검증하세요.

GenderCodable을 공개하지만 현재 테스트는 rawValueEquatable만 검증합니다. InterestUserProfile과 같이 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.

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 새로운 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant