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.batch.service;
017    
018    import java.sql.Date;
019    
020    import org.kuali.kfs.gl.batch.CollectorBatch;
021    import org.kuali.kfs.gl.businessobject.OriginEntryFull;
022    import org.kuali.kfs.gl.businessobject.OriginEntryInformation;
023    import org.kuali.kfs.gl.report.CollectorReportData;
024    import org.kuali.kfs.gl.service.impl.ScrubberStatus;
025    
026    
027    public interface ScrubberProcess {
028    
029        /**
030         * Scrub this single group read only. This will only output the scrubber report. It won't output any other groups.
031         * 
032         * @param group the origin entry group that should be scrubbed
033         * @param the document number of any specific entries to scrub
034         */
035        public void scrubGroupReportOnly(String fileName, String documentNumber);
036    
037        /**
038         * Scrubs all entries in all groups and documents.
039         */
040        public void scrubEntries();
041    
042        /**
043         * Scrubs the origin entry and ID billing details if the given batch. Store all scrubber output into the collectorReportData
044         * parameter. NOTE: DO NOT CALL ANY OF THE scrub* METHODS OF THIS CLASS AFTER CALLING THIS METHOD FOR EVERY UNIQUE INSTANCE OF
045         * THIS CLASS, OR THE COLLECTOR REPORTS MAY BE CORRUPTED
046         * 
047         * @param batch the data gathered from a Collector file
048         * @param collectorReportData the statistics generated by running the Collector
049         */
050        public void scrubCollectorBatch(ScrubberStatus scrubberStatus, CollectorBatch batch, CollectorReportData collectorReportData);
051    
052        /**
053         * Scrub all entries that need it in origin entry. Put valid scrubbed entries in a scrubber valid group, put errors in a
054         * scrubber error group, and transactions with an expired account in the scrubber expired account group.
055         * @param group the specific origin entry group to scrub
056         * @param documentNumber the number of the document with entries to scrub
057         */
058        public void scrubEntries(boolean reportOnlyMode, String documentNumber);
059    
060        /**
061         * The demerger process reads all of the documents in the error group, then moves all of the original entries for that document
062         * from the valid group to the error group. It does not move generated entries to the error group. Those are deleted. It also
063         * modifies the doc number and origin code of cost share transfers.
064         * 
065         * @param errorGroup this scrubber run's error group
066         * @param validGroup this scrubber run's valid group
067         */
068        public void performDemerger();
069    
070        /**
071         * Sets the proper cost share object code in an entry and its offset
072         * 
073         * @param costShareEntry GL Entry for cost share
074         * @param originEntry Scrubbed GL Entry that this is based on
075         */
076        public void setCostShareObjectCode(OriginEntryFull costShareEntry, OriginEntryInformation originEntry);
077    
078        /**
079         * This method modifies the run date if it is before the cutoff time specified by the RunTimeService See
080         * KULRNE-70 This method is public to facilitate unit testing
081         * 
082         * @param currentDate the date the scrubber should report as having run on
083         * @return the run date
084         */
085        public Date calculateRunDate(java.util.Date currentDate);
086    
087    }