package com.bio.bio_backend.domain.admin.common_code.entity;

import com.bio.bio_backend.global.constants.AppConstants;
import com.bio.bio_backend.global.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Comment;

@Entity
@Getter @Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(
    name = AppConstants.TABLE_PREFIX + "common_group_code",
    indexes = {
        @Index(name = "idx_common_group_code_code", columnList = "code")
    }
)
public class CommonGroupCode extends BaseEntity {

    @Column(name = "code", nullable = false, length = 50, unique = true)
    @Comment("코드")
    private String code;

    @Column(name = "name", nullable = false, length = 100)
    @Comment("코드명")
    private String name;

    @Column(name = "character_ref1_title", length = 100)
    @Comment("문자 참조 타이틀1")
    private String characterRef1Title;

    @Column(name = "character_ref2_title", length = 100)
    @Comment("문자 참조 타이틀2")
    private String characterRef2Title;

    @Column(name = "character_ref3_title", length = 100)
    @Comment("문자 참조 타이틀3")
    private String characterRef3Title;

    @Column(name = "character_ref4_title", length = 100)
    @Comment("문자 참조 타이틀4")
    private String characterRef4Title;

    @Column(name = "character_ref5_title", length = 100)
    @Comment("문자 참조 타이틀5")
    private String characterRef5Title;

    @Column(name = "sort_order", nullable = false)
    @Comment("정렬 순번")
    @Builder.Default
    private Integer sortOrder = 0;

    @Column(name = "use_flag", nullable = false)
    @Comment("사용 여부")
    @Builder.Default
    private Boolean useFlag = true;
}
