package com.agent.management.model.entity;

import lombok.Data;

import java.time.LocalDateTime;

/**
 * 技能分类 — 自引用树结构，支持无限层级
 */
@Data
public class Category {

    private Long id;

    /** 父分类 ID，根节点为 null */
    private Long parentId;

    private String name;

    private Integer sortOrder;

    private LocalDateTime createdAt;

    private LocalDateTime updatedAt;

    public void onCreate() {
        createdAt = LocalDateTime.now();
        updatedAt = LocalDateTime.now();
    }

    public void onUpdate() {
        updatedAt = LocalDateTime.now();
    }
}
