package com.icomsys.main_vm.db.jpa.entity.conversation;

import com.icomsys.main_vm.db.jpa.entity.conversation.id.TbIcsLogId;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.time.LocalDateTime;

@Table(name = "TB_ICS_LOG")
@Entity
@Getter
@Setter
@NoArgsConstructor
@IdClass(TbIcsLogId.class)
public class TbIcsLog {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SEQ", nullable = false, length = 20)
    private Long seq;
    @Id
    @Column(name = "REGIST_DATE", nullable = false)
    private LocalDateTime registDate;
    @Id
    @Column(name = "USER_ID", nullable = false, length = 20)
    private String userId;
    @Column(name = "ACTION_CODE", nullable = false, length = 20)
    private String actionCode;
    @Column(name = "MENU_AUTH", nullable = false, length = 100)
    private String menuAuth;
    @Column(name = "IP", nullable = false, length = 20)
    private String ip;
    @Column(name = "REMARK", nullable = true, length = 1000)
    private String remark;
    @Column(name = "SERVICE_GROUP", nullable = false, length = 20)
    private String serviceGroup;
    @Column(name = "ATTRIBUTE_1", nullable = true, length = 20)
    private String attribute1;
    @Column(name = "ATTRIBUTE_2", nullable = true, length = 20)
    private String attribute2;
    @Column(name = "ATTRIBUTE_3", nullable = true, length = 20)
    private String attribute3;
    @Column(name = "ATTRIBUTE_4", nullable = true, length = 20)
    private String attribute4;

    @Builder
    public TbIcsLog(Long seq, LocalDateTime registDate, String userId, String actionCode, String menuAuth, String ip, String remark, String serviceGroup, String attribute1, String attribute2, String attribute3, String attribute4) {
        this.seq = seq;
        this.registDate = registDate;
        this.userId = userId;
        this.actionCode = actionCode;
        this.menuAuth = menuAuth;
        this.ip = ip;
        this.remark = remark;
        this.serviceGroup = serviceGroup;
        this.attribute1 = attribute1;
        this.attribute2 = attribute2;
        this.attribute3 = attribute3;
        this.attribute4 = attribute4;
    }
}
