001    /*
002     * Copyright 2011 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     */
016    package org.kuali.kfs.module.endow.document.service;
017    
018    import java.math.BigDecimal;
019    import java.util.List;
020    
021    import org.kuali.kfs.module.endow.businessobject.HoldingTaxLot;
022    
023    public interface HoldingTaxLotService {
024    
025        /**
026         * Gets a holding tax lot based on primary keys: kemid, security id, registration code, lot number and IP indicator.
027         * 
028         * @param kemid
029         * @param securityId
030         * @param registrationCode
031         * @param lotNumber
032         * @param ipIndicator
033         * @return the corresponding tax lot
034         */
035        public HoldingTaxLot getByPrimaryKey(String kemid, String securityId, String registrationCode, int lotNumber, String ipIndicator);
036    
037        /**
038         * Gets the holding tax lot based on the following criteria: kemid, security id, registration code, and IP indicator.
039         * 
040         * @param kemid
041         * @param securityId
042         * @param registrationCode
043         * @param ipIndicator
044         * @return a list of tax lots that meet the criteria
045         */
046        public List<HoldingTaxLot> getAllTaxLots(String kemid, String securityId, String registrationCode, String ipIndicator);
047    
048        /**
049         * Gets all tax lots with positive units based on the following criteria: kemid, security id, registration code, and IP
050         * indicator.
051         * 
052         * @param kemid
053         * @param securityId
054         * @param registrationCode
055         * @param ipIndicator
056         * @return a list of tax lots that meet the criteria
057         */
058        public List<HoldingTaxLot> getAllTaxLotsWithPositiveUnits(String kemid, String securityId, String registrationCode, String ipIndicator);
059    
060        /**
061         * Gets the holding tax lot based on the following criteria: kemid, security id, registration code, and IP indicator and orders
062         * them ascending or descending based on the acquired date.
063         * 
064         * @param kemid
065         * @param securityId
066         * @param registrationCode
067         * @param ipIndicator returned in the descending order
068         * @return a list of tax lots that meet the criteria and in the right order
069         */
070        public List<HoldingTaxLot> getAllTaxLotsOrderByAcquiredDate(String kemid, String securityId, String registrationCode, String ipIndicator, boolean sortAscending);
071    
072        /**
073         * Gets all tax lots with positive cost based on the following criteria: kemid, security id, registration code, and IP
074         * indicator.
075         * 
076         * @param kemid
077         * @param securityId
078         * @param registrationCode
079         * @param ipIndicator
080         * @return a list of tax lots that meet the criteria
081         */
082        public List<HoldingTaxLot> getAllTaxLotsWithPositiveCost(String kemid, String securityId, String registrationCode, String ipIndicator);
083    
084        /**
085         * Gets all tax lots on the following criteria: kemi and IPindicator.
086         * 
087         * @param kemid
088         * @param ipIndicator
089         * @return a list of tax lots that meet the criteria
090         */
091        public List<HoldingTaxLot> getAllTaxLotsByKemIdAdndIPIndicator(String kemid, String ipIndicator);
092    
093        /**
094         * Gets class code type based on securityId. Based on security ID, you search END_SEC_T Table to get END_SEC_T:SEC_CLS_CD, then,
095         * based on class code, you search END_CLS_CD_T, to get END_CLS_CD_T:CLS_CD_TYP
096         * 
097         * @param id
098         * @return class code type
099         */
100        public String getClassCodeType(String securityId);
101    
102        /**
103         * The Market Value of the KEMID END_HLDG_TAX_LOT_T records with a CLS_CD_TYP of Cash Equivalents (C), and with the HLDG_IP_IND
104         * equal to I.
105         * 
106         * @param kemId
107         * @return marketValue
108         */
109        public BigDecimal getMarketValueForCashEquivalentsForAvailableIncomeCash(String kemId);
110    
111        /**
112         * The Market Value of the KEMID END_HLDG_TAX_LOT_T records with a CLS_CD_TYP of Pooled Investment (P) and with the HLDG_IP_IND
113         * equal to I times the value in the Available Cash Percent institutional parameter (accounts for only a percentage of the
114         * market value allowing for pricing changes).
115         * 
116         * @return marketValue
117         */
118        public BigDecimal getMarketValueForPooledInvestmentForAvailableIncomeCash(String kemId);
119    
120        /**
121         * The Market Value of the KEMID END_HLDG_TAX_LOT_T records with a CLS_CD_TYP of Cash Equivalents (C), and with the HLDG_IP_IND
122         * equal to P.
123         * 
124         * @param kemId
125         * @return marketValue
126         */
127        public BigDecimal getMarketValueForCashEquivalentsForAvailablePrincipalCash(String kemId);
128    
129        /**
130         * The Market Value of the KEMID END_HLDG_TAX_LOT_T records with a CLS_CD_TYP of Pooled Investment (P) and with the HLDG_IP_IND
131         * equal to P times the value in the Available Cash Percent institutional parameter (accounts for only a percentage of the
132         * market value allowing for pricing changes).
133         * 
134         * @return marketValue
135         */
136        public BigDecimal getMarketValueForPooledInvestmentForAvailablePrincipalCash(String kemId);
137    
138        /**
139         * Gets all tax lots.
140         * 
141         * @return a list of tax lots
142         */
143        public List<HoldingTaxLot> getAllTaxLots();
144    
145        /**
146         * Get all tax lots for the given security that have an accrued income greater than zero.
147         * 
148         * @param securityId the id of the security for which to retrieve the tax lots
149         * @return all tax lots that meet the criteria
150         */
151        public List<HoldingTaxLot> getAllTaxLotsWithAccruedIncomeGreaterThanZeroPerSecurity(String securityId);
152    
153        /**
154         * Gets all the tax lots for the given security that have units greater than zero.
155         * 
156         * @param securityId
157         * @return all tax lots that meet the criteria
158         */
159        public List<HoldingTaxLot> getTaxLotsPerSecurityIDWithUnitsGreaterThanZero(String securityId);
160    
161        /**
162         * Removes all HoldingTaxLot records from END_HLDG_TAX_LOT_T
163         * @return true is successfully removed the records, else false
164         */
165        public boolean removeAllHoldingTaxLots();
166    }