public Mono<Void> authAndBlockUser(
            @NotNull Long requesterId,
            @NotNull Long groupId,
            @NotNull Long userIdToBlock,
            @Nullable ClientSession session) {
        try {
            Validator.notNull(requesterId, "requesterId");
            Validator.notNull(groupId, "groupId");
            Validator.notNull(userIdToBlock, "userIdToBlock");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        if (requesterId.equals(userIdToBlock)) {
            return Mono.error(ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                    "Cannot block oneself"));
        }
        return groupMemberService.isOwnerOrManager(requesterId, groupId, false)
                .flatMap(authenticated -> authenticated
                        ? groupMemberService.isGroupMember(groupId, userIdToBlock, false)
                        : Mono.error(ResponseException.get(
                                ResponseStatusCode.NOT_GROUP_OWNER_OR_MANAGER_TO_ADD_BLOCKED_USER)))
                .flatMap(isGroupMember -> {
                    GroupBlockedUser blockedUser =
                            new GroupBlockedUser(groupId, userIdToBlock, new Date(), requesterId);
                    if (isGroupMember) {
                        Mono<Void> updateVersion =
                                groupVersionService.updateVersion(groupId, true, true, false, false)
                                        .onErrorResume(t -> {
                                            LOGGER.error(
                                                    "Caught an error while updating the members and blocklist version of the group ({}) after blocking a user",
                                                    groupId,
                                                    t);
                                            return Mono.empty();
                                        })
                                        .then();
                        if (session == null) {
                            return groupBlocklistRepository
                                    .inTransaction(newSession -> groupMemberService
                                            .deleteGroupMember(groupId,
                                                    userIdToBlock,
                                                    newSession,
                                                    false)
                                            .then(groupBlocklistRepository.insert(blockedUser,
                                                    newSession))
                                            .then(updateVersion)
                                            .retryWhen(TRANSACTION_RETRY));
                        }
                        return groupMemberService
                                .deleteGroupMember(groupId, userIdToBlock, session, false)
                                .then(groupBlocklistRepository.insert(blockedUser, session))
                                .then(updateVersion);
                    }
                    return groupBlocklistRepository.insert(blockedUser, session)
                            .then(groupVersionService.updateBlocklistVersion(groupId)
                                    .onErrorResume(t -> {
                                        LOGGER.error(
                                                "Caught an error while updating the blocklist version of the group ({}) after blocking a user",
                                                groupId,
                                                t);
                                        return Mono.empty();
                                    })
                                    .then());
                });
    }
@return an empty publish if the user was blocked successfully, or an error for other cases.
        Note that the method will throw if the user has been blocked
turms-service/src/main/java/im/turms/service/domain/group/service/GroupBlocklistService.java