package com.dbnt.sims.authMgt.model;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "approval_config")
@IdClass(ApprovalConfig.ApprovalConfigId.class)
public class ApprovalConfig {
  @Id
  @Column(name = "menu_key")
  private Integer menuKey;
  @Id
  @Column(name = "user_seq")
  private Integer userSeq;
  @Column(name = "approval_auth")
  private String approvalAuth;

  @Transient
  private String cat1Cd;
  @Transient
  private String cat2Cd;
  @Transient
  private String cat3Cd;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class ApprovalConfigId implements Serializable {
    private Integer menuKey;
    private Integer userSeq;
  }

}
