package vn.azteam.tpf.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import org.springframework.data.elasticsearch.annotations.Document;
import java.io.Serializable;
import java.util.Objects;

/**
 * A TBSuppliesUsingDetails.
 */
@Entity
@Table(name = "tb_supplies_using_details")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "smf_tbsuppliesusingdetails")
public class TBSuppliesUsingDetails implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "dosage")
    private String dosage;

    @Column(name = "quantity")
    private Double quantity;

    @Column(name = "jhi_cost")
    private Double cost;

    @Column(name = "how_to_use")
    private String howToUse;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBEquipmentOfCustomer tbEquipmentOfCustomer;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBSuppliesInWarehouse tbSuppliesInWarehouse;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBBlockDetails tbBlockDetails;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBActivity tbActivity;

    @ManyToOne
    @JsonIgnoreProperties("")
    private TBGuidelineActivity tbGuidelineActivity;


    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

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

    public String getDosage() {
        return dosage;
    }

    public TBSuppliesUsingDetails dosage(String dosage) {
        this.dosage = dosage;
        return this;
    }

    public void setDosage(String dosage) {
        this.dosage = dosage;
    }

    public Double getQuantity() {
        return quantity;
    }

    public TBSuppliesUsingDetails quantity(Double quantity) {
        this.quantity = quantity;
        return this;
    }

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

    public Double getCost() {
        return cost;
    }

    public TBSuppliesUsingDetails cost(Double cost) {
        this.cost = cost;
        return this;
    }

    public void setCost(Double cost) {
        this.cost = cost;
    }

    public String getHowToUse() {
        return howToUse;
    }

    public TBSuppliesUsingDetails howToUse(String howToUse) {
        this.howToUse = howToUse;
        return this;
    }

    public void setHowToUse(String howToUse) {
        this.howToUse = howToUse;
    }

    public TBEquipmentOfCustomer getTbEquipmentOfCustomer() {
        return tbEquipmentOfCustomer;
    }

    public TBSuppliesUsingDetails tbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) {
        this.tbEquipmentOfCustomer = tBEquipmentOfCustomer;
        return this;
    }

    public void setTbEquipmentOfCustomer(TBEquipmentOfCustomer tBEquipmentOfCustomer) {
        this.tbEquipmentOfCustomer = tBEquipmentOfCustomer;
    }

    public TBBlockDetails getTbBlockDetails() {
        return tbBlockDetails;
    }

    public TBSuppliesUsingDetails tbBlockDetails(TBBlockDetails tbBlockDetails) {
        this.tbBlockDetails = tbBlockDetails;
        return this;
    }

    public void setTbBlockDetails(TBBlockDetails tbBlockDetails) {
        this.tbBlockDetails = tbBlockDetails;
    }

    public TBSuppliesInWarehouse getTbSuppliesInWarehouse() {
        return tbSuppliesInWarehouse;
    }

    public TBSuppliesUsingDetails tbSuppliesInWarehouse(TBSuppliesInWarehouse tbSuppliesInWarehouse) {
        this.tbSuppliesInWarehouse = tbSuppliesInWarehouse;
        return this;
    }

    public void setTbSuppliesInWarehouse(TBSuppliesInWarehouse tbSuppliesInWarehouse) {
        this.tbSuppliesInWarehouse = tbSuppliesInWarehouse;
    }

    public TBActivity getTbActivity() {
        return tbActivity;
    }

    public TBSuppliesUsingDetails tbActivity(TBActivity tbActivity) {
        this.tbActivity = tbActivity;
        return this;
    }

    public void setTbActivity(TBActivity tbActivity) {
        this.tbActivity = tbActivity;
    }

    public TBGuidelineActivity getTbGuidelineActivity() {
        return tbGuidelineActivity;
    }

    public TBSuppliesUsingDetails tbGuidelineActivity(TBGuidelineActivity tbGuidelineActivity) {
        this.tbGuidelineActivity = tbGuidelineActivity;
        return this;
    }

    public void setTbGuidelineActivity(TBGuidelineActivity tbGuidelineActivity) {
        this.tbGuidelineActivity = tbGuidelineActivity;
    }

    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

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

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

    @Override
    public String toString() {
        return "TBSuppliesUsingDetails{" +
            "id=" + getId() +
            ", dosage='" + getDosage() + "'" +
            ", quantity=" + getQuantity() +
            ", cost=" + getCost() +
            ", howToUse='" + getHowToUse() + "'" +
            "}";
    }
}
