using System.Text.Json.Serialization; namespace Elternbeirat.Contracts; /// A news post. Sorted by , newest first. public record Post { /// PocketBase record id. [JsonPropertyName("id")] public string Id { get; init; } = ""; /// /// Publication date. Stored as UTC by PocketBase but read as local time /// (Europe/Berlin) by convention; only the date part is shown. /// [JsonPropertyName("date")] public DateTime Date { get; init; } /// Post heading shown to visitors; may contain umlauts and spaces. [JsonPropertyName("title")] public string Title { get; init; } = ""; /// Post body in Markdown. [JsonPropertyName("body")] public string Body { get; init; } = ""; /// URL slug (lowercase, no umlauts), e.g. "herbstbasar" -> /posts/herbstbasar. [JsonPropertyName("slug")] public string Slug { get; init; } = ""; /// Whether the post is visible to visitors. [JsonPropertyName("public")] public bool Public { get; init; } }