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

Ignore: ✏️ Users are unable to delete their accounts while they hold ownership of any chatrooms #198

Merged
merged 5 commits into from
Nov 13, 2024

Conversation

psychology50
Copy link
Member

작업 이유

  • Add a restriction in the sign-out process to prevent users from signing out if they hold ownership of any chatrooms.

작업 사항

@Slf4j
@Service
@RequiredArgsConstructor
public class UserDeleteService {
    ...

    private final ChatMemberService chatMemberService;

    /**
     * 사용자와 관련한 모든 데이터를 삭제(soft delete)하는 메서드
     * <p>
     * hard delete가 수행되어야 할 데이터는 삭제하지 않으며, 사용자 데이터 유지 기간이 만료될 때 DBA가 수행한다.
     *
     * @param userId
     */
    @Transactional
    public void execute(Long userId) {
        if (!userService.isExistUser(userId)) throw new UserErrorException(UserErrorCode.NOT_FOUND);

        if (chatMemberService.hasUserChatRoomOwnership(userId)) {
            throw new UserErrorException(UserErrorCode.HAS_OWNERSHIP_CHAT_ROOM);
        }

        // .. delete process
    }
}

리뷰어가 중점적으로 확인해야 하는 부분

  • none

발견한 이슈

  • It should be appended deletion processes related user data

@psychology50 psychology50 added the fix 기능 수정 label Nov 13, 2024
@psychology50 psychology50 self-assigned this Nov 13, 2024
@psychology50 psychology50 changed the title Api: ✏️ Users are unable to delete their accounts while they hold ownership of any chatrooms Ignore: ✏️ Users are unable to delete their accounts while they hold ownership of any chatrooms Nov 13, 2024
@psychology50 psychology50 merged commit af58ae7 into dev Nov 13, 2024
1 check passed
@psychology50 psychology50 deleted the fix/add-sign-out-pre-condition branch November 13, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 기능 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant