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.weekly;
17  
18  import java.math.BigDecimal;
19  
20  import org.kuali.kpme.core.earncode.EarnCodeBo;
21  import org.kuali.kpme.core.earncode.group.EarnCodeGroupBo;
22  import org.kuali.kpme.tklm.api.time.rules.overtime.weekly.WeeklyOvertimeRuleContract;
23  import org.kuali.kpme.tklm.api.common.TkConstants;
24  import org.kuali.kpme.tklm.time.rules.TkRule;
25  
26  import com.google.common.collect.ImmutableMap;
27  
28  public class WeeklyOvertimeRule extends TkRule implements WeeklyOvertimeRuleContract {
29  
30  	private static final long serialVersionUID = 5229797885418317405L;
31  
32  	public static final String CACHE_NAME = TkConstants.Namespace.NAMESPACE_PREFIX + "WeeklyOvertimeRule";
33  
34  	private String tkWeeklyOvertimeRuleId;
35  	private String maxHoursEarnGroup;
36  	private String convertFromEarnGroup;
37  	private String convertToEarnCode;
38      private String applyToEarnGroup;
39  
40      private boolean overrideWorkAreaDefaultOvertime;
41  
42  	private BigDecimal step;
43  	private BigDecimal maxHours;
44  	private boolean ovtEarnCode;
45  	
46  	private Long tkWeeklyOvertimeRuleGroupId = 1L;
47  	
48  	private EarnCodeGroupBo maxHoursEarnGroupObj;
49  	private EarnCodeGroupBo convertFromEarnGroupObj;
50  	private EarnCodeGroupBo applyToEarnGroupObj;
51  
52      private EarnCodeBo convertToEarnCodeObj;
53  
54  	
55  	// TODO returning an empty map for the time-being, until the BK is finalized
56  	@Override
57  	public ImmutableMap<String, Object> getBusinessKeyValuesMap() {
58  		return new ImmutableMap.Builder<String, Object>()
59  				.build();
60  	}
61  	
62  
63  	public String getTkWeeklyOvertimeRuleId() {
64  		return tkWeeklyOvertimeRuleId;
65  	}
66  
67  	public void setTkWeeklyOvertimeRuleId(String tkWeeklyOvertimeRuleId) {
68  		this.tkWeeklyOvertimeRuleId = tkWeeklyOvertimeRuleId;
69  	}
70  
71  	public String getMaxHoursEarnGroup() {
72  		return maxHoursEarnGroup;
73  	}
74  
75  	public void setMaxHoursEarnGroup(String maxHoursEarnGroup) {
76  		this.maxHoursEarnGroup = maxHoursEarnGroup;
77  	}
78  
79  	public String getConvertFromEarnGroup() {
80  		return convertFromEarnGroup;
81  	}
82  
83  	public void setConvertFromEarnGroup(String convertFromEarnGroup) {
84  		this.convertFromEarnGroup = convertFromEarnGroup;
85  	}
86  
87  	public String getConvertToEarnCode() {
88  		return convertToEarnCode;
89  	}
90  
91  	public void setConvertToEarnCode(String convertToEarnCode) {
92  		this.convertToEarnCode = convertToEarnCode;
93  	}
94  
95  	public BigDecimal getStep() {
96  		return step;
97  	}
98  
99  	public void setStep(BigDecimal step) {
100 		this.step = step;
101 	}
102 
103 	public BigDecimal getMaxHours() {
104 		return maxHours;
105 	}
106 
107 	public void setMaxHours(BigDecimal maxHours) {
108 		this.maxHours = maxHours;
109 	}
110 
111 	public boolean isOvtEarnCode() {
112 		return ovtEarnCode;
113 	}
114 
115 	public void setOvtEarnCode(boolean ovtEarnCode) {
116 		this.ovtEarnCode = ovtEarnCode;
117 	}
118 
119 	public EarnCodeGroupBo getMaxHoursEarnGroupObj() {
120 		return maxHoursEarnGroupObj;
121 	}
122 
123 	public void setMaxHoursEarnGroupObj(EarnCodeGroupBo maxHoursEarnGroupObj) {
124 		this.maxHoursEarnGroupObj = maxHoursEarnGroupObj;
125 	}
126 
127 	public EarnCodeGroupBo getConvertFromEarnGroupObj() {
128 		return convertFromEarnGroupObj;
129 	}
130 
131 	public void setConvertFromEarnGroupObj(EarnCodeGroupBo convertFromEarnGroupObj) {
132 		this.convertFromEarnGroupObj = convertFromEarnGroupObj;
133 	}
134 
135 	public EarnCodeBo getConvertToEarnCodeObj() {
136 		return convertToEarnCodeObj;
137 	}
138 
139 	public void setConvertToEarnCodeObj(EarnCodeBo convertToEarnCodeObj) {
140 		this.convertToEarnCodeObj = convertToEarnCodeObj;
141 	}
142 
143 	public Long getTkWeeklyOvertimeRuleGroupId() {
144 		return tkWeeklyOvertimeRuleGroupId;
145 	}
146 
147 	public void setTkWeeklyOvertimeRuleGroupId(Long tkWeeklyOvertimeRuleGroupId) {
148 		this.tkWeeklyOvertimeRuleGroupId = tkWeeklyOvertimeRuleGroupId;
149 	}
150 
151 	@Override
152 	public String getUniqueKey() {
153 		return convertFromEarnGroup + "_" + maxHoursEarnGroup;
154 	}
155 
156 	@Override
157 	public String getId() {
158 		return getTkWeeklyOvertimeRuleId();
159 	}
160 
161 	@Override
162 	public void setId(String id) {
163 		setTkWeeklyOvertimeRuleId(id);
164 	}
165 
166     @Override
167     public String getApplyToEarnGroup() {
168         return applyToEarnGroup;
169     }
170 
171     public void setApplyToEarnGroup(String applyToEarnGroup) {
172         this.applyToEarnGroup = applyToEarnGroup;
173     }
174 
175 
176 
177     public EarnCodeGroupBo getApplyToEarnGroupObj() {
178         return applyToEarnGroupObj;
179     }
180 
181     public void setApplyToEarnGroupObj(EarnCodeGroupBo applyToEarnGroupObj) {
182         this.applyToEarnGroupObj = applyToEarnGroupObj;
183     }
184 
185     public boolean isOverrideWorkAreaDefaultOvertime() {
186         return overrideWorkAreaDefaultOvertime;
187     }
188 
189     public void setOverrideWorkAreaDefaultOvertime(boolean overrideWorkAreaDefaultOvertime) {
190         this.overrideWorkAreaDefaultOvertime = overrideWorkAreaDefaultOvertime;
191     }
192 }