Skip reveal phase and freeze titles after suggestions
This commit is contained in:
@@ -49,7 +49,6 @@ public static class StateEndpoints
|
||||
return Results.BadRequest(new { error = "Results are locked until the admin enables them." });
|
||||
}
|
||||
|
||||
// Non-admins can only move forward
|
||||
player.CurrentPhase = next;
|
||||
await db.SaveChangesAsync();
|
||||
return Results.Ok(new { player.CurrentPhase, appState.ResultsOpen });
|
||||
@@ -90,8 +89,8 @@ public static class StateEndpoints
|
||||
|
||||
private static Phase NextPhase(Phase current) => current switch
|
||||
{
|
||||
Phase.Suggest => Phase.Reveal,
|
||||
Phase.Reveal => Phase.Vote,
|
||||
Phase.Suggest => Phase.Vote,
|
||||
Phase.Reveal => Phase.Vote, // legacy safety
|
||||
Phase.Vote => Phase.Results,
|
||||
_ => Phase.Results
|
||||
};
|
||||
@@ -99,8 +98,8 @@ public static class StateEndpoints
|
||||
private static Phase PrevPhase(Phase current) => current switch
|
||||
{
|
||||
Phase.Results => Phase.Vote,
|
||||
Phase.Vote => Phase.Reveal,
|
||||
Phase.Reveal => Phase.Suggest,
|
||||
Phase.Vote => Phase.Suggest,
|
||||
Phase.Reveal => Phase.Suggest, // legacy safety
|
||||
_ => Phase.Suggest
|
||||
};
|
||||
}
|
||||
|
||||
@@ -187,8 +187,8 @@ public static class SuggestEndpoints
|
||||
var player = await EndpointHelpers.GetAuthenticatedPlayer(ctx, db);
|
||||
if (player is null) return Results.Unauthorized();
|
||||
var phase = await EndpointHelpers.GetPhase(db, player.Id);
|
||||
if (phase < Phase.Reveal)
|
||||
return EndpointHelpers.PhaseMismatch(Phase.Reveal, phase);
|
||||
if (phase < Phase.Vote)
|
||||
return EndpointHelpers.PhaseMismatch(Phase.Vote, phase);
|
||||
|
||||
var all = await db.Suggestions.AsNoTracking()
|
||||
.Include(s => s.Player)
|
||||
|
||||
Reference in New Issue
Block a user