package dev.lions.unionflow.server.entity;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * Entité Configuration pour la gestion de la configuration système
 * 
 * @author UnionFlow Team
 * @version 1.0
 */
@Entity
@Table(name = "configurations")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
public class Configuration extends BaseEntity {

    @NotBlank
    @Column(name = "cle", nullable = false, unique = true, length = 255)
    private String cle;

    @Column(name = "valeur", columnDefinition = "TEXT")
    private String valeur;

    @Column(name = "type", length = 50)
    private String type; // STRING, NUMBER, BOOLEAN, JSON, DATE

    @Column(name = "categorie", length = 50)
    private String categorie; // SYSTEME, SECURITE, NOTIFICATION, INTEGRATION, APPEARANCE

    @Column(name = "description", length = 1000)
    private String description;

    @Column(name = "modifiable")
    @Builder.Default
    private Boolean modifiable = true;

    @Column(name = "visible")
    @Builder.Default
    private Boolean visible = true;

    @Column(name = "metadonnees", columnDefinition = "TEXT")
    private String metadonnees; // JSON string pour stocker les métadonnées
}

