package cn.palmte.work.model.process;

import org.hibernate.Hibernate;
import org.hibernate.annotations.GenericGenerator;

import java.util.Objects;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 供应商比选材料
 *
 * @author <a href="https://github.com/TAKETODAY">Harry Yang</a>
 * @since 2.0 2022/12/26 17:34
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "procurement_contract_supplier_material")
public class SupplierMaterial {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @GenericGenerator(name = "persistenceGenerator", strategy = "increment")
  private Integer id;

  private String companyName;
  private String totalAmount;
  private String serviceTerms;
  private String paymentTerms;
  private String taxRate;
  private String remark;

  private String attachment;

  private Integer processId;

  private Integer contractId;

  @Override
  public boolean equals(Object o) {
    if (this == o)
      return true;
    if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o))
      return false;
    SupplierMaterial that = (SupplierMaterial) o;
    return id != null && Objects.equals(id, that.id);
  }

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

}
