using System.Text.Json.Serialization;
namespace Elternbeirat.Contracts;
/// A calendar entry. Sorted by .
public record Event
{
/// PocketBase record id.
[JsonPropertyName("id")]
public string Id { get; init; } = "";
///
/// Start of the event with date and time. Stored as UTC by PocketBase but
/// read as local time (Europe/Berlin) by convention. An all-day event uses
/// 00:00 as the time.
///
[JsonPropertyName("start")]
public DateTime Start { get; init; }
/// Optional end of the event; null when unset.
[JsonPropertyName("end")]
public DateTime? End { get; init; }
/// Event name, e.g. "Elternbeiratssitzung".
[JsonPropertyName("title")]
public string Title { get; init; } = "";
/// Optional location, e.g. "Aula".
[JsonPropertyName("location")]
public string Location { get; init; } = "";
/// Optional note, e.g. "Anmeldung erforderlich".
[JsonPropertyName("note")]
public string Note { get; init; } = "";
/// Whether the event is visible to visitors.
[JsonPropertyName("public")]
public bool Public { get; init; }
}