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.weekly.rule;
017    
018    import java.math.BigDecimal;
019    
020    import org.kuali.hr.core.KPMEConstants;
021    import org.kuali.hr.time.earncode.EarnCode;
022    import org.kuali.hr.time.earncodegroup.EarnCodeGroup;
023    import org.kuali.hr.time.rule.TkRule;
024    
025    public class WeeklyOvertimeRule extends TkRule {
026    
027            private static final long serialVersionUID = 5229797885418317405L;
028    
029            public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "WeeklyOvertimeRule";
030    
031            private String tkWeeklyOvertimeRuleId;
032            private String maxHoursEarnGroup;
033            private String convertFromEarnGroup;
034            private String convertToEarnCode;
035            private BigDecimal step;
036            private BigDecimal maxHours;
037            private String userPrincipalId;
038            private Boolean ovtEarnCode;
039            
040            private Long tkWeeklyOvertimeRuleGroupId = 1L;
041            
042            private EarnCodeGroup maxHoursEarnGroupObj;
043            private EarnCodeGroup convertFromEarnGroupObj;
044            private EarnCode convertToEarnCodeObj;
045            
046    
047            public String getTkWeeklyOvertimeRuleId() {
048                    return tkWeeklyOvertimeRuleId;
049            }
050    
051            public void setTkWeeklyOvertimeRuleId(String tkWeeklyOvertimeRuleId) {
052                    this.tkWeeklyOvertimeRuleId = tkWeeklyOvertimeRuleId;
053            }
054    
055            public String getMaxHoursEarnGroup() {
056                    return maxHoursEarnGroup;
057            }
058    
059            public void setMaxHoursEarnGroup(String maxHoursEarnGroup) {
060                    this.maxHoursEarnGroup = maxHoursEarnGroup;
061            }
062    
063            public String getConvertFromEarnGroup() {
064                    return convertFromEarnGroup;
065            }
066    
067            public void setConvertFromEarnGroup(String convertFromEarnGroup) {
068                    this.convertFromEarnGroup = convertFromEarnGroup;
069            }
070    
071            public String getConvertToEarnCode() {
072                    return convertToEarnCode;
073            }
074    
075            public void setConvertToEarnCode(String convertToEarnCode) {
076                    this.convertToEarnCode = convertToEarnCode;
077            }
078    
079            public BigDecimal getStep() {
080                    return step;
081            }
082    
083            public void setStep(BigDecimal step) {
084                    this.step = step;
085            }
086    
087            public BigDecimal getMaxHours() {
088                    return maxHours;
089            }
090    
091            public void setMaxHours(BigDecimal maxHours) {
092                    this.maxHours = maxHours;
093            }
094    
095            public String getUserPrincipalId() {
096                    return userPrincipalId;
097            }
098    
099            public void setUserPrincipalId(String userPrincipalId) {
100                    this.userPrincipalId = userPrincipalId;
101            }
102            
103            
104            public Boolean getOvtEarnCode() {
105                    return ovtEarnCode;
106            }
107    
108            public void setOvtEarnCode(Boolean ovtEarnCode) {
109                    this.ovtEarnCode = ovtEarnCode;
110            }
111    
112            public EarnCodeGroup getMaxHoursEarnGroupObj() {
113                    return maxHoursEarnGroupObj;
114            }
115    
116            public void setMaxHoursEarnGroupObj(EarnCodeGroup maxHoursEarnGroupObj) {
117                    this.maxHoursEarnGroupObj = maxHoursEarnGroupObj;
118            }
119    
120            public EarnCodeGroup getConvertFromEarnGroupObj() {
121                    return convertFromEarnGroupObj;
122            }
123    
124            public void setConvertFromEarnGroupObj(EarnCodeGroup convertFromEarnGroupObj) {
125                    this.convertFromEarnGroupObj = convertFromEarnGroupObj;
126            }
127    
128            public EarnCode getConvertToEarnCodeObj() {
129                    return convertToEarnCodeObj;
130            }
131    
132            public void setConvertToEarnCodeObj(EarnCode convertToEarnCodeObj) {
133                    this.convertToEarnCodeObj = convertToEarnCodeObj;
134            }
135    
136            public Long getTkWeeklyOvertimeRuleGroupId() {
137                    return tkWeeklyOvertimeRuleGroupId;
138            }
139    
140            public void setTkWeeklyOvertimeRuleGroupId(Long tkWeeklyOvertimeRuleGroupId) {
141                    this.tkWeeklyOvertimeRuleGroupId = tkWeeklyOvertimeRuleGroupId;
142            }
143    
144            @Override
145            public String getUniqueKey() {
146                    return convertFromEarnGroup + "_" + maxHoursEarnGroup;
147            }
148    
149            @Override
150            public String getId() {
151                    return getTkWeeklyOvertimeRuleId();
152            }
153    
154            @Override
155            public void setId(String id) {
156                    setTkWeeklyOvertimeRuleId(id);
157            }
158    }