001/*
002 * Copyright 2008 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 */
016package org.kuali.ole.fp.document.service;
017
018import java.util.Map;
019
020import org.kuali.ole.fp.businessobject.DisbursementPayee;
021import org.kuali.ole.fp.businessobject.DisbursementVoucherPayeeDetail;
022import org.kuali.ole.fp.document.DisbursementVoucherDocument;
023import org.kuali.ole.vnd.businessobject.VendorDetail;
024import org.kuali.rice.kim.api.identity.Person;
025
026/**
027 * define a set of service methods related to disbursement payee
028 */
029public interface DisbursementVoucherPayeeService {
030
031    /**
032     * find the payee type description corresponding to the given payee type code
033     * 
034     * @param payeeTypeCode the given payee type code
035     * @return the payee type description corresponding to the given payee type code
036     */
037    public String getPayeeTypeDescription(String payeeTypeCode);
038
039    /**
040     * determine whether the given payee is an employee
041     * 
042     * @param dvPayeeDetail the given payee
043     * @return true if the given payee is an employee; otherwise, false
044     */
045    public boolean isEmployee(DisbursementVoucherPayeeDetail dvPayeeDetail);
046
047    /**
048     * determine whether the given payee is an employee
049     * 
050     * @param payee the given payee
051     * @return true if the given payee is an employee; otherwise, false
052     */
053    public boolean isEmployee(DisbursementPayee payee);
054
055    /**
056     * determine whether the given payee is a vendor
057     * 
058     * @param dvPayeeDetail the given payee
059     * @return true if the given payee is a vendor; otherwise, false
060     */
061    public boolean isVendor(DisbursementVoucherPayeeDetail dvPayeeDetail);
062
063    /**
064     * determine whether the given payee is a vendor
065     * 
066     * @param payee the given payee
067     * @return true if the given payee is a vendor; otherwise, false
068     */
069    public boolean isVendor(DisbursementPayee payee);
070
071    /**
072     * determine whether the given payee is an individual vendor
073     * 
074     * @param dvPayeeDetail the given payee
075     * @return true if the given payee is an individual vendor; otherwise, false
076     */
077    public boolean isPayeeIndividualVendor(DisbursementVoucherPayeeDetail dvPayeeDetail);
078    
079    /**
080     * determine whether the given payee is an individual vendor
081     * 
082     * @param payee the given payee
083     * @return true if the given payee is an individual vendor; otherwise, false
084     */
085    public boolean isPayeeIndividualVendor(DisbursementPayee payee);
086
087    public void checkPayeeAddressForChanges(DisbursementVoucherDocument dvDoc);
088    
089    /**
090     * get the ownership type code if the given payee is a vendor
091     * @param payee the given payee
092     * @return the ownership type code if the given payee is a vendor; otherwise, return null
093     */
094    public String getVendorOwnershipTypeCode(DisbursementPayee payee);
095
096    /**
097     * convert the field names between Payee and Vendor
098     *
099     * @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}