class CompetitionSetupStakeholderServiceImpl extends BaseTransactionalService implements CompetitionSetupStakeholderService {

    @Override
    @Transactional
    public ServiceResult<Void> addStakeholder(long competitionId, long stakeholderUserId) {
        return getCompetition(competitionId)
                .andOnSuccessReturnVoid(competition ->
                        find(userRepository.findById(stakeholderUserId),
                                notFoundError(User.class, stakeholderUserId))
                                .andOnSuccess(stakeholderUser -> {
                                    Stakeholder savedStakeholder = stakeholderRepository.save(new Stakeholder(competition, stakeholderUser));
                                    return sendAddStakeholderNotification(savedStakeholder, competition);
                                })
                );
    }

}