1 /* 2 * Copyright 2006 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.List; 19 20 import org.kuali.ole.fp.document.CashReceiptDocument; 21 import org.kuali.rice.kim.api.identity.Person; 22 23 /** 24 * 25 * This service interface defines the methods that a CashReceiptService implementation must provide. 26 */ 27 public interface CashReceiptService { 28 /** 29 * This method retrieves the cash receipt verification unit for the given user. 30 * 31 * TODO: change this to do something other than return null (which will require updating CashReceiptDocumentAuthorizer, since 32 * that's the one place I'm sure that returning a null is interpreted to mean that a user is a member of no verificationUnit) 33 * 34 * @param user The user to retrieve the cash receipt verification unit for. 35 * @return Cash receipt verificationUnit campusCode associated with the given user; null if the user is not a member of any verification campus. 36 */ 37 public String getCashReceiptVerificationUnitForUser(Person user); 38 39 /** 40 * Returns a List of CashReceiptDocuments for the given verification unit whose status matches the given status code. 41 * 42 * @param verificationUnit A verification unit for a cash receipt. 43 * @param statusCode A cash receipt status code. 44 * @return List of CashReceiptDocument instances. 45 * @throws IllegalArgumentException Thrown if verificationUnit is blank 46 * @throws IllegalArgumentException Thrown if statusCode is blank 47 */ 48 public List getCashReceipts(String verificationUnit, String statusCode); 49 50 /** 51 * Returns a List of CashReceiptDocuments for the given verificationUnit whose status matches any of the status codes in the 52 * given String[]. 53 * 54 * @param verificationUnit A verification unit for a cash receipt. 55 * @param statii A collection of potential cash receipt document statuses. 56 * @return List of CashReceiptDocument instances. 57 * @throws IllegalArgumentException Thrown if verificationUnit is blank 58 * @throws IllegalArgumentException Thrown if statii is null or empty or contains any blank statusCodes 59 */ 60 public List getCashReceipts(String verificationUnit, String[] statii); 61 62 /** 63 * This adds the currency and coin details associated with this Cash Receipt document to the proper cash drawer and to the 64 * cumulative Cash Receipt details for the document which opened the cash drawer. 65 * 66 * @param crDoc The cash receipt document with cash details to add to the cash drawer. 67 */ 68 public void addCashDetailsToCashDrawer(CashReceiptDocument crDoc); 69 70 /** 71 * Checks whether the CashReceiptDocument's cash totals are invalid, generating global errors if so. 72 * 73 * @param cashReceiptDocument submitted cash receipt document 74 * @return true if CashReceiptDocument's cash totals are valid 75 */ 76 public abstract boolean areCashTotalsInvalid(CashReceiptDocument cashReceiptDocument); 77 } 78