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.sys.service;
20
21 import org.kuali.kfs.sys.KFSConstants;
22 import org.kuali.kfs.sys.businessobject.Bank;
23
24 /**
25 * This service interface defines methods that a BankService implementation must provide.
26 */
27 public interface BankService {
28 public static final String[] PERMANENT_BANK_SPECIFICATION_ENABLED_DOCUMENT_TYPES = {KFSConstants.FinancialDocumentTypeCodes.ADVANCE_DEPOSIT, KFSConstants.FinancialDocumentTypeCodes.CASH_MANAGEMENT, KFSConstants.FinancialDocumentTypeCodes.NON_CHECK_DISBURSEMENT};
29
30 /**
31 * Retrieves a bank object who's primary id matches the values provided.
32 *
33 * @param bankCode The bank code to be looked up by.
34 * @return A Bank object with a matching primary id.
35 */
36 public Bank getByPrimaryId(String bankCode);
37
38 /**
39 * Retrieves the default bank code for the given document type from system parameter.
40 * .
41 * @param documentClass <code>Class</code> for the document type
42 * @return <code>Bank</code> object retrieved by default bank code
43 */
44 public Bank getDefaultBankByDocType(Class<?> documentClass);
45
46 /**
47 * Retrieves the default bank code for the given document type from system parameter.
48 * .
49 * @param documentTypeCode the document type code
50 * @return <code>Bank</code> object retrieved by default bank code
51 */
52 public Bank getDefaultBankByDocType(String documentTypeCode);
53
54 /**
55 * Determines if the bank specification is enabled in the system by system parameter.
56 *
57 * @return true if specification is enabled
58 */
59 public boolean isBankSpecificationEnabled();
60
61 /**
62 * Determines if the bank specification is enabled for the given document by a) the document being one of the permanent
63 * bank code documents (AD's, CMD's, and ND's) or by the document being listed in the KFS-SYS / Bank / BANK_CODE_DOCUMENT_TYPES parameter
64 * @param documentClass the class of the document to determine if it has bank specifications enabled
65 * @return true if specification is enabled, false if specification is disabled
66 */
67 public boolean isBankSpecificationEnabledForDocument(Class<?> documentClass);
68 }