001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.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/ecl2.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.gl.service;
017    
018    import java.util.Calendar;
019    import java.util.List;
020    
021    import org.kuali.kfs.coa.businessobject.Account;
022    import org.kuali.kfs.gl.batch.service.AccountingCycleCachingService;
023    import org.kuali.kfs.gl.businessobject.OriginEntryInformation;
024    import org.kuali.kfs.sys.Message;
025    import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry;
026    import org.kuali.kfs.sys.businessobject.UniversityDate;
027    
028    /**
029     * An interface that declares methods that would be needed to validate origin entries and transactions run through the scrubber
030     */
031    public interface ScrubberValidator {
032        /**
033         * Validate a transaction in the scrubber
034         * 
035         * @param originEntry Input transaction (never changed)
036         * @param scrubbedEntry Output transaction (scrubbed version of input transaction)
037         * @param universityRunDate Date of scrubber run
038         * @return List of Message objects based for warnings or errors that happened when validating the transaction
039         */
040        public List<Message> validateTransaction(OriginEntryInformation originEntry, OriginEntryInformation scrubbedEntry, UniversityDate universityRunDate, boolean laborIndicator, AccountingCycleCachingService accountingCycleCachingService);
041    
042        /**
043         * Validate a transaction for use in balance inquiry
044         * 
045         * @param entry Input transaction
046         */
047        public void validateForInquiry(GeneralLedgerPendingEntry entry);
048        
049        /**
050         * Performs logic to determine whether an account is expired
051         * 
052         * @param account Account to validate
053         * @param universityRunDate Run date of process
054         * @return true if account is expired, false if not
055         */
056        public boolean isAccountExpired(Account account, UniversityDate universityRunDate);
057    }