package com.eactive.eai.rms.data.entity.onl.djb.apistatus;

import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;

import com.eactive.eai.data.entity.AbstractEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;

@Data
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
@Entity
@Table(name = "API_STATUS")
public class ApiStatus extends AbstractEntity<String> {

	@Id
	@Column(name = "EAISVCNAME", length = 100)
	private String eaisvcname;
		
	@Column(name = "STATUS_CODE", length = 1)
	private String statusCode;
	
	@LastModifiedBy                          // ← EMSAuditorAware가 자동으로 채움
    @Column(name = "MODIFIED_BY", length = 50)
    private String modifiedBy = "SCHEDULER";

    @LastModifiedDate                        // ← save() 시 자동으로 sysdate 채움
    @Column(name = "MODIFIED_DATE")
    private LocalDateTime modifiedDate;
		
	@Override
	public @NonNull String getId() { return eaisvcname; }
}