Introduce typed API responses and align workflow outputs
This commit is contained in:
56
Contracts/Responses.cs
Normal file
56
Contracts/Responses.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using GameList.Domain;
|
||||
|
||||
namespace GameList.Contracts;
|
||||
|
||||
public record SuggestionCreatedResponse(int Id);
|
||||
|
||||
public record SuggestionUpdatedResponse(
|
||||
int Id,
|
||||
string Name,
|
||||
string? Genre,
|
||||
string? Description,
|
||||
string? ScreenshotUrl,
|
||||
string? YoutubeUrl,
|
||||
string? GameUrl,
|
||||
int? MinPlayers,
|
||||
int? MaxPlayers
|
||||
);
|
||||
|
||||
public record VoteUpsertResponse(IReadOnlyList<int> SuggestionIds, int Score);
|
||||
|
||||
public record VoteFinalizeResponse(bool VotesFinal);
|
||||
|
||||
public record AdminResultsStateResponse(bool ResultsOpen, DateTimeOffset UpdatedAt);
|
||||
|
||||
public record AdminGrantJokerResponse(Guid Id, bool HasJoker);
|
||||
|
||||
public record AdminDeletePlayerResponse(Guid DeletedPlayerId);
|
||||
|
||||
public record AdminLinkSuggestionsResponse(int RootId, IReadOnlyList<int> LinkedSuggestionIds, int UnfinalizedPlayers);
|
||||
|
||||
public record AdminUnlinkSuggestionsResponse(IReadOnlyList<int> UnlinkedSuggestionIds, int UnfinalizedPlayers);
|
||||
|
||||
public record AdminResetStateResponse(Phase Phase, bool ResultsOpen, DateTimeOffset UpdatedAt);
|
||||
|
||||
public record VoteStatusResponse(IReadOnlyList<VoteStatusDto> Voters, bool Ready, IReadOnlyList<string> Waiting);
|
||||
|
||||
public record ResultItemDto(
|
||||
int Id,
|
||||
string Name,
|
||||
string? Author,
|
||||
int? MinPlayers,
|
||||
int? MaxPlayers,
|
||||
int Total,
|
||||
int Count,
|
||||
double Average,
|
||||
IReadOnlyList<int> Votes,
|
||||
int? MyVote,
|
||||
string? ScreenshotUrl,
|
||||
string? YoutubeUrl,
|
||||
string? GameUrl,
|
||||
string? Description,
|
||||
string? Genre,
|
||||
int? ParentSuggestionId,
|
||||
IReadOnlyList<int> LinkedIds,
|
||||
IReadOnlyList<string> LinkedTitles
|
||||
);
|
||||
Reference in New Issue
Block a user