class ApplicationFundingServiceImpl extends BaseTransactionalService implements ApplicationFundingService {

    @Override
    @Transactional
    public ServiceResult<Void> saveFundingDecisionData(Long competitionId, Map<Long, FundingDecision> applicationFundingDecisions) {
        if (applicationFundingDecisions.isEmpty()) {
            return serviceFailure(FUNDING_PANEL_DECISION_NONE_PROVIDED);
        }
        return getCompetition(competitionId).andOnSuccess(competition -> {
            List<Application> applications = findValidApplications(applicationFundingDecisions, competitionId);
            return saveFundingDecisionData(applications, applicationFundingDecisions);
        });
    }

}