package com.ecep.contract.ds.customer.model;

import com.ecep.contract.model.IdentityEntity;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.*;
import lombok.*;

import java.util.Objects;

/**
 * 销售订单发票
 */
@Getter
@Setter
@RequiredArgsConstructor
@Entity
@Table(name = "SALES_ORDER_INVOICE", schema = "supplier_ms")
@ToString
public class SalesOrderInvoice implements IdentityEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", nullable = false)
    private Integer id;

    @Override
    public final boolean equals(Object o) {
        if (this == o) return true;
        if (o == null) return false;
        if (HibernateProxyUtils.isNotEffectiveClassEquals(o, this)) {
            return false;
        }
        SalesOrderInvoice that = (SalesOrderInvoice) o;
        return getId() != null && Objects.equals(getId(), that.getId());
    }

    @Override
    public final int hashCode() {
        return HibernateProxyUtils.hashCode(this);
    }


}
