1 /* 2 * The Kuali Financial System, a comprehensive financial management system for higher education. 3 * 4 * Copyright 2005-2014 The Kuali Foundation 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU Affero General Public License as 8 * published by the Free Software Foundation, either version 3 of the 9 * License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Affero General Public License for more details. 15 * 16 * You should have received a copy of the GNU Affero General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 package org.kuali.kfs.coa.service; 20 21 import java.util.List; 22 23 import org.kuali.kfs.coa.businessobject.ObjectCode; 24 25 /** 26 * This interface defines methods that an ObjectCode Service must provide. 27 */ 28 public interface ObjectCodeService { 29 30 /** 31 * @param universityFiscalYear - University Fiscal Year 32 * @param chartOfAccountsCode - Chart of Accounts Code 33 * @param financialObjectCode - Financial Object Code 34 * @return ObjectCode Retrieves an ObjectCode object based on primary key. 35 */ 36 public ObjectCode getByPrimaryId(Integer universityFiscalYear, String chartOfAccountsCode, String financialObjectCode); 37 38 /** 39 * @param universityFiscalYear - University Fiscal Year 40 * @param chartOfAccountsCode - Chart of Accounts Code 41 * @param financialObjectCode - Financial Object Code 42 * @return ObjectCode Retrieves an ObjectCode object based on primary key. 43 */ 44 public ObjectCode getByPrimaryIdWithCaching(Integer universityFiscalYear, String chartOfAccountsCode, String financialObjectCode); 45 46 /** 47 * This method returns an financial object code for the current fiscal year. 48 * 49 * @param chartOfAccountsCode chart of accounts code for object code 50 * @param financialObjectCode financial object code 51 * @return the object code specified 52 */ 53 public ObjectCode getByPrimaryIdForCurrentYear(String chartOfAccountsCode, String financialObjectCode); 54 55 /** 56 * @param chartOfAccountsCode - Chart of Accounts Code 57 * @param financialObjectCode - Financial Object Code 58 * @return a list containing integer years, given object code. The list may be empty, but will not be null. 59 */ 60 public List getYearList(String chartOfAccountsCode, String financialObjectCode); 61 62 /** 63 * This method, written for use with DWR, returns a joined string representation of all of the names of the distinct object 64 * codes associated with each of the chart codes given. In the best of all possible worlds, this will only ever return *one* 65 * object code name, as object codes will be shared across charts. 66 * 67 * @param universityFiscalYear the fiscal year of the financial object code to check. 68 * @param chartOfAccountCodes array of Chart of Accounts codes to 69 * @param financialObjectCode financial object code to look up 70 * @return a String representation of the distinct names of the object codes 71 */ 72 public String getObjectCodeNamesByCharts(Integer universityFiscalYear, String[] chartOfAccountCodes, String financialObjectCode); 73 74 /** 75 * This method returns a list of Object Codes that correspond to a list of Object Level Codes. 76 * 77 * @param levelCodes List of Object Level Codes used to retrieve Object Codes 78 * @return List of Object Codes 79 */ 80 public List<ObjectCode> getObjectCodesByLevelIds(List<String> levelCodes); 81 82 /** 83 * Determines if the given object consolidation contains any object codes with the financial object code matching the given object code 84 * @param chartOfAccountsCode the chartOfAccountsCode of the object consolidation to check 85 * @param consolidationCode the object consolidation to check 86 * @param objectChartOfAccountsCode the chart of accounts code of the object code to look for 87 * @param objectCode the object code to look for 88 * @return true if the object consolidation contains the given object code, false if not 89 */ 90 public boolean doesObjectConsolidationContainObjectCode(String chartOfAccountsCode, String consolidationCode, String objectChartOfAccountsCode, String objectCode); 91 92 /** 93 * Determines if the given level contains any object codes with the financial object code matching the given object code 94 * @param chartOfAccountsCode the chartOfAccountsCode of the object level to check 95 * @param levelCode the object level to check 96 * @param objectChartOfAccountsCode the chart of accounts code of the object code to look for 97 * @param objectCode the object code to look for 98 * @return true if the object level contains the given object code, false if not 99 */ 100 public boolean doesObjectLevelContainObjectCode(String chartOfAccountsCode, String levelCode, String objectChartOfAccountsCode, String objectCode); 101 }