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.overtime.daily.rule;
017    
018    import java.math.BigDecimal;
019    
020    import org.kuali.hr.core.KPMEConstants;
021    import org.kuali.hr.location.Location;
022    import org.kuali.hr.time.department.Department;
023    import org.kuali.hr.time.earncode.EarnCode;
024    import org.kuali.hr.time.earncodegroup.EarnCodeGroup;
025    import org.kuali.hr.time.paytype.PayType;
026    import org.kuali.hr.time.rule.TkRule;
027    import org.kuali.hr.time.task.Task;
028    import org.kuali.hr.time.workarea.WorkArea;
029    
030    public class DailyOvertimeRule extends TkRule {
031    
032            private static final long serialVersionUID = 2064326101630818390L;
033    
034            public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "DailyOvertimeRule";
035    
036            private String tkDailyOvertimeRuleId;
037    
038            private String fromEarnGroup;
039            private String earnCode;
040    
041            private String location;
042            private String paytype;
043            private String dept;
044            private Long workArea;
045    
046            private BigDecimal maxGap;
047            private BigDecimal minHours;
048            private String userPrincipalId;
049            private boolean history;
050            private Boolean ovtEarnCode;
051    
052            private String tkWorkAreaId;
053            private String hrDeptId;
054            private String hrLocationId;
055            
056            private Task taskObj;
057            private WorkArea workAreaObj;
058            private Department departmentObj;
059            private PayType payTypeObj;
060    
061            private EarnCodeGroup fromEarnGroupObj;
062            private EarnCode earnCodeObj;
063            private Location locationObj;
064    
065            public String getTkDailyOvertimeRuleId() {
066                    return tkDailyOvertimeRuleId;
067            }
068    
069            public void setTkDailyOvertimeRuleId(String tkDailyOvertimeRuleId) {
070                    this.tkDailyOvertimeRuleId = tkDailyOvertimeRuleId;
071            }
072    
073            public String getLocation() {
074                    return location;
075            }
076    
077            public void setLocation(String location) {
078                    this.location = location;
079            }
080    
081            public BigDecimal getMaxGap() {
082                    return maxGap;
083            }
084    
085            public void setMaxGap(BigDecimal maxGap) {
086                    this.maxGap = maxGap;
087            }
088    
089            public String getUserPrincipalId() {
090                    return userPrincipalId;
091            }
092    
093            public void setUserPrincipalId(String userPrincipalId) {
094                    this.userPrincipalId = userPrincipalId;
095            }
096    
097            public Department getDepartmentObj() {
098                    return departmentObj;
099            }
100    
101            public void setDepartmentObj(Department departmentObj) {
102                    this.departmentObj = departmentObj;
103            }
104    
105            public String getPaytype() {
106                    return paytype;
107            }
108    
109            public void setPaytype(String paytype) {
110                    this.paytype = paytype;
111            }
112    
113            public String getDept() {
114                    return dept;
115            }
116    
117            public void setDept(String dept) {
118                    this.dept = dept;
119            }
120    
121            public Task getTaskObj() {
122                    return taskObj;
123            }
124    
125            public void setTaskObj(Task taskObj) {
126                    this.taskObj = taskObj;
127            }
128    
129            public WorkArea getWorkAreaObj() {
130                    return workAreaObj;
131            }
132    
133            public void setWorkAreaObj(WorkArea workAreaObj) {
134                    this.workAreaObj = workAreaObj;
135            }
136    
137            public void setWorkArea(Long workArea) {
138                    this.workArea = workArea;
139            }
140    
141            public Long getWorkArea() {
142                    return workArea;
143            }
144    
145            public PayType getPayTypeObj() {
146                    return payTypeObj;
147            }
148    
149            public void setPayTypeObj(PayType payTypeObj) {
150                    this.payTypeObj = payTypeObj;
151            }
152    
153            public String getFromEarnGroup() {
154                    return fromEarnGroup;
155            }
156    
157            public void setFromEarnGroup(String fromEarnGroup) {
158                    this.fromEarnGroup = fromEarnGroup;
159            }
160    
161            public String getEarnCode() {
162                    return earnCode;
163            }
164    
165            public void setEarnCode(String earnCode) {
166                    this.earnCode = earnCode;
167            }
168    
169            public BigDecimal getMinHours() {
170                    return minHours;
171            }
172    
173            public void setMinHours(BigDecimal minHours) {
174                    this.minHours = minHours;
175            }
176    
177            public EarnCodeGroup getFromEarnGroupObj() {
178                    return fromEarnGroupObj;
179            }
180    
181            public void setFromEarnGroupObj(EarnCodeGroup fromEarnGroupObj) {
182                    this.fromEarnGroupObj = fromEarnGroupObj;
183            }
184    
185            public EarnCode getEarnCodeObj() {
186                    return earnCodeObj;
187            }
188    
189            public void setEarnCodeObj(EarnCode earnCodeObj) {
190                    this.earnCodeObj = earnCodeObj;
191            }
192    
193            public Location getLocationObj() {
194                    return locationObj;
195            }
196    
197            public void setLocationObj(Location locationObj) {
198                    this.locationObj = locationObj;
199            }
200    
201            public boolean isHistory() {
202                    return history;
203            }
204    
205            public void setHistory(boolean history) {
206                    this.history = history;
207            }
208    
209            public Boolean getOvtEarnCode() {
210                    return ovtEarnCode;
211            }
212    
213            public void setOvtEarnCode(Boolean ovtEarnCode) {
214                    this.ovtEarnCode = ovtEarnCode;
215            }
216    
217            public String getTkWorkAreaId() {
218                    return tkWorkAreaId;
219            }
220    
221            public void setTkWorkAreaId(String tkWorkAreaId) {
222                    this.tkWorkAreaId = tkWorkAreaId;
223            }
224    
225            public String getHrDeptId() {
226                    return hrDeptId;
227            }
228    
229            public void setHrDeptId(String hrDeptId) {
230                    this.hrDeptId = hrDeptId;
231            }
232    
233            public String getHrLocationId() {
234                    return hrLocationId;
235            }
236    
237            public void setHrLocationId(String hrLocationId) {
238                    this.hrLocationId = hrLocationId;
239            }
240    
241            @Override
242            public String getUniqueKey() {
243                    return location + "_" + dept + "_" + workArea + "_" + paytype;
244            }
245    
246            @Override
247            public String getId() {
248                    return getTkDailyOvertimeRuleId();
249            }
250    
251            @Override
252            public void setId(String id) {
253                    setTkDailyOvertimeRuleId(id);
254            }
255    
256    }