001/*
002 * Copyright 2006 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 */
016package org.kuali.ole.module.purap.document.service;
017
018import org.kuali.ole.module.purap.document.PurchaseOrderDocument;
019import org.kuali.ole.module.purap.document.RequisitionDocument;
020import org.kuali.rice.kew.api.exception.WorkflowException;
021
022import java.util.List;
023
024/**
025 * Defines methods that must be implemented by classes providing a RequisitionService.
026 */
027public interface RequisitionService extends PurchasingDocumentSpecificService {
028
029    /**
030     * Creates a Requisition object from Purchaser Order
031     *
032     * @param purDocument
033     * @return
034     * @throws WorkflowException
035     */
036    public RequisitionDocument generateRequisitionFromPurchaseOrder(PurchaseOrderDocument purDocument) throws WorkflowException;
037
038    /**
039     * Obtains the requisition document from the database given a requisition id as the input parameter
040     *
041     * @param id the requisition id of the document we want to obtain.
042     * @return RequisitionDocument the requisition document whose requisition id is the id in the input parameter of this method.
043     */
044    public RequisitionDocument getRequisitionById(Integer id);
045
046    /**
047     * Checks whether the requisition is eligible to become an Automatic Purchase Order (APO)
048     *
049     * @param requisition the requisition document to be checked.
050     * @return boolean true if the requisition is eligible to become APO.
051     */
052    public boolean isAutomaticPurchaseOrderAllowed(RequisitionDocument requisition);
053
054    /**
055     * Returns the list of Requisitions that are awaiting contract manager assignment
056     *
057     * @return List<RequisitionDocument>
058     */
059    public List<RequisitionDocument> getRequisitionsAwaitingContractManagerAssignment();
060
061    /**
062     * Returns the count of how many Requisitions are awaiting contract manager assignment
063     *
064     * @return int
065     */
066    public int getCountOfRequisitionsAwaitingContractManagerAssignment();
067
068}