YD_TrainingCompetition_Api/Competition/CompetitionSessionState.cs

73 lines
2.6 KiB
C#
Raw Normal View History

2026-06-10 11:16:46 +08:00
namespace YD_TrainingCompetition_Api.Competition;
public sealed class CompetitionSessionState
{
public bool Loaded { get; init; }
public string EventId { get; init; } = string.Empty;
public string EventName { get; init; } = string.Empty;
public string? RosterPath { get; init; }
public int TotalRounds { get; init; }
public int CurrentRoundIndex { get; init; }
public bool IsTesting { get; init; }
public int? TestDurationSeconds { get; init; }
2026-06-10 15:54:30 +08:00
public int? RemainingSeconds { get; init; }
public DateTimeOffset? CountdownEndsAt { get; init; }
2026-06-10 11:16:46 +08:00
public DateTimeOffset UpdatedAt { get; init; } = DateTimeOffset.UtcNow;
public IReadOnlyList<int> RoundParticipantCounts { get; init; } = [];
public IReadOnlyList<string> RoundNames { get; init; } = [];
public IReadOnlyList<CompetitionParticipantState> Participants { get; init; } = [];
}
public sealed class CompetitionParticipantState
{
public int Id { get; init; }
public string Name { get; init; } = string.Empty;
public string? ProjectName { get; init; }
public string? School { get; init; }
public string DeviceId { get; init; } = string.Empty;
public string? Rfid { get; init; }
public int RoundIndex { get; init; }
public int SlotIndex { get; init; }
public int Count { get; init; }
public int? Battery { get; init; }
public int? Mode { get; init; }
public int? RemainingSeconds { get; init; }
public bool Online { get; init; }
public DateTimeOffset? LastSeen { get; init; }
}
public sealed class CreateCompetitionSessionRequest
{
public string? EventId { get; init; }
public string? EventName { get; init; }
public string? RosterPath { get; init; }
public int? TotalRounds { get; init; }
public int? TestDurationSeconds { get; init; }
public IReadOnlyList<int>? RoundParticipantCounts { get; init; }
public IReadOnlyList<string>? RoundNames { get; init; }
public IReadOnlyList<CreateCompetitionParticipantRequest>? Participants { get; init; }
}
public sealed class CreateCompetitionParticipantRequest
{
public int? Id { get; init; }
public string? Name { get; init; }
public string? ProjectName { get; init; }
public string? School { get; init; }
public string? DeviceId { get; init; }
public string? Rfid { get; init; }
public int? RoundIndex { get; init; }
public int? SlotIndex { get; init; }
public int? Count { get; init; }
}
public sealed class CompetitionParticipantCountRequest
{
public int Count { get; init; }
}
public sealed class CompetitionParticipantDeltaRequest
{
public int Delta { get; init; }
}