42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace NeonSprawl.Server.Game.Quests;
|
|
|
|
/// <summary>JSON body for <c>GET /game/players/{{id}}/quest-progress</c> (NEO-119).</summary>
|
|
public sealed class QuestProgressListResponse
|
|
{
|
|
public const int CurrentSchemaVersion = 1;
|
|
|
|
[JsonPropertyName("schemaVersion")]
|
|
public int SchemaVersion { get; init; } = CurrentSchemaVersion;
|
|
|
|
[JsonPropertyName("playerId")]
|
|
public required string PlayerId { get; init; }
|
|
|
|
/// <summary>Per-player rows ordered by catalog quest <c>id</c> (ordinal).</summary>
|
|
[JsonPropertyName("quests")]
|
|
public required IReadOnlyList<QuestProgressRowJson> Quests { get; init; }
|
|
}
|
|
|
|
/// <summary>Authoritative per-player progress for one quest definition.</summary>
|
|
public sealed class QuestProgressRowJson
|
|
{
|
|
[JsonPropertyName("questId")]
|
|
public required string QuestId { get; init; }
|
|
|
|
/// <summary><c>not_started</c>, <c>active</c>, or <c>completed</c>.</summary>
|
|
[JsonPropertyName("status")]
|
|
public required string Status { get; init; }
|
|
|
|
[JsonPropertyName("currentStepIndex")]
|
|
public int CurrentStepIndex { get; init; }
|
|
|
|
/// <summary>Objective id → accumulated count for the current step only.</summary>
|
|
[JsonPropertyName("objectiveCounters")]
|
|
public required IReadOnlyDictionary<string, int> ObjectiveCounters { get; init; }
|
|
|
|
[JsonPropertyName("completedAt")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public DateTimeOffset? CompletedAt { get; init; }
|
|
}
|