| | | 1 | | using NodaTime; |
| | | 2 | | |
| | | 3 | | namespace EHonda.KicktippAi.Core; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a scheduled match between two teams. |
| | | 7 | | /// </summary> |
| | | 8 | | /// <param name="HomeTeam">The name of the home team.</param> |
| | | 9 | | /// <param name="AwayTeam">The name of the away team.</param> |
| | | 10 | | /// <param name="StartsAt"> |
| | | 11 | | /// The scheduled start time of the match. |
| | | 12 | | /// <para> |
| | | 13 | | /// <b>Important:</b> For cancelled matches (<see cref="IsCancelled"/> = true), this value is inherited from |
| | | 14 | | /// the previous match in the time slot order. This preserves database key consistency since the |
| | | 15 | | /// composite key (HomeTeam, AwayTeam, StartsAt, ...) must remain stable. See the cancellation handling |
| | | 16 | | /// documentation at <c>docs/features/cancelled-matches.md</c> for details. |
| | | 17 | | /// </para> |
| | | 18 | | /// </param> |
| | | 19 | | /// <param name="Matchday">The matchday number (e.g., 1-34 for Bundesliga).</param> |
| | | 20 | | /// <param name="IsCancelled"> |
| | | 21 | | /// Indicates whether the match has been cancelled (German: "Abgesagt"). |
| | | 22 | | /// <para> |
| | | 23 | | /// When true, the match appears on the Kicktipp page with "Abgesagt" instead of a date/time. |
| | | 24 | | /// Cancelled matches can still receive predictions, but their <see cref="StartsAt"/> value |
| | | 25 | | /// is inherited from the previous match slot (not a valid scheduled time). |
| | | 26 | | /// </para> |
| | | 27 | | /// <para> |
| | | 28 | | /// <b>Design Decision:</b> We continue processing cancelled matches rather than skipping them because: |
| | | 29 | | /// (1) users can still place predictions on Kicktipp, and (2) when rescheduled, we want to have |
| | | 30 | | /// a prediction in place. The old prediction will carry over when the match gets a new time slot. |
| | | 31 | | /// See <c>docs/features/cancelled-matches.md</c> for complete rationale. |
| | | 32 | | /// </para> |
| | | 33 | | /// </param> |
| | 1 | 34 | | public record Match( |
| | 1 | 35 | | string HomeTeam, |
| | 1 | 36 | | string AwayTeam, |
| | 1 | 37 | | ZonedDateTime StartsAt, |
| | 1 | 38 | | int Matchday, |
| | 1 | 39 | | bool IsCancelled = false); |