package eu.dnetlib.goldoa.domain;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.google.gwt.user.client.rpc.IsSerializable;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by antleb on 7/9/15.
 */
@Entity
public class BankTransferReceipt implements IsSerializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "uuid")
	private String id;

	private String contentType;
	private byte[] content;

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	@JsonBackReference
	private Budget budget;

	private Timestamp date;

	private Double amount;

	private Double transferCost;

	private Double otherCosts;

	public BankTransferReceipt() {
	}

	public BankTransferReceipt(String contentType, byte[] content) {
		this.contentType = contentType;
		this.content = content;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Timestamp getDate() {
		return date;
	}

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

	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public Double getTransferCost() {
		return transferCost;
	}

	public void setTransferCost(Double costTransfer) {
		this.transferCost = costTransfer;
	}

	public String getContentType() {
		return contentType;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	public byte[] getContent() {
		return content;
	}

	public void setContent(byte[] content) {
		this.content = content;
	}

	public Budget getBudget() {
		return budget;
	}

	public void setBudget(Budget budget) {
		this.budget = budget;
	}

	public Double getOtherCosts() {
		return otherCosts;
	}

	public void setOtherCosts(Double otherCosts) {
		this.otherCosts = otherCosts;
	}
}
