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.sys.service;
017    
018    import java.util.List;
019    
020    import org.kuali.kfs.sys.businessobject.ElectronicPaymentClaim;
021    import org.kuali.rice.kim.bo.Person;
022    
023    /**
024     * A set of methods that help the ElectronicPaymentClaimingService turn a list of ElectronicPaymentClaim records into a document
025     * used to claim those records.
026     * 
027     * @see org.kuali.kfs.sys.service.ElectronicPaymentClaimingService
028     * @see org.kuali.kfs.sys.businessobject.ElectronicPaymentClaim
029     */
030    public interface ElectronicPaymentClaimingDocumentGenerationStrategy {
031    
032        /**
033         * Returns the label which will identify the claiming document to users
034         * 
035         * @return a label
036         */
037        public abstract String getDocumentLabel();
038    
039        /**
040         * get the workflow document type code of the claiming document
041         * 
042         * @return the workflow document type code of the claiming document
043         */
044        public String getClaimingDocumentWorkflowDocumentType();
045    
046        /**
047         * Determines if the given user can use the document wrapped by this ElectronicPaymentClaimingDocumentGenerationStrategy
048         * implementaton to claim any ElectronicPaymentClaim records
049         * 
050         * @param claimingUser the user attempting to claim ElectronicPaymentClaim records with a document
051         * @return true if the user can use this kind of document to claim ElectronicPaymentClaim records, false otherwise
052         */
053        public abstract boolean userMayUseToClaim(Person claimingUser);
054    
055        /**
056         * Creates a document to claim a given list of ElectronicPaymentClaim records.
057         * 
058         * @param electronicPayments a List of ElectronicPaymentClaim records
059         * @param user the user doing the claiming
060         * @return the absolute URL that should be redirected to, so that the user can edit the document
061         */
062        public abstract String createDocumentFromElectronicPayments(List<ElectronicPaymentClaim> electronicPayments, Person user);
063    
064        /**
065         * Determines whether the given document number would be considered valid by the system that the document this strategy
066         * interacts with
067         * 
068         * @param referenceDocumentNumber the document number reference to validate
069         * @return true if the document reference is considered valid, false otherwise
070         */
071        public abstract boolean isDocumentReferenceValid(String referenceDocumentNumber);
072    }