Skip to content
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

feat: 멤버 탈퇴 api 구현 #38

Merged
merged 18 commits into from
Feb 9, 2024
Merged

Conversation

Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Feb 4, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 멤버 삭제
  • redis에서 토큰 삭제

@Sangwook02 Sangwook02 added the ✨ feature 새로운 기능 추가 및 수정 label Feb 4, 2024
@Sangwook02 Sangwook02 self-assigned this Feb 4, 2024
@Sangwook02 Sangwook02 requested a review from a team as a code owner February 4, 2024 13:52
Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

lgtm

다만 한 가지 논의해야 하는 것이... soft delete vs hard delete인데요,
서버끼리 한번 이야기해봐야 할 것 같습니다.

Copy link
Member Author

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

soft delete 하도록 수정했습니다

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

멤버 탈퇴 시 재가입이 가능하도록 로그인 fetchOrCreate 쪽 로직에서 멤버 fetch할 때 일반 상태만 가져오도록 해서, deleted인 경우 create 로직 타도록 변경해주세요.

@@ -86,4 +89,15 @@ public static Member createGuestMember(String oauthId) {
.status(MemberStatus.NORMAL)
.build();
}

public void softDelete() {
if (this.status.isDeleted()) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (this.status.isDeleted()) {
if (isDeleted()) {

Copy link
Member Author

Choose a reason for hiding this comment

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

해당 내용 수정했습니다

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

soft delete와 hard delete는 DB 상에서의 삭제 구현 방식에 대한 논의이지,
애플리케이션 단에서 특수하게 둘을 구분할 필요가 없고 구분해야 하는 요구사항도 없습니다.
애플리케이션에서 예외 상황을 구별해야 한다면 삭제 했냐 / 안했냐에 대한 문제이지 DB 삭제 방식까지 구별해야 하는 것은 아닙니다.

요약하자면 우리 서비스에서 soft delete / hard delete 라는 지식을 가지고 있을 필요가 없습니다. 오히려 도메인 메서드나 예외 코드가 고정되어 버리면 추후 하드 딜리트로 넘어가는 상황에서 대처하기도 어렵습니다. 이 부분에 대해서 수정이 필요해 보입니다.

@@ -86,4 +89,15 @@ public static Member createGuestMember(String oauthId) {
.status(MemberStatus.NORMAL)
.build();
}

public void softDelete() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public void softDelete() {
public void withdraw() {

의미를 더 잘 드러낼 수 있는 메서드 이름을 써주면 좋을 것 같습니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

좋은 지적 감사합니다👍

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

이 부분만 수정하고 머지하심 될 듯합니다~


// Member
MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, "존재하지 않는 회원입니다."),
MEMBER_DELETED(HttpStatus.BAD_REQUEST, "탈퇴한 회원입니다.");
Copy link
Member

Choose a reason for hiding this comment

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

409 Conflict가 더 적절해보입니다.

@Sangwook02 Sangwook02 merged commit a223438 into develop Feb 9, 2024
1 check passed
@Sangwook02 Sangwook02 deleted the feature/25-member-withdrawal branch February 9, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature 새로운 기능 추가 및 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ 어드민 멤버 탈퇴 처리하기 API 구현
2 participants