package vn.azteam.tpf.domain;

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.time.Instant;
import java.util.Objects;

/**
 * A TBNotification.
 */
@Entity
@Table(name = "tb_notification")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "smf_tbnotification")
public class TBNotification implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

    @Column(name = "send_from")
    private Long sendFrom;

    @Column(name = "send_to")
    private Long sendTo;

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

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

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

    @Column(name = "tb_crop_id")
    private Long tbCropId;

    @Column(name = "tb_entity_id")
    private Long tbEntityId;

    @Column(name = "click_action")
    private String clickAction;

    @Column(name = "jhi_contents")
    private String contents;

    @Column(name = "created_date")
    private Instant createdDate;

    @Column(name = "send_date")
    private Instant sendDate;

    @Column(name = "is_read")
    private Integer isRead;

    @Column(name = "is_test_message")
    private Integer isTestMessage;

    @Column(name = "jhi_type")
    private String type;

    @Column(name = "external_id")
    private Long externalId;

    // 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 getChannel() {
        return channel;
    }

    public TBNotification channel(String channel) {
        this.channel = channel;
        return this;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public Long getSendFrom() {
        return sendFrom;
    }

    public TBNotification sendFrom(Long sendFrom) {
        this.sendFrom = sendFrom;
        return this;
    }

    public void setSendFrom(Long sendFrom) {
        this.sendFrom = sendFrom;
    }

    public Long getSendTo() {
        return sendTo;
    }

    public TBNotification sendTo(Long sendTo) {
        this.sendTo = sendTo;
        return this;
    }

    public void setSendTo(Long sendTo) {
        this.sendTo = sendTo;
    }

    public String getSubject() {
        return subject;
    }

    public TBNotification subject(String subject) {
        this.subject = subject;
        return this;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getMessage() {
        return message;
    }

    public TBNotification message(String message) {
        this.message = message;
        return this;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getStatus() {
        return status;
    }

    public TBNotification status(String status) {
        this.status = status;
        return this;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long getTbCropId() {
        return tbCropId;
    }

    public TBNotification tbCropId(Long tbCropId) {
        this.tbCropId = tbCropId;
        return this;
    }

    public void setTbCropId(Long tbCropId) {
        this.tbCropId = tbCropId;
    }

    public Long getTbEntityId() {
        return tbEntityId;
    }

    public TBNotification tbEntityId(Long tbEntityId) {
        this.tbEntityId = tbEntityId;
        return this;
    }

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

    public String getClickAction() {
        return clickAction;
    }

    public TBNotification clickAction(String clickAction) {
        this.clickAction = clickAction;
        return this;
    }

    public void setClickAction(String clickAction) {
        this.clickAction = clickAction;
    }

    public String getContents() {
        return contents;
    }

    public TBNotification contents(String contents) {
        this.contents = contents;
        return this;
    }

    public void setContents(String contents) {
        this.contents = contents;
    }

    public Instant getCreatedDate() {
        return createdDate;
    }

    public TBNotification createdDate(Instant createdDate) {
        this.createdDate = createdDate;
        return this;
    }

    public void setCreatedDate(Instant createdDate) {
        this.createdDate = createdDate;
    }

    public Instant getSendDate() {
        return sendDate;
    }

    public TBNotification sendDate(Instant sendDate) {
        this.sendDate = sendDate;
        return this;
    }

    public void setSendDate(Instant sendDate) {
        this.sendDate = sendDate;
    }

    public Integer getIsRead() {
        return isRead;
    }

    public TBNotification isRead(Integer isRead) {
        this.isRead = isRead;
        return this;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }

    public Integer getIsTestMessage() {
        return isTestMessage;
    }

    public TBNotification isTestMessage(Integer isTestMessage) {
        this.isTestMessage = isTestMessage;
        return this;
    }

    public void setIsTestMessage(Integer isTestMessage) {
        this.isTestMessage = isTestMessage;
    }

    public String getType() {
        return type;
    }

    public TBNotification type(String type) {
        this.type = type;
        return this;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getExternalId() {
        return externalId;
    }

    public TBNotification externalId(Long externalId) {
        this.externalId = externalId;
        return this;
    }

    public void setExternalId(Long externalId) {
        this.externalId = externalId;
    }
    // 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;
        }
        TBNotification tBNotification = (TBNotification) o;
        if (tBNotification.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), tBNotification.getId());
    }

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

    @Override
    public String toString() {
        return "TBNotification{" +
            "id=" + getId() +
            ", channel='" + getChannel() + "'" +
            ", sendFrom=" + getSendFrom() +
            ", sendTo=" + getSendTo() +
            ", subject='" + getSubject() + "'" +
            ", message='" + getMessage() + "'" +
            ", status='" + getStatus() + "'" +
            ", tbCropId=" + getTbCropId() +
            ", tbEntityId=" + getTbEntityId() +
            ", clickAction='" + getClickAction() + "'" +
            ", contents='" + getContents() + "'" +
            ", createdDate='" + getCreatedDate() + "'" +
            ", sendDate='" + getSendDate() + "'" +
            ", isRead=" + getIsRead() +
            ", isTestMessage=" + getIsTestMessage() +
            ", type='" + getType() + "'" +
            ", externalId=" + getExternalId() +
            "}";
    }
}
