001 /* 002 * Copyright 2011 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.kfs.module.bc.document.service; 017 018 import java.util.List; 019 020 import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding; 021 import org.kuali.rice.kns.util.ErrorMap; 022 import org.kuali.rice.kns.util.MessageMap; 023 024 /** 025 * define a set of validations methods for salary setting 026 */ 027 public interface SalarySettingRuleHelperService { 028 029 /** 030 * determine whether the salary amount of the given appointment funding can be adjusted 031 * 032 * @param appointmentFunding the given appointment funding 033 * @param errorMap the given error map that can hold the error message if any 034 * @return true if the salary amount of the given appointment funding can be adjusted; otherwise, false 035 */ 036 public boolean canBeAdjusted(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 037 038 /** 039 * determine whether the given appointment funding is associated with an active job 040 * 041 * @param appointmentFunding the given appointment funding 042 * @param errorMap the given error map that can hold the error message if any 043 * @return true if the given appointment funding is associated with an active job; otherwise, false 044 */ 045 public boolean hasActiveJob(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 046 047 /** 048 * determine whether the object code of the given appointment funding matches the position default object code 049 * 050 * @param appointmentFunding the given appointment funding 051 * @param errorMap the given error map that can hold the error message if any 052 * @return true if the object code of the given appointment funding matches the position default object code; otherwise, false 053 */ 054 public boolean hasObjectCodeMatchingDefaultOfPosition(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 055 056 /** 057 * request salary amount must be zero for full year leave 058 * 059 * @param appointmentFunding the given appointment funding 060 * @param errorMap the given error map that can hold the error message if any 061 * @return true if request salary amount is zero for full year leave; otherwise, false 062 */ 063 public boolean hasRequestedAmountZeroWhenFullYearLeave(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 064 065 /** 066 * request fte quantity must be zero for full year leave 067 * 068 * @param appointmentFunding the given appointment funding 069 * @param errorMap the given error map that can hold the error message if any 070 * @return true if the request fte quantity is zero for full year leave; otherwise, false 071 */ 072 public boolean hasRequestedFteQuantityZeroWhenFullYearLeave(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 073 074 /** 075 * determine if there is an appointment funding in the given list that has the same key information as the specified appointment 076 * funding 077 * 078 * @param appointmentFundings the given appointment funding collection 079 * @param appointmentFunding the given appointment funding 080 * @param errorMap the given error map that can hold the error message if any 081 * @return true if there is no an appointment funding in the given list that has the same key information as the specified 082 * appointment funding; otherwise, false 083 */ 084 public boolean hasNoExistingLine(List<PendingBudgetConstructionAppointmentFunding> appointmentFundings, PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 085 086 /** 087 * determine whether the requested salary amount of the given appointment funding is valid 088 * 089 * @param appointmentFunding the given appointment funding 090 * @return true if the requested salary amount of the given appointment funding is valid; otherwise, false 091 */ 092 public boolean hasValidRequestedAmount(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 093 094 /** 095 * determine whether the requested salary amount of the given appointment funding is valid for the quick salary setting screen 096 * 097 * @param appointmentFunding 098 * @param errorMap 099 * @return 100 */ 101 public boolean hasValidRequestedAmountQuickSalarySetting(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 102 103 /** 104 * determine whether the requested leave csf amount of the given appointment funding is valid 105 * 106 * @param appointmentFunding the given appointment funding 107 * @param errorMap the given error map that can hold the error message if any 108 * @return true if the requested leave csf amount of the given appointment funding is valid; otherwise, false 109 */ 110 public boolean hasValidRequestedCsfAmount(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 111 112 /** 113 * determine whether the requested leave csf time percent of the given appointment funding is valid 114 * 115 * @param appointmentFunding the given appointment funding 116 * @param errorMap the given error map that can hold the error message if any 117 * @return true if the requested leave csf time percent of the given appointment funding is valid; otherwise, false 118 */ 119 public boolean hasValidRequestedCsfTimePercent(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 120 121 /** 122 * determine whether the requested FTE is valid 123 * 124 * @param appointmentFunding the given appointment funding 125 * @param errorMap the given error map that can hold the error message if any 126 * @return true if the requested FTE is valid; otherwise, false 127 */ 128 public boolean hasValidRequestedFteQuantity(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 129 130 /** 131 * determine whether the requested funding month of the given appointment funding is valid 132 * 133 * @param appointmentFunding the given appointment funding 134 * @param errorMap the given error map that can hold the error message if any 135 * @return true if the requested funding month of the given appointment funding is valid; otherwise, false 136 */ 137 public boolean hasValidRequestedFundingMonth(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 138 139 /** 140 * determine whether the requested FTE is valid 141 * 142 * @param appointmentFunding the given appointment funding 143 * @param errorMap the given error map that can hold the error message if any 144 * @return true if the requested FTE is valid; otherwise, false 145 */ 146 public boolean hasValidRequestedTimePercent(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 147 148 /** 149 * determine whether the adjustment amount is valid 150 * 151 * @param appointmentFunding the given appointment funding 152 * @param errorMap the given error map that can hold the error message if any 153 * @return true if the adjustment amount is valid; otherwise, false 154 */ 155 public boolean hasValidAdjustmentAmount(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 156 157 /** 158 * determine whether either pay rate or annual amount is not empty, and both of them have valid formats if not empty 159 * 160 * @param appointmentFunding the given appointment funding 161 * @param errorMap the given error map that can hold the error message if any 162 * @return true if either pay rate or annual amount is valid; otherwise, false 163 */ 164 public boolean hasValidPayRateOrAnnualAmount(PendingBudgetConstructionAppointmentFunding appointmentFunding, MessageMap errorMap); 165 }