package vn.azteam.tpf.service.dto;

import java.time.Instant;
import java.io.Serializable;
import java.util.Objects;

/**
 * A DTO for the TBBlockDetails entity.
 */
public class TBBlockDetailsDTO implements Serializable {

    private Long id;

    private Double quantity;

    private String code;

    private Instant mfgDate;

    private Instant expDate;

    private Long tbSuppliesInWarehouseId;

    private Long tbEntityId;

    private String tbEntityName;

    private Long tbSuppliesId;

    private String tbSuppliesUnit;

    public Long getId() {
        return id;
    }

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

    public Double getQuantity() {
        return quantity;
    }

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

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Instant getMfgDate() {
        return mfgDate;
    }

    public void setMfgDate(Instant mfgDate) {
        this.mfgDate = mfgDate;
    }

    public Instant getExpDate() {
        return expDate;
    }

    public void setExpDate(Instant expDate) {
        this.expDate = expDate;
    }

    public Long getTbSuppliesInWarehouseId() {
        return tbSuppliesInWarehouseId;
    }

    public void setTbSuppliesInWarehouseId(Long tbSuppliesInWarehouseId) {
        this.tbSuppliesInWarehouseId = tbSuppliesInWarehouseId;
    }

    public Long getTbEntityId() {
        return tbEntityId;
    }

    public void setTbEntityId(Long tbEntityId) {
        this.tbEntityId = tbEntityId;
    }

    public String getTbEntityName() {
        return tbEntityName;
    }

    public void setTbEntityName(String tbEntityName) {
        this.tbEntityName = tbEntityName;
    }

    public Long getTbSuppliesId() {
        return tbSuppliesId;
    }

    public void setTbSuppliesId(Long tbSuppliesId) {
        this.tbSuppliesId = tbSuppliesId;
    }

    public String getTbSuppliesUnit() {
        return tbSuppliesUnit;
    }

    public void setTbSuppliesUnit(String tbSuppliesUnit) {
        this.tbSuppliesUnit = tbSuppliesUnit;
    }

    public TBBlockDetailsOptionDTO toOptionDto() {
        TBBlockDetailsOptionDTO optionDTO = new TBBlockDetailsOptionDTO();
        optionDTO.setId(this.getId());
        optionDTO.setCode(this.getCode());
        optionDTO.setTbSuppliesInWarehouseId(this.getTbSuppliesInWarehouseId());
        return optionDTO;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        TBBlockDetailsDTO tBBlockDetailsDTO = (TBBlockDetailsDTO) o;
        if (tBBlockDetailsDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), tBBlockDetailsDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "TBBlockDetailsDTO{" +
            "id=" + getId() +
            ", quantity=" + getQuantity() +
            ", code='" + getCode() + "'" +
            ", mfgDate='" + getMfgDate() + "'" +
            ", expDate='" + getExpDate() + "'" +
            "}";
    }
}
