public Mono<UserFriendRequest> authAndCreateFriendRequest(
            @NotNull Long requesterId,
            @NotNull Long recipientId,
            @Nullable String content,
            @NotNull @PastOrPresent Date creationDate) {
        try {
            Validator.notNull(requesterId, "requesterId");
            Validator.notNull(recipientId, "recipientId");
            Validator.maxLength(content, "content", maxContentLength);
            Validator.notNull(creationDate, "creationDate");
            Validator.pastOrPresent(creationDate, "creationDate");
            Validator.notEquals(requesterId,
                    recipientId,
                    "The requester ID must not be equal to the recipient ID");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        return userRelationshipService.isNotBlocked(recipientId, requesterId, false)
                .flatMap(isNotBlocked -> {
                    if (!isNotBlocked) {
                        return Mono.error(ResponseException
                                .get(ResponseStatusCode.BLOCKED_USER_TO_SEND_FRIEND_REQUEST));
                    }
                    // Allow creating a friend request even there is already an accepted request
                    // because the relationships can be deleted and rebuilt
                    Mono<Boolean> requestExistsMono =
                            allowSendRequestAfterDeclinedOrIgnoredOrExpired
                                    ? hasPendingFriendRequest(requesterId, recipientId)
                                    : hasPendingOrDeclinedOrIgnoredOrExpiredRequest(requesterId,
                                            recipientId);
                    return requestExistsMono.flatMap(requestExists -> {
                        String finalContent = content == null
                                ? ""
                                : content;
                        return requestExists
                                ? Mono.error(ResponseException
                                        .get(ResponseStatusCode.CREATE_EXISTING_FRIEND_REQUEST))
                                : createFriendRequest(null,
                                        requesterId,
                                        recipientId,
                                        finalContent,
                                        RequestStatus.PENDING,
                                        creationDate,
                                        null,
                                        null);
                    });
                });
    }
@author James Chen
@implNote The status of friend requests never become EXPIRED in MongoDB automatically (admins can
          specify them to expired manually though) even if there is an expireAfter property
          because Turms will not create a cron job to scan and expire requests in MongoDB.
          Instead, Turms transforms the status of requests when returning them to users or admins
          for less resource consumption and better performance to expire requests.
turms-service/src/main/java/im/turms/service/domain/user/service/UserFriendRequestService.java