01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.chart.service;
17:
18: import java.util.Iterator;
19: import java.util.List;
20:
21: import org.kuali.core.bo.user.UniversalUser;
22: import org.kuali.module.chart.bo.Account;
23: import org.kuali.module.chart.bo.Delegate;
24:
25: /**
26: * This interface defines methods that an Account Service must provide
27: */
28: public interface AccountService {
29: /**
30: * Retrieves an Account object based on primary key.
31: *
32: * @param chartOfAccountsCode - Chart of Accounts Code
33: * @param accountNumber - Account Number
34: * @return Account
35: */
36: public Account getByPrimaryId(String chartOfAccountsCode,
37: String accountNumber);
38:
39: /**
40: * Method is used by KualiAccountAttribute to enable caching of orgs for routing.
41: *
42: * @see org.kuali.module.chart.service.AccountService#getByPrimaryId(java.lang.String, java.lang.String)
43: */
44: public Account getByPrimaryIdWithCaching(
45: String chartOfAccountsCode, String accountNumber);
46:
47: /**
48: * This method retrieves the fiscal officers primary delegate based on the chart, account, and document type specified on the
49: * example, along with the total dollar amount
50: *
51: * @param delegateExample The object that contains the chart, account, and document type that should be used to query the
52: * account delegate table
53: * @param totalDollarAmount The amount that should be compared to the from and to amount on the account delegate table
54: * @return The primary delegate for this account, document type, and amount
55: */
56: public Delegate getPrimaryDelegationByExample(
57: Delegate delegateExample, String totalDollarAmount);
58:
59: /**
60: * This method retrieves the fiscal officers secondary delegates based on the chart, account, and document type specified on the
61: * example, along with the total dollar amount
62: *
63: * @param delegateExample The object that contains the chart, account, and document type that should be used to query the
64: * account delegate table
65: * @param totalDollarAmount The amount that should be compared to the from and to amount on the account delegate table
66: * @return The primary delegate for this account, document type, and amount
67: */
68: public List getSecondaryDelegationsByExample(
69: Delegate delegateExample, String totalDollarAmount);
70:
71: /**
72: * Fetches the accounts that the user is either the fiscal officer or fiscal officer delegate for.
73: *
74: * @param kualiUser
75: * @return a list of Accounts that the user has responsibility for
76: */
77: public List getAccountsThatUserIsResponsibleFor(
78: UniversalUser kualiUser);
79:
80: /**
81: * Does the given user have responsibilities on the given account?
82: *
83: * @param kualiUser the universal user to check responsibilities for
84: * @param account the account to check responsibilities on
85: * @return true if user does have responsibilities, false if otherwise
86: */
87: public boolean hasResponsibilityOnAccount(UniversalUser kualiUser,
88: Account account);
89:
90: /**
91: * get all accounts in the system. This is needed by a sufficient funds rebuilder job
92: *
93: * @return iterator of all accounts
94: */
95: public Iterator getAllAccounts();
96: }
|