001    /**
002     * Copyright 2004-2014 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.kpme.tklm.time.rules.shiftdifferential.service;
017    
018    import java.util.List;
019    
020    import org.joda.time.LocalDate;
021    import org.kuali.kpme.tklm.time.rules.shiftdifferential.ShiftDifferentialRule;
022    import org.kuali.kpme.tklm.time.timesheet.TimesheetDocument;
023    import org.kuali.kpme.tklm.time.util.TkTimeBlockAggregate;
024    import org.springframework.cache.annotation.CacheEvict;
025    import org.springframework.cache.annotation.Cacheable;
026    
027    public interface ShiftDifferentialRuleService {
028            /**
029             * Save or Update List of ShiftDifferentialRule objects
030             * @param shiftDifferentialRules
031             */
032        @CacheEvict(value={ShiftDifferentialRule.CACHE_NAME}, allEntries = true)
033            public void saveOrUpdate(List<ShiftDifferentialRule> shiftDifferentialRules);
034            /**
035             * Save or Update a ShiftDifferentialRule object
036             * @param shiftDifferentialRule
037             */
038        @CacheEvict(value={ShiftDifferentialRule.CACHE_NAME}, allEntries = true)
039            public void saveOrUpdate(ShiftDifferentialRule shiftDifferentialRule);
040            /**
041             * Fetch a ShiftDifferentialRule object for a given id
042             * @param tkShiftDifferentialRuleId
043             * @return
044             */
045        @Cacheable(value= ShiftDifferentialRule.CACHE_NAME, key="'tkShiftDifferentialRuleId=' + #p0")
046            public ShiftDifferentialRule getShiftDifferentialRule(String tkShiftDifferentialRuleId);
047            /**
048             * Fetch a given ShiftDifferentialRule based on criteria passed in
049             * @param location
050             * @param hrSalGroup
051             * @param payGrade
052             * @param pyCalendarGroup
053             * @param asOfDate
054             * @return
055             */
056        @Cacheable(value= ShiftDifferentialRule.CACHE_NAME,
057                key="'location=' + #p0" +
058                    "+ '|' + 'hrSalGroup=' + #p1" +
059                    "+ '|' + 'payGrade=' + #p2" +
060                    "+ '|' + 'pyCalendarGroup=' + #p3" +
061                    "+ '|' + 'asOfDate=' + #p4")
062            public List<ShiftDifferentialRule> getShiftDifferentalRules(String location,
063                String hrSalGroup, String payGrade, String pyCalendarGroup, LocalDate asOfDate);
064            /**
065             * Process a given TkTimeBlockAggregate with appropriate shift differential rules
066             * @param timesheetDocument
067             * @param aggregate
068             */
069            public void processShiftDifferentialRules(TimesheetDocument timesheetDocument, TkTimeBlockAggregate aggregate);
070    
071        List<ShiftDifferentialRule> getShiftDifferentialRules(String userPrincipalId, String location, String hrSalGroup, String payGrade, LocalDate fromEffdt,
072                    LocalDate toEffdt, String active, String showHist);
073    
074    }