1 /*
2  * @(#) $Id: Transaction.java,v 1.2 2003/07/08 08:13:53 pankaj Exp $
3  *
4  * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net). 
5  * All rights reserved.
6  *
7  * The license governing the use of this file can be found in the 
8  * root directory of the containing software.
9  */
10package org.jstk.example.bank.server;
11
12import java.math.BigDecimal;
13import java.util.Date;
14
15public class Transaction implements java.io.Serializable {
16    public static String OPEN = "OPEN";
17    public static String CLOSE = "CLOSE";
18    public static String DEBIT = "DEBIT";
19    public static String CREDIT = "CREDIT";
20
21    private String type;
22    private BigDecimal amt;
23    private BigDecimal balance;
24    private String desc;
25    private Date date;
26
27    public Transaction(String type, BigDecimal amt, BigDecimal balance, String desc){
28        this.type = type;
29        this.amt = amt;
30        this.balance = balance;
31        this.desc = desc;
32        date = new Date();
33    }
34
35    public String toString(){
36        return date.toString() + "   " + type + "   " + amt + "   " + balance + "  " + desc;
37    }
38}