using System.ComponentModel.DataAnnotations;

namespace ERPCore.Dtos.Categories;

/// <summary>Flat category resource (docs/11-BACKEND-PHASE1.md §2.3).</summary>
public sealed record CategoryDto(int CategoryId, string Name, int? ParentId);

/// <summary>Nested category node for <c>GET /categories?tree=true</c>.</summary>
public sealed record CategoryTreeDto(int CategoryId, string Name, int? ParentId, IReadOnlyList<CategoryTreeDto> Children);

public sealed class CreateCategoryRequest
{
    [Required, StringLength(200)] public string Name { get; set; } = string.Empty;
    public int? ParentId { get; set; }
}
