001 /**
002 * Copyright 2004-2012 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.missedpunch;
017
018 import java.sql.Time;
019 import java.sql.Timestamp;
020
021 import org.kuali.hr.time.service.base.TkServiceLocator;
022 import org.kuali.rice.krad.document.TransactionalDocumentBase;
023 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent;
024
025 public class MissedPunchDocument extends TransactionalDocumentBase {
026
027 /**
028 *
029 */
030 private static final long serialVersionUID = 1L;
031
032 private String principalId;
033 private String clockAction;
034 private java.util.Date actionDate;
035 private Time actionTime;
036 private String timesheetDocumentId;
037 private String documentStatus;
038 private String tkClockLogId;
039 private Timestamp timestamp;
040 private String ipAddress;
041
042 /** Selection key matching what is used on the clock action GUI */
043 private String assignment;
044
045 public String getPrincipalId() {
046 return principalId;
047 }
048 public void setPrincipalId(String principalId) {
049 this.principalId = principalId;
050 }
051 public String getClockAction() {
052 return clockAction;
053 }
054 public void setClockAction(String clockAction) {
055 this.clockAction = clockAction;
056 }
057 public java.util.Date getActionDate() {
058 return actionDate;
059 }
060 public void setActionDate(java.util.Date actionDate) {
061 this.actionDate = actionDate;
062 }
063 public Time getActionTime() {
064 return actionTime;
065 }
066 public void setActionTime(Time actionTime) {
067 this.actionTime = actionTime;
068 }
069 public String getTimesheetDocumentId() {
070 return timesheetDocumentId;
071 }
072 public void setTimesheetDocumentId(String timesheetDocumentId) {
073 this.timesheetDocumentId = timesheetDocumentId;
074 }
075 public String getDocumentStatus() {
076 return documentStatus;
077 }
078 public void setDocumentStatus(String documentStatus) {
079 this.documentStatus = documentStatus;
080 }
081 public String getTkClockLogId() {
082 return tkClockLogId;
083 }
084 public void setTkClockLogId(String tkClockLogId) {
085 this.tkClockLogId = tkClockLogId;
086 }
087 public Timestamp getTimestamp() {
088 return timestamp;
089 }
090 public void setTimestamp(Timestamp timestamp) {
091 this.timestamp = timestamp;
092 }
093 public String getIpAddress() {
094 return ipAddress;
095 }
096 public void setIpAddress(String ipAddress) {
097 this.ipAddress = ipAddress;
098 }
099 public String getAssignment() {
100 return assignment;
101 }
102 public void setAssignment(String assignment) {
103 this.assignment = assignment;
104 }
105
106 @Override
107 public void prepareForSave(KualiDocumentEvent event) {
108 if(this.getTkClockLogId() == null) {
109 TkServiceLocator.getMissedPunchService().addClockLogForMissedPunch(this);
110 }
111 }
112
113 }