From 89b64cc51bc53bcf86fa045c340b0b4984f0c5fb Mon Sep 17 00:00:00 2001 From: Simon Schulze Date: Sun, 12 Jan 2025 14:08:44 +0100 Subject: [PATCH] [F] Add country code for standings --- src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj | 2 +- .../Models/Standings/StandingRowModel.cs | 2 ++ src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj | 2 +- .../Handlers/Standings/StandingsHandlerBase.cs | 3 +++ src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj | 2 +- src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj b/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj index 75d23097..8cff5f8a 100644 --- a/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj +++ b/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj @@ -13,7 +13,7 @@ Library net8.0 iRLeagueApiCore.Client - 0.14.3 + 0.14.4 Simon Schulze Simon Schulze This package contains shared objects for all members of the iRLeagueDatabase-iRLeagueApi stack diff --git a/src/iRLeagueApiCore.Common/Models/Standings/StandingRowModel.cs b/src/iRLeagueApiCore.Common/Models/Standings/StandingRowModel.cs index f0f36f7a..f63c2741 100644 --- a/src/iRLeagueApiCore.Common/Models/Standings/StandingRowModel.cs +++ b/src/iRLeagueApiCore.Common/Models/Standings/StandingRowModel.cs @@ -88,5 +88,7 @@ public class StandingRowModel [DataMember] public int LastIrating { get; set; } [DataMember] + public string? CountryCode { get; set; } + [DataMember] public IEnumerable ResultRows { get; set; } = Array.Empty(); } diff --git a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj index 9844580c..cd11e80c 100644 --- a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj +++ b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj @@ -18,7 +18,7 @@ Library net8.0 iRLeagueApiCore.Common - 0.14.3 + 0.14.4 Simon Schulze Simon Schulze enable diff --git a/src/iRLeagueApiCore.Server/Handlers/Standings/StandingsHandlerBase.cs b/src/iRLeagueApiCore.Server/Handlers/Standings/StandingsHandlerBase.cs index 5fde5da3..9e216656 100644 --- a/src/iRLeagueApiCore.Server/Handlers/Standings/StandingsHandlerBase.cs +++ b/src/iRLeagueApiCore.Server/Handlers/Standings/StandingsHandlerBase.cs @@ -116,6 +116,9 @@ protected async Task> AlignStandingResultRows(long s TotalPoints = standingResultRow.ScoredResultRow.TotalPoints, IsScored = standingResultRow.IsScored, }).ToList(), + CountryCode = standingRow.ResultRows.Count != 0 + ? standingRow.ResultRows.OrderBy(x => x.ScoredResultRow.ScoredSessionResult.ScoredEventResult.Event.Date).Last().ScoredResultRow.CountryCode + : null, }).ToList(), }; diff --git a/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj b/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj index e3486f60..091bb322 100644 --- a/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj +++ b/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj @@ -78,7 +78,7 @@ true - 0.14.3 + 0.14.4 enable diff --git a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj index 2500deb8..c233316d 100644 --- a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj +++ b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj @@ -35,7 +35,7 @@ net8.0 12 iRLeagueDatabaseCore - 0.14.3 + 0.14.4 enable