001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.kfs.rule;
017:
018: import org.kuali.core.rule.BusinessRule;
019: import org.kuali.kfs.bo.AccountingLine;
020: import org.kuali.kfs.document.AccountingDocument;
021:
022: /**
023: * Defines methods common to all *AccountingLineRule interfaces
024: */
025: public interface AccountingLineRule<F extends AccountingDocument>
026: extends BusinessRule {
027: /**
028: * This method checks the amount of a given accounting line to make sure it's a valid amount.
029: *
030: * @param document
031: * @param accountingLine
032: * @return boolean True if there aren't any issues, false otherwise.
033: */
034: public boolean isAmountValid(F document,
035: AccountingLine accountingLine);
036:
037: /**
038: * This method checks to see if the object code for the passed in accounting is allowed.
039: *
040: * @param accountingLine
041: * @return boolean True if the use of the object code is allowed.
042: */
043: public boolean isObjectCodeAllowed(Class documentClass,
044: AccountingLine accountingLine);
045:
046: /**
047: * This checks the accounting line's object type code to ensure that it is allowed.
048: *
049: * @param accountingLine
050: * @return boolean
051: */
052: public boolean isObjectTypeAllowed(Class documentClass,
053: AccountingLine accountingLine);
054:
055: /**
056: * This method checks to see if the object sub-type code for the accouting line's object code is allowed.
057: *
058: * @param accountingLine
059: * @return boolean True if the use of the object code's object sub type code is allowed; false otherwise.
060: */
061: public boolean isObjectSubTypeAllowed(Class documentClass,
062: AccountingLine accountingLine);
063:
064: /**
065: * This method checks to see if the object level for the accouting line's object code is allowed.
066: *
067: * @param accountingLine
068: * @return boolean True if the use of the object code's object sub type code is allowed; false otherwise.
069: */
070: public boolean isObjectLevelAllowed(Class documentClass,
071: AccountingLine accountingLine);
072:
073: /**
074: * This method checks to see if the object consolidation for the accouting line's object code is allowed.
075: *
076: * @param accountingLine
077: * @return boolean True if the use of the object code's object sub type code is allowed; false otherwise.
078: */
079: public boolean isObjectConsolidationAllowed(Class documentClass,
080: AccountingLine accountingLine);
081:
082: /**
083: * This method checks to see if the sub fund group code for the accouting line's account is allowed.
084: *
085: * @param accountingLine
086: * @return boolean
087: */
088: public boolean isSubFundGroupAllowed(Class documentClass,
089: AccountingLine accountingLine);
090:
091: /**
092: * This method checks to see if the fund group code for the accouting line's account
093: *
094: * @param accountingLine
095: * @return boolean
096: */
097: public boolean isFundGroupAllowed(Class documentClass,
098: AccountingLine accountingLine);
099:
100: /**
101: * This method determines if the passed in accounting line is a debit or not.
102: *
103: * @param financialDocument
104: * @param accountingLine
105: * @return boolean
106: */
107: public boolean isDebit(AccountingDocument financialDocument,
108: AccountingLine accountingLine);
109:
110: /**
111: * This method determines if the passed in accounting line is a credit or not.
112: *
113: * @param accountingLine
114: * @param financialDocument TODO
115: * @return boolean
116: */
117: public boolean isCredit(AccountingLine accountingLine,
118: F financialDocument);
119: }
|