31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
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; }
|
||
}
|