001package org.kuali.coeus.s2sgen.impl.budget;
002
003import org.kuali.coeus.propdev.api.budget.ProposalDevelopmentBudgetExtContract;
004import org.kuali.coeus.propdev.api.core.DevelopmentProposalContract;
005import org.springframework.stereotype.Component;
006
007@Component("s2SCommonBudgetService")
008public class S2SCommonBudgetServiceImpl implements S2SCommonBudgetService {
009    @Override
010    public ProposalDevelopmentBudgetExtContract getBudget(DevelopmentProposalContract developmentProposal) {
011        if (developmentProposal == null) {
012            throw new IllegalArgumentException("developmentProposal is null");
013        }
014
015        final ProposalDevelopmentBudgetExtContract finalBudget = developmentProposal.getFinalBudget();
016        return finalBudget != null ? finalBudget : developmentProposal.getLatestBudget();
017    }
018}