1 /*
2 * Copyright 2005-2014 The Kuali Foundation.
3 *
4 * Licensed under the Educational Community License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl1.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.coeus.s2sgen.impl.budget;
17
18 import org.kuali.coeus.common.budget.api.core.BudgetContract;
19 import org.kuali.coeus.common.budget.api.nonpersonnel.BudgetLineItemContract;
20 import org.kuali.coeus.common.budget.api.period.BudgetPeriodContract;
21 import org.kuali.coeus.common.budget.api.personnel.BudgetPersonnelDetailsContract;
22 import org.kuali.coeus.propdev.api.person.ProposalPersonContract;
23 import org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract;
24 import org.kuali.coeus.sys.api.model.ScaleTwoDecimal;
25 import org.kuali.coeus.s2sgen.api.core.S2SException;
26 import org.kuali.coeus.common.budget.api.core.category.BudgetCategoryMapContract;
27
28 import java.util.List;
29
30 /**
31 * This class contains the Budget related calculations for a proposal
32 *
33 * @author Kuali Research Administration Team (kualidev@oncourse.iu.edu)
34 */
35 public interface S2SBudgetCalculatorService {
36
37 String getParticipantSupportCategoryCode();
38
39 List<? extends BudgetLineItemContract> getMatchingLineItems(List<? extends BudgetLineItemContract> lineItems, List<String> budgetCategoryType);
40
41 /**
42 *
43 * This method returns a list of {@link BudgetCategoryMapContract} based on the input. The list returned will not contain the categories
44 * that the codes passed as a list of {@link String} and also will not contain those that match the types passed as list of
45 * {@link String}. In case 2 empty lists are passed as parameters, the method will return entire list without applying any
46 * filters.
47 *
48 * @param filterTargetCategoryCodes Category Codes that must be filtered
49 * @param filterCategoryTypes Category types that must be filtered
50 * @return a List of BudgetCategoryMap.
51 */
52 List<? extends BudgetCategoryMapContract> getBudgetCategoryMapList(List<String> filterTargetCategoryCodes, List<String> filterCategoryTypes);
53
54 /**
55 *
56 * This method does the budget related calculations for a given {@link ProposalDevelopmentDocumentContract} and returns them in
57 * {@link BudgetSummaryDto}
58 *
59 * @param pdDoc ProposalDevelopmentDocumentContract.
60 * @return BudgetSummaryInfo corresponding to the ProposalDevelopmentDocumentContract object.
61 * @throws S2SException
62 */
63 BudgetSummaryDto getBudgetInfo(ProposalDevelopmentDocumentContract pdDoc, List<BudgetPeriodDto> budgetperiodList) throws S2SException;
64
65 /**
66 *
67 * This method gets the list of {@link BudgetPeriodDto} for the latest {@link BudgetContract} of the given
68 * {@link ProposalDevelopmentDocumentContract}
69 *
70 * @param pdDoc ProposalDevelopmentDocumentContract
71 * @return a List of BudgetPeriodInfo corresponding to the ProposalDevelopmentDocumentContract object.
72 * @throws S2SException
73 */
74 List<BudgetPeriodDto> getBudgetPeriods(ProposalDevelopmentDocumentContract pdDoc) throws S2SException;
75
76 /**
77 *
78 * This method determines whether a {@link org.kuali.coeus.propdev.api.person.ProposalPersonContract} is a Non MIT person
79 *
80 * @param proposalPerson ProposalPerson.
81 * @return boolean true if Non MIT Person false otherwise.
82 */
83 boolean isPersonNonMITPerson(ProposalPersonContract proposalPerson);
84 /**
85 *
86 * This method computes the indirect costs for a given {@link org.kuali.coeus.common.budget.api.period.BudgetPeriodContract}
87 *
88 * @param budgetPeriod
89 * given BudgetPeriod.
90 * @return IndirectCostInfo for the corresponding BudgetPeriod object.
91 */
92 IndirectCostDto getIndirectCosts(BudgetContract budget,BudgetPeriodContract budgetPeriod);
93
94 ScaleTwoDecimal getBaseSalaryByPeriod(Long budgetId, int budgetPeriod, KeyPersonDto keyPerson );
95
96 /**
97 *
98 * This method compares a key person with budget person. It checks whether
99 * the key person is from PERSON or ROLODEX and matches the respective
100 * person ID with the person in {@link org.kuali.coeus.common.budget.api.personnel.BudgetPersonnelDetailsContract}
101 *
102 * @param keyPersonInfo -
103 * key person to compare
104 * @param budgetPersonnelDetails
105 * person from BudgetPersonnelDetails
106 * @return true if persons match, false otherwise
107 */
108 boolean keyPersonEqualsBudgetPerson(KeyPersonDto keyPersonInfo,
109 BudgetPersonnelDetailsContract budgetPersonnelDetails);
110
111 }