class InterviewInviteServiceImpl extends InviteService<InterviewInvite> implements InterviewInviteService {

    @Override
    public ServiceResult<Void> deleteAllInvites(long competitionId) {
        return find(competitionRepository.findById(competitionId), notFoundError(Competition.class, competitionId))
                .andOnSuccessReturnVoid(competition ->
                        interviewInviteRepository.deleteByCompetitionIdAndStatus(competition.getId(), CREATED));
    }

}