40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Elternbeirat.Contracts;
|
|
|
|
/// <summary>A calendar entry. Sorted by <see cref="Start"/>.</summary>
|
|
public record Event
|
|
{
|
|
/// <summary>PocketBase record id.</summary>
|
|
[JsonPropertyName("id")]
|
|
public string Id { get; init; } = "";
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
[JsonPropertyName("start")]
|
|
public DateTime Start { get; init; }
|
|
|
|
/// <summary>Optional end of the event; null when unset.</summary>
|
|
[JsonPropertyName("end")]
|
|
public DateTime? End { get; init; }
|
|
|
|
/// <summary>Event name, e.g. "Elternbeiratssitzung".</summary>
|
|
[JsonPropertyName("title")]
|
|
public string Title { get; init; } = "";
|
|
|
|
/// <summary>Optional location, e.g. "Aula".</summary>
|
|
[JsonPropertyName("location")]
|
|
public string Location { get; init; } = "";
|
|
|
|
/// <summary>Optional note, e.g. "Anmeldung erforderlich".</summary>
|
|
[JsonPropertyName("note")]
|
|
public string Note { get; init; } = "";
|
|
|
|
/// <summary>Whether the event is visible to visitors.</summary>
|
|
[JsonPropertyName("public")]
|
|
public bool Public { get; init; }
|
|
}
|