using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace MoneyMap.Models; public class Category { [Key] public int Id { get; set; } [Required] [MaxLength(100)] public string Name { get; set; } = string.Empty; [MaxLength(500)] public string Description { get; set; } = string.Empty; [MaxLength(50)] public string Type { get; set; } = string.Empty; // e.g., "Expense", "Income", "Transfer" public bool IsDefault { get; set; } = false; public int? ParentCategoryId { get; set; } public Category? ParentCategory { get; set; } public ICollection Children { get; set; } = new List(); public ICollection RecurringPlaces { get; set; } = new List(); public ICollection CategoryMappings { get; set; } = new List(); public ICollection Transactions { get; set; } = new List(); [NotMapped] public string DisplayLabel => Name; }