This commit is contained in:
2026-03-29 23:47:31 +02:00
commit 216d5d2280
75 changed files with 5702 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
namespace LehrerApp.Sync.Models;
/// <summary>
/// Event das die WebApp oder Companion-App erzeugt.
/// Payload ist NICHT verschlüsselt JWT schützt den Transport.
/// Der Desktop-Client erkennt PlainEvents am DeviceType
/// und wendet sie ohne Entschlüsselung an.
/// </summary>
public class PlainSyncEvent
{
public Guid EventId { get; init; } = Guid.NewGuid();
public string DeviceId { get; init; } = "";
public DeviceType DeviceType { get; init; } = DeviceType.Companion;
public DateTime Timestamp { get; init; } = DateTime.UtcNow;
public string EntityType { get; init; } = ""; // "Grade", "Exam", ...
public string EntityId { get; init; } = "";
public string Operation { get; init; } = ""; // "Upsert", "Delete"
public string Payload { get; init; } = ""; // JSON, Klartext
}
/// <summary>
/// Antwort auf einen Plain-Push.
/// </summary>
public class PlainPushResponse
{
public bool Success { get; init; }
public long ServerSequenceNr { get; init; }
public List<Guid> RejectedEventIds { get; init; } = [];
public string? ErrorMessage { get; init; }
}