package org.raddatz.familienarchiv.tag;

import java.util.UUID;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.*;

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Tag {
    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
    private UUID id;

    @Column(unique = true, nullable = false)
    @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    /** UUID of the parent tag, or null for root-level tags. */
    @Column(name = "parent_id")
    private UUID parentId;

    /** Color token name (e.g. "sage"), only set on root-level tags. Null means no color. */
    private String color;
}
