View Javadoc
1   /**
2    * Copyright 2004-2014 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.kpme.tklm.time.rules.overtime.daily;
17  
18  import java.math.BigDecimal;
19  
20  import org.kuali.kpme.core.department.Department;
21  import org.kuali.kpme.core.earncode.EarnCode;
22  import org.kuali.kpme.core.earncode.group.EarnCodeGroup;
23  import org.kuali.kpme.core.location.Location;
24  import org.kuali.kpme.core.paytype.PayType;
25  import org.kuali.kpme.core.task.Task;
26  import org.kuali.kpme.core.workarea.WorkArea;
27  import org.kuali.kpme.tklm.api.time.rules.overtime.daily.DailyOvertimeRuleContract;
28  import org.kuali.kpme.tklm.common.TkConstants;
29  import org.kuali.kpme.tklm.time.rules.TkRule;
30  
31  import com.google.common.collect.ImmutableList;
32  
33  public class DailyOvertimeRule extends TkRule implements DailyOvertimeRuleContract {
34  
35  	private static final long serialVersionUID = 2064326101630818390L;
36  	//KPME-2273/1965 Primary Business Keys List.
37  	public static final ImmutableList<String> EQUAL_TO_FIELDS = new ImmutableList.Builder<String>()
38  	            .add("location")
39  	            .add("payType")
40  	            .add("dept")
41  	            .add("workArea")
42  	            .build();
43  
44  		
45  	public static final String CACHE_NAME = TkConstants.CacheNamespace.NAMESPACE_PREFIX + "DailyOvertimeRule";
46  
47  	private String tkDailyOvertimeRuleId;
48  
49  	private String fromEarnGroup;
50  	private String earnCode;
51  
52  	private String location;
53  	private String paytype;
54  	private String dept;
55  	private Long workArea;
56  
57  	private BigDecimal maxGap;
58  	private BigDecimal minHours;
59  	private String userPrincipalId;
60  	private boolean history;
61  	private Boolean ovtEarnCode;
62  
63  	private String tkWorkAreaId;
64  	private String hrDeptId;
65  	private String hrLocationId;
66  	
67  	private Task taskObj;
68  	private WorkArea workAreaObj;
69  	private Department departmentObj;
70  	private PayType payTypeObj;
71  
72  	private EarnCodeGroup fromEarnGroupObj;
73  	private EarnCode earnCodeObj;
74  	private Location locationObj;
75  
76  	public String getTkDailyOvertimeRuleId() {
77  		return tkDailyOvertimeRuleId;
78  	}
79  
80  	public void setTkDailyOvertimeRuleId(String tkDailyOvertimeRuleId) {
81  		this.tkDailyOvertimeRuleId = tkDailyOvertimeRuleId;
82  	}
83  
84  	public String getLocation() {
85  		return location;
86  	}
87  
88  	public void setLocation(String location) {
89  		this.location = location;
90  	}
91  
92  	public BigDecimal getMaxGap() {
93  		return maxGap;
94  	}
95  
96  	public void setMaxGap(BigDecimal maxGap) {
97  		this.maxGap = maxGap;
98  	}
99  
100 	public String getUserPrincipalId() {
101 		return userPrincipalId;
102 	}
103 
104 	public void setUserPrincipalId(String userPrincipalId) {
105 		this.userPrincipalId = userPrincipalId;
106 	}
107 
108 	public Department getDepartmentObj() {
109 		return departmentObj;
110 	}
111 
112 	public void setDepartmentObj(Department departmentObj) {
113 		this.departmentObj = departmentObj;
114 	}
115 
116 	public String getPaytype() {
117 		return paytype;
118 	}
119 
120 	public void setPaytype(String paytype) {
121 		this.paytype = paytype;
122 	}
123 
124 	public String getDept() {
125 		return dept;
126 	}
127 
128 	public void setDept(String dept) {
129 		this.dept = dept;
130 	}
131 
132 	public Task getTaskObj() {
133 		return taskObj;
134 	}
135 
136 	public void setTaskObj(Task taskObj) {
137 		this.taskObj = taskObj;
138 	}
139 
140 	public WorkArea getWorkAreaObj() {
141 		return workAreaObj;
142 	}
143 
144 	public void setWorkAreaObj(WorkArea workAreaObj) {
145 		this.workAreaObj = workAreaObj;
146 	}
147 
148 	public void setWorkArea(Long workArea) {
149 		this.workArea = workArea;
150 	}
151 
152 	public Long getWorkArea() {
153 		return workArea;
154 	}
155 
156 	public PayType getPayTypeObj() {
157 		return payTypeObj;
158 	}
159 
160 	public void setPayTypeObj(PayType payTypeObj) {
161 		this.payTypeObj = payTypeObj;
162 	}
163 
164 	public String getFromEarnGroup() {
165 		return fromEarnGroup;
166 	}
167 
168 	public void setFromEarnGroup(String fromEarnGroup) {
169 		this.fromEarnGroup = fromEarnGroup;
170 	}
171 
172 	public String getEarnCode() {
173 		return earnCode;
174 	}
175 
176 	public void setEarnCode(String earnCode) {
177 		this.earnCode = earnCode;
178 	}
179 
180 	public BigDecimal getMinHours() {
181 		return minHours;
182 	}
183 
184 	public void setMinHours(BigDecimal minHours) {
185 		this.minHours = minHours;
186 	}
187 
188 	public EarnCodeGroup getFromEarnGroupObj() {
189 		return fromEarnGroupObj;
190 	}
191 
192 	public void setFromEarnGroupObj(EarnCodeGroup fromEarnGroupObj) {
193 		this.fromEarnGroupObj = fromEarnGroupObj;
194 	}
195 
196 	public EarnCode getEarnCodeObj() {
197 		return earnCodeObj;
198 	}
199 
200 	public void setEarnCodeObj(EarnCode earnCodeObj) {
201 		this.earnCodeObj = earnCodeObj;
202 	}
203 
204 	public Location getLocationObj() {
205 		return locationObj;
206 	}
207 
208 	public void setLocationObj(Location locationObj) {
209 		this.locationObj = locationObj;
210 	}
211 
212 	public boolean isHistory() {
213 		return history;
214 	}
215 
216 	public void setHistory(boolean history) {
217 		this.history = history;
218 	}
219 
220 	public Boolean getOvtEarnCode() {
221 		return ovtEarnCode;
222 	}
223 
224 	public void setOvtEarnCode(Boolean ovtEarnCode) {
225 		this.ovtEarnCode = ovtEarnCode;
226 	}
227 
228 	public String getTkWorkAreaId() {
229 		return tkWorkAreaId;
230 	}
231 
232 	public void setTkWorkAreaId(String tkWorkAreaId) {
233 		this.tkWorkAreaId = tkWorkAreaId;
234 	}
235 
236 	public String getHrDeptId() {
237 		return hrDeptId;
238 	}
239 
240 	public void setHrDeptId(String hrDeptId) {
241 		this.hrDeptId = hrDeptId;
242 	}
243 
244 	public String getHrLocationId() {
245 		return hrLocationId;
246 	}
247 
248 	public void setHrLocationId(String hrLocationId) {
249 		this.hrLocationId = hrLocationId;
250 	}
251 
252 	@Override
253 	public String getUniqueKey() {
254 		return location + "_" + dept + "_" + workArea + "_" + paytype;
255 	}
256 
257 	@Override
258 	public String getId() {
259 		return getTkDailyOvertimeRuleId();
260 	}
261 
262 	@Override
263 	public void setId(String id) {
264 		setTkDailyOvertimeRuleId(id);
265 	}
266 
267 }