1 /* 2 * The Kuali Financial System, a comprehensive financial management system for higher education. 3 * 4 * Copyright 2005-2014 The Kuali Foundation 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU Affero General Public License as 8 * published by the Free Software Foundation, either version 3 of the 9 * License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Affero General Public License for more details. 15 * 16 * You should have received a copy of the GNU Affero General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 package org.kuali.kfs.module.tem.document.service; 20 21 import java.util.List; 22 import java.util.Set; 23 24 import org.kuali.kfs.module.tem.businessobject.AccountingDocumentRelationship; 25 26 public interface AccountingDocumentRelationshipService { 27 28 /** 29 * This method gets directly related document numbers 30 * 31 * @param documentNumber 32 * @return 33 */ 34 public Set<String> getRelatedDocumentNumbers(String documentNumber); 35 36 /** 37 * This method gets all related document numbers (sibling document numbers included). 38 * 39 * @param documentNumber 40 * @return 41 */ 42 public Set<String> getAllRelatedDocumentNumbers(String documentNumber); 43 44 /** 45 * This method gets the main root of the document number. The lookup is done recursively. 46 * 47 * @param documentNumber 48 * @return 49 */ 50 public String getRootDocumentNumber(String documentNumber); 51 52 /** 53 * This method saves a list of accountingDocumentRelationships 54 * 55 * @param accountingDocumentRelationships 56 */ 57 public void save(List<AccountingDocumentRelationship> accountingDocumentRelationships); 58 59 /** 60 * This method saves an accountingDocumentRelationship 61 * 62 * @param accountingDocumentRelationship 63 */ 64 public void save(AccountingDocumentRelationship accountingDocumentRelationship); 65 66 /** 67 * This method deletes a list of accountingDocumentRelationships 68 * 69 * @param accountingDocumentRelationships 70 */ 71 public void delete(List<AccountingDocumentRelationship> accountingDocumentRelationships); 72 73 /** 74 * This method deletes an accountingDocumentRelationship 75 * 76 * @param accountingDocumentRelationship 77 */ 78 public void delete(AccountingDocumentRelationship accountingDocumentRelationship); 79 80 /** 81 * 82 * This method finds an accountingDocumentRelationship 83 * @param adr 84 * @return 85 */ 86 public List<AccountingDocumentRelationship> find(AccountingDocumentRelationship adr); 87 88 /** 89 * This method gets directly related document numbers 90 * 91 * @param documentNumber 92 * @return 93 */ 94 public Set<String> huntForRelatedDocumentNumbersWithDocumentType(String documentNumber, String documentType); 95 96 /** 97 * Determines if the given document number represents a document which is a "child" of another document 98 * @param documentNumber the document number to check for childishness 99 * @return true if the document number represents a document which is the "related" document in any accounting document relationship; false otherwise 100 */ 101 public boolean isDocumentSomebodysChild(String documentNumber); 102 }