using System.Text.Json.Serialization;
namespace Elternbeirat.Contracts;
///
/// A content page. Pages also drive the site navigation:
/// and decide where and in which order a page appears in the
/// header or footer menu, and lists dynamic blocks (posts,
/// events, faqs) rendered below the page body.
///
public record Page
{
/// PocketBase record id.
[JsonPropertyName("id")]
public string Id { get; init; } = "";
/// Heading shown to visitors; may contain umlauts and spaces.
[JsonPropertyName("title")]
public string Title { get; init; } = "";
/// Page body in Markdown.
[JsonPropertyName("body")]
public string Body { get; init; } = "";
/// Where the page appears in the navigation: "header" or "footer".
[JsonPropertyName("location")]
public string Location { get; init; } = "";
/// Sort order within its navigation location; smaller is earlier.
[JsonPropertyName("order")]
public double Order { get; init; }
/// URL slug (lowercase, no umlauts), e.g. "board" -> /board.
[JsonPropertyName("slug")]
public string Slug { get; init; } = "";
///
/// Dynamic blocks to render below the body: any of "posts", "events", "faqs".
/// Empty for a plain text page.
///
[JsonPropertyName("embed")]
public IReadOnlyList Embed { get; init; } = [];
/// Whether the page is visible to visitors.
[JsonPropertyName("public")]
public bool Public { get; init; }
}