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.sql.Date; 020 import java.util.Collection; 021 import java.util.List; 022 023 import org.kuali.kfs.module.endow.businessobject.Security; 024 025 /** 026 * 027 */ 028 public interface SecurityService { 029 030 /** 031 * Calculates market value or unit value based on the security valuation method 032 * 033 * @param security the security for which we calculate the market value or unit value 034 * @return 035 */ 036 public void computeValueBasedOnValuationMethod(Security security); 037 038 /** 039 * This method will perform the following updates: 1) Copy current Security Unit Value to Previous Unit Value 2) Copy current 040 * Security Value Date to Previous Unit Value Date 3) Copy newUnitValue to current Security Unit Value 4) Copy newValueDate to 041 * current Security Unit Value Date 5) Copy newUnitValueSource to Unit Value Source 042 * 043 * @param security the BO that needs to be updated. 044 * @param newUnitValue the new unit value for that security 045 * @param newValueDate the new value date for that security 046 * @param newUnitValueSource the new unit value source for that security 047 * @return Security the update security object 048 */ 049 public Security updateUnitValue(Security security, BigDecimal newUnitValue, Date newValueDate, String newUnitValueSource); 050 051 /** 052 * This method will update the interest rate or amount 053 * 054 * @return Security the update security object 055 */ 056 public Security updateInterestRate(Security theSecurity, BigDecimal interestRate); 057 058 /** 059 * Updates incomeChangeDate to currentDate 060 * 061 * @param id 062 */ 063 public Security updateIncomeChangeDate(Security security); 064 065 /** 066 * Gets a Security by primary key. 067 * 068 * @param id 069 * @return a Security 070 */ 071 public Security getByPrimaryKey(String id); 072 073 /** 074 * Gets all the Securities with the class code in the classCodes array and the units held greater than zero. 075 * 076 * @param classCodes 077 * @return All securities that meet the criteria 078 */ 079 public List<Security> getSecuritiesByClassCodeWithUnitsGreaterThanZero(List<String> classCodes); 080 081 }