namespace LehrerApp.Sync.Models; /// /// 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. /// 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 } /// /// Antwort auf einen Plain-Push. /// public record class PlainPushResponse { public bool Success { get; init; } public long ServerSequenceNr { get; init; } public List RejectedEventIds { get; init; } = []; public string? ErrorMessage { get; init; } }