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.dept.lunch;
017    
018    import java.math.BigDecimal;
019    
020    import org.kuali.hr.core.KPMEConstants;
021    import org.kuali.hr.job.Job;
022    import org.kuali.hr.time.HrBusinessObject;
023    import org.kuali.hr.time.authorization.DepartmentalRule;
024    import org.kuali.hr.time.department.Department;
025    import org.kuali.hr.time.workarea.WorkArea;
026    import org.kuali.rice.kim.api.identity.Person;
027    
028    public class DeptLunchRule extends HrBusinessObject implements DepartmentalRule {
029        public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "DeptLunchRule";
030        private static final long serialVersionUID = 1L;
031    
032        private String tkDeptLunchRuleId;
033        private String dept;
034        private Long workArea;
035        private String principalId;
036        private Long jobNumber;    
037        private BigDecimal deductionMins;
038        private BigDecimal shiftHours;
039        private String userPrincipalId;
040    
041        private String tkWorkAreaId;
042        private String hrDeptId;
043        private String hrJobId;
044    
045        WorkArea workAreaObj;
046        Department departmentObj;
047        private Job job;
048            private Person principal;
049            
050            public Person getPrincipal() {
051                    return principal;
052            }
053    
054            public void setPrincipal(Person principal) {
055                    this.principal = principal;
056            }
057    
058            public Job getJob() {
059                    return job;
060            }
061    
062    
063            public void setJob(Job job) {
064                    this.job = job;
065            }
066    
067    
068            public WorkArea getWorkAreaObj() {
069                    return workAreaObj;
070            }
071    
072    
073            public void setWorkAreaObj(WorkArea workAreaObj) {
074                    this.workAreaObj = workAreaObj;
075            }
076    
077    
078            public Department getDepartmentObj() {
079                    return departmentObj;
080            }
081    
082    
083            public void setDepartmentObj(Department departmentObj) {
084                    this.departmentObj = departmentObj;
085            }
086    
087        public Long getWorkArea() {
088                    return workArea;
089            }
090    
091    
092            public void setWorkArea(Long workArea) {
093                    this.workArea = workArea;
094            }
095    
096        public String getPrincipalId() {
097            return principalId;
098        }
099    
100    
101        public void setPrincipalId(String principalId) {
102            this.principalId = principalId;
103        }
104    
105    
106        public Long getJobNumber() {
107                    return jobNumber;
108            }
109    
110    
111            public void setJobNumber(Long jobNumber) {
112                    this.jobNumber = jobNumber;
113            }
114    
115    
116            public String getUserPrincipalId() {
117            return userPrincipalId;
118        }
119    
120    
121        public void setUserPrincipalId(String userPrincipalId) {
122            this.userPrincipalId = userPrincipalId;
123        }
124    
125            public String getTkDeptLunchRuleId() {
126                    return tkDeptLunchRuleId;
127            }
128    
129    
130            public void setTkDeptLunchRuleId(String tkDeptLunchRuleId) {
131                    this.tkDeptLunchRuleId = tkDeptLunchRuleId;
132            }
133    
134    
135            public String getDept() {
136                    return dept;
137            }
138    
139    
140            public void setDept(String dept) {
141                    this.dept = dept;
142            }
143    
144    
145            public BigDecimal getDeductionMins() {
146                    return deductionMins;
147            }
148    
149    
150            public void setDeductionMins(BigDecimal deductionMins) {
151                    this.deductionMins = deductionMins;
152            }
153    
154    
155            public BigDecimal getShiftHours() {
156                    return shiftHours;
157            }
158    
159    
160            public void setShiftHours(BigDecimal shiftHours) {
161                    this.shiftHours = shiftHours;
162            }
163    
164            public String getTkWorkAreaId() {
165                    return tkWorkAreaId;
166            }
167    
168            public void setTkWorkAreaId(String tkWorkAreaId) {
169                    this.tkWorkAreaId = tkWorkAreaId;
170            }
171    
172            public String getHrDeptId() {
173                    return hrDeptId;
174            }
175    
176            public void setHrDeptId(String hrDeptId) {
177                    this.hrDeptId = hrDeptId;
178            }
179    
180            public String getHrJobId() {
181                    return hrJobId;
182            }
183    
184            public void setHrJobId(String hrJobId) {
185                    this.hrJobId = hrJobId;
186            }
187    
188            @Override
189            public String getUniqueKey() {
190                    return getDept() + "_" + getWorkArea() != null ? getWorkArea().toString() : "" + "_" + 
191                                    getPrincipalId() + "_" + getJobNumber() != null ? getJobNumber().toString() : "";
192            }
193    
194            @Override
195            public String getId() {
196                    return getTkDeptLunchRuleId();
197            }
198    
199            @Override
200            public void setId(String id) {
201                    setTkDeptLunchRuleId(id);
202            }
203    }