package eu.dnetlib.goldoa.domain;

import com.google.gwt.user.client.rpc.IsSerializable;

import java.util.Date;

/**
 * Created by antleb on 3/8/15.
 */
public class Budget extends GoldBean implements IsSerializable {

    public enum Status implements IsSerializable {
        INCOMPLETE("Incomplete", 1),
        SUBMITTED("Submitted", 2),
        APPROVED("Approved", 4),
        REJECTED("Rejected", 8),
        EXPIRED("Expired", 16);

        private String value;
        private int code;

        Status(String value, int code) {
            this.value = value;
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }
    }

	private Date date;
    private Date startDate;
    private Date endDate;
	private float amountRequested;
    private float amountGranted;
    private Currency currency;
	private float remaining;
    int statusCode;
    private String user;
    private String organisation;
    private BankAccount bankAccount;

	public Budget() {
	}

    public Budget(String budgetId) {
        super(budgetId);
    }

    public Budget(String id, Date date, Date startDate, Date endDate, float amountRequested, float amountGranted, Currency currency, float remaining, int statusCode, String user, String organisation, BankAccount bankAccount) {
        super(id);
        this.date = date;
        this.startDate = startDate;
        this.endDate = endDate;
        this.amountRequested = amountRequested;
        this.amountGranted = amountGranted;
        this.currency = currency;
        this.remaining = remaining;
        this.statusCode = statusCode;
        this.user = user;
        this.organisation = organisation;
        this.bankAccount = bankAccount;
    }

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

    public float getAmountRequested() {
        return amountRequested;
    }

    public void setAmountRequested(float amountRequested) {
        this.amountRequested = amountRequested;
    }

    public float getAmountGranted() {
        return amountGranted;
    }

    public void setAmountGranted(float amountGranted) {
        this.amountGranted = amountGranted;
    }

    public Currency getCurrency() {
        return currency;
    }

    public void setCurrency(Currency currency) {
        this.currency = currency;
    }

    public BankAccount getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(BankAccount bankAccount) {
        this.bankAccount = bankAccount;
    }

    public float getRemaining() {
		return remaining;
	}

	public void setRemaining(float remaining) {
		this.remaining = remaining;
	}

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getOrganisation() {
        return organisation;
    }

    public void setOrganisation(String organisation) {
        this.organisation = organisation;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getStatus() {
        // TODO know man!
        return "I DONT KNOW MAN";
    }

}