Files
SVSimServer/SVSim.EmulatedEntrypoint/Models/Dtos/ArenaColosseum/ColosseumEventInfo.cs
gamer147 110867358c feat(arena-colosseum): lobby + constructed entry (phase 1)
Closes 5 of arena-colosseum's 16 spec shapes (1/16 → 6/16). Lobby reads
(/top, /get_fee_info, /event_info) render an empty "no event scheduled"
payload by default; /entry + /register_deck activate via admin-flipped
ColosseumSeason + ColosseumRounds config sections.

* Schema: ViewerArenaColosseumRun standalone table (unique on ViewerId)
  with jsonb run-state columns mirroring ViewerArenaTwoPickRun.
* Config sections: ColosseumSeasonConfig (event-level), ColosseumRoundsConfig
  (the 3-round bracket). Empty defaults — IsColosseumPeriod=false.
* Migration AddArenaColosseumRun (DDL only; seed rows come from the section
  ShippedDefaults via EnsureSeedDataAsync).
* DTOs: ColosseumLobbyInfo (round-level, /top + /get_fee_info), ColosseumEventInfo
  (event-level, /event_info), ColosseumOwnStatus (shared status block),
  ColosseumEntryRef, ColosseumFeeList, ColosseumUserDeck, ColosseumBattleResults,
  ColosseumRoundDetail + ColosseumGroupRow. EventInfoResponse uses explicit
  [JsonPropertyName("1"|"2"|"3")] for the string-keyed rounds shape per spec.
* Controller: ArenaColosseumController replaces the 1-action stub with
  the five lifecycle endpoints. /top emits leader_skin_id even when 0
  (project_wire_null_policy override).
* Tests: 11 controller-level tests + 6 config round-trip tests covering
  empty-season payloads, run-seeded /top round-trip, crystal/rupy entry
  debits, now_round_id mismatch rejection, deck_no_list round-trip + reject.
2026-06-13 12:16:22 -04:00

64 lines
2.2 KiB
C#

using System.Text.Json.Serialization;
using MessagePack;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.ArenaColosseum;
/// <summary>
/// Event-level descriptor used by <c>/event_info</c> only — distinct shape from
/// <see cref="ColosseumInfo"/>: only <c>format</c>, the event window, the announce id,
/// and the final-round eliminate count. The client's <c>ColosseumDetailTask</c> reads
/// these five fields plus the three string-keyed rounds.
/// </summary>
[MessagePackObject]
public class ColosseumEventInfo
{
/// <summary>Event format. Mapped via <c>ApiRuleParseAndSet</c> on the client.</summary>
[JsonPropertyName("format")] [Key("format")]
public int Format { get; set; }
[JsonPropertyName("start_time")] [Key("start_time")]
public string StartTime { get; set; } = "";
[JsonPropertyName("end_time")] [Key("end_time")]
public string EndTime { get; set; } = "";
/// <summary>Optional — emit <c>null</c> when no announce content is configured.</summary>
[JsonPropertyName("announce_id")] [Key("announce_id")]
public string? AnnounceId { get; set; }
[JsonPropertyName("final_round_eliminate_count")] [Key("final_round_eliminate_count")]
public int FinalRoundEliminateCount { get; set; }
}
[MessagePackObject]
public class ColosseumRoundDetail
{
[JsonPropertyName("start_time")] [Key("start_time")]
public string StartTime { get; set; } = "";
[JsonPropertyName("end_time")] [Key("end_time")]
public string EndTime { get; set; } = "";
[JsonPropertyName("is_now_round")] [Key("is_now_round")]
public bool IsNowRound { get; set; }
[JsonPropertyName("round_detail")] [Key("round_detail")]
public List<ColosseumGroupRow> RoundDetail { get; set; } = new();
}
[MessagePackObject]
public class ColosseumGroupRow
{
[JsonPropertyName("group")] [Key("group")]
public string Group { get; set; } = "";
[JsonPropertyName("max_battle_count")] [Key("max_battle_count")]
public int MaxBattleCount { get; set; }
[JsonPropertyName("breakthrough_number")] [Key("breakthrough_number")]
public int BreakthroughNumber { get; set; }
[JsonPropertyName("entry_number")] [Key("entry_number")]
public int EntryNumber { get; set; }
}