73 lines
2.0 KiB
C#
73 lines
2.0 KiB
C#
using System.Text.Json;
|
||
|
||
namespace Server.WatchBody.Web.Dto;
|
||
|
||
/// <summary>Ответы API (specs 03–05); сериализация camelCase, null-поля опускаются.</summary>
|
||
public class SyncResponse
|
||
{
|
||
public List<Guid> Accepted { get; set; } = [];
|
||
}
|
||
|
||
public class ErrorResponse
|
||
{
|
||
public string Error { get; set; } = string.Empty;
|
||
}
|
||
|
||
public class WorkoutSetDto
|
||
{
|
||
public Guid SetId { get; set; }
|
||
public Guid? ExerciseId { get; set; }
|
||
public int Seq { get; set; }
|
||
public decimal WeightKg { get; set; }
|
||
public int Reps { get; set; }
|
||
public DateTime DoneAt { get; set; }
|
||
public string Source { get; set; } = string.Empty;
|
||
public bool InPlan { get; set; }
|
||
public int? Rpe { get; set; }
|
||
public int? KneePain { get; set; }
|
||
}
|
||
|
||
public class WorkoutDto
|
||
{
|
||
public Guid WorkoutId { get; set; }
|
||
public DateTime StartedAt { get; set; }
|
||
public DateTime? EndedAt { get; set; }
|
||
public string Status { get; set; } = string.Empty;
|
||
public string SessionKind { get; set; } = string.Empty;
|
||
public int? AvgHr { get; set; }
|
||
public List<WorkoutSetDto> Sets { get; set; } = [];
|
||
}
|
||
|
||
public class WorkoutListResponse
|
||
{
|
||
public List<WorkoutDto> Items { get; set; } = [];
|
||
public int Total { get; set; }
|
||
}
|
||
|
||
public class CommandLogDto
|
||
{
|
||
public Guid Id { get; set; }
|
||
public int TOffsetS { get; set; }
|
||
public string RecognizedText { get; set; } = string.Empty;
|
||
public JsonElement Semantics { get; set; }
|
||
public bool Accepted { get; set; }
|
||
}
|
||
|
||
public class WorkoutCardResponse : WorkoutDto
|
||
{
|
||
public List<CommandLogDto> CommandLog { get; set; } = [];
|
||
}
|
||
|
||
public class ActiveProgramResponse
|
||
{
|
||
public int ProgramId { get; set; }
|
||
public Guid VersionId { get; set; }
|
||
public int Version { get; set; }
|
||
public int? BasedOnVersion { get; set; }
|
||
public string Author { get; set; } = string.Empty;
|
||
public string Status { get; set; } = string.Empty;
|
||
public JsonElement Body { get; set; }
|
||
public string? Rationale { get; set; }
|
||
public DateTime CreatedAt { get; set; }
|
||
}
|