package kr.co.zioinfo.web.model;

import jakarta.persistence.*;
import lombok.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;

@Entity @Table(name = "company_history")
@Getter @Setter @Builder @NoArgsConstructor @AllArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class CompanyHistory {

    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /** 연도 또는 기간 표시 (예: "2026", "2020–2021") */
    @Column(nullable = false, length = 20)
    private String year;

    /** 항목 내용 */
    @Column(nullable = false, length = 500)
    private String content;

    /** 같은 연도 내 순서 */
    @Column(name = "sort_order")
    private int sortOrder = 0;

    /** 노출 여부 */
    private boolean visible = true;

    @CreatedDate
    private LocalDateTime createdAt;

    @LastModifiedDate
    private LocalDateTime updatedAt;
}
