This commit is contained in:
2025-12-26 16:40:32 +03:00
commit 4f1be2c3db
37 changed files with 2222 additions and 0 deletions

36
Models/Node.cs Normal file
View File

@@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace public_valetax.Models
{
[Table("nodes")]
public class Node
{
[Key]
[Column("id")]
public long Id { get; set; }
[Required]
[Column("tree_id")]
public long TreeId { get; set; }
[Column("parent_id")]
public long? ParentId { get; set; }
[Required]
[Column("name")]
public string Name { get; set; } = string.Empty;
[Column("created_at")]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// Navigation properties
[ForeignKey("TreeId")]
public Tree Tree { get; set; } = null!;
[ForeignKey("ParentId")]
public Node? Parent { get; set; }
public ICollection<Node> Children { get; set; } = [];
}
}