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.api.leave.block; 17 18 import java.math.BigDecimal; 19 20 21 /** 22 * <p>LeaveBlockRendererContract interface</p> 23 * 24 */ 25 public interface LeaveBlockRendererContract { 26 27 /** 28 * The LeaveBlock object associated with the LeaveBlockRenderer 29 * 30 * <p> 31 * leaveBlock of a LeaveBlockRenderer 32 * <p> 33 * 34 * @return leaveBlock for LeaveBlockRenderer 35 */ 36 public LeaveBlockContract getLeaveBlock(); 37 38 /** 39 * The leave amount of the LeaveBlock object associated with the LeaveBlockRenderer 40 * 41 * <p> 42 * leaveBlock.getLeaveAmount() of a LeaveBlockRenderer 43 * <p> 44 * 45 * @return leaveBlock.getLeaveAmount() for LeaveBlockRenderer 46 */ 47 public BigDecimal getHours(); 48 49 /** 50 * The EarnCode name of the LeaveBlock object associated with the LeaveBlockRenderer 51 * 52 * <p> 53 * leaveBlock.getEarnCode() of a LeaveBlockRenderer 54 * <p> 55 * 56 * @return leaveBlock.getEarnCode() for LeaveBlockRenderer 57 */ 58 public String getEarnCode(); 59 60 /** 61 * The leave block id of the LeaveBlock object associated with the LeaveBlockRenderer 62 * 63 * <p> 64 * leaveBlock.getLmLeaveBlockId() of a LeaveBlockRenderer 65 * <p> 66 * 67 * @return leaveBlock.getLmLeaveBlockId() for LeaveBlockRenderer 68 */ 69 public String getLeaveBlockId(); 70 71 /** 72 * The document id of the LeaveBlock object associated with the LeaveBlockRenderer 73 * 74 * <p> 75 * leaveBlock.getDocumentId() of a LeaveBlockRenderer 76 * <p> 77 * 78 * @return leaveBlock.getDocumentId() for LeaveBlockRenderer 79 */ 80 public String getDocumentId(); 81 82 /** 83 * The assignment title of the LeaveBlock object associated with the LeaveBlockRenderer 84 * 85 * <p> 86 * leaveBlock.getAssignmentTitle() of a LeaveBlockRenderer 87 * <p> 88 * 89 * @return leaveBlock.getAssignmentTitle() for LeaveBlockRenderer 90 */ 91 public String getAssignmentTitle(); 92 93 /** 94 * The editable flag of the LeaveBlock object associated with the LeaveBlockRenderer 95 * 96 * <p> 97 * leaveBlock.isEditable() of a LeaveBlockRenderer 98 * <p> 99 * 100 * @return leaveBlock.isEditable() for LeaveBlockRenderer 101 */ 102 public boolean isEditable(); 103 104 /** 105 * The deletable flag of the LeaveBlock object associated with the LeaveBlockRenderer 106 * 107 * <p> 108 * leaveBlock.isDeletable() of a LeaveBlockRenderer 109 * <p> 110 * 111 * @return leaveBlock.isDeletable() for LeaveBlockRenderer 112 */ 113 public boolean isDeletable(); 114 115 /** 116 * The assignment class associated with the LeaveBlockRenderer 117 * 118 * <p> 119 * assignmentClass of a LeaveBlockRenderer 120 * <p> 121 * 122 * @return assignmentClass for LeaveBlockRenderer 123 */ 124 public String getAssignmentClass(); 125 126 /** 127 * The request status string of the LeaveBlock object associated with the LeaveBlockRenderer 128 * 129 * <p> 130 * leaveBlock.getRequestStatusString().toLowerCase() of an LeaveBlockRenderer 131 * <p> 132 * 133 * @return leaveBlock.getRequestStatusString().toLowerCase() for LeaveBlockRenderer 134 */ 135 public String getRequestStatusClass(); 136 137 /** 138 * The details of the LeaveBlock object associated with the LeaveBlockRenderer 139 * 140 * <p> 141 * If the leave block type is Accrual Service 142 * if the ScheduleTimeOffId of the leave block is not null, return the description of the ScheduleTimeOff, else "accrual" 143 * If the leave block type is Carry Over Adjustment 144 * if the description of the leave block is Max carry over adjustment, return "carryover adjustment", else "adjustment" 145 * If the leave block type is Balance Transfer 146 * if the description of the leave block contains Forfeited, return "transfer forfeiture" 147 * else if it contains Amount transferred, return "amount transferred" 148 * else if it contains Transferred amount, return "transferred amount" 149 * else "balance transfer" 150 * If the leave block type is Leave Payout 151 * if the description of the leave block contains Forfeited, return "payout forfeiture" 152 * else if it contains Amount paid out, return "amount paid out" 153 * else if it contains Payout amount, return "payout amount" 154 * else "leave payout" 155 * Else 156 * if the leave block type is not Leave Calendar nor Time Calendar, return corresponding string in LEAVE_BLOCK_TYPE_MAP for the leave block type 157 * else return leaveBlock.getRequestStatusString() 158 * <p> 159 * 160 * @return see above 161 */ 162 public String getLeaveBlockDetails(); 163 164 /** 165 * The description of the LeaveBlock object associated with the LeaveBlockRenderer 166 * 167 * <p> 168 * leaveBlock.getDescription() of a LeaveBlockRenderer 169 * <p> 170 * 171 * @return leaveBlock.getDescription() for LeaveBlockRenderer 172 */ 173 public String getDescription(); 174 175 /** 176 * The time range of the LeaveBlock object associated with the LeaveBlockRenderer 177 * 178 * <p> 179 * If the begin timestamp and end timestamp of the LeaveBlock are not null, and If the earn code type of the LeaveBlock is "T", 180 * it constructs and returns a string that contains begin timestamp and end timestamp. 181 * <p> 182 * 183 * @return "leaveBlock.getBeginDateTime() in (hh:mm aa) - leaveBlock.getEndDateTime() in (hh:mm aa)" for LeaveBlockRenderer 184 */ 185 public String getTimeRange(); 186 187 }