Skip to content

[Feat] 회원탈퇴 기능 구현 #16#22

Merged
ProtossManse merged 7 commits intodevelopfrom
feat/delete-member-#16
Mar 25, 2026
Merged

[Feat] 회원탈퇴 기능 구현 #16#22
ProtossManse merged 7 commits intodevelopfrom
feat/delete-member-#16

Conversation

@ProtossManse
Copy link
Copy Markdown
Contributor

@ProtossManse ProtossManse commented Mar 19, 2026

🔗 관련 이슈

📙 작업 설명

  • 회원 탈퇴 API를 연동하였습니다.
  • 회원 탈퇴 이후 로그아웃되도록 구현하였습니다.

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 설정의 '내 정보'에서 계정 삭제 기능이 추가되었으며, 삭제 성공 시 자동으로 로그아웃되어 로그인 화면으로 이동합니다.
    • 계정 삭제 요청이 비동기적으로 처리되어 실패/성공 콜백을 받을 수 있습니다.
  • 리팩토링

    • 내부 의존성 등록 및 리소스 import 정리를 통해 구현 구조를 정돈했습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be5d0a82-64fc-4f5f-a18f-915e04b9c7ee

📥 Commits

Reviewing files that changed from the base of the PR and between e13531a and 580decb.

📒 Files selected for processing (1)
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.kt

Walkthrough

계정 탈퇴 API 연동 기능이 추가되었습니다. 새로운 MemberDeleteService API 인터페이스, MemberDeleteRepository 추상화와 구현체, Koin 모듈 등록, ViewModel의 삭제 메서드 및 설정 화면의 탈퇴 버튼 연결이 포함됩니다.

Changes

Cohort / File(s) Summary
API 레이어
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/member/MemberDeleteService.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/di/ApiModule.kt
MemberDeleteService 인터페이스 추가 (@DELETE("member")) 및 Koin에 provideMemberDeleteService 등록.
Repository 레이어
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/MemberDeleteRepository.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.kt
MemberDeleteRepository 인터페이스와 MemberDeleteRepositoryImpl 구현 추가. API 호출 래핑 및 Result<Unit> 반환(예외는 runCatching으로 처리).
UI / ViewModel 통합
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/screen/SettingsMyDataScreen.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/viewmodel/SettingsMyDataViewModel.kt
ViewModel에 deleteUser(onSuccess,onError) 추가 및 설정 화면의 onServiceWithdrawClick에서 삭제 후 로그아웃 체인 호출로 연결.
Import 정리
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/subscription/screen/SettingsSubscriptionScreen.kt
와일드카드 리소스 임포트 제거 및 명시적 임포트로 변경.

Sequence Diagram(s)

sequenceDiagram
    participant User as "사용자 (UI)"
    participant Screen as "SettingsMyDataScreen"
    participant VM as "SettingsMyDataViewModel"
    participant Repo as "MemberDeleteRepository"
    participant Service as "MemberDeleteService (Ktorfit)"
    participant Auth as "Auth (로그아웃)"

    User->>Screen: 탈퇴 버튼 클릭
    Screen->>VM: deleteUser(onSuccess, onError)
    VM->>Repo: deleteMember()
    Repo->>Service: DELETE /member
    Service-->>Repo: HTTP 200 / 응답
    Repo-->>VM: Result.success
    VM->>VM: onSuccess 콜백 호출
    VM->>Auth: logout()
    Auth-->>VM: logout 성공
    VM-->>Screen: navigateToLoginAfterLogout()
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • alswlekk

Poem

계정 지우려 손을 뻗으면 ✨
API, Repo, ViewModel이 손잡네 🤝
DELETE 한 번에 흐르는 깔끔한 선율
로그아웃까지 부드럽게 이어져
작별은 조용히, 코드로 완성 👋

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 회원탈퇴 기능 구현이라는 변경의 핵심 내용을 정확하게 반영하고 있으며, 구체적이고 명확합니다.
Linked Issues check ✅ Passed PR은 계정 탈퇴 API 연동 요구사항을 완전히 충족하며, 관련 저장소와 뷰모델에 모두 구현되어 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 회원탈퇴 기능 구현 범위 내에 있으며, 불필요한 변경이 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/delete-member-#16
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

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

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.kt`:
- Around line 11-13: The method currently wraps
memberDeleteService.deleteMember() in runCatching but returns Result<Unit>,
causing a mismatch and not propagating HTTP errors; change the implementation in
MemberDeleteRepositoryImpl.deleteMember to call .handleNullableResponse() on the
Response before wrapping so the HTTP errors are converted/propagated and the
result becomes Unit (for example: runCatching {
memberDeleteService.deleteMember().handleNullableResponse() }), ensuring the
function returns Result<Unit>.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/screen/SettingsMyDataScreen.kt`:
- Around line 80-93: The empty failure callbacks for onServiceWithdrawClick
(calls to viewModel.deleteUser and nested viewModel.logout) swallow errors and
break user flow; implement onError handlers for viewModel.deleteUser and
viewModel.logout to handle failures (e.g., display an error UI/message, keep
showLogoutDialog true to avoid closing the dialog prematurely, and avoid
navigating via navigateToLoginAfterLogout on logout failure) and ensure any
necessary local cleanup is still done or retried; update the onError lambdas in
the deleteUser and logout calls to call the viewModel/error-dispatch method or
UI toast/snackbar and to preserve correct dialog/navigation state (referencing
onServiceWithdrawClick, viewModel.deleteUser, viewModel.logout,
showLogoutDialog, navigateToLoginAfterLogout).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2aa7519e-e5ac-453b-94fd-a9a58d319a28

📥 Commits

Reviewing files that changed from the base of the PR and between 61088a4 and e13531a.

📒 Files selected for processing (7)
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/api/member/MemberDeleteService.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/di/ApiModule.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/MemberDeleteRepository.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/MemberDeleteRepositoryImpl.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/screen/SettingsMyDataScreen.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/viewmodel/SettingsMyDataViewModel.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/subscription/screen/SettingsSubscriptionScreen.kt
💤 Files with no reviewable changes (1)
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/subscription/screen/SettingsSubscriptionScreen.kt

Comment on lines +80 to +93
onServiceWithdrawClick = {
viewModel.deleteUser(
onSuccess = {
viewModel.logout(
onSuccess = {
showLogoutDialog = false
navigateToLoginAfterLogout()
},
onError = { error ->
},
)
},
onError = {},
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

실패 콜백이 비어 있어 탈퇴/로그아웃 실패 시 사용자 흐름이 끊깁니다.

Line 88-89, Line 92에서 onError를 비워두면 실패가 완전히 무시됩니다. 특히 로그아웃은 로컬 토큰이 이미 정리될 수 있어(관련 구현상) 화면만 남는 불일치 상태가 생길 수 있습니다.

🩹 최소 보완안
         onServiceWithdrawClick = {
             viewModel.deleteUser(
                 onSuccess = {
                     viewModel.logout(
                         onSuccess = {
                             showLogoutDialog = false
                             navigateToLoginAfterLogout()
                         },
-                        onError = { error ->
-                        },
+                        onError = { _ ->
+                            // 로컬 세션 정리 상태와 UI 상태를 맞춤
+                            showLogoutDialog = false
+                            navigateToLoginAfterLogout()
+                        },
                     )
                 },
-                onError = {},
+                onError = { _ ->
+                    // TODO: 스낵바/다이얼로그 등 사용자 피드백 연결
+                },
             )
         },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/settings/mydata/screen/SettingsMyDataScreen.kt`
around lines 80 - 93, The empty failure callbacks for onServiceWithdrawClick
(calls to viewModel.deleteUser and nested viewModel.logout) swallow errors and
break user flow; implement onError handlers for viewModel.deleteUser and
viewModel.logout to handle failures (e.g., display an error UI/message, keep
showLogoutDialog true to avoid closing the dialog prematurely, and avoid
navigating via navigateToLoginAfterLogout on logout failure) and ensure any
necessary local cleanup is still done or retried; update the onError lambdas in
the deleteUser and logout calls to call the viewModel/error-dispatch method or
UI toast/snackbar and to preserve correct dialog/navigation state (referencing
onServiceWithdrawClick, viewModel.deleteUser, viewModel.logout,
showLogoutDialog, navigateToLoginAfterLogout).

Copy link
Copy Markdown
Contributor

@librawish808 librawish808 left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Contributor

@alswlekk alswlekk left a comment

Choose a reason for hiding this comment

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

LGTM

@ProtossManse ProtossManse merged commit 8e5e799 into develop Mar 25, 2026
3 checks passed
@ProtossManse ProtossManse deleted the feat/delete-member-#16 branch March 25, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 계정 탈퇴 API 연동

3 participants