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.lm.accrual.service;
017
018 import java.sql.Date;
019 import java.util.List;
020
021 import org.kuali.hr.lm.accrual.RateRangeAggregate;
022
023 public interface AccrualService {
024 public void runAccrual(String principalId);
025
026 /*
027 * run Accrual for the given principal id and dates.
028 * If recordRanData is true, record the timestamp of this run in database
029 */
030 public void runAccrual(String principalId, Date startDate, Date endDate, boolean recordRanData);
031 public void runAccrual(String principalId, Date startDate, Date endDate, boolean recordRanData, String runAsPrincipalId);
032 public void runAccrual(List<String> principalIds);
033
034
035 /**
036 * determine if the given date is at the earn interval
037 * @param aDate
038 * @param earnInterval
039 * @return boolean
040 */
041 public boolean isDateAtEarnInterval(java.util.Date aDate, String earnInterval);
042
043 /**
044 * build a RateRangeAggregate with given parameters
045 * @param principalId
046 * @param startDate
047 * @param endDate
048 * @return boolean
049 */
050 public RateRangeAggregate buildRateRangeAggregate(String principalId, Date startDate, Date endDate);
051
052 /**
053 * determine if the employee's future status is changed during the range of given Calendar Entry
054 * @param principalId
055 * @param startDate
056 * @param endDate
057 * @return boolean
058 */
059 public boolean isEmpoyeementFutureStatusChanged(String principalId, Date startDate, Date endDate);
060
061 /**
062 * calculate future accrual for given principal id
063 * @param principalId
064 * @param asOfDate
065 * @return
066 */
067 public void calculateFutureAccrualUsingPlanningMonth(String principalId, Date asOfDate);
068
069 /**
070 * get the accrual interval date of the previous accrual period with given parameters
071 * @param earnInterval
072 * @param aDate
073 * @return
074 */
075 public java.util.Date getPreviousAccrualIntervalDate(String earnInterval, Date aDate);
076
077 /**
078 * get the accrual interval date of the next accrual period with given parameters
079 * @param earnInterval
080 * @param aDate
081 * @return
082 */
083 public java.util.Date getNextAccrualIntervalDate(String earnInterval, Date aDate);
084
085 /**
086 * calculate # of work days in an accrual period
087 * @param earnInterval
088 * @param aDate
089 * @return int
090 */
091 public int getWorkDaysInAccrualInterval(String earnInterval, Date aDate);
092
093 public boolean statusChangedSinceLastRun(String principalId);
094
095 }