namespace Marathon.Infrastructure.Persistence.Entities; /// /// EF Core persistence entity for a user-tracked . /// Flattens the embedded Bet selection (Scope / Type / Side / Value / Rate) /// into columns so SQLite can index by event and outcome cheaply. /// public sealed class PlacedBetEntity { /// GUID primary key stored as TEXT. public string Id { get; set; } = default!; /// Foreign key to . public string EventCode { get; set; } = default!; // ─── Embedded Bet selection ────────────────────────────────────────────── /// Scope discriminator: 0 = Match, 1 = Period. public int Scope { get; set; } /// Period number when = 1; null otherwise. public int? PeriodNumber { get; set; } /// BetType as int (Win / Draw / WinFora / Total). public int Type { get; set; } /// Side as int (Side1 / Side2 / Draw / Less / More). public int Side { get; set; } /// Handicap or total threshold; null for Win / Draw markets. public decimal? Value { get; set; } /// Decimal odds the user took. public decimal Rate { get; set; } // ─── Wager fields ──────────────────────────────────────────────────────── /// Stake in the user's currency. public decimal Stake { get; set; } /// ISO 8601 timestamp when the bet was recorded (Moscow time). public string PlacedAt { get; set; } = default!; /// BetOutcome as int (Pending / Won / Lost / Void). public int Outcome { get; set; } /// Optional free-text note from the user. public string? Notes { get; set; } }