Add PocketBase client with contracts and sharp build tooling

This commit is contained in:
tleininger committed 2026-09-22 19:32:32 +02:00
1 parent 56922707ea
commit 251f2d818b
24 files changed
+578 -20

No files matched your search

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