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.sys.service;
17
18 import java.util.List;
19
20 import org.kuali.ole.sys.businessobject.ElectronicPaymentClaim;
21 import org.kuali.rice.kim.api.identity.Person;
22
23 /**
24 * A set of methods that help the ElectronicPaymentClaimingService turn a list of ElectronicPaymentClaim records into a document
25 * used to claim those records.
26 *
27 * @see org.kuali.ole.sys.service.ElectronicPaymentClaimingService
28 * @see org.kuali.ole.sys.businessobject.ElectronicPaymentClaim
29 */
30 public interface ElectronicPaymentClaimingDocumentGenerationStrategy {
31
32 /**
33 * Returns the label which will identify the claiming document to users
34 *
35 * @return a label
36 */
37 public abstract String getDocumentLabel();
38
39 /**
40 * get the workflow document type code of the claiming document
41 *
42 * @return the workflow document type code of the claiming document
43 */
44 public String getClaimingDocumentWorkflowDocumentType();
45
46 /**
47 * Determines if the given user can use the document wrapped by this ElectronicPaymentClaimingDocumentGenerationStrategy
48 * implementaton to claim any ElectronicPaymentClaim records
49 *
50 * @param claimingUser the user attempting to claim ElectronicPaymentClaim records with a document
51 * @return true if the user can use this kind of document to claim ElectronicPaymentClaim records, false otherwise
52 */
53 public abstract boolean userMayUseToClaim(Person claimingUser);
54
55 /**
56 * Creates a document to claim a given list of ElectronicPaymentClaim records.
57 *
58 * @param electronicPayments a List of ElectronicPaymentClaim records
59 * @param user the user doing the claiming
60 * @return the absolute URL that should be redirected to, so that the user can edit the document
61 */
62 public abstract String createDocumentFromElectronicPayments(List<ElectronicPaymentClaim> electronicPayments, Person user);
63
64 /**
65 * Determines whether the given document number would be considered valid by the system that the document this strategy
66 * interacts with
67 *
68 * @param referenceDocumentNumber the document number reference to validate
69 * @return true if the document reference is considered valid, false otherwise
70 */
71 public abstract boolean isDocumentReferenceValid(String referenceDocumentNumber);
72 }