1 package org.kuali.coeus.propdev.api.attachment; 2 3 import java.util.List; 4 5 6 public interface NarrativeService { 7 8 /** 9 * Given a collection of narratives, each narratives that was "auto-generated" will be deleted 10 * from the proposal development system of record. 11 * 12 * @param narratives the collection of narratives. Cannot be null. 13 * @throws IllegalArgumentException if narratives collection is null 14 */ 15 void deleteAutoGeneratedNarratives(List<? extends NarrativeContract> narratives); 16 17 /** 18 * Checks if a narrative is "auto-generated". 19 * @param narrative the narrative. Cannot be null. 20 * @return true if the narrative is "auto-generated" 21 * @throws IllegalArgumentException if narrative is null 22 */ 23 boolean isAutoGeneratedNarrative(NarrativeContract narrative); 24 25 /** 26 * This method creates a system generated narrative. Save it to the system of record. 27 * None of the parameters can be null or blank. 28 * @param proposalNumber the proposal number which the narrative is associated with. Cannot be blank. 29 * @param narrativeTypeCode the narrative type code. Cannot be blank. 30 * @param attachmentData the attachment data. Cannot be blank (null or empty array) 31 * @param attachmentName the name of the attachment. Cannot be blank. 32 * @param comments the comments on the narrative. Cannot be blank. 33 * @return the created and saved narrative. Will not return null. 34 */ 35 NarrativeContract createSystemGeneratedNarrative(String proposalNumber, String narrativeTypeCode, byte[] attachmentData, String attachmentName, String comments); 36 37 /** 38 * Given a collection of narratives, each narratives that was "system-generated" will be deleted 39 * from the proposal development system of record. 40 * 41 * @param narratives the collection of narratives. Cannot be null. 42 * @throws IllegalArgumentException if narratives collection is null 43 */ 44 void deleteSystemGeneratedNarratives(List<? extends NarrativeContract> narratives); 45 46 /** 47 * Checks if a narrative is "system-generated". 48 * @param narrative the narrative. Cannot be null. 49 * @return true if the narrative is "auto-generated" 50 * @throws IllegalArgumentException if narrative is null 51 */ 52 boolean isSystemGeneratedNarrative(NarrativeContract narrative); 53 }