package com.agent.management.model.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import lombok.Data;

import java.time.Instant;

@Data
@Entity
@Table(name = "rag_graph_governance_config",
        uniqueConstraints = @UniqueConstraint(name = "uk_rag_graph_governance_source",
                columnNames = "graph_source_id"))
public class RagGraphGovernanceConfigEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "graph_source_id", nullable = false)
    private Long graphSourceId;

    @Column(name = "config_json", nullable = false, columnDefinition = "CLOB")
    private String configJson;

    @Column(name = "schema_version", nullable = false, length = 64)
    private String schemaVersion;

    @Column(name = "updated_at", nullable = false)
    private Instant updatedAt;
}
