1 /* 2 * Copyright 2005-2006 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.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/ecl2.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.ole.coa.dataaccess; 17 18 import java.sql.Date; 19 import java.util.Collection; 20 import java.util.Iterator; 21 import java.util.List; 22 23 import org.kuali.ole.coa.businessobject.Account; 24 import org.kuali.ole.coa.businessobject.AccountDelegate; 25 import org.kuali.rice.kim.api.identity.Person; 26 27 28 /** 29 * This interface defines what methods of data retrieval should be allowed for {@link org.kuali.ole.coa.businessobject.Account}, and 30 * {@link org.kuali.ole.coa.businessobject.AccountDelegate}. It also defines a method for checking if a given User is responsible 31 * for an Account 32 */ 33 public interface AccountDao { 34 35 /** 36 * @see org.kuali.ole.coa.service.AccountService#getPrimaryDelegationByExample(org.kuali.ole.coa.businessobject.AccountDelegate, 37 * java.lang.String) 38 */ 39 public List getPrimaryDelegationByExample(AccountDelegate delegateExample, Date currentSqlDate, String totalDollarAmount); 40 41 /** 42 * @see org.kuali.ole.coa.service.AccountService#getSecondaryDelegationsByExample(org.kuali.ole.coa.businessobject.AccountDelegate, 43 * java.lang.String) 44 */ 45 public List getSecondaryDelegationsByExample(AccountDelegate delegateExample, Date currentSqlDate, String totalDollarAmount); 46 47 /** 48 * fetch the AccountResponsibility objects that the user has associated with them 49 * 50 * @param kualiUser 51 * @param currentDate current date 52 * @return a list of AccountResponsibility objects 53 */ 54 public List getAccountsThatUserIsResponsibleFor(Person kualiUser, java.util.Date currentDate); 55 56 /** 57 * This method should determine if the given user has any responsibilities on the given account 58 * 59 * @param person the user to check responsibilities for 60 * @param account the account to check responsibilities on 61 * @param currentSqlDate current Sql date 62 * @return true if user is somehow responsible for account, false if otherwise 63 */ 64 public boolean determineUserResponsibilityOnAccount(Person person, Account account, Date currentSqlDate); 65 66 /** 67 * get all accounts in the system. This is needed by a sufficient funds rebuilder job 68 * 69 * @return iterator of all accounts 70 */ 71 public Iterator getAllAccounts(); 72 73 /** 74 * Retrieves all active accounts from the database where the given principal is the fiscal officer 75 * 76 * @param principalId the principal id of the fiscal officer 77 * @param currentSqlDate current sql date 78 * @return an Iterator of active Accounts 79 */ 80 public abstract Iterator<Account> getActiveAccountsForFiscalOfficer(String principalId, Date currentSqlDate); 81 82 /** 83 * Retrieves all expired accounts from the database where the given principal is the fiscal officer 84 * 85 * @param principalId the principal id of the fiscal officer 86 * @param currentSqlDate current Sql Date 87 * @return an Iterator of expired Accounts 88 */ 89 public abstract Iterator<Account> getExpiredAccountsForFiscalOfficer(String principalId, Date currentSqlDate); 90 91 /** 92 * Retrieves all active accounts from the database where the given principal is the account supervisor 93 * 94 * @param principalId the principal id of the account supervisor 95 * @param currentSalDate 96 * @return an Iterator of active Accounts 97 */ 98 public abstract Iterator<Account> getActiveAccountsForAccountSupervisor(String principalId, Date currentSalDate); 99 100 /** 101 * Retrieves all active accounts from the database where the given principal is the account supervisor 102 * 103 * @param principalId the principal id of the account supervisor 104 * @param currentSqlDate current Sql Date 105 * @return an Iterator of expired Accounts 106 */ 107 public abstract Iterator<Account> getExpiredAccountsForAccountSupervisor(String principalId, Date currentSqlDate); 108 109 /** 110 * Determines if the given principal is the fiscal officer of any non-closed account 111 * 112 * @param principalId the principal to check for the fiscal officer role 113 * @return true if the principal is a fiscal officer for any non-closed account, false otherwise 114 */ 115 public abstract boolean isPrincipalInAnyWayShapeOrFormFiscalOfficer(String principalId); 116 117 /** 118 * Determines if the given principal is the account supervisor of any non-closed account 119 * 120 * @param principalId the principal to check for the account supervisor role 121 * @return true if the principal is a account supervisor for any non-closed account, false otherwise 122 */ 123 public abstract boolean isPrincipalInAnyWayShapeOrFormAccountSupervisor(String principalId); 124 125 /** 126 * Determines if the given principal is the account manager of any non-closed account 127 * 128 * @param principalId the principal to check for the account manager role 129 * @return true if the principal is a account manager for any non-closed account, false otherwise 130 */ 131 public abstract boolean isPrincipalInAnyWayShapeOrFormAccountManager(String principalId); 132 133 public Collection<Account> getAccountsForAccountNumber(String accountNumber); 134 }