diff --git a/src/Koogle.Infrastructure/Data/Configurations/ClubConfiguration.cs b/src/Koogle.Infrastructure/Data/Configurations/ClubConfiguration.cs index 4cd0a38..f08e55f 100644 --- a/src/Koogle.Infrastructure/Data/Configurations/ClubConfiguration.cs +++ b/src/Koogle.Infrastructure/Data/Configurations/ClubConfiguration.cs @@ -17,7 +17,7 @@ public class ClubConfiguration : IEntityTypeConfiguration .IsRequired(); builder.Property(x => x.LoginName) - .HasMaxLength(10) + .HasMaxLength(50) .IsRequired(); // Enum als int (Default) – explizit ist oft schöner diff --git a/src/Koogle.Infrastructure/Data/Migrations/20260107082529_IncreaseClubLoginNameLength.Designer.cs b/src/Koogle.Infrastructure/Data/Migrations/20260107082529_IncreaseClubLoginNameLength.Designer.cs new file mode 100644 index 0000000..298a57a --- /dev/null +++ b/src/Koogle.Infrastructure/Data/Migrations/20260107082529_IncreaseClubLoginNameLength.Designer.cs @@ -0,0 +1,1633 @@ +// +using System; +using KoogleApp.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Koogle.Infrastructure.Data.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20260107082529_IncreaseClubLoginNameLength")] + partial class IncreaseClubLoginNameLength + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("app") + .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Koogle.Domain.Entities.BookingCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryType") + .HasColumnType("int"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("Color") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Icon") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSystemCategory") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasAlternateKey("Id", "ClubId"); + + b.HasIndex("ClubId"); + + b.HasIndex("ClubId", "Name") + .IsUnique() + .HasFilter("[IsDeleted] = 0"); + + b.ToTable("BookingCategories", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.CashBookEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amount") + .HasPrecision(10, 2) + .HasColumnType("decimal(10,2)"); + + b.Property("BookingDate") + .HasColumnType("datetime2"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("Comment") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("DayId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntryType") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("ReceiptReference") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("BookingDate"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ClubId"); + + b.HasIndex("DayId"); + + b.HasIndex("PersonId"); + + b.ToTable("CashBookEntries", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Club", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpenseCalculation") + .HasColumnType("int"); + + b.Property("InitialBalance") + .HasPrecision(10, 2) + .HasColumnType("decimal(10,2)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LoginName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("MonthlyMembershipFee") + .HasPrecision(10, 2) + .HasColumnType("decimal(10,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("SenderEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("LoginName"); + + b.HasIndex("Name"); + + b.ToTable("Clubs", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubGif", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssignedEvents") + .HasColumnType("int"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("ContentType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FileSizeBytes") + .HasColumnType("bigint"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("IsPendingApproval") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("OriginalFileName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("RatingCount") + .HasColumnType("int"); + + b.Property("RatingScore") + .HasColumnType("int"); + + b.Property("SourceUrl") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("Id"); + + b.HasIndex("ClubId", "AssignedEvents", "IsEnabled") + .HasFilter("[IsDeleted] = 0 AND [IsPendingApproval] = 0"); + + b.ToTable("ClubGifs", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubGifRating", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubGifId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("UserProfileId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserProfileId"); + + b.HasIndex("ClubGifId", "UserProfileId") + .IsUnique(); + + b.ToTable("ClubGifRatings", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubInvitation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpiresAt") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("MaxUses") + .HasColumnType("int"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Token") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UsedCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("Token") + .IsUnique(); + + b.ToTable("ClubInvitations", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApprovedAt") + .HasColumnType("datetime2"); + + b.Property("ApprovedById") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LoginName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("RejectedAt") + .HasColumnType("datetime2"); + + b.Property("RejectedById") + .HasColumnType("uniqueidentifier"); + + b.Property("RejectionReason") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("RequestedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CreatedClubId"); + + b.HasIndex("RequestedById"); + + b.ToTable("ClubRequests", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubTerminology", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("TermKey") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("ClubId", "TermKey") + .IsUnique() + .HasFilter("[IsDeleted] = 0"); + + b.ToTable("ClubTerminologies", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Day", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId1") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("PostDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClubId1"); + + b.HasIndex("ClubId", "PostDate"); + + b.ToTable("Days", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.DayPerson", b => + { + b.Property("DayId") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("DayId", "PersonId"); + + b.HasIndex("ClubId"); + + b.HasIndex("DayId"); + + b.HasIndex("PersonId"); + + b.HasIndex("DayId", "ClubId"); + + b.HasIndex("PersonId", "ClubId"); + + b.ToTable("DayPersons", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Expense", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId1") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ExpenseType") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsInverse") + .HasColumnType("bit"); + + b.Property("IsOneClick") + .HasColumnType("bit"); + + b.Property("IsVariable") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Price") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("ClubId1"); + + b.HasIndex("ClubId", "Name"); + + b.ToTable("Expenses", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ExpenseTrigger", b => + { + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpenseId") + .HasColumnType("uniqueidentifier"); + + b.Property("TriggerId") + .HasColumnType("uniqueidentifier"); + + b.Property("AssignedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("SYSUTCDATETIME()"); + + b.Property("AssignedById") + .HasColumnType("uniqueidentifier"); + + b.HasKey("ClubId", "ExpenseId", "TriggerId"); + + b.HasIndex("ClubId"); + + b.HasIndex("ExpenseId"); + + b.HasIndex("TriggerId"); + + b.HasIndex("ExpenseId", "ClubId"); + + b.ToTable("ExpenseTriggers", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Game", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("CompletedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("DayId") + .HasColumnType("uniqueidentifier"); + + b.Property("GameData") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("GameType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("rowversion"); + + b.Property("StartedAt") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("DayId"); + + b.HasIndex("DayId", "Status"); + + b.ToTable("Games", "app", t => + { + t.HasCheckConstraint("CK_Games_GameData_IsJson", "ISJSON([GameData]) > 0"); + }); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.GamePerson", b => + { + b.Property("GameId") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("GameId", "PersonId"); + + b.HasIndex("ClubId"); + + b.HasIndex("GameId"); + + b.HasIndex("PersonId"); + + b.ToTable("GamePersons", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.GifSubmissionToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("DayId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpiresAt") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("MaxSubmissions") + .HasColumnType("int"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("SubmissionCount") + .HasColumnType("int"); + + b.Property("Token") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("DayId"); + + b.HasIndex("Token") + .IsUnique(); + + b.ToTable("GifSubmissionTokens", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Person", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId1") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("PersonStatus") + .HasColumnType("int"); + + b.Property("UserProfileId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("ClubId1"); + + b.HasIndex("UserProfileId"); + + b.ToTable("Persons", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.PersonExpense", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssignedById") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("DayId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpenseId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExpenseType") + .HasColumnType("int"); + + b.Property("GameId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("PersonExpenseStatus") + .HasColumnType("int"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("DayId"); + + b.HasIndex("ExpenseId"); + + b.HasIndex("GameId"); + + b.HasIndex("PersonId", "DayId"); + + b.ToTable("PersonExpenses", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.PlayerGameStatistics", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BellCount") + .HasColumnType("int"); + + b.Property("CircleCount") + .HasColumnType("int"); + + b.Property("ClearedCount") + .HasColumnType("int"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("GameId") + .HasColumnType("uniqueidentifier"); + + b.Property("GutterCount") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("PersonId") + .HasColumnType("uniqueidentifier"); + + b.Property("PinCount") + .HasColumnType("int"); + + b.Property("StrikeCount") + .HasColumnType("int"); + + b.Property("ThrowCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("GameId"); + + b.HasIndex("PersonId"); + + b.HasIndex("GameId", "PersonId") + .IsUnique(); + + b.ToTable("PlayerGameStatistics", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Trigger", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ExpenseTriggerType") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("ExpenseTriggerType"); + + b.ToTable("Triggers", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("CurrentClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("IdentityUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Locale") + .HasMaxLength(20) + .IsUnicode(false) + .HasColumnType("varchar(20)"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeZone") + .HasMaxLength(64) + .IsUnicode(false) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("CurrentClubId"); + + b.HasIndex("IdentityUserId") + .IsUnique(); + + b.ToTable("UserProfiles", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClub", b => + { + b.Property("UserProfileId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("ApprovedAt") + .HasColumnType("datetime2"); + + b.Property("ApprovedById") + .HasColumnType("uniqueidentifier"); + + b.Property("AssignedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("SYSUTCDATETIME()"); + + b.Property("AssignedById") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId1") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("RejectedAt") + .HasColumnType("datetime2"); + + b.Property("RejectedById") + .HasColumnType("uniqueidentifier"); + + b.Property("RejectionReason") + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("UserProfileId", "ClubId"); + + b.HasIndex("ClubId"); + + b.HasIndex("ClubId1"); + + b.HasIndex("UserProfileId") + .IsUnique() + .HasFilter("[IsDefault] = 1"); + + b.ToTable("UserProfileClubs", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClubRoleAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssignedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("SYSUTCDATETIME()"); + + b.Property("AssignedById") + .HasColumnType("uniqueidentifier"); + + b.Property("ClubId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedById") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedAt") + .HasColumnType("datetime2"); + + b.Property("ModifiedById") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserProfileId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ClubId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserProfileId", "ClubId", "RoleId") + .IsUnique() + .HasFilter("[IsDeleted] = 0"); + + b.ToTable("UserProfileClubRoleAssignments", "app"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.BookingCategory", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany("BookingCategories") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Club"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.CashBookEntry", b => + { + b.HasOne("Koogle.Domain.Entities.BookingCategory", "Category") + .WithMany("CashBookEntries") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany("CashBookEntries") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Day", "Day") + .WithMany() + .HasForeignKey("DayId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Koogle.Domain.Entities.Person", "Person") + .WithMany() + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Category"); + + b.Navigation("Club"); + + b.Navigation("Day"); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubGif", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany("Gifs") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Club"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubGifRating", b => + { + b.HasOne("Koogle.Domain.Entities.ClubGif", "ClubGif") + .WithMany("Ratings") + .HasForeignKey("ClubGifId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.UserProfile", "UserProfile") + .WithMany() + .HasForeignKey("UserProfileId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ClubGif"); + + b.Navigation("UserProfile"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubInvitation", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Club"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubRequest", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "CreatedClub") + .WithMany() + .HasForeignKey("CreatedClubId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("Koogle.Domain.Entities.UserProfile", "RequestedBy") + .WithMany() + .HasForeignKey("RequestedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedClub"); + + b.Navigation("RequestedBy"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubTerminology", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany("Terminologies") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Club"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Day", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Club", null) + .WithMany("Days") + .HasForeignKey("ClubId1"); + + b.Navigation("Club"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.DayPerson", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Day", "Day") + .WithMany("DayPersons") + .HasForeignKey("DayId", "ClubId") + .HasPrincipalKey("Id", "ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Person", "Person") + .WithMany("DayPersons") + .HasForeignKey("PersonId", "ClubId") + .HasPrincipalKey("Id", "ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Club"); + + b.Navigation("Day"); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Expense", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Club", null) + .WithMany("Expenses") + .HasForeignKey("ClubId1"); + + b.Navigation("Club"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ExpenseTrigger", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Trigger", "Trigger") + .WithMany() + .HasForeignKey("TriggerId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Expense", "Expense") + .WithMany() + .HasForeignKey("ExpenseId", "ClubId") + .HasPrincipalKey("Id", "ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Club"); + + b.Navigation("Expense"); + + b.Navigation("Trigger"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Game", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Day", "Day") + .WithMany() + .HasForeignKey("DayId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Club"); + + b.Navigation("Day"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.GamePerson", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Game", "Game") + .WithMany("GamePersons") + .HasForeignKey("GameId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Person", "Person") + .WithMany() + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Club"); + + b.Navigation("Game"); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.GifSubmissionToken", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany("GifSubmissionTokens") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Day", "Day") + .WithMany() + .HasForeignKey("DayId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Club"); + + b.Navigation("Day"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Person", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Club", null) + .WithMany("Persons") + .HasForeignKey("ClubId1"); + + b.HasOne("Koogle.Domain.Entities.UserProfile", "UserProfile") + .WithMany() + .HasForeignKey("UserProfileId") + .OnDelete(DeleteBehavior.SetNull); + + b.Navigation("Club"); + + b.Navigation("UserProfile"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.PersonExpense", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Day", "Day") + .WithMany() + .HasForeignKey("DayId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Expense", "Expense") + .WithMany() + .HasForeignKey("ExpenseId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Game", "Game") + .WithMany() + .HasForeignKey("GameId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("Koogle.Domain.Entities.Person", "Person") + .WithMany("Expenses") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Club"); + + b.Navigation("Day"); + + b.Navigation("Expense"); + + b.Navigation("Game"); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.PlayerGameStatistics", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Game", "Game") + .WithMany() + .HasForeignKey("GameId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Person", "Person") + .WithMany() + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Club"); + + b.Navigation("Game"); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfile", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "CurrentClub") + .WithMany() + .HasForeignKey("CurrentClubId"); + + b.Navigation("CurrentClub"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClub", b => + { + b.HasOne("Koogle.Domain.Entities.Club", "Club") + .WithMany() + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Koogle.Domain.Entities.Club", null) + .WithMany("Users") + .HasForeignKey("ClubId1"); + + b.HasOne("Koogle.Domain.Entities.UserProfile", "UserProfile") + .WithMany("Clubs") + .HasForeignKey("UserProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Club"); + + b.Navigation("UserProfile"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClubRoleAssignment", b => + { + b.HasOne("Koogle.Domain.Entities.UserProfileClub", "UserProfileClub") + .WithMany("RoleAssignments") + .HasForeignKey("UserProfileId", "ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("UserProfileClub"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.BookingCategory", b => + { + b.Navigation("CashBookEntries"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Club", b => + { + b.Navigation("BookingCategories"); + + b.Navigation("CashBookEntries"); + + b.Navigation("Days"); + + b.Navigation("Expenses"); + + b.Navigation("GifSubmissionTokens"); + + b.Navigation("Gifs"); + + b.Navigation("Persons"); + + b.Navigation("Terminologies"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.ClubGif", b => + { + b.Navigation("Ratings"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Day", b => + { + b.Navigation("DayPersons"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Game", b => + { + b.Navigation("GamePersons"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.Person", b => + { + b.Navigation("DayPersons"); + + b.Navigation("Expenses"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfile", b => + { + b.Navigation("Clubs"); + }); + + modelBuilder.Entity("Koogle.Domain.Entities.UserProfileClub", b => + { + b.Navigation("RoleAssignments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Koogle.Infrastructure/Data/Migrations/20260107082529_IncreaseClubLoginNameLength.cs b/src/Koogle.Infrastructure/Data/Migrations/20260107082529_IncreaseClubLoginNameLength.cs new file mode 100644 index 0000000..63c21f8 --- /dev/null +++ b/src/Koogle.Infrastructure/Data/Migrations/20260107082529_IncreaseClubLoginNameLength.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Koogle.Infrastructure.Data.Migrations +{ + /// + public partial class IncreaseClubLoginNameLength : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "LoginName", + schema: "app", + table: "Clubs", + type: "nvarchar(50)", + maxLength: 50, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(10)", + oldMaxLength: 10); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "LoginName", + schema: "app", + table: "Clubs", + type: "nvarchar(10)", + maxLength: 10, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50); + } + } +} diff --git a/src/Koogle.Infrastructure/Data/Migrations/AppDbContextModelSnapshot.cs b/src/Koogle.Infrastructure/Data/Migrations/AppDbContextModelSnapshot.cs index e92c208..56c42be 100644 --- a/src/Koogle.Infrastructure/Data/Migrations/AppDbContextModelSnapshot.cs +++ b/src/Koogle.Infrastructure/Data/Migrations/AppDbContextModelSnapshot.cs @@ -176,8 +176,8 @@ namespace Koogle.Infrastructure.Data.Migrations b.Property("LoginName") .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.Property("ModifiedAt") .HasColumnType("datetime2"); diff --git a/src/Koogle.Web/Components/Pages/Account/ClubSetup.razor b/src/Koogle.Web/Components/Pages/Account/ClubSetup.razor index 86a6302..7f47f24 100644 --- a/src/Koogle.Web/Components/Pages/Account/ClubSetup.razor +++ b/src/Koogle.Web/Components/Pages/Account/ClubSetup.razor @@ -72,6 +72,7 @@ Label="Login-Name" Variant="Variant.Outlined" Required="true" + MaxLength="10" HelperText="Eindeutiger Kurzname (z.B. meinclub)" Style="text-transform: lowercase;" Class="mb-3" />