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.shiftdiff.rule;
017    
018    import java.math.BigDecimal;
019    import java.sql.Date;
020    import java.sql.Time;
021    
022    import org.kuali.hr.core.KPMEConstants;
023    import org.kuali.hr.location.Location;
024    import org.kuali.hr.paygrade.PayGrade;
025    import org.kuali.hr.time.calendar.Calendar;
026    import org.kuali.hr.time.earncode.EarnCode;
027    import org.kuali.hr.time.earngroup.EarnGroup;
028    import org.kuali.hr.time.rule.TkRule;
029    import org.kuali.hr.time.salgroup.SalGroup;
030    
031    public class ShiftDifferentialRule extends TkRule {
032        public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "ShiftDifferentialRule";
033            /**
034             *
035             */
036            private static final long serialVersionUID = 1L;
037            private String tkShiftDiffRuleId;
038            private String location;
039            private String hrSalGroup;
040            private String payGrade;
041            private String earnCode;
042            private Time beginTime;
043            private Time endTime;
044            private BigDecimal minHours;
045            private boolean sunday;
046            private boolean monday;
047            private boolean tuesday;
048            private boolean wednesday;
049            private boolean thursday;
050            private boolean friday;
051            private boolean saturday;
052            private String fromEarnGroup;
053            private String pyCalendarGroup;
054            private BigDecimal maxGap; // Gap is in HOURS
055            private String userPrincipalId;
056    
057            private String hrSalGroupId;
058            private String hrLocationId;
059            private String hrPayGradeId;    
060            
061            private boolean history;
062            
063            private EarnCode earnCodeObj;
064            private SalGroup salGroupObj;
065        private EarnGroup fromEarnGroupObj;
066        private Calendar payCalendar;
067        private Location locationObj;
068        private PayGrade payGradeObj;
069        
070            public String getTkShiftDiffRuleId() {
071                    return tkShiftDiffRuleId;
072            }
073    
074            public void setTkShiftDiffRuleId(String tkShiftDiffRuleId) {
075                    this.tkShiftDiffRuleId = tkShiftDiffRuleId;
076            }
077    
078            public String getLocation() {
079                    return location;
080            }
081    
082            public void setLocation(String location) {
083                    this.location = location;
084            }
085    
086            public String getPayGrade() {
087                    return payGrade;
088            }
089    
090            public void setPayGrade(String payGrade) {
091                    this.payGrade = payGrade;
092            }
093    
094            public Date getEffectiveDate() {
095                    return effectiveDate;
096            }
097    
098            public void setEffectiveDate(Date effectiveDate) {
099                    this.effectiveDate = effectiveDate;
100            }
101    
102            public String getEarnCode() {
103                    return earnCode;
104            }
105    
106            public void setEarnCode(String earnCode) {
107                    this.earnCode = earnCode;
108            }
109    
110            public BigDecimal getMinHours() {
111                    return minHours;
112            }
113    
114            public void setMinHours(BigDecimal minHours) {
115                    this.minHours = minHours;
116            }
117    
118        /**
119         * @return The maximum gap, in hours.
120         */
121            public BigDecimal getMaxGap() {
122                    return maxGap;
123            }
124    
125        /**
126         *
127         * @param maxGap The number of hours that can be between one time block and another for the rule to consider it part of the same shift.
128         */
129            public void setMaxGap(BigDecimal maxGap) {
130                    this.maxGap = maxGap;
131            }
132    
133            public String getUserPrincipalId() {
134                    return userPrincipalId;
135            }
136    
137            public void setUserPrincipalId(String userPrincipalId) {
138                    this.userPrincipalId = userPrincipalId;
139            }
140    
141            public boolean isActive() {
142                    return active;
143            }
144    
145            public void setActive(boolean active) {
146                    this.active = active;
147            }
148    
149            public String getHrSalGroup() {
150                    return hrSalGroup;
151            }
152    
153            public void setHrSalGroup(String hrSalGroup) {
154                    this.hrSalGroup = hrSalGroup;
155            }
156    
157            public String getPyCalendarGroup() {
158                    return pyCalendarGroup;
159            }
160    
161            public void setPyCalendarGroup(String pyCalendarGroup) {
162                    this.pyCalendarGroup = pyCalendarGroup;
163            }
164    
165            public Time getBeginTime() {
166                    return beginTime;
167            }
168    
169            public void setBeginTime(Time beginTime) {
170                    this.beginTime = beginTime;
171            }
172    
173            public Time getEndTime() {
174                    return endTime;
175            }
176    
177            public void setEndTime(Time endTime) {
178                    this.endTime = endTime;
179            }
180    
181            public String getFromEarnGroup() {
182                    return fromEarnGroup;
183            }
184    
185            public void setFromEarnGroup(String fromEarnGroup) {
186                    this.fromEarnGroup = fromEarnGroup;
187            }
188    
189            public boolean isSunday() {
190                    return sunday;
191            }
192    
193            public void setSunday(boolean sunday) {
194                    this.sunday = sunday;
195            }
196    
197            public boolean isMonday() {
198                    return monday;
199            }
200    
201            public void setMonday(boolean monday) {
202                    this.monday = monday;
203            }
204    
205            public boolean isTuesday() {
206                    return tuesday;
207            }
208    
209            public void setTuesday(boolean tuesday) {
210                    this.tuesday = tuesday;
211            }
212    
213            public boolean isWednesday() {
214                    return wednesday;
215            }
216    
217            public void setWednesday(boolean wednesday) {
218                    this.wednesday = wednesday;
219            }
220    
221            public boolean isThursday() {
222                    return thursday;
223            }
224    
225            public void setThursday(boolean thursday) {
226                    this.thursday = thursday;
227            }
228    
229            public boolean isFriday() {
230                    return friday;
231            }
232    
233            public void setFriday(boolean friday) {
234                    this.friday = friday;
235            }
236    
237            public boolean isSaturday() {
238                    return saturday;
239            }
240    
241            public void setSaturday(boolean saturday) {
242                    this.saturday = saturday;
243            }
244    
245            public EarnCode getEarnCodeObj() {
246                    return earnCodeObj;
247            }
248    
249            public void setEarnCodeObj(EarnCode earnCodeObj) {
250                    this.earnCodeObj = earnCodeObj;
251            }
252    
253            public SalGroup getSalGroupObj() {
254                    return salGroupObj;
255            }
256    
257            public void setSalGroupObj(SalGroup salGroupObj) {
258                    this.salGroupObj = salGroupObj;
259            }
260    
261        public EarnGroup getFromEarnGroupObj() {
262            return fromEarnGroupObj;
263        }
264    
265        public void setFromEarnGroupObj(EarnGroup fromEarnGroupObj) {
266            this.fromEarnGroupObj = fromEarnGroupObj;
267        }
268    
269        public Calendar getPayCalendar() {
270            return payCalendar;
271        }
272    
273        public void setPayCalendar(Calendar payCalendar) {
274            this.payCalendar = payCalendar;
275        }
276    
277            public Location getLocationObj() {
278                    return locationObj;
279            }
280    
281            public void setLocationObj(Location locationObj) {
282                    this.locationObj = locationObj;
283            }
284    
285            public PayGrade getPayGradeObj() {
286                    return payGradeObj;
287            }
288    
289            public void setPayGradeObj(PayGrade payGradeObj) {
290                    this.payGradeObj = payGradeObj;
291            }
292    
293            public String getHrSalGroupId() {
294                    return hrSalGroupId;
295            }
296    
297            public void setHrSalGroupId(String hrSalGroupId) {
298                    this.hrSalGroupId = hrSalGroupId;
299            }
300    
301            public String getHrLocationId() {
302                    return hrLocationId;
303            }
304    
305            public void setHrLocationId(String hrLocationId) {
306                    this.hrLocationId = hrLocationId;
307            }
308    
309            public String getHrPayGradeId() {
310                    return hrPayGradeId;
311            }
312    
313            public void setHrPayGradeId(String hrPayGradeId) {
314                    this.hrPayGradeId = hrPayGradeId;
315            }
316    
317            @Override
318            public String getUniqueKey() {
319                    return location + "_" + hrSalGroup + "_" + payGrade;
320            }
321    
322            @Override
323            public String getId() {
324                    return getTkShiftDiffRuleId();
325            }
326    
327            @Override
328            public void setId(String id) {
329                    setTkShiftDiffRuleId(id);
330            }
331    
332            public boolean isHistory() {
333                    return history;
334            }
335    
336            public void setHistory(boolean history) {
337                    this.history = history;
338            }
339    
340    }