1 /**
2 * Copyright 2004-2013 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.hr.lm.accrual.service;
17
18 import java.sql.Date;
19 import java.util.List;
20
21 import org.kuali.hr.lm.accrual.RateRangeAggregate;
22
23 public interface AccrualService {
24 public void runAccrual(String principalId);
25
26 /*
27 * run Accrual for the given principal id and dates.
28 * If recordRanData is true, record the timestamp of this run in database
29 */
30 public void runAccrual(String principalId, Date startDate, Date endDate, boolean recordRanData);
31 public void runAccrual(String principalId, Date startDate, Date endDate, boolean recordRanData, String runAsPrincipalId);
32 public void runAccrual(List<String> principalIds);
33
34
35 /**
36 * determine if the given date is at the earn interval
37 * @param aDate
38 * @param earnInterval
39 * @return boolean
40 */
41 public boolean isDateAtEarnInterval(java.util.Date aDate, String earnInterval);
42
43 /**
44 * build a RateRangeAggregate with given parameters
45 * @param principalId
46 * @param startDate
47 * @param endDate
48 * @return boolean
49 */
50 public RateRangeAggregate buildRateRangeAggregate(String principalId, Date startDate, Date endDate);
51
52 /**
53 * determine if the employee's future status is changed during the range of given Calendar Entry
54 * @param principalId
55 * @param startDate
56 * @param endDate
57 * @return boolean
58 */
59 public boolean isEmpoyeementFutureStatusChanged(String principalId, Date startDate, Date endDate);
60
61 /**
62 * calculate future accrual for given principal id
63 * @param principalId
64 * @param asOfDate
65 * @return
66 */
67 public void calculateFutureAccrualUsingPlanningMonth(String principalId, Date asOfDate);
68
69 /**
70 * get the accrual interval date of the previous accrual period with given parameters
71 * @param earnInterval
72 * @param aDate
73 * @return
74 */
75 public java.util.Date getPreviousAccrualIntervalDate(String earnInterval, Date aDate);
76
77 /**
78 * get the accrual interval date of the next accrual period with given parameters
79 * @param earnInterval
80 * @param aDate
81 * @return
82 */
83 public java.util.Date getNextAccrualIntervalDate(String earnInterval, Date aDate);
84
85 /**
86 * calculate # of work days in an accrual period
87 * @param earnInterval
88 * @param aDate
89 * @return int
90 */
91 public int getWorkDaysInAccrualInterval(String earnInterval, Date aDate);
92
93 public boolean statusChangedSinceLastRun(String principalId);
94
95 }