package com.datamate.datamanagement.domain.model.knowledge;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.datamate.common.domain.model.base.BaseEntity;
import com.datamate.datamanagement.common.enums.KnowledgeSourceType;
import com.datamate.datamanagement.common.enums.KnowledgeStatusType;
import com.datamate.datamanagement.domain.model.dataset.Tag;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.util.Collection;
import java.util.HashSet;

/**
 * 知识集实体（与数据库表 t_dm_knowledge_sets 对齐）
 */
@Getter
@Setter
@TableName(value = "t_dm_knowledge_sets", autoResultMap = true)
public class KnowledgeSet extends BaseEntity<String> {
    /**
     * 知识集名称
     */
    private String name;
    /**
     * 知识集描述
     */
    private String description;
    /**
     * 知识集状态
     */
    private KnowledgeStatusType status;
    /**
     * 领域
     */
    private String domain;
    /**
     * 业务线
     */
    private String businessLine;
    /**
     * 负责人
     */
    private String owner;
    /**
     * 有效期开始
     */
    private LocalDate validFrom;
    /**
     * 有效期结束
     */
    private LocalDate validTo;
    /**
     * 来源类型
     */
    private KnowledgeSourceType sourceType;
    /**
     * 敏感级别
     */
    private String sensitivity;
    /**
     * 标签列表
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Collection<Tag> tags = new HashSet<>();
    /**
     * 扩展元数据
     */
    private String metadata;
}
