1 /* 2 * Copyright 2008 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.ole.fp.document.service; 17 18 import java.util.Map; 19 20 import org.kuali.ole.fp.businessobject.DisbursementPayee; 21 import org.kuali.ole.fp.businessobject.DisbursementVoucherPayeeDetail; 22 import org.kuali.ole.fp.document.DisbursementVoucherDocument; 23 import org.kuali.ole.vnd.businessobject.VendorDetail; 24 import org.kuali.rice.kim.api.identity.Person; 25 26 /** 27 * define a set of service methods related to disbursement payee 28 */ 29 public interface DisbursementVoucherPayeeService { 30 31 /** 32 * find the payee type description corresponding to the given payee type code 33 * 34 * @param payeeTypeCode the given payee type code 35 * @return the payee type description corresponding to the given payee type code 36 */ 37 public String getPayeeTypeDescription(String payeeTypeCode); 38 39 /** 40 * determine whether the given payee is an employee 41 * 42 * @param dvPayeeDetail the given payee 43 * @return true if the given payee is an employee; otherwise, false 44 */ 45 public boolean isEmployee(DisbursementVoucherPayeeDetail dvPayeeDetail); 46 47 /** 48 * determine whether the given payee is an employee 49 * 50 * @param payee the given payee 51 * @return true if the given payee is an employee; otherwise, false 52 */ 53 public boolean isEmployee(DisbursementPayee payee); 54 55 /** 56 * determine whether the given payee is a vendor 57 * 58 * @param dvPayeeDetail the given payee 59 * @return true if the given payee is a vendor; otherwise, false 60 */ 61 public boolean isVendor(DisbursementVoucherPayeeDetail dvPayeeDetail); 62 63 /** 64 * determine whether the given payee is a vendor 65 * 66 * @param payee the given payee 67 * @return true if the given payee is a vendor; otherwise, false 68 */ 69 public boolean isVendor(DisbursementPayee payee); 70 71 /** 72 * determine whether the given payee is an individual vendor 73 * 74 * @param dvPayeeDetail the given payee 75 * @return true if the given payee is an individual vendor; otherwise, false 76 */ 77 public boolean isPayeeIndividualVendor(DisbursementVoucherPayeeDetail dvPayeeDetail); 78 79 /** 80 * determine whether the given payee is an individual vendor 81 * 82 * @param payee the given payee 83 * @return true if the given payee is an individual vendor; otherwise, false 84 */ 85 public boolean isPayeeIndividualVendor(DisbursementPayee payee); 86 87 public void checkPayeeAddressForChanges(DisbursementVoucherDocument dvDoc); 88 89 /** 90 * get the ownership type code if the given payee is a vendor 91 * @param payee the given payee 92 * @return the ownership type code if the given payee is a vendor; otherwise, return null 93 */ 94 public String getVendorOwnershipTypeCode(DisbursementPayee payee); 95 96 /** 97 * convert the field names between Payee and Vendor 98 * 99 * @return a field name map of Payee and Vendor. The map key is a field name of Payee, and its value is a field name of Vendor 100 */ 101 public Map<String, String> getFieldConversionBetweenPayeeAndVendor(); 102 103 /** 104 * convert the field names between Payee and Person 105 * 106 * @return a field name map of Payee and Person. The map key is a field name of Payee, and its value is a field name of Person 107 */ 108 public Map<String, String> getFieldConversionBetweenPayeeAndPerson(); 109 110 /** 111 * build a payee object from the given vendor object 112 * 113 * @param vendorDetail the given vendor object 114 * @return a payee object built from the given vendor object 115 */ 116 public DisbursementPayee getPayeeFromVendor(VendorDetail vendorDetail); 117 118 /** 119 * build a payee object from the given person object 120 * 121 * @param person the given person object 122 * @return a payee object built from the given person object 123 */ 124 public DisbursementPayee getPayeeFromPerson(Person person); 125 }