| | | 1 | | using NodaTime; |
| | | 2 | | |
| | | 3 | | namespace EHonda.KicktippAi.Core; |
| | | 4 | | |
| | | 5 | | public enum MatchOutcomeAvailability |
| | | 6 | | { |
| | | 7 | | Pending, |
| | | 8 | | Completed |
| | | 9 | | } |
| | | 10 | | |
| | | 11 | | public enum MatchOutcomeWriteDisposition |
| | | 12 | | { |
| | | 13 | | Created, |
| | | 14 | | Updated, |
| | | 15 | | Unchanged |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | public record CollectedMatchOutcome( |
| | | 19 | | string HomeTeam, |
| | | 20 | | string AwayTeam, |
| | | 21 | | ZonedDateTime StartsAt, |
| | | 22 | | int Matchday, |
| | | 23 | | int? HomeGoals, |
| | | 24 | | int? AwayGoals, |
| | | 25 | | MatchOutcomeAvailability Availability, |
| | | 26 | | string? TippSpielId = null) |
| | | 27 | | { |
| | | 28 | | public bool HasOutcome => Availability == MatchOutcomeAvailability.Completed; |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | public record PersistedMatchOutcome( |
| | | 32 | | string CommunityContext, |
| | | 33 | | string Competition, |
| | | 34 | | string HomeTeam, |
| | | 35 | | string AwayTeam, |
| | | 36 | | ZonedDateTime StartsAt, |
| | | 37 | | int Matchday, |
| | | 38 | | int? HomeGoals, |
| | | 39 | | int? AwayGoals, |
| | | 40 | | MatchOutcomeAvailability Availability, |
| | | 41 | | string? TippSpielId, |
| | | 42 | | DateTimeOffset CreatedAt, |
| | | 43 | | DateTimeOffset UpdatedAt) |
| | | 44 | | { |
| | | 45 | | public bool HasOutcome => Availability == MatchOutcomeAvailability.Completed; |
| | | 46 | | } |
| | | 47 | | |
| | 1 | 48 | | public record MatchOutcomeUpsertResult( |
| | 1 | 49 | | MatchOutcomeWriteDisposition Disposition, |
| | 0 | 50 | | PersistedMatchOutcome Outcome); |