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

import com.icomsys.main_vm.db.jpa.entity.system.id.TbIcsOprMngInfoId;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;

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

@Table(name = "TB_ICS_OPR_MNG_INFO")
@Entity
@Getter
@Setter
@NoArgsConstructor
@DynamicUpdate
@IdClass(TbIcsOprMngInfoId.class)
public class TbIcsOprMngInfo {

    @Id
    @Column(name = "CUST_CODE", nullable = false, length = 40)
    private String custCode;
    @Id
    @Column(name = "SERVICE_CODE", nullable = false, length = 40)
    private String serviceGroup;
    @Id
    @Column(name = "OPR_MNG_CODE", nullable = false, length = 100)
    private String oprMngCode;
    @Id
    @Column(name = "SOL_VAL", nullable = false, length = 40)
    private String solVal;
    @Column(name = "DTMF", nullable = true)
    private int dtmf;
    @Column(name = "ROUTE_URL", nullable = true, length = 200)
    private String routeUrl;
    @Column(name = "USE_YN", nullable = false, length = 1)
    private String useYn;
    @Column(name = "REGIST_ID", nullable = false, length = 20)
    private String registId;
    @Column(name = "REGIST_DATE", nullable = false)
    private LocalDateTime registDate;
    @Column(name = "UPDATE_ID", nullable = true, length = 20)
    private String updateId;
    @Column(name = "UPDATE_DATE", nullable = true)
    private LocalDateTime updateDate;

    @Builder
    public TbIcsOprMngInfo(String custCode, String serviceGroup, String oprMngCode, String solVal, int dtmf, String routeUrl, String useYn, String registId, LocalDateTime registDate, String updateId, LocalDateTime updateDate) {
        this.custCode = custCode;
        this.serviceGroup = serviceGroup;
        this.oprMngCode = oprMngCode;
        this.solVal = solVal;
        this.dtmf = dtmf;
        this.routeUrl = routeUrl;
        this.useYn = useYn;
        this.registId = registId;
        this.registDate = registDate;
        this.updateId = updateId;
        this.updateDate = updateDate;
    }
}
