namespace CMSDAL.DTO.Navigation; // LinkType values — 0=InternalPage, 1=ExternalURL, 2=Anchor, 3=Group (no link, header for a // submenu). Kept as a plain byte (not a C# enum) to match the DB TINYINT column and every // other CMS status-style field in this module (ContentStatus, SharingMode, etc.). public static class NavigationLinkType { public const byte InternalPage = 0; public const byte ExternalUrl = 1; public const byte Anchor = 2; public const byte Group = 3; } public class NavigationItemDTO { public int NavigationItemId { get; set; } public int NavigationId { get; set; } public int? ParentNavigationItemId { get; set; } public string Label { get; set; } = string.Empty; public byte LinkType { get; set; } public int? SitePageId { get; set; } public string? ExternalUrl { get; set; } public short PositionNo { get; set; } public bool IsNewTab { get; set; } public byte Status { get; set; } public int TenantId { get; set; } public int CreatedById { get; set; } public System.DateTime CreatedOn { get; set; } public int ModifiedById { get; set; } public System.DateTime ModifiedOn { get; set; } } // Flat row GetNavigationTree resolves from the DB, with the referenced SitePage's UrlPath // already joined in (so ResolvedUrl is populated regardless of LinkType, no second lookup // needed by callers). public class NavigationItemFlatDTO { public int NavigationItemId { get; set; } public int? ParentNavigationItemId { get; set; } public string Label { get; set; } = string.Empty; public byte LinkType { get; set; } public int? SitePageId { get; set; } public string? SitePageUrlPath { get; set; } public string? ExternalUrl { get; set; } public short PositionNo { get; set; } public bool IsNewTab { get; set; } } // The resolved tree GetNavigationTree returns — built in-memory from NavigationItemFlatDTO // rows rather than a recursive CTE (nav trees are shallow; keeps the query simple). public class NavigationItemNodeDTO { public int NavigationItemId { get; set; } public string Label { get; set; } = string.Empty; public byte LinkType { get; set; } public string? ResolvedUrl { get; set; } public bool IsNewTab { get; set; } public System.Collections.Generic.List Children { get; set; } = new(); }