01: /*
02: * Copyright 2006 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.gl.service;
17:
18: import java.util.Date;
19: import java.util.Iterator;
20:
21: import org.kuali.module.gl.bo.Reversal;
22: import org.kuali.module.gl.bo.Transaction;
23: import org.kuali.module.gl.util.LedgerEntryHolder;
24:
25: /**
26: * An interface with methods to interact with reversals
27: */
28: public interface ReversalService {
29: /**
30: * Saves a reversal to the database
31: *
32: * @param re the reversal to save
33: */
34: public void save(Reversal re);
35:
36: /**
37: * Fetches or generates a reversal record, based on the given transaction
38: *
39: * @param t a transaction to find a reversal record for
40: * @return a reversal record for the transaction
41: */
42: public Reversal getByTransaction(Transaction t);
43:
44: /**
45: * Fetches all of the reversals that are set to reverse before or on the given date
46: *
47: * @param before the date returned reversals should reverse on or before
48: * @return an Iterator of reversals
49: */
50: public Iterator getByDate(Date before);
51:
52: /**
53: * Summarizes all of the reversal records set to reverse before or on the given date
54: *
55: * @param before the date summarized reversals should reverse on or before
56: * @return a LedgerEntryHolder with the summary date
57: */
58: public LedgerEntryHolder getSummaryByDate(Date before);
59:
60: /**
61: * Removes a reversal record from the persistence store
62: *
63: * @param re the reversal to send to the happy reversal farm in the sky
64: */
65: public void delete(Reversal re);
66: }
|