using System.Text.Json.Serialization; namespace Elternbeirat.Contracts; /// /// A news post of the site, as stored in PocketBase. /// /// /// Post lists are ordered by , newest first. /// public record Post { /// /// Gets the PocketBase record id. /// [JsonPropertyName("id")] public string Id { get; init; } = ""; /// /// Gets the publication date as Europe/Berlin wall-clock time. /// /// /// PocketBase stores the value in UTC; it is converted to Berlin local time on /// deserialization, with daylight saving applied. Only the date part is shown. /// [JsonPropertyName("date")] public DateTime Date { get; init; } /// /// Gets the heading shown to visitors. /// /// /// Free text; may contain umlauts and spaces. For the URL, see . /// [JsonPropertyName("title")] public string Title { get; init; } = ""; /// /// Gets the post body as Markdown. /// [JsonPropertyName("body")] public string Body { get; init; } = ""; /// /// Gets the URL slug of the post, e.g. "herbstbasar" for /posts/herbstbasar. /// /// /// A lowercase path segment without umlauts. /// [JsonPropertyName("slug")] public string Slug { get; init; } = ""; /// /// Gets a value indicating whether the post is visible to visitors of the site. /// [JsonPropertyName("public")] public bool Public { get; init; } }