package com.dbnt.sims.fpiMgt.affair.model;

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

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

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "affair_rating")
@IdClass(AffairRating.AffairRatingId.class)
public class AffairRating{
  @Id
  @Column(name = "affair_key")
  private Integer affairKey;
  @Id
  @Column(name = "rating_organ")
  private String ratingOrgan;
  @Column(name = "section_nm")
  private String sectionNm;
  @Column(name = "section_apprv_dt")
  private LocalDateTime sectionApprvDt;
  @Column(name = "section_apprv")
  private String sectionApprv;
  @Column(name = "section_etc")
  private String sectionEtc;
  @Column(name = "head_nm")
  private String headNm;
  @Column(name = "head_apprv_dt")
  private LocalDateTime headApprvDt;
  @Column(name = "head_apprv")
  private String headApprv;
  @Column(name = "head_etc")
  private String headEtc;
  @Column(name = "affair_rate")
  private String affairRate;
  @Column(name = "organ_up")
  private String organUp;
  @Column(name = "affair_status")
  private String affairStatus;


  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class AffairRatingId implements Serializable {
    private Integer affairKey;
    private String ratingOrgan;
  }

}
