diff --git a/src/Turnierplan.App/Client/src/app/i18n/de.ts b/src/Turnierplan.App/Client/src/app/i18n/de.ts
index 590b53c0..05c8ca19 100644
--- a/src/Turnierplan.App/Client/src/app/i18n/de.ts
+++ b/src/Turnierplan.App/Client/src/app/i18n/de.ts
@@ -519,6 +519,11 @@ export const de = {
MatchWonPoints: 'Punkte für Sieg:',
MatchDrawnPoints: 'Punkte für Unentschieden:',
MatchLostPoints: 'Punkte für Niederlage:',
+ HigherScoreLoses: {
+ Label: 'Ergebnis invertieren:',
+ Tooltip: 'Wenn aktiviert, ist diejenige Mannschaft, welche weniger Tore geschossen hat, der Gewinner vom Spiel.',
+ Activated: 'Die Ergebnisse werden invertiert. Das heißt, die Mannschaft mit weniger Toren gewinnt.'
+ },
ComparisonModes: {
Label: 'Platzierungsregel in Gruppen:',
Values: {
diff --git a/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html b/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html
index 744b03a1..a05ec2f9 100644
--- a/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html
+++ b/src/Turnierplan.App/Client/src/app/portal/components/computation-configuration/computation-configuration.component.html
@@ -63,6 +63,23 @@
+
+
+
+
+
+
{{ tournament.computationConfiguration.matchLostPoints }}
+ @if (tournament.computationConfiguration.higherScoreLoses) {
+
+ }
@for (entry of tournament.computationConfiguration.comparisonModes; track entry; let isLast = $last) {
diff --git a/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs b/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs
index a1c0699e..3c489f22 100644
--- a/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs
+++ b/src/Turnierplan.App/Endpoints/Tournaments/SetTournamentComputationConfigurationEndpoint.cs
@@ -45,6 +45,7 @@ private static async Task
Handle(
MatchWonPoints = request.Configuration.MatchWonPoints,
MatchDrawnPoints = request.Configuration.MatchDrawnPoints,
MatchLostPoints = request.Configuration.MatchLostPoints,
+ HigherScoreLoses = request.Configuration.HigherScoreLoses,
ComparisonModes = request.Configuration.ComparisonModes.ToList()
};
diff --git a/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs b/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs
index 5fc599d6..184a9c4d 100644
--- a/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs
+++ b/src/Turnierplan.App/Mapping/Rules/TournamentMappingRule.cs
@@ -128,6 +128,7 @@ protected override TournamentDto Map(IMapper mapper, MappingContext context, Tou
MatchWonPoints = source.ComputationConfiguration.MatchWonPoints,
MatchDrawnPoints = source.ComputationConfiguration.MatchDrawnPoints,
MatchLostPoints = source.ComputationConfiguration.MatchLostPoints,
+ HigherScoreLoses = source.ComputationConfiguration.HigherScoreLoses,
ComparisonModes = source.ComputationConfiguration.ComparisonModes.ToArray()
},
PresentationConfiguration = mapper.Map(source.PresentationConfiguration)
diff --git a/src/Turnierplan.App/Models/ComputationConfigurationDto.cs b/src/Turnierplan.App/Models/ComputationConfigurationDto.cs
index 83c568a6..dfb583b8 100644
--- a/src/Turnierplan.App/Models/ComputationConfigurationDto.cs
+++ b/src/Turnierplan.App/Models/ComputationConfigurationDto.cs
@@ -10,5 +10,7 @@ public sealed record ComputationConfigurationDto
public required int MatchLostPoints { get; init; }
+ public required bool HigherScoreLoses { get; init; }
+
public required TeamComparisonMode[] ComparisonModes { get; init; }
}
diff --git a/src/Turnierplan.Core.Test.Unit/Tournament/TeamGroupResultsTest.cs b/src/Turnierplan.Core.Test.Unit/Tournament/TeamGroupResultsTest.cs
index 5c0c8ab3..c21771e9 100644
--- a/src/Turnierplan.Core.Test.Unit/Tournament/TeamGroupResultsTest.cs
+++ b/src/Turnierplan.Core.Test.Unit/Tournament/TeamGroupResultsTest.cs
@@ -56,6 +56,58 @@ public sealed class TeamGroupStatisticsTest
}
};
+ public static readonly TheoryData<(int GoalsFor, int GoalsAgainst)[], TeamGroupStatistics> AddMatchOutcomeWhenHigherScoreLosesTestData = new()
+ {
+ {
+ [
+ (GoalsFor: 2, GoalsAgainst: 3),
+ (GoalsFor: 1, GoalsAgainst: 1),
+ (GoalsFor: 4, GoalsAgainst: 0)
+ ],
+ new TeamGroupStatistics
+ {
+ ScoreFor = 2 + 1 + 4,
+ ScoreAgainst = 3 + 1 + 0,
+ MatchesWon = 1,
+ MatchesDrawn = 1,
+ MatchesLost = 1,
+ Points = 4
+ }
+ },
+ {
+ [
+ (GoalsFor: 1, GoalsAgainst: 0),
+ (GoalsFor: 2, GoalsAgainst: 2)
+ ],
+ new TeamGroupStatistics
+ {
+ ScoreFor = 1 + 2,
+ ScoreAgainst = 0 + 2,
+ MatchesWon = 0,
+ MatchesDrawn = 1,
+ MatchesLost = 1,
+ Points = 1
+ }
+ },
+ {
+ [
+ (GoalsFor: 1, GoalsAgainst: 1),
+ (GoalsFor: 2, GoalsAgainst: 0),
+ (GoalsFor: 1, GoalsAgainst: 3),
+ (GoalsFor: 2, GoalsAgainst: 2)
+ ],
+ new TeamGroupStatistics
+ {
+ ScoreFor = 1 + 2 + 1 + 2,
+ ScoreAgainst = 1 + 0 + 3 + 2,
+ MatchesWon = 1,
+ MatchesDrawn = 2,
+ MatchesLost = 1,
+ Points = 5
+ }
+ }
+ };
+
[Theory]
[InlineData(7, 3, 4)]
[InlineData(3, 7, -4)]
@@ -101,7 +153,7 @@ public void TeamGroupResults___Add_Match_Outcome___Works_As_Expected((int GoalsF
[Theory]
[MemberData(nameof(AddMatchOutcomeTestData))]
- public void TeamGroupResults___Add_Match_Outcome_With_Custom_Computation_Configuration___Works_As_Expected((int GoalsFor, int GoalsAgainst)[] matchOutcomes, TeamGroupStatistics expectedResults)
+ public void TeamGroupResults___Add_Match_Outcome_With_Custom_Point_Counts___Works_As_Expected((int GoalsFor, int GoalsAgainst)[] matchOutcomes, TeamGroupStatistics expectedResults)
{
// Arrange
var results = new TeamGroupStatistics();
@@ -119,4 +171,22 @@ public void TeamGroupResults___Add_Match_Outcome_With_Custom_Computation_Configu
Points = expectedResults.MatchesDrawn * 2 + expectedResults.MatchesWon * 5
});
}
+
+ [Theory]
+ [MemberData(nameof(AddMatchOutcomeWhenHigherScoreLosesTestData))]
+ public void TeamGroupResults___Add_Match_Outcome_With_HigherScoreLoses_Enabled___Works_As_Expected((int GoalsFor, int GoalsAgainst)[] matchOutcomes, TeamGroupStatistics expectedResults)
+ {
+ // Arrange
+ var results = new TeamGroupStatistics();
+ var configuration = new ComputationConfiguration { HigherScoreLoses = true };
+
+ // Act
+ foreach (var matchOutcome in matchOutcomes)
+ {
+ results.AddMatchOutcome(matchOutcome.GoalsFor, matchOutcome.GoalsAgainst, configuration);
+ }
+
+ // Assert
+ results.Should().BeEquivalentTo(expectedResults);
+ }
}
diff --git a/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs b/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs
index 8a803a25..71776170 100644
--- a/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs
+++ b/src/Turnierplan.Core/Tournament/ComputationConfiguration.cs
@@ -21,6 +21,9 @@ public sealed record ComputationConfiguration
[JsonPropertyName("l")]
public int MatchLostPoints { get; set; } = 0;
+ [JsonPropertyName("r")]
+ public bool HigherScoreLoses { get; set; } = false;
+
[JsonPropertyName("cmp")]
public List ComparisonModes { get; set; } = [..__defaultTeamComparisonModes];
}
diff --git a/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs b/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs
index 0c7d12de..63690d4f 100644
--- a/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs
+++ b/src/Turnierplan.Core/Tournament/TeamGroupStatistics.cs
@@ -36,20 +36,39 @@ internal void AddMatchOutcome(int scoreFor, int scoreAgainst, ComputationConfigu
ScoreFor += scoreFor;
ScoreAgainst += scoreAgainst;
- if (scoreFor > scoreAgainst)
- {
- MatchesWon++;
- Points += computationConfiguration.MatchWonPoints;
- }
- else if (scoreFor == scoreAgainst)
+ if (scoreFor == scoreAgainst)
{
MatchesDrawn++;
Points += computationConfiguration.MatchDrawnPoints;
+
+ return;
+ }
+
+ if (computationConfiguration.HigherScoreLoses)
+ {
+ if (scoreFor > scoreAgainst)
+ {
+ MatchesLost++;
+ Points += computationConfiguration.MatchLostPoints;
+ }
+ else
+ {
+ MatchesWon++;
+ Points += computationConfiguration.MatchWonPoints;
+ }
}
else
{
- MatchesLost++;
- Points += computationConfiguration.MatchLostPoints;
+ if (scoreFor > scoreAgainst)
+ {
+ MatchesWon++;
+ Points += computationConfiguration.MatchWonPoints;
+ }
+ else
+ {
+ MatchesLost++;
+ Points += computationConfiguration.MatchLostPoints;
+ }
}
}
}
diff --git a/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.Designer.cs b/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.Designer.cs
new file mode 100644
index 00000000..aff8a0ec
--- /dev/null
+++ b/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.Designer.cs
@@ -0,0 +1,1285 @@
+//
+using System;
+using System.Collections.Generic;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using Turnierplan.Dal;
+
+#nullable disable
+
+namespace Turnierplan.Dal.Migrations
+{
+ [DbContext(typeof(TurnierplanContext))]
+ [Migration("20250706170447_Add_HigherScoreLoses")]
+ partial class Add_HigherScoreLoses
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IsActive")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(25)
+ .HasColumnType("character varying(25)");
+
+ b.Property("OrganizationId")
+ .HasColumnType("bigint");
+
+ b.Property("PrincipalId")
+ .HasColumnType("uuid");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.Property("SecretHash")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrganizationId");
+
+ b.HasIndex("PrincipalId")
+ .IsUnique();
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.ToTable("ApiKeys", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ApiKeyId")
+ .HasColumnType("bigint");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("character varying(150)");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApiKeyId");
+
+ b.HasIndex("Timestamp");
+
+ b.ToTable("ApiKeyRequests", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Document.Document", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Configuration")
+ .IsRequired()
+ .HasMaxLength(1024)
+ .HasColumnType("character varying(1024)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("GenerationCount")
+ .HasColumnType("integer");
+
+ b.Property("LastGeneration")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("LastModifiedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("character varying(30)");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b.Property("Type")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.HasIndex("TournamentId");
+
+ b.ToTable("Documents", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("character varying(64)");
+
+ b.Property("OrganizationId")
+ .HasColumnType("bigint");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrganizationId");
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.ToTable("Folders", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Image.Image", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("FileType")
+ .IsRequired()
+ .HasMaxLength(5)
+ .HasColumnType("character varying(5)");
+
+ b.Property("Height")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("OrganizationId")
+ .HasColumnType("bigint");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.Property("ResourceIdentifier")
+ .HasColumnType("uuid");
+
+ b.Property("Type")
+ .HasColumnType("integer");
+
+ b.Property("Width")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrganizationId");
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.HasIndex("ResourceIdentifier")
+ .IsUnique();
+
+ b.ToTable("Images", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("character varying(40)");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.ToTable("Organizations", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("ApiKeyId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Principal")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Role")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApiKeyId");
+
+ b.ToTable("IAM_ApiKey", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("FolderId")
+ .HasColumnType("bigint");
+
+ b.Property("Principal")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Role")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FolderId");
+
+ b.ToTable("IAM_Folder", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ImageId")
+ .HasColumnType("bigint");
+
+ b.Property("Principal")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Role")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ImageId");
+
+ b.ToTable("IAM_Image", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("OrganizationId")
+ .HasColumnType("bigint");
+
+ b.Property("Principal")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Role")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrganizationId");
+
+ b.ToTable("IAM_Organization", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Principal")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Role")
+ .HasColumnType("integer");
+
+ b.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TournamentId");
+
+ b.ToTable("IAM_Tournament", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Principal")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Role")
+ .HasColumnType("integer");
+
+ b.Property("VenueId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("VenueId");
+
+ b.ToTable("IAM_Venue", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b =>
+ {
+ b.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b.Property("Id")
+ .HasColumnType("integer");
+
+ b.Property("AlphabeticalId")
+ .HasColumnType("character(1)");
+
+ b.Property("DisplayName")
+ .HasMaxLength(25)
+ .HasColumnType("character varying(25)");
+
+ b.HasKey("TournamentId", "Id");
+
+ b.ToTable("Groups", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b =>
+ {
+ b.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b.Property("GroupId")
+ .HasColumnType("integer");
+
+ b.Property("TeamId")
+ .HasColumnType("integer");
+
+ b.Property("Order")
+ .HasColumnType("integer");
+
+ b.Property("Priority")
+ .HasColumnType("integer");
+
+ b.HasKey("TournamentId", "GroupId", "TeamId");
+
+ b.HasIndex("TournamentId", "TeamId");
+
+ b.ToTable("GroupParticipants", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b =>
+ {
+ b.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b.Property("Id")
+ .HasColumnType("integer");
+
+ b.Property("Court")
+ .HasColumnType("smallint");
+
+ b.Property("FinalsRound")
+ .HasColumnType("integer");
+
+ b.Property("GroupId")
+ .HasColumnType("integer");
+
+ b.Property("Index")
+ .HasColumnType("integer");
+
+ b.Property("IsCurrentlyPlaying")
+ .HasColumnType("boolean");
+
+ b.Property("Kickoff")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("OutcomeType")
+ .HasColumnType("integer");
+
+ b.Property("PlayoffPosition")
+ .HasColumnType("integer");
+
+ b.Property("ScoreA")
+ .HasColumnType("integer");
+
+ b.Property("ScoreB")
+ .HasColumnType("integer");
+
+ b.Property("TeamSelectorA")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("character varying(32)");
+
+ b.Property("TeamSelectorB")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("character varying(32)");
+
+ b.HasKey("TournamentId", "Id");
+
+ b.HasIndex("TournamentId", "GroupId");
+
+ b.ToTable("Matches", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b =>
+ {
+ b.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b.Property("Id")
+ .HasColumnType("integer");
+
+ b.Property("EntryFeePaidAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(60)
+ .HasColumnType("character varying(60)");
+
+ b.Property("OutOfCompetition")
+ .HasColumnType("boolean");
+
+ b.HasKey("TournamentId", "Id");
+
+ b.ToTable("Teams", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("FolderId")
+ .HasColumnType("bigint");
+
+ b.Property("IsMigrated")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(60)
+ .HasColumnType("character varying(60)");
+
+ b.Property("OrganizationId")
+ .HasColumnType("bigint");
+
+ b.Property("OrganizerLogoId")
+ .HasColumnType("bigint");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.Property("PublicPageViews")
+ .HasColumnType("integer");
+
+ b.Property("SponsorBannerId")
+ .HasColumnType("bigint");
+
+ b.Property("SponsorLogoId")
+ .HasColumnType("bigint");
+
+ b.Property("VenueId")
+ .HasColumnType("bigint");
+
+ b.Property("Visibility")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FolderId");
+
+ b.HasIndex("OrganizationId");
+
+ b.HasIndex("OrganizerLogoId");
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.HasIndex("SponsorBannerId");
+
+ b.HasIndex("SponsorLogoId");
+
+ b.HasIndex("VenueId");
+
+ b.ToTable("Tournaments", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.User.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("EMail")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("IsAdministrator")
+ .HasColumnType("boolean");
+
+ b.Property("LastLogin")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("LastPasswordChange")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("NormalizedEMail")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("PasswordHash")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("PrincipalId")
+ .HasColumnType("uuid");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEMail")
+ .IsUnique();
+
+ b.HasIndex("PrincipalId")
+ .IsUnique();
+
+ b.ToTable("Users", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.PrimitiveCollection>("AddressDetails")
+ .IsRequired()
+ .HasColumnType("text[]");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.PrimitiveCollection>("ExternalLinks")
+ .IsRequired()
+ .HasColumnType("text[]");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(60)
+ .HasColumnType("character varying(60)");
+
+ b.Property("OrganizationId")
+ .HasColumnType("bigint");
+
+ b.Property("PublicId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrganizationId");
+
+ b.HasIndex("PublicId")
+ .IsUnique();
+
+ b.ToTable("Venues", "turnierplan");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b =>
+ {
+ b.HasOne("Turnierplan.Core.Organization.Organization", "Organization")
+ .WithMany("ApiKeys")
+ .HasForeignKey("OrganizationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Organization");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKeyRequest", b =>
+ {
+ b.HasOne("Turnierplan.Core.ApiKey.ApiKey", "ApiKey")
+ .WithMany("Requests")
+ .HasForeignKey("ApiKeyId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ApiKey");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Document.Document", b =>
+ {
+ b.HasOne("Turnierplan.Core.Tournament.Tournament", "Tournament")
+ .WithMany("Documents")
+ .HasForeignKey("TournamentId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Tournament");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b =>
+ {
+ b.HasOne("Turnierplan.Core.Organization.Organization", "Organization")
+ .WithMany("Folders")
+ .HasForeignKey("OrganizationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Organization");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Image.Image", b =>
+ {
+ b.HasOne("Turnierplan.Core.Organization.Organization", "Organization")
+ .WithMany("Images")
+ .HasForeignKey("OrganizationId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("Organization");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.HasOne("Turnierplan.Core.ApiKey.ApiKey", "Scope")
+ .WithMany("RoleAssignments")
+ .HasForeignKey("ApiKeyId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.HasOne("Turnierplan.Core.Folder.Folder", "Scope")
+ .WithMany("RoleAssignments")
+ .HasForeignKey("FolderId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.HasOne("Turnierplan.Core.Image.Image", "Scope")
+ .WithMany("RoleAssignments")
+ .HasForeignKey("ImageId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.HasOne("Turnierplan.Core.Organization.Organization", "Scope")
+ .WithMany("RoleAssignments")
+ .HasForeignKey("OrganizationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.HasOne("Turnierplan.Core.Tournament.Tournament", "Scope")
+ .WithMany("RoleAssignments")
+ .HasForeignKey("TournamentId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.RoleAssignment.RoleAssignment", b =>
+ {
+ b.HasOne("Turnierplan.Core.Venue.Venue", "Scope")
+ .WithMany("RoleAssignments")
+ .HasForeignKey("VenueId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b =>
+ {
+ b.HasOne("Turnierplan.Core.Tournament.Tournament", null)
+ .WithMany("Groups")
+ .HasForeignKey("TournamentId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.GroupParticipant", b =>
+ {
+ b.HasOne("Turnierplan.Core.Tournament.Group", "Group")
+ .WithMany("Participants")
+ .HasForeignKey("TournamentId", "GroupId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Turnierplan.Core.Tournament.Team", "Team")
+ .WithMany()
+ .HasForeignKey("TournamentId", "TeamId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Group");
+
+ b.Navigation("Team");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Match", b =>
+ {
+ b.HasOne("Turnierplan.Core.Tournament.Tournament", null)
+ .WithMany("Matches")
+ .HasForeignKey("TournamentId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Turnierplan.Core.Tournament.Group", "Group")
+ .WithMany()
+ .HasForeignKey("TournamentId", "GroupId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.Navigation("Group");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Team", b =>
+ {
+ b.HasOne("Turnierplan.Core.Tournament.Tournament", null)
+ .WithMany("Teams")
+ .HasForeignKey("TournamentId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b =>
+ {
+ b.HasOne("Turnierplan.Core.Folder.Folder", "Folder")
+ .WithMany("Tournaments")
+ .HasForeignKey("FolderId")
+ .OnDelete(DeleteBehavior.SetNull);
+
+ b.HasOne("Turnierplan.Core.Organization.Organization", "Organization")
+ .WithMany("Tournaments")
+ .HasForeignKey("OrganizationId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Turnierplan.Core.Image.Image", "OrganizerLogo")
+ .WithMany()
+ .HasForeignKey("OrganizerLogoId")
+ .OnDelete(DeleteBehavior.SetNull);
+
+ b.HasOne("Turnierplan.Core.Image.Image", "SponsorBanner")
+ .WithMany()
+ .HasForeignKey("SponsorBannerId")
+ .OnDelete(DeleteBehavior.SetNull);
+
+ b.HasOne("Turnierplan.Core.Image.Image", "SponsorLogo")
+ .WithMany()
+ .HasForeignKey("SponsorLogoId")
+ .OnDelete(DeleteBehavior.SetNull);
+
+ b.HasOne("Turnierplan.Core.Venue.Venue", "Venue")
+ .WithMany("Tournaments")
+ .HasForeignKey("VenueId")
+ .OnDelete(DeleteBehavior.SetNull);
+
+ b.OwnsOne("Turnierplan.Core.Tournament.ComputationConfiguration", "ComputationConfiguration", b1 =>
+ {
+ b1.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b1.PrimitiveCollection("ComparisonModes")
+ .IsRequired()
+ .HasColumnType("integer[]")
+ .HasAnnotation("Relational:JsonPropertyName", "cmp");
+
+ b1.Property("HigherScoreLoses")
+ .HasColumnType("boolean")
+ .HasAnnotation("Relational:JsonPropertyName", "r");
+
+ b1.Property("MatchDrawnPoints")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "d");
+
+ b1.Property("MatchLostPoints")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "l");
+
+ b1.Property("MatchWonPoints")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "w");
+
+ b1.HasKey("TournamentId");
+
+ b1.ToTable("Tournaments", "turnierplan");
+
+ b1.ToJson("ComputationConfiguration");
+
+ b1.WithOwner()
+ .HasForeignKey("TournamentId");
+ });
+
+ b.OwnsOne("Turnierplan.Core.Tournament.MatchPlanConfiguration", "MatchPlanConfiguration", b1 =>
+ {
+ b1.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b1.HasKey("TournamentId");
+
+ b1.ToTable("Tournaments", "turnierplan");
+
+ b1.ToJson("MatchPlanConfiguration");
+
+ b1.WithOwner()
+ .HasForeignKey("TournamentId");
+
+ b1.OwnsOne("Turnierplan.Core.Tournament.FinalsRoundConfig", "FinalsRoundConfig", b2 =>
+ {
+ b2.Property("MatchPlanConfigurationTournamentId")
+ .HasColumnType("bigint");
+
+ b2.Property("EnableThirdPlacePlayoff")
+ .HasColumnType("boolean")
+ .HasAnnotation("Relational:JsonPropertyName", "3rd");
+
+ b2.Property("FirstFinalsRoundOrder")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "fo");
+
+ b2.PrimitiveCollection>("TeamSelectors")
+ .HasColumnType("text[]")
+ .HasAnnotation("Relational:JsonPropertyName", "ts");
+
+ b2.HasKey("MatchPlanConfigurationTournamentId");
+
+ b2.ToTable("Tournaments", "turnierplan");
+
+ b2.HasAnnotation("Relational:JsonPropertyName", "fr");
+
+ b2.WithOwner()
+ .HasForeignKey("MatchPlanConfigurationTournamentId");
+
+ b2.OwnsMany("Turnierplan.Core.Tournament.AdditionalPlayoffConfig", "AdditionalPlayoffs", b3 =>
+ {
+ b3.Property("FinalsRoundConfigMatchPlanConfigurationTournamentId")
+ .HasColumnType("bigint");
+
+ b3.Property("__synthesizedOrdinal")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ b3.Property("PlayoffPosition")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "p");
+
+ b3.Property("TeamSelectorA")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasAnnotation("Relational:JsonPropertyName", "a");
+
+ b3.Property("TeamSelectorB")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasAnnotation("Relational:JsonPropertyName", "b");
+
+ b3.HasKey("FinalsRoundConfigMatchPlanConfigurationTournamentId", "__synthesizedOrdinal");
+
+ b3.ToTable("Tournaments", "turnierplan");
+
+ b3.HasAnnotation("Relational:JsonPropertyName", "ap");
+
+ b3.WithOwner()
+ .HasForeignKey("FinalsRoundConfigMatchPlanConfigurationTournamentId");
+ });
+
+ b2.Navigation("AdditionalPlayoffs");
+ });
+
+ b1.OwnsOne("Turnierplan.Core.Tournament.GroupRoundConfig", "GroupRoundConfig", b2 =>
+ {
+ b2.Property("MatchPlanConfigurationTournamentId")
+ .HasColumnType("bigint");
+
+ b2.Property("GroupMatchOrder")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "o");
+
+ b2.Property("GroupPhaseRounds")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "r");
+
+ b2.HasKey("MatchPlanConfigurationTournamentId");
+
+ b2.ToTable("Tournaments", "turnierplan");
+
+ b2.HasAnnotation("Relational:JsonPropertyName", "gr");
+
+ b2.WithOwner()
+ .HasForeignKey("MatchPlanConfigurationTournamentId");
+ });
+
+ b1.OwnsOne("Turnierplan.Core.Tournament.ScheduleConfig", "ScheduleConfig", b2 =>
+ {
+ b2.Property("MatchPlanConfigurationTournamentId")
+ .HasColumnType("bigint");
+
+ b2.Property("FinalsPhaseNumberOfCourts")
+ .HasColumnType("smallint")
+ .HasAnnotation("Relational:JsonPropertyName", "fc");
+
+ b2.Property("FinalsPhasePauseTime")
+ .HasColumnType("interval")
+ .HasAnnotation("Relational:JsonPropertyName", "fp");
+
+ b2.Property("FinalsPhasePlayTime")
+ .HasColumnType("interval")
+ .HasAnnotation("Relational:JsonPropertyName", "fd");
+
+ b2.Property("FirstMatchKickoff")
+ .HasColumnType("timestamp with time zone")
+ .HasAnnotation("Relational:JsonPropertyName", "f");
+
+ b2.Property("GroupPhaseNumberOfCourts")
+ .HasColumnType("smallint")
+ .HasAnnotation("Relational:JsonPropertyName", "gc");
+
+ b2.Property("GroupPhasePauseTime")
+ .HasColumnType("interval")
+ .HasAnnotation("Relational:JsonPropertyName", "gp");
+
+ b2.Property("GroupPhasePlayTime")
+ .HasColumnType("interval")
+ .HasAnnotation("Relational:JsonPropertyName", "gd");
+
+ b2.Property("PauseBetweenGroupAndFinalsPhase")
+ .HasColumnType("interval")
+ .HasAnnotation("Relational:JsonPropertyName", "p");
+
+ b2.HasKey("MatchPlanConfigurationTournamentId");
+
+ b2.ToTable("Tournaments", "turnierplan");
+
+ b2.HasAnnotation("Relational:JsonPropertyName", "sc");
+
+ b2.WithOwner()
+ .HasForeignKey("MatchPlanConfigurationTournamentId");
+ });
+
+ b1.Navigation("FinalsRoundConfig");
+
+ b1.Navigation("GroupRoundConfig");
+
+ b1.Navigation("ScheduleConfig");
+ });
+
+ b.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration", "PresentationConfiguration", b1 =>
+ {
+ b1.Property("TournamentId")
+ .HasColumnType("bigint");
+
+ b1.Property("ShowOrganizerLogo")
+ .HasColumnType("boolean")
+ .HasAnnotation("Relational:JsonPropertyName", "ol");
+
+ b1.Property("ShowResults")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "o");
+
+ b1.Property("ShowSponsorLogo")
+ .HasColumnType("boolean")
+ .HasAnnotation("Relational:JsonPropertyName", "sl");
+
+ b1.HasKey("TournamentId");
+
+ b1.ToTable("Tournaments", "turnierplan");
+
+ b1.ToJson("PresentationConfiguration");
+
+ b1.WithOwner()
+ .HasForeignKey("TournamentId");
+
+ b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header1", b2 =>
+ {
+ b2.Property("PresentationConfigurationTournamentId")
+ .HasColumnType("bigint");
+
+ b2.Property("Content")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "c");
+
+ b2.Property("CustomContent")
+ .HasColumnType("text")
+ .HasAnnotation("Relational:JsonPropertyName", "cc");
+
+ b2.HasKey("PresentationConfigurationTournamentId");
+
+ b2.ToTable("Tournaments", "turnierplan");
+
+ b2.HasAnnotation("Relational:JsonPropertyName", "h1");
+
+ b2.WithOwner()
+ .HasForeignKey("PresentationConfigurationTournamentId");
+ });
+
+ b1.OwnsOne("Turnierplan.Core.Tournament.PresentationConfiguration+HeaderLine", "Header2", b2 =>
+ {
+ b2.Property("PresentationConfigurationTournamentId")
+ .HasColumnType("bigint");
+
+ b2.Property("Content")
+ .HasColumnType("integer")
+ .HasAnnotation("Relational:JsonPropertyName", "c");
+
+ b2.Property("CustomContent")
+ .HasColumnType("text")
+ .HasAnnotation("Relational:JsonPropertyName", "cc");
+
+ b2.HasKey("PresentationConfigurationTournamentId");
+
+ b2.ToTable("Tournaments", "turnierplan");
+
+ b2.HasAnnotation("Relational:JsonPropertyName", "h2");
+
+ b2.WithOwner()
+ .HasForeignKey("PresentationConfigurationTournamentId");
+ });
+
+ b1.Navigation("Header1")
+ .IsRequired();
+
+ b1.Navigation("Header2")
+ .IsRequired();
+ });
+
+ b.Navigation("ComputationConfiguration")
+ .IsRequired();
+
+ b.Navigation("Folder");
+
+ b.Navigation("MatchPlanConfiguration");
+
+ b.Navigation("Organization");
+
+ b.Navigation("OrganizerLogo");
+
+ b.Navigation("PresentationConfiguration")
+ .IsRequired();
+
+ b.Navigation("SponsorBanner");
+
+ b.Navigation("SponsorLogo");
+
+ b.Navigation("Venue");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b =>
+ {
+ b.HasOne("Turnierplan.Core.Organization.Organization", "Organization")
+ .WithMany("Venues")
+ .HasForeignKey("OrganizationId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("Organization");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.ApiKey.ApiKey", b =>
+ {
+ b.Navigation("Requests");
+
+ b.Navigation("RoleAssignments");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Folder.Folder", b =>
+ {
+ b.Navigation("RoleAssignments");
+
+ b.Navigation("Tournaments");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Image.Image", b =>
+ {
+ b.Navigation("RoleAssignments");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Organization.Organization", b =>
+ {
+ b.Navigation("ApiKeys");
+
+ b.Navigation("Folders");
+
+ b.Navigation("Images");
+
+ b.Navigation("RoleAssignments");
+
+ b.Navigation("Tournaments");
+
+ b.Navigation("Venues");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Group", b =>
+ {
+ b.Navigation("Participants");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Tournament.Tournament", b =>
+ {
+ b.Navigation("Documents");
+
+ b.Navigation("Groups");
+
+ b.Navigation("Matches");
+
+ b.Navigation("RoleAssignments");
+
+ b.Navigation("Teams");
+ });
+
+ modelBuilder.Entity("Turnierplan.Core.Venue.Venue", b =>
+ {
+ b.Navigation("RoleAssignments");
+
+ b.Navigation("Tournaments");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.cs b/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.cs
new file mode 100644
index 00000000..f88ce5d0
--- /dev/null
+++ b/src/Turnierplan.Dal/Migrations/20250706170447_Add_HigherScoreLoses.cs
@@ -0,0 +1,22 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Turnierplan.Dal.Migrations
+{
+ ///
+ public partial class Add_HigherScoreLoses : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs
index 7d3b755a..544116c3 100644
--- a/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs
+++ b/src/Turnierplan.Dal/Migrations/TurnierplanContextModelSnapshot.cs
@@ -928,6 +928,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("integer[]")
.HasAnnotation("Relational:JsonPropertyName", "cmp");
+ b1.Property("HigherScoreLoses")
+ .HasColumnType("boolean")
+ .HasAnnotation("Relational:JsonPropertyName", "r");
+
b1.Property("MatchDrawnPoints")
.HasColumnType("integer")
.HasAnnotation("Relational:JsonPropertyName", "d");