package com.smyhub.infogenie.infogeniebackendjava.entity;

import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.LocalDateTime;

/**
 * Maps to the site_ai_runtime table (singleton row id=1).
 * When api_base and api_key are both non-empty, DeepSeek calls use this
 * runtime-configured endpoint instead of the ai_configs table entry.
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "site_ai_runtime")
public class SiteAIRuntime {

    @Id
    private Long id;

    @Column(name = "api_base", length = 500)
    private String apiBase;

    @Column(name = "api_key", length = 500)
    private String apiKey;

    @Column(name = "default_model", length = 100)
    private String defaultModel;

    @Column(name = "default_provider", length = 50)
    private String defaultProvider;

    @UpdateTimestamp
    @Column(name = "updated_at")
    private LocalDateTime updatedAt;
}
