package ee.ut.math.tvt2008.salessystem.domain.data;

import java.math.BigDecimal;

/**
 * Stock item. Corresponds to the Data Transfer Object design pattern.
 * This object is used by hibernate and corresponds to a table in database.
 */
public class StockItem implements Cloneable, DisplayableItem {
	private Long id;
	private String name;
	private BigDecimal price;
	private Integer quantity;
        private boolean enabled;
        
        public boolean getEnabled(){
            return enabled;
        }
        
        public void setEnabled(boolean enabled){
            this.enabled = enabled;
        }

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Long getId() {
		return id;
	}

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

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Override
	public String toString() {
		return id + " " + name + " " + price + " " + quantity;
	}

	@Override
	public StockItem clone() {
		StockItem item = new StockItem();
		item.setQuantity(getQuantity());
		item.setId(getId());
		item.setName(getName());
		item.setPrice(price);

		return item;
	}
}
