class ReviewInviteServiceImpl extends InviteService<ReviewInvite> implements ReviewInviteService {

    @Override
    public ServiceResult<List<ReviewParticipantResource>> getAllInvitesByUser(long userId) {
        List<ReviewParticipantResource> reviewParticipantResources =
                reviewParticipantRepository
                        .findByUserIdAndRole(userId, PANEL_ASSESSOR)
                        .stream()
                        .filter(participant -> now().isBefore(participant.getInvite().getTarget().getAssessmentPanelDate()))
                        .map(reviewParticipantMapper::mapToResource)
                        .collect(toList());

        reviewParticipantResources.forEach(this::determineStatusOfPanelApplications);

        return serviceSuccess(reviewParticipantResources);
    }

}