001    /**
002     * Copyright 2004-2013 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.hr.time.earncodegroup.service;
017    
018    import org.kuali.hr.time.earncodegroup.EarnCodeGroup;
019    import org.kuali.hr.time.timeblock.TimeBlock;
020    import org.kuali.hr.time.timesheet.TimesheetDocument;
021    
022    import java.sql.Date;
023    import java.util.List;
024    import java.util.Set;
025    
026    public interface EarnCodeGroupService {
027            /**
028             * Fetch earn group for a particular date
029             * @param earnCodeGroup
030             * @param asOfDate
031             * @return
032             */
033            public EarnCodeGroup getEarnCodeGroup(String earnCodeGroup, Date asOfDate);
034            /**
035             * Fetch earn group for an earn code as of a particular date
036             * @param earnCode
037             * @param asOfDate
038             * @return
039             */
040            public EarnCodeGroup getEarnCodeGroupForEarnCode(String earnCode, Date asOfDate);
041            /**
042             * Fetch Set of earn codes for earn group
043             * @param earnGroup
044             * @param asOfDate
045             * @return
046             */
047            public Set<String> getEarnCodeListForEarnCodeGroup(String earnCodeGroup, Date asOfDate);
048            /**
049             * Used to get earn group that this earn code belongs on in context to the summary
050             * CAUTION this is used only for the timesheet summary
051             */
052            public EarnCodeGroup getEarnCodeGroupSummaryForEarnCode(String earnCode, Date asOfDate);
053            
054            public EarnCodeGroup getEarnCodeGroup(String hrEarnCodeGroupId);
055            
056            /**
057             * Returns list of warning text from earn group that is used by time blocks of the timesheetDocument
058             * @param timesheetDocument
059             * @return
060             */
061            public List<String> warningTextFromEarnCodeGroupsOfDocument(TimesheetDocument timesheetDocument);
062    
063        /**
064         * Returns list of warning text from earn group that is used by time blocks of the timesheetDocument
065         * @param timeBlockList
066         * @return
067         */
068        public List<String> warningTextFromEarnCodeGroupsOfTimeblocks(List<TimeBlock> timeBlockList);
069        /**
070         * get the count of earn groups by given earnGroup
071         * @param earnGroup
072         * @return int
073         */
074        public int getEarnCodeGroupCount(String earnGroup);
075        /**
076         * get the count of newer version of earn groups by given earnGroup and date
077         * @param earnGroup
078         * @param effdt
079         * @return int
080         */
081        public int getNewerEarnCodeGroupCount(String earnGroup, Date effdt);
082    }