package cz.fi.muni.pa165.dto;

import cz.fi.muni.pa165.enums.Currency;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;


public class NewPriceDTO {
	private Long productId;

    @NotNull
    private BigDecimal value;

    @NotNull
    private Currency currency;
    

    public Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public BigDecimal getValue() {
        return value;
    }

    public void setValue(BigDecimal value) {
        this.value = value;
    }

    public Currency getCurrency() {
        return currency;
    }

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


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((currency == null) ? 0 : currency.hashCode());
		result = prime * result + ((value == null) ? 0 : value.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NewPriceDTO other = (NewPriceDTO) obj;
		if (currency != other.currency)
			return false;
		if (value == null) {
			if (other.value != null)
				return false;
		} else if (!value.equals(other.value))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "NewPriceDTO{" +
				"productId=" + productId +
				", value=" + value +
				", currency=" + currency +
				'}';
	}
}
