diff --git a/Api/Controllers/v1/SquadTypesController.cs b/Api/Controllers/v1/SquadTypesController.cs new file mode 100644 index 0000000..2183438 --- /dev/null +++ b/Api/Controllers/v1/SquadTypesController.cs @@ -0,0 +1,37 @@ +using Application.DataTransferObjects.SquadType; +using Application.Interfaces; +using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Api.Controllers.v1 +{ + [Route("api/v{version:apiVersion}/[controller]")] + [ApiController] + [ApiVersion("1.0")] + [Authorize] + public class SquadTypesController(ISquadTypeRepository squadTypeRepository, ILogger logger) + : ControllerBase + { + [HttpGet] + public async Task>> GetSquadTypes(CancellationToken cancellationToken) + { + try + { + var squadTypesResult = await squadTypeRepository.GetSquadTypesAsync(cancellationToken); + if (squadTypesResult.IsFailure) return BadRequest(squadTypesResult.Error); + return squadTypesResult.Value.Count > 0 + ? Ok(squadTypesResult.Value) + : NoContent(); + } + catch (Exception e) + { + logger.LogError(e, "{ErrorMessage}", e.Message); + return Problem( + detail: $"Failed to process {nameof(GetSquadTypes)}", + statusCode: StatusCodes.Status500InternalServerError, + title: "Internal server error"); + } + } + } +} diff --git a/Api/Controllers/v1/SquadsController.cs b/Api/Controllers/v1/SquadsController.cs new file mode 100644 index 0000000..41a38cb --- /dev/null +++ b/Api/Controllers/v1/SquadsController.cs @@ -0,0 +1,106 @@ +using Application.DataTransferObjects.Squad; +using Application.Interfaces; +using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Api.Controllers.v1 +{ + [Route("api/v{version:apiVersion}/[controller]")] + [ApiController] + [ApiVersion("1.0")] + [Authorize] + public class SquadsController(ISquadRepository squadRepository, ILogger logger) : ControllerBase + { + [HttpGet("player/{playerId:guid}")] + public async Task>> GetPlayerSquads(Guid playerId, CancellationToken cancellationToken) + { + try + { + var playerSquadsResult = await squadRepository.GetPlayerSquadsAsync(playerId, cancellationToken); + + if (playerSquadsResult.IsFailure) return BadRequest(playerSquadsResult.Error); + + return playerSquadsResult.Value.Count > 0 + ? Ok(playerSquadsResult.Value) + : NoContent(); + } + catch (Exception e) + { + logger.LogError(e, "{ErrorMessage}", e.Message); + return Problem( + detail: $"Failed to process {nameof(GetPlayerSquads)}", + statusCode: StatusCodes.Status500InternalServerError, + title: "Internal server error"); + } + } + + [HttpPost] + public async Task> CreateSquad(CreateSquadDto createSquadDto, + CancellationToken cancellationToken) + { + try + { + if (!ModelState.IsValid) return UnprocessableEntity(ModelState); + + var createSquadResult = await squadRepository.CreateSquadAsync(createSquadDto, cancellationToken); + + return createSquadResult.IsSuccess + ? Ok(createSquadResult.Value) + : BadRequest(createSquadResult.Error); + } + catch (Exception e) + { + logger.LogError(e, "{ErrorMessage}", e.Message); + return Problem( + detail: $"Failed to process {nameof(GetPlayerSquads)}", + statusCode: StatusCodes.Status500InternalServerError, + title: "Internal server error"); + } + } + + [HttpPut("{squadId:guid}")] + public async Task> UpdateSquad(Guid squadId, UpdateSquadDto updateSquadDto, CancellationToken cancellationToken) + { + try + { + if (!ModelState.IsValid) return UnprocessableEntity(ModelState); + + var updateSquadResult = await squadRepository.UpdateSquadAsync(updateSquadDto, cancellationToken); + return updateSquadResult.IsSuccess + ? Ok(updateSquadResult.Value) + : BadRequest(updateSquadResult.Error); + } + catch (Exception e) + { + logger.LogError(e, "{ErrorMessage}", e.Message); + return Problem( + detail: $"Failed to process {nameof(UpdateSquad)}", + statusCode: StatusCodes.Status500InternalServerError, + title: "Internal server error"); + } + } + + [HttpDelete("{squadId:guid}")] + public async Task> DeleteSquad(Guid squadId, CancellationToken cancellationToken) + { + try + { + var deleteSquadResult = await squadRepository.DeleteSquadAsync(squadId, cancellationToken); + + return deleteSquadResult.IsSuccess + ? Ok(deleteSquadResult.Value) + : BadRequest(deleteSquadResult.Error); + } + catch (Exception e) + { + logger.LogError(e, "{ErrorMessage}", e.Message); + return Problem( + detail: $"Failed to process {nameof(DeleteSquad)}", + statusCode: StatusCodes.Status500InternalServerError, + title: "Internal server error"); + } + } + } + +} diff --git a/Api/Controllers/v1/ValuesController.cs b/Api/Controllers/v1/ValuesController.cs deleted file mode 100644 index daf1c64..0000000 --- a/Api/Controllers/v1/ValuesController.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Api.Helpers; -using Asp.Versioning; -using Microsoft.AspNetCore.Mvc; - -namespace Api.Controllers.v1 -{ - [Route("api/v{version:apiVersion}/[controller]")] - [ApiController] - [ApiVersion("1.0")] - public class ValuesController : ControllerBase - { - [AllowApiKey] - [HttpGet] - public async Task Test([FromQuery] Guid allianceId, [FromQuery] string? key) - { - return Ok(new - { - AllianceId = allianceId, - Key = key - }); - } - } -} diff --git a/Application/ApplicationDependencyInjection.cs b/Application/ApplicationDependencyInjection.cs index bc1fd37..2cb1296 100644 --- a/Application/ApplicationDependencyInjection.cs +++ b/Application/ApplicationDependencyInjection.cs @@ -37,6 +37,8 @@ public static class ApplicationDependencyInjection services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); services.AddTransient(); diff --git a/Application/DataTransferObjects/Squad/CreateSquadDto.cs b/Application/DataTransferObjects/Squad/CreateSquadDto.cs new file mode 100644 index 0000000..cd7e028 --- /dev/null +++ b/Application/DataTransferObjects/Squad/CreateSquadDto.cs @@ -0,0 +1,12 @@ +namespace Application.DataTransferObjects.Squad; + +public class CreateSquadDto +{ + public Guid SquadTypeId { get; set; } + + public Guid PlayerId { get; set; } + + public decimal Power { get; set; } + + public int Position { get; set; } +} \ No newline at end of file diff --git a/Application/DataTransferObjects/Squad/SquadDto.cs b/Application/DataTransferObjects/Squad/SquadDto.cs new file mode 100644 index 0000000..88ea3c1 --- /dev/null +++ b/Application/DataTransferObjects/Squad/SquadDto.cs @@ -0,0 +1,19 @@ +namespace Application.DataTransferObjects.Squad; + +public class SquadDto +{ + public Guid Id { get; set; } + + public Guid SquadTypeId { get; set; } + + public Guid PlayerId { get; set; } + + public required string TypeName { get; set; } + + public decimal Power { get; set; } + + public int Position { get; set; } + + public DateTime LastUpdateAt { get; set; } + +} \ No newline at end of file diff --git a/Application/DataTransferObjects/Squad/UpdateSquadDto.cs b/Application/DataTransferObjects/Squad/UpdateSquadDto.cs new file mode 100644 index 0000000..c582a49 --- /dev/null +++ b/Application/DataTransferObjects/Squad/UpdateSquadDto.cs @@ -0,0 +1,14 @@ +namespace Application.DataTransferObjects.Squad; + +public class UpdateSquadDto +{ + public Guid Id { get; set; } + + public Guid SquadTypeId { get; set; } + + public Guid PlayerId { get; set; } + + public decimal Power { get; set; } + + public int Position { get; set; } +} \ No newline at end of file diff --git a/Application/DataTransferObjects/SquadType/SquadTypeDto.cs b/Application/DataTransferObjects/SquadType/SquadTypeDto.cs new file mode 100644 index 0000000..c7e5a75 --- /dev/null +++ b/Application/DataTransferObjects/SquadType/SquadTypeDto.cs @@ -0,0 +1,9 @@ +namespace Application.DataTransferObjects.SquadType; + +public class SquadTypeDto +{ + public Guid Id { get; set; } + + public required string TypeName { get; set; } + +} \ No newline at end of file diff --git a/Application/Errors/SquadErrors.cs b/Application/Errors/SquadErrors.cs new file mode 100644 index 0000000..b9a1993 --- /dev/null +++ b/Application/Errors/SquadErrors.cs @@ -0,0 +1,9 @@ +namespace Application.Errors; + +public class SquadErrors +{ + public static readonly Error NotFound = new("Error.Squad.NotFound", + "The quad with the specified identifier was not found"); + + public static readonly Error IdConflict = new("Error.Note.IdConflict", "There is a conflict with the id's"); +} \ No newline at end of file diff --git a/Application/Interfaces/ISquadRepository.cs b/Application/Interfaces/ISquadRepository.cs new file mode 100644 index 0000000..acb7355 --- /dev/null +++ b/Application/Interfaces/ISquadRepository.cs @@ -0,0 +1,15 @@ +using Application.Classes; +using Application.DataTransferObjects.Squad; + +namespace Application.Interfaces; + +public interface ISquadRepository +{ + Task>> GetPlayerSquadsAsync(Guid playerId, CancellationToken cancellationToken = default); + + Task> CreateSquadAsync(CreateSquadDto createSquadDto, CancellationToken cancellationToken = default); + + Task> UpdateSquadAsync(UpdateSquadDto updateSquadDto, CancellationToken cancellationToken = default); + + Task> DeleteSquadAsync(Guid squadId, CancellationToken cancellationToken = default); +} \ No newline at end of file diff --git a/Application/Interfaces/ISquadTypeRepository.cs b/Application/Interfaces/ISquadTypeRepository.cs new file mode 100644 index 0000000..c9aee2f --- /dev/null +++ b/Application/Interfaces/ISquadTypeRepository.cs @@ -0,0 +1,9 @@ +using Application.Classes; +using Application.DataTransferObjects.SquadType; + +namespace Application.Interfaces; + +public interface ISquadTypeRepository +{ + Task>> GetSquadTypesAsync(CancellationToken cancellationToken); +} \ No newline at end of file diff --git a/Application/Profiles/SquadProfile.cs b/Application/Profiles/SquadProfile.cs new file mode 100644 index 0000000..1bdeecf --- /dev/null +++ b/Application/Profiles/SquadProfile.cs @@ -0,0 +1,21 @@ +using Application.DataTransferObjects.Squad; +using AutoMapper; +using Database.Entities; + +namespace Application.Profiles; + +public class SquadProfile : Profile +{ + public SquadProfile() + { + CreateMap() + .ForMember(des => des.TypeName, opt => opt.MapFrom(src => src.SquadType.TypeName)); + + CreateMap() + .ForMember(dest => dest.LastUpdateAt, opt => opt.MapFrom(src => DateTime.UtcNow)) + .ForMember(dest => dest.Id, opt => opt.MapFrom(src => Guid.CreateVersion7())); + + CreateMap() + .ForMember(des => des.LastUpdateAt, opt => opt.MapFrom(src => DateTime.UtcNow)); + } +} \ No newline at end of file diff --git a/Application/Profiles/SquadTypeProfile.cs b/Application/Profiles/SquadTypeProfile.cs new file mode 100644 index 0000000..749967e --- /dev/null +++ b/Application/Profiles/SquadTypeProfile.cs @@ -0,0 +1,13 @@ +using Application.DataTransferObjects.SquadType; +using AutoMapper; +using Database.Entities; + +namespace Application.Profiles; + +public class SquadTypeProfile : Profile +{ + public SquadTypeProfile() + { + CreateMap(); + } +} \ No newline at end of file diff --git a/Application/Repositories/SquadRepository.cs b/Application/Repositories/SquadRepository.cs new file mode 100644 index 0000000..65a0e69 --- /dev/null +++ b/Application/Repositories/SquadRepository.cs @@ -0,0 +1,91 @@ +using Application.Classes; +using Application.DataTransferObjects.Squad; +using Application.Errors; +using Application.Interfaces; +using AutoMapper; +using AutoMapper.QueryableExtensions; +using Database; +using Database.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +namespace Application.Repositories; + +public class SquadRepository(ApplicationContext dbContext, IMapper mapper, ILogger logger) : ISquadRepository +{ + public async Task>> GetPlayerSquadsAsync(Guid playerId, CancellationToken cancellationToken = default) + { + var playerSquads = await dbContext.Squads + .Where(squad => squad.PlayerId == playerId) + .ProjectTo(mapper.ConfigurationProvider) + .OrderBy(squad => squad.Position) + .AsNoTracking() + .ToListAsync(cancellationToken); + + return Result.Success(playerSquads); + } + + public async Task> CreateSquadAsync(CreateSquadDto createSquadDto, CancellationToken cancellationToken = default) + { + try + { + var newSuad = mapper.Map(createSquadDto); + + await dbContext.Squads.AddAsync(newSuad, cancellationToken); + + await dbContext.SaveChangesAsync(cancellationToken); + + return Result.Success(mapper.Map(newSuad)); + } + catch (Exception e) + { + logger.LogError(e, "{DatabaseException}", e.Message); + return Result.Failure(GeneralErrors.DatabaseError); + } + } + + public async Task> UpdateSquadAsync(UpdateSquadDto updateSquadDto, CancellationToken cancellationToken = default) + { + try + { + var squadToUpdate = await dbContext.Squads + .FirstOrDefaultAsync(squad => squad.Id == updateSquadDto.Id, cancellationToken); + + if (squadToUpdate is null) return Result.Failure(SquadErrors.NotFound); + + mapper.Map(updateSquadDto, squadToUpdate); + + await dbContext.SaveChangesAsync(cancellationToken); + + return Result.Success(mapper.Map(squadToUpdate)); + } + catch (Exception e) + { + logger.LogError(e, "{DatabaseException}", e.Message); + return Result.Failure(GeneralErrors.DatabaseError); + } + + } + + public async Task> DeleteSquadAsync(Guid squadId, CancellationToken cancellationToken = default) + { + try + { + var squadToDelete = await dbContext.Squads + .FirstOrDefaultAsync(squad => squad.Id == squadId, cancellationToken); + + if (squadToDelete is null) return Result.Failure(SquadErrors.NotFound); + + dbContext.Squads.Remove(squadToDelete); + + await dbContext.SaveChangesAsync(cancellationToken); + + return Result.Success(mapper.Map(true)); + } + catch (Exception e) + { + logger.LogError(e, "{DatabaseException}", e.Message); + return Result.Failure(GeneralErrors.DatabaseError); + } + } +} \ No newline at end of file diff --git a/Application/Repositories/SquadTypeRepository.cs b/Application/Repositories/SquadTypeRepository.cs new file mode 100644 index 0000000..fa7ec9f --- /dev/null +++ b/Application/Repositories/SquadTypeRepository.cs @@ -0,0 +1,22 @@ +using Application.Classes; +using Application.DataTransferObjects.SquadType; +using Application.Interfaces; +using AutoMapper; +using AutoMapper.QueryableExtensions; +using Database; +using Microsoft.EntityFrameworkCore; + +namespace Application.Repositories; + +public class SquadTypeRepository(ApplicationContext dbContext, IMapper mapper) : ISquadTypeRepository +{ + public async Task>> GetSquadTypesAsync(CancellationToken cancellationToken) + { + var squadTypes = await dbContext.SquadTypes + .ProjectTo(mapper.ConfigurationProvider) + .AsNoTracking() + .ToListAsync(cancellationToken); + + return Result.Success(squadTypes); + } +} \ No newline at end of file diff --git a/Database/ApplicationContext.cs b/Database/ApplicationContext.cs index 4aacbf7..18e5f40 100644 --- a/Database/ApplicationContext.cs +++ b/Database/ApplicationContext.cs @@ -46,6 +46,10 @@ public class ApplicationContext(DbContextOptions options) : public DbSet CustomEventCategories { get; set; } + public DbSet Squads { get; set; } + + public DbSet SquadTypes { get; set; } + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { base.OnConfiguring(optionsBuilder); diff --git a/Database/Configurations/SquadConfiguration.cs b/Database/Configurations/SquadConfiguration.cs new file mode 100644 index 0000000..bea2db4 --- /dev/null +++ b/Database/Configurations/SquadConfiguration.cs @@ -0,0 +1,28 @@ +using Database.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace Database.Configurations; + +public class SquadConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(squad => squad.Id); + builder.Property(squad => squad.Id).ValueGeneratedNever(); + + builder.Property(squad => squad.Power).IsRequired().HasPrecision(18,2); + builder.Property(squad => squad.Position).IsRequired(); + builder.Property(squad => squad.LastUpdateAt).IsRequired(); + + builder.HasOne(squad => squad.SquadType) + .WithMany(squadType => squadType.Squads) + .HasForeignKey(squad => squad.SquadTypeId) + .OnDelete(DeleteBehavior.Restrict); + + builder.HasOne(squatType => squatType.Player) + .WithMany(player => player.Squads) + .HasForeignKey(squad => squad.PlayerId) + .OnDelete(DeleteBehavior.Cascade); + } +} \ No newline at end of file diff --git a/Database/Configurations/SquadTypeConfiguration.cs b/Database/Configurations/SquadTypeConfiguration.cs new file mode 100644 index 0000000..da3a205 --- /dev/null +++ b/Database/Configurations/SquadTypeConfiguration.cs @@ -0,0 +1,46 @@ +using Database.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace Database.Configurations; + +public class SquadTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(squadType => squadType.Id); + builder.Property(squadType => squadType.Id).ValueGeneratedNever(); + + builder.Property(squadType => squadType.TypeName) + .IsRequired() + .HasMaxLength(150); + + var squadTypes = new List() + { + new() + { + Id = Guid.CreateVersion7(), + TypeName = "Tanks" + }, + new() + { + Id = Guid.CreateVersion7(), + TypeName = "Missile" + }, + new() + { + Id = Guid.CreateVersion7(), + TypeName = "Aircraft" + }, + new() + { + Id = Guid.CreateVersion7(), + TypeName = "Mixed" + } + }; + + builder.HasData(squadTypes); + + + } +} \ No newline at end of file diff --git a/Database/Entities/Player.cs b/Database/Entities/Player.cs index e09e6aa..8ea0262 100644 --- a/Database/Entities/Player.cs +++ b/Database/Entities/Player.cs @@ -41,4 +41,6 @@ public class Player : BaseEntity public ICollection CustomEventParticipants { get; set; } = []; public ICollection ZombieSiegeParticipants { get; set; } = []; + + public ICollection Squads { get; set; } = []; } \ No newline at end of file diff --git a/Database/Entities/Squad.cs b/Database/Entities/Squad.cs new file mode 100644 index 0000000..290bad4 --- /dev/null +++ b/Database/Entities/Squad.cs @@ -0,0 +1,18 @@ +namespace Database.Entities; + +public class Squad : BaseEntity +{ + public Guid SquadTypeId { get; set; } + + public SquadType SquadType { get; set; } = null!; + + public decimal Power { get; set; } + + public int Position { get; set; } + + public Guid PlayerId { get; set; } + + public Player Player { get; set; } = null!; + + public DateTime LastUpdateAt { get; set; } +} \ No newline at end of file diff --git a/Database/Entities/SquadType.cs b/Database/Entities/SquadType.cs new file mode 100644 index 0000000..fd3beae --- /dev/null +++ b/Database/Entities/SquadType.cs @@ -0,0 +1,8 @@ +namespace Database.Entities; + +public class SquadType : BaseEntity +{ + public required string TypeName { get; set; } + + public ICollection Squads { get; set; } = []; +} \ No newline at end of file diff --git a/Database/Migrations/20250617074428_Add_Squds.Designer.cs b/Database/Migrations/20250617074428_Add_Squds.Designer.cs new file mode 100644 index 0000000..d023c5c --- /dev/null +++ b/Database/Migrations/20250617074428_Add_Squds.Designer.cs @@ -0,0 +1,1379 @@ +// +using System; +using Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Database.Migrations +{ + [DbContext(typeof(ApplicationContext))] + [Migration("20250617074428_Add_Squds")] + partial class Add_Squds + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("dbo") + .HasAnnotation("ProductVersion", "9.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Admonitions", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Server") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Alliances", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("EncryptedKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId") + .IsUnique(); + + b.ToTable("ApiKeys", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CustomEventCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("CustomEventCategoryId"); + + b.ToTable("CustomEvents", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("CustomEventCategories", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AchievedPoints") + .HasColumnType("bigint"); + + b.Property("CustomEventId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CustomEventId"); + + b.HasIndex("PlayerId"); + + b.ToTable("CustomEventParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpposingParticipants") + .HasColumnType("int"); + + b.Property("Team") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasDefaultValue("A"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("DesertStorms", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DesertStormId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Registered") + .HasColumnType("bit"); + + b.Property("StartPlayer") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DesertStormId"); + + b.HasIndex("PlayerId"); + + b.ToTable("DesertStormParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("RewardPhase") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("MarshalGuards", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("MarshalGuardId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MarshalGuardId"); + + b.HasIndex("PlayerId"); + + b.ToTable("MarshalGuardParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerNote") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Notes", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("DismissalReason") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DismissedAt") + .HasColumnType("datetime2"); + + b.Property("IsDismissed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("RankId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("RankId"); + + b.ToTable("Players", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.HasKey("Id"); + + b.ToTable("Ranks", "dbo"); + + b.HasData( + new + { + Id = new Guid("b1c10a1c-5cf3-4e22-9fc1-d9b165b85dd3"), + Name = "R5" + }, + new + { + Id = new Guid("0fc2f68a-0a4d-4922-981e-c624e4c39024"), + Name = "R4" + }, + new + { + Id = new Guid("4970e1f5-f7f5-43e8-88cc-7f8fc4075418"), + Name = "R3" + }, + new + { + Id = new Guid("d8d0c587-f269-45ff-b13e-4631298bf0af"), + Name = "R2" + }, + new + { + Id = new Guid("326edef0-5074-43a5-9db9-edc71221a0f7"), + Name = "R1" + }); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Power") + .HasColumnType("bigint"); + + b.Property("SquadTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("SquadTypeId"); + + b.ToTable("Squad", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("SquadType", "dbo"); + + b.HasData( + new + { + Id = new Guid("01977cd8-bb62-7d5b-823e-b77c6121c4f1"), + TypeName = "Tanks" + }, + new + { + Id = new Guid("01977cd8-bb62-79aa-9a71-95d57250d723"), + TypeName = "Missile" + }, + new + { + Id = new Guid("01977cd8-bb62-7089-85cb-5a48223a6e92"), + TypeName = "Aircraft" + }, + new + { + Id = new Guid("01977cd8-bb62-7150-a0f9-5415e46a87e4"), + TypeName = "Mixed" + }); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("Users", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentPower") + .HasColumnType("bigint"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpponentSize") + .HasColumnType("int"); + + b.Property("VsDuelLeagueId") + .HasColumnType("uniqueidentifier"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("VsDuelLeagueId"); + + b.ToTable("VsDuels", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("VsDuelLeagues", "dbo"); + + b.HasData( + new + { + Id = new Guid("01977cd8-bb64-721f-8881-a613b564da5d"), + Code = 1, + Name = "Silver League" + }, + new + { + Id = new Guid("01977cd8-bb64-7a7c-9c41-e19877c39ebb"), + Code = 2, + Name = "Gold League" + }, + new + { + Id = new Guid("01977cd8-bb64-712a-b54f-d8a6ca676771"), + Code = 3, + Name = "Diamond League" + }); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("VsDuelId") + .HasColumnType("uniqueidentifier"); + + b.Property("WeeklyPoints") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("VsDuelId"); + + b.ToTable("VsDuelParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("ZombieSieges", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SurvivedWaves") + .HasColumnType("int"); + + b.Property("ZombieSiegeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("ZombieSiegeId"); + + b.ToTable("ZombieSiegeParticipants", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Roles", "dbo"); + + b.HasData( + new + { + Id = new Guid("d8b9f882-95f0-4ba0-80ed-9c22c27ac88a"), + Name = "SystemAdministrator", + NormalizedName = "SYSTEMADMINISTRATOR" + }, + new + { + Id = new Guid("47de05ba-ff1e-46b6-9995-269084006c24"), + Name = "Administrator", + NormalizedName = "ADMINISTRATOR" + }, + new + { + Id = new Guid("5cc27946-5601-4a25-b9a9-75b8a11c0cf4"), + Name = "User", + NormalizedName = "USER" + }, + new + { + Id = new Guid("207bb0a3-ad50-49bb-bc41-b266fce66529"), + Name = "ReadOnly", + NormalizedName = "READONLY" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("RoleClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("UserLogins", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("UserRoles", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("UserTokens", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Admonitions") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithOne("ApiKey") + .HasForeignKey("Database.Entities.ApiKey", "AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEvents") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.CustomEventCategory", "CustomEventCategory") + .WithMany("CustomEvents") + .HasForeignKey("CustomEventCategoryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Alliance"); + + b.Navigation("CustomEventCategory"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEventCategories") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.HasOne("Database.Entities.CustomEvent", "CustomEvent") + .WithMany("CustomEventParticipants") + .HasForeignKey("CustomEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("CustomEventParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CustomEvent"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("DesertStorms") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.HasOne("Database.Entities.DesertStorm", "DesertStorm") + .WithMany("DesertStormParticipants") + .HasForeignKey("DesertStormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("DesertStormParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("DesertStorm"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("MarshalGuards") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.HasOne("Database.Entities.MarshalGuard", "MarshalGuard") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("MarshalGuardId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("MarshalGuard"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Notes") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Players") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Rank", "Rank") + .WithMany("Players") + .HasForeignKey("RankId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + + b.Navigation("Rank"); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Squads") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.SquadType", "SquadType") + .WithMany("Squads") + .HasForeignKey("SquadTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("SquadType"); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Users") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("VsDuels") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuelLeague", "VsDuelLeague") + .WithMany("VsDuels") + .HasForeignKey("VsDuelLeagueId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Alliance"); + + b.Navigation("VsDuelLeague"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("VsDuelParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuel", "VsDuel") + .WithMany("VsDuelParticipants") + .HasForeignKey("VsDuelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("VsDuel"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("ZombieSieges") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.ZombieSiege", "ZombieSiege") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("ZombieSiegeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("ZombieSiege"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Navigation("ApiKey"); + + b.Navigation("CustomEventCategories"); + + b.Navigation("CustomEvents"); + + b.Navigation("DesertStorms"); + + b.Navigation("MarshalGuards"); + + b.Navigation("Players"); + + b.Navigation("Users"); + + b.Navigation("VsDuels"); + + b.Navigation("ZombieSieges"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Navigation("CustomEventParticipants"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Navigation("CustomEvents"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Navigation("DesertStormParticipants"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Navigation("MarshalGuardParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Navigation("Admonitions"); + + b.Navigation("CustomEventParticipants"); + + b.Navigation("DesertStormParticipants"); + + b.Navigation("MarshalGuardParticipants"); + + b.Navigation("Notes"); + + b.Navigation("Squads"); + + b.Navigation("VsDuelParticipants"); + + b.Navigation("ZombieSiegeParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Navigation("Players"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Navigation("Squads"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Navigation("VsDuelParticipants"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Navigation("VsDuels"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Navigation("ZombieSiegeParticipants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Database/Migrations/20250617074428_Add_Squds.cs b/Database/Migrations/20250617074428_Add_Squds.cs new file mode 100644 index 0000000..73b797a --- /dev/null +++ b/Database/Migrations/20250617074428_Add_Squds.cs @@ -0,0 +1,96 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace Database.Migrations +{ + /// + public partial class Add_Squds : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + migrationBuilder.CreateTable( + name: "SquadType", + schema: "dbo", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TypeName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SquadType", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Squad", + schema: "dbo", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + SquadTypeId = table.Column(type: "uniqueidentifier", nullable: false), + Power = table.Column(type: "bigint", nullable: false), + PlayerId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Squad", x => x.Id); + table.ForeignKey( + name: "FK_Squad_Players_PlayerId", + column: x => x.PlayerId, + principalSchema: "dbo", + principalTable: "Players", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Squad_SquadType_SquadTypeId", + column: x => x.SquadTypeId, + principalSchema: "dbo", + principalTable: "SquadType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.InsertData( + schema: "dbo", + table: "SquadType", + columns: new[] { "Id", "TypeName" }, + values: new object[,] + { + { new Guid("01977cd8-bb62-7089-85cb-5a48223a6e92"), "Aircraft" }, + { new Guid("01977cd8-bb62-7150-a0f9-5415e46a87e4"), "Mixed" }, + { new Guid("01977cd8-bb62-79aa-9a71-95d57250d723"), "Missile" }, + { new Guid("01977cd8-bb62-7d5b-823e-b77c6121c4f1"), "Tanks" } + }); + + migrationBuilder.CreateIndex( + name: "IX_Squad_PlayerId", + schema: "dbo", + table: "Squad", + column: "PlayerId"); + + migrationBuilder.CreateIndex( + name: "IX_Squad_SquadTypeId", + schema: "dbo", + table: "Squad", + column: "SquadTypeId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Squad", + schema: "dbo"); + + migrationBuilder.DropTable( + name: "SquadType", + schema: "dbo"); + } + } +} diff --git a/Database/Migrations/20250617082727_Update_Squad.Designer.cs b/Database/Migrations/20250617082727_Update_Squad.Designer.cs new file mode 100644 index 0000000..808b5ec --- /dev/null +++ b/Database/Migrations/20250617082727_Update_Squad.Designer.cs @@ -0,0 +1,1382 @@ +// +using System; +using Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Database.Migrations +{ + [DbContext(typeof(ApplicationContext))] + [Migration("20250617082727_Update_Squad")] + partial class Update_Squad + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("dbo") + .HasAnnotation("ProductVersion", "9.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Admonitions", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Server") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Alliances", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("EncryptedKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId") + .IsUnique(); + + b.ToTable("ApiKeys", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CustomEventCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("CustomEventCategoryId"); + + b.ToTable("CustomEvents", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("CustomEventCategories", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AchievedPoints") + .HasColumnType("bigint"); + + b.Property("CustomEventId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CustomEventId"); + + b.HasIndex("PlayerId"); + + b.ToTable("CustomEventParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpposingParticipants") + .HasColumnType("int"); + + b.Property("Team") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasDefaultValue("A"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("DesertStorms", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DesertStormId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Registered") + .HasColumnType("bit"); + + b.Property("StartPlayer") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DesertStormId"); + + b.HasIndex("PlayerId"); + + b.ToTable("DesertStormParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("RewardPhase") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("MarshalGuards", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("MarshalGuardId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MarshalGuardId"); + + b.HasIndex("PlayerId"); + + b.ToTable("MarshalGuardParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerNote") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Notes", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("DismissalReason") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DismissedAt") + .HasColumnType("datetime2"); + + b.Property("IsDismissed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("RankId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("RankId"); + + b.ToTable("Players", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.HasKey("Id"); + + b.ToTable("Ranks", "dbo"); + + b.HasData( + new + { + Id = new Guid("b1c10a1c-5cf3-4e22-9fc1-d9b165b85dd3"), + Name = "R5" + }, + new + { + Id = new Guid("0fc2f68a-0a4d-4922-981e-c624e4c39024"), + Name = "R4" + }, + new + { + Id = new Guid("4970e1f5-f7f5-43e8-88cc-7f8fc4075418"), + Name = "R3" + }, + new + { + Id = new Guid("d8d0c587-f269-45ff-b13e-4631298bf0af"), + Name = "R2" + }, + new + { + Id = new Guid("326edef0-5074-43a5-9db9-edc71221a0f7"), + Name = "R1" + }); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Position") + .HasColumnType("int"); + + b.Property("Power") + .HasColumnType("bigint"); + + b.Property("SquadTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("SquadTypeId"); + + b.ToTable("Squads", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("SquadTypes", "dbo"); + + b.HasData( + new + { + Id = new Guid("01977d00-1596-7c18-a665-e079870ae3cb"), + TypeName = "Tanks" + }, + new + { + Id = new Guid("01977d00-1596-7078-b24d-f5abd8baaec1"), + TypeName = "Missile" + }, + new + { + Id = new Guid("01977d00-1596-71a1-bbff-db88a4a59f32"), + TypeName = "Aircraft" + }, + new + { + Id = new Guid("01977d00-1596-7644-98aa-ff20f05f13bb"), + TypeName = "Mixed" + }); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("Users", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentPower") + .HasColumnType("bigint"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpponentSize") + .HasColumnType("int"); + + b.Property("VsDuelLeagueId") + .HasColumnType("uniqueidentifier"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("VsDuelLeagueId"); + + b.ToTable("VsDuels", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("VsDuelLeagues", "dbo"); + + b.HasData( + new + { + Id = new Guid("01977d00-159a-7c8d-947d-56c18ec1ec5b"), + Code = 1, + Name = "Silver League" + }, + new + { + Id = new Guid("01977d00-159a-766e-bdbd-e7c9a6b0805c"), + Code = 2, + Name = "Gold League" + }, + new + { + Id = new Guid("01977d00-159a-75b5-b1b3-2b968e39eb21"), + Code = 3, + Name = "Diamond League" + }); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("VsDuelId") + .HasColumnType("uniqueidentifier"); + + b.Property("WeeklyPoints") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("VsDuelId"); + + b.ToTable("VsDuelParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("ZombieSieges", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SurvivedWaves") + .HasColumnType("int"); + + b.Property("ZombieSiegeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("ZombieSiegeId"); + + b.ToTable("ZombieSiegeParticipants", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Roles", "dbo"); + + b.HasData( + new + { + Id = new Guid("d8b9f882-95f0-4ba0-80ed-9c22c27ac88a"), + Name = "SystemAdministrator", + NormalizedName = "SYSTEMADMINISTRATOR" + }, + new + { + Id = new Guid("47de05ba-ff1e-46b6-9995-269084006c24"), + Name = "Administrator", + NormalizedName = "ADMINISTRATOR" + }, + new + { + Id = new Guid("5cc27946-5601-4a25-b9a9-75b8a11c0cf4"), + Name = "User", + NormalizedName = "USER" + }, + new + { + Id = new Guid("207bb0a3-ad50-49bb-bc41-b266fce66529"), + Name = "ReadOnly", + NormalizedName = "READONLY" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("RoleClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("UserLogins", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("UserRoles", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("UserTokens", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Admonitions") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithOne("ApiKey") + .HasForeignKey("Database.Entities.ApiKey", "AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEvents") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.CustomEventCategory", "CustomEventCategory") + .WithMany("CustomEvents") + .HasForeignKey("CustomEventCategoryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Alliance"); + + b.Navigation("CustomEventCategory"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEventCategories") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.HasOne("Database.Entities.CustomEvent", "CustomEvent") + .WithMany("CustomEventParticipants") + .HasForeignKey("CustomEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("CustomEventParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CustomEvent"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("DesertStorms") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.HasOne("Database.Entities.DesertStorm", "DesertStorm") + .WithMany("DesertStormParticipants") + .HasForeignKey("DesertStormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("DesertStormParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("DesertStorm"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("MarshalGuards") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.HasOne("Database.Entities.MarshalGuard", "MarshalGuard") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("MarshalGuardId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("MarshalGuard"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Notes") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Players") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Rank", "Rank") + .WithMany("Players") + .HasForeignKey("RankId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + + b.Navigation("Rank"); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Squads") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.SquadType", "SquadType") + .WithMany("Squads") + .HasForeignKey("SquadTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("SquadType"); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Users") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("VsDuels") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuelLeague", "VsDuelLeague") + .WithMany("VsDuels") + .HasForeignKey("VsDuelLeagueId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Alliance"); + + b.Navigation("VsDuelLeague"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("VsDuelParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuel", "VsDuel") + .WithMany("VsDuelParticipants") + .HasForeignKey("VsDuelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("VsDuel"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("ZombieSieges") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.ZombieSiege", "ZombieSiege") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("ZombieSiegeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("ZombieSiege"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Navigation("ApiKey"); + + b.Navigation("CustomEventCategories"); + + b.Navigation("CustomEvents"); + + b.Navigation("DesertStorms"); + + b.Navigation("MarshalGuards"); + + b.Navigation("Players"); + + b.Navigation("Users"); + + b.Navigation("VsDuels"); + + b.Navigation("ZombieSieges"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Navigation("CustomEventParticipants"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Navigation("CustomEvents"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Navigation("DesertStormParticipants"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Navigation("MarshalGuardParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Navigation("Admonitions"); + + b.Navigation("CustomEventParticipants"); + + b.Navigation("DesertStormParticipants"); + + b.Navigation("MarshalGuardParticipants"); + + b.Navigation("Notes"); + + b.Navigation("Squads"); + + b.Navigation("VsDuelParticipants"); + + b.Navigation("ZombieSiegeParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Navigation("Players"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Navigation("Squads"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Navigation("VsDuelParticipants"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Navigation("VsDuels"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Navigation("ZombieSiegeParticipants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Database/Migrations/20250617082727_Update_Squad.cs b/Database/Migrations/20250617082727_Update_Squad.cs new file mode 100644 index 0000000..4e6ee25 --- /dev/null +++ b/Database/Migrations/20250617082727_Update_Squad.cs @@ -0,0 +1,224 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace Database.Migrations +{ + /// + public partial class Update_Squad : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Squad_Players_PlayerId", + schema: "dbo", + table: "Squad"); + + migrationBuilder.DropForeignKey( + name: "FK_Squad_SquadType_SquadTypeId", + schema: "dbo", + table: "Squad"); + + migrationBuilder.DropPrimaryKey( + name: "PK_SquadType", + schema: "dbo", + table: "SquadType"); + + migrationBuilder.DropPrimaryKey( + name: "PK_Squad", + schema: "dbo", + table: "Squad"); + + + migrationBuilder.RenameTable( + name: "SquadType", + schema: "dbo", + newName: "SquadTypes", + newSchema: "dbo"); + + migrationBuilder.RenameTable( + name: "Squad", + schema: "dbo", + newName: "Squads", + newSchema: "dbo"); + + migrationBuilder.RenameIndex( + name: "IX_Squad_SquadTypeId", + schema: "dbo", + table: "Squads", + newName: "IX_Squads_SquadTypeId"); + + migrationBuilder.RenameIndex( + name: "IX_Squad_PlayerId", + schema: "dbo", + table: "Squads", + newName: "IX_Squads_PlayerId"); + + migrationBuilder.AddColumn( + name: "Position", + schema: "dbo", + table: "Squads", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddPrimaryKey( + name: "PK_SquadTypes", + schema: "dbo", + table: "SquadTypes", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_Squads", + schema: "dbo", + table: "Squads", + column: "Id"); + + + migrationBuilder.AddForeignKey( + name: "FK_Squads_Players_PlayerId", + schema: "dbo", + table: "Squads", + column: "PlayerId", + principalSchema: "dbo", + principalTable: "Players", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_Squads_SquadTypes_SquadTypeId", + schema: "dbo", + table: "Squads", + column: "SquadTypeId", + principalSchema: "dbo", + principalTable: "SquadTypes", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Squads_Players_PlayerId", + schema: "dbo", + table: "Squads"); + + migrationBuilder.DropForeignKey( + name: "FK_Squads_SquadTypes_SquadTypeId", + schema: "dbo", + table: "Squads"); + + migrationBuilder.DropPrimaryKey( + name: "PK_SquadTypes", + schema: "dbo", + table: "SquadTypes"); + + migrationBuilder.DropPrimaryKey( + name: "PK_Squads", + schema: "dbo", + table: "Squads"); + + migrationBuilder.DeleteData( + schema: "dbo", + table: "SquadTypes", + keyColumn: "Id", + keyValue: new Guid("01977d00-1596-7078-b24d-f5abd8baaec1")); + + migrationBuilder.DeleteData( + schema: "dbo", + table: "SquadTypes", + keyColumn: "Id", + keyValue: new Guid("01977d00-1596-71a1-bbff-db88a4a59f32")); + + migrationBuilder.DeleteData( + schema: "dbo", + table: "SquadTypes", + keyColumn: "Id", + keyValue: new Guid("01977d00-1596-7644-98aa-ff20f05f13bb")); + + migrationBuilder.DeleteData( + schema: "dbo", + table: "SquadTypes", + keyColumn: "Id", + keyValue: new Guid("01977d00-1596-7c18-a665-e079870ae3cb")); + + migrationBuilder.DropColumn( + name: "Position", + schema: "dbo", + table: "Squads"); + + migrationBuilder.RenameTable( + name: "SquadTypes", + schema: "dbo", + newName: "SquadType", + newSchema: "dbo"); + + migrationBuilder.RenameTable( + name: "Squads", + schema: "dbo", + newName: "Squad", + newSchema: "dbo"); + + migrationBuilder.RenameIndex( + name: "IX_Squads_SquadTypeId", + schema: "dbo", + table: "Squad", + newName: "IX_Squad_SquadTypeId"); + + migrationBuilder.RenameIndex( + name: "IX_Squads_PlayerId", + schema: "dbo", + table: "Squad", + newName: "IX_Squad_PlayerId"); + + migrationBuilder.AddPrimaryKey( + name: "PK_SquadType", + schema: "dbo", + table: "SquadType", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_Squad", + schema: "dbo", + table: "Squad", + column: "Id"); + + migrationBuilder.InsertData( + schema: "dbo", + table: "SquadType", + columns: new[] { "Id", "TypeName" }, + values: new object[,] + { + { new Guid("01977cd8-bb62-7089-85cb-5a48223a6e92"), "Aircraft" }, + { new Guid("01977cd8-bb62-7150-a0f9-5415e46a87e4"), "Mixed" }, + { new Guid("01977cd8-bb62-79aa-9a71-95d57250d723"), "Missile" }, + { new Guid("01977cd8-bb62-7d5b-823e-b77c6121c4f1"), "Tanks" } + }); + + migrationBuilder.AddForeignKey( + name: "FK_Squad_Players_PlayerId", + schema: "dbo", + table: "Squad", + column: "PlayerId", + principalSchema: "dbo", + principalTable: "Players", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_Squad_SquadType_SquadTypeId", + schema: "dbo", + table: "Squad", + column: "SquadTypeId", + principalSchema: "dbo", + principalTable: "SquadType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/Database/Migrations/20250619052205_Add_Lastupdate_to_squad.Designer.cs b/Database/Migrations/20250619052205_Add_Lastupdate_to_squad.Designer.cs new file mode 100644 index 0000000..bcd569c --- /dev/null +++ b/Database/Migrations/20250619052205_Add_Lastupdate_to_squad.Designer.cs @@ -0,0 +1,1385 @@ +// +using System; +using Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Database.Migrations +{ + [DbContext(typeof(ApplicationContext))] + [Migration("20250619052205_Add_Lastupdate_to_squad")] + partial class Add_Lastupdate_to_squad + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("dbo") + .HasAnnotation("ProductVersion", "9.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Admonitions", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Server") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Alliances", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("EncryptedKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId") + .IsUnique(); + + b.ToTable("ApiKeys", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CustomEventCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("CustomEventCategoryId"); + + b.ToTable("CustomEvents", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("CustomEventCategories", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AchievedPoints") + .HasColumnType("bigint"); + + b.Property("CustomEventId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CustomEventId"); + + b.HasIndex("PlayerId"); + + b.ToTable("CustomEventParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpposingParticipants") + .HasColumnType("int"); + + b.Property("Team") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasDefaultValue("A"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("DesertStorms", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DesertStormId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Registered") + .HasColumnType("bit"); + + b.Property("StartPlayer") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DesertStormId"); + + b.HasIndex("PlayerId"); + + b.ToTable("DesertStormParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("RewardPhase") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("MarshalGuards", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("MarshalGuardId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MarshalGuardId"); + + b.HasIndex("PlayerId"); + + b.ToTable("MarshalGuardParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerNote") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Notes", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("DismissalReason") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DismissedAt") + .HasColumnType("datetime2"); + + b.Property("IsDismissed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("RankId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("RankId"); + + b.ToTable("Players", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.HasKey("Id"); + + b.ToTable("Ranks", "dbo"); + + b.HasData( + new + { + Id = new Guid("b1c10a1c-5cf3-4e22-9fc1-d9b165b85dd3"), + Name = "R5" + }, + new + { + Id = new Guid("0fc2f68a-0a4d-4922-981e-c624e4c39024"), + Name = "R4" + }, + new + { + Id = new Guid("4970e1f5-f7f5-43e8-88cc-7f8fc4075418"), + Name = "R3" + }, + new + { + Id = new Guid("d8d0c587-f269-45ff-b13e-4631298bf0af"), + Name = "R2" + }, + new + { + Id = new Guid("326edef0-5074-43a5-9db9-edc71221a0f7"), + Name = "R1" + }); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdateAt") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Position") + .HasColumnType("int"); + + b.Property("Power") + .HasColumnType("bigint"); + + b.Property("SquadTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("SquadTypeId"); + + b.ToTable("Squads", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("SquadTypes", "dbo"); + + b.HasData( + new + { + Id = new Guid("019786a3-17f5-7634-bb11-87b188d9510b"), + TypeName = "Tanks" + }, + new + { + Id = new Guid("019786a3-17f5-77c9-ad85-398874bf3497"), + TypeName = "Missile" + }, + new + { + Id = new Guid("019786a3-17f5-728c-a5de-162cdf8a1b0d"), + TypeName = "Aircraft" + }, + new + { + Id = new Guid("019786a3-17f5-732b-ac04-dcdddd3f7736"), + TypeName = "Mixed" + }); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("Users", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentPower") + .HasColumnType("bigint"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpponentSize") + .HasColumnType("int"); + + b.Property("VsDuelLeagueId") + .HasColumnType("uniqueidentifier"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("VsDuelLeagueId"); + + b.ToTable("VsDuels", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("VsDuelLeagues", "dbo"); + + b.HasData( + new + { + Id = new Guid("019786a3-17f8-78a8-8c5e-cc1036f64454"), + Code = 1, + Name = "Silver League" + }, + new + { + Id = new Guid("019786a3-17f8-7e97-acd6-3b84721f6ba4"), + Code = 2, + Name = "Gold League" + }, + new + { + Id = new Guid("019786a3-17f8-7e3a-99ce-b8f2458c8561"), + Code = 3, + Name = "Diamond League" + }); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("VsDuelId") + .HasColumnType("uniqueidentifier"); + + b.Property("WeeklyPoints") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("VsDuelId"); + + b.ToTable("VsDuelParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("ZombieSieges", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SurvivedWaves") + .HasColumnType("int"); + + b.Property("ZombieSiegeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("ZombieSiegeId"); + + b.ToTable("ZombieSiegeParticipants", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Roles", "dbo"); + + b.HasData( + new + { + Id = new Guid("d8b9f882-95f0-4ba0-80ed-9c22c27ac88a"), + Name = "SystemAdministrator", + NormalizedName = "SYSTEMADMINISTRATOR" + }, + new + { + Id = new Guid("47de05ba-ff1e-46b6-9995-269084006c24"), + Name = "Administrator", + NormalizedName = "ADMINISTRATOR" + }, + new + { + Id = new Guid("5cc27946-5601-4a25-b9a9-75b8a11c0cf4"), + Name = "User", + NormalizedName = "USER" + }, + new + { + Id = new Guid("207bb0a3-ad50-49bb-bc41-b266fce66529"), + Name = "ReadOnly", + NormalizedName = "READONLY" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("RoleClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("UserLogins", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("UserRoles", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("UserTokens", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Admonitions") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithOne("ApiKey") + .HasForeignKey("Database.Entities.ApiKey", "AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEvents") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.CustomEventCategory", "CustomEventCategory") + .WithMany("CustomEvents") + .HasForeignKey("CustomEventCategoryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Alliance"); + + b.Navigation("CustomEventCategory"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEventCategories") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.HasOne("Database.Entities.CustomEvent", "CustomEvent") + .WithMany("CustomEventParticipants") + .HasForeignKey("CustomEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("CustomEventParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CustomEvent"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("DesertStorms") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.HasOne("Database.Entities.DesertStorm", "DesertStorm") + .WithMany("DesertStormParticipants") + .HasForeignKey("DesertStormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("DesertStormParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("DesertStorm"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("MarshalGuards") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.HasOne("Database.Entities.MarshalGuard", "MarshalGuard") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("MarshalGuardId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("MarshalGuard"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Notes") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Players") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Rank", "Rank") + .WithMany("Players") + .HasForeignKey("RankId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + + b.Navigation("Rank"); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Squads") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.SquadType", "SquadType") + .WithMany("Squads") + .HasForeignKey("SquadTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("SquadType"); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Users") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("VsDuels") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuelLeague", "VsDuelLeague") + .WithMany("VsDuels") + .HasForeignKey("VsDuelLeagueId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Alliance"); + + b.Navigation("VsDuelLeague"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("VsDuelParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuel", "VsDuel") + .WithMany("VsDuelParticipants") + .HasForeignKey("VsDuelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("VsDuel"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("ZombieSieges") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.ZombieSiege", "ZombieSiege") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("ZombieSiegeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("ZombieSiege"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Navigation("ApiKey"); + + b.Navigation("CustomEventCategories"); + + b.Navigation("CustomEvents"); + + b.Navigation("DesertStorms"); + + b.Navigation("MarshalGuards"); + + b.Navigation("Players"); + + b.Navigation("Users"); + + b.Navigation("VsDuels"); + + b.Navigation("ZombieSieges"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Navigation("CustomEventParticipants"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Navigation("CustomEvents"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Navigation("DesertStormParticipants"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Navigation("MarshalGuardParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Navigation("Admonitions"); + + b.Navigation("CustomEventParticipants"); + + b.Navigation("DesertStormParticipants"); + + b.Navigation("MarshalGuardParticipants"); + + b.Navigation("Notes"); + + b.Navigation("Squads"); + + b.Navigation("VsDuelParticipants"); + + b.Navigation("ZombieSiegeParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Navigation("Players"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Navigation("Squads"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Navigation("VsDuelParticipants"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Navigation("VsDuels"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Navigation("ZombieSiegeParticipants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Database/Migrations/20250619052205_Add_Lastupdate_to_squad.cs b/Database/Migrations/20250619052205_Add_Lastupdate_to_squad.cs new file mode 100644 index 0000000..70115ed --- /dev/null +++ b/Database/Migrations/20250619052205_Add_Lastupdate_to_squad.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace Database.Migrations +{ + /// + public partial class Add_Lastupdate_to_squad : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "LastUpdateAt", + schema: "dbo", + table: "Squads", + type: "datetime2", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "LastUpdateAt", + schema: "dbo", + table: "Squads"); + } + } +} diff --git a/Database/Migrations/20250619075856_Change_squad_power_to_decimal.Designer.cs b/Database/Migrations/20250619075856_Change_squad_power_to_decimal.Designer.cs new file mode 100644 index 0000000..6958cae --- /dev/null +++ b/Database/Migrations/20250619075856_Change_squad_power_to_decimal.Designer.cs @@ -0,0 +1,1386 @@ +// +using System; +using Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Database.Migrations +{ + [DbContext(typeof(ApplicationContext))] + [Migration("20250619075856_Change_squad_power_to_decimal")] + partial class Change_squad_power_to_decimal + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("dbo") + .HasAnnotation("ProductVersion", "9.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Reason") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Admonitions", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Server") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Alliances", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("EncryptedKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId") + .IsUnique(); + + b.ToTable("ApiKeys", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CustomEventCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("CustomEventCategoryId"); + + b.ToTable("CustomEvents", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsParticipationEvent") + .HasColumnType("bit"); + + b.Property("IsPointsEvent") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("CustomEventCategories", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AchievedPoints") + .HasColumnType("bigint"); + + b.Property("CustomEventId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("CustomEventId"); + + b.HasIndex("PlayerId"); + + b.ToTable("CustomEventParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpposingParticipants") + .HasColumnType("int"); + + b.Property("Team") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasDefaultValue("A"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("DesertStorms", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DesertStormId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Registered") + .HasColumnType("bit"); + + b.Property("StartPlayer") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DesertStormId"); + + b.HasIndex("PlayerId"); + + b.ToTable("DesertStormParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("RewardPhase") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("MarshalGuards", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("MarshalGuardId") + .HasColumnType("uniqueidentifier"); + + b.Property("Participated") + .HasColumnType("bit"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("MarshalGuardId"); + + b.HasIndex("PlayerId"); + + b.ToTable("MarshalGuardParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerNote") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.ToTable("Notes", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("CreatedOn") + .HasColumnType("datetime2"); + + b.Property("DismissalReason") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("DismissedAt") + .HasColumnType("datetime2"); + + b.Property("IsDismissed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("RankId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("RankId"); + + b.ToTable("Players", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.HasKey("Id"); + + b.ToTable("Ranks", "dbo"); + + b.HasData( + new + { + Id = new Guid("b1c10a1c-5cf3-4e22-9fc1-d9b165b85dd3"), + Name = "R5" + }, + new + { + Id = new Guid("0fc2f68a-0a4d-4922-981e-c624e4c39024"), + Name = "R4" + }, + new + { + Id = new Guid("4970e1f5-f7f5-43e8-88cc-7f8fc4075418"), + Name = "R3" + }, + new + { + Id = new Guid("d8d0c587-f269-45ff-b13e-4631298bf0af"), + Name = "R2" + }, + new + { + Id = new Guid("326edef0-5074-43a5-9db9-edc71221a0f7"), + Name = "R1" + }); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdateAt") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Position") + .HasColumnType("int"); + + b.Property("Power") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("SquadTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("SquadTypeId"); + + b.ToTable("Squads", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("SquadTypes", "dbo"); + + b.HasData( + new + { + Id = new Guid("01978732-b32b-7af9-bf5f-a69585d89eb7"), + TypeName = "Tanks" + }, + new + { + Id = new Guid("01978732-b32b-7fe8-9ee5-68b0d0df44f4"), + TypeName = "Missile" + }, + new + { + Id = new Guid("01978732-b32b-780e-bef0-6bcf784ee1b4"), + TypeName = "Aircraft" + }, + new + { + Id = new Guid("01978732-b32b-79c9-adaa-19ed53157f67"), + TypeName = "Mixed" + }); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("PlayerName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("Users", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("IsInProgress") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.Property("OpponentName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("OpponentPower") + .HasColumnType("bigint"); + + b.Property("OpponentServer") + .HasColumnType("int"); + + b.Property("OpponentSize") + .HasColumnType("int"); + + b.Property("VsDuelLeagueId") + .HasColumnType("uniqueidentifier"); + + b.Property("Won") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.HasIndex("VsDuelLeagueId"); + + b.ToTable("VsDuels", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("VsDuelLeagues", "dbo"); + + b.HasData( + new + { + Id = new Guid("01978732-b32e-7aa5-8e77-507b8b20977d"), + Code = 1, + Name = "Silver League" + }, + new + { + Id = new Guid("01978732-b32e-76d6-9beb-3fd062efe9ef"), + Code = 2, + Name = "Gold League" + }, + new + { + Id = new Guid("01978732-b32e-7583-9522-90dde6d778b6"), + Code = 3, + Name = "Diamond League" + }); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("VsDuelId") + .HasColumnType("uniqueidentifier"); + + b.Property("WeeklyPoints") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("VsDuelId"); + + b.ToTable("VsDuelParticipants", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceId") + .HasColumnType("uniqueidentifier"); + + b.Property("AllianceSize") + .HasColumnType("int"); + + b.Property("CreatedBy") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EventDate") + .HasColumnType("datetime2"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ModifiedOn") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("AllianceId"); + + b.ToTable("ZombieSieges", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("SurvivedWaves") + .HasColumnType("int"); + + b.Property("ZombieSiegeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("ZombieSiegeId"); + + b.ToTable("ZombieSiegeParticipants", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Roles", "dbo"); + + b.HasData( + new + { + Id = new Guid("d8b9f882-95f0-4ba0-80ed-9c22c27ac88a"), + Name = "SystemAdministrator", + NormalizedName = "SYSTEMADMINISTRATOR" + }, + new + { + Id = new Guid("47de05ba-ff1e-46b6-9995-269084006c24"), + Name = "Administrator", + NormalizedName = "ADMINISTRATOR" + }, + new + { + Id = new Guid("5cc27946-5601-4a25-b9a9-75b8a11c0cf4"), + Name = "User", + NormalizedName = "USER" + }, + new + { + Id = new Guid("207bb0a3-ad50-49bb-bc41-b266fce66529"), + Name = "ReadOnly", + NormalizedName = "READONLY" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("RoleClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserClaims", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("UserLogins", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("UserRoles", "dbo"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("UserTokens", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.Admonition", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Admonitions") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.ApiKey", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithOne("ApiKey") + .HasForeignKey("Database.Entities.ApiKey", "AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEvents") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.CustomEventCategory", "CustomEventCategory") + .WithMany("CustomEvents") + .HasForeignKey("CustomEventCategoryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Alliance"); + + b.Navigation("CustomEventCategory"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("CustomEventCategories") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventParticipant", b => + { + b.HasOne("Database.Entities.CustomEvent", "CustomEvent") + .WithMany("CustomEventParticipants") + .HasForeignKey("CustomEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("CustomEventParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CustomEvent"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("DesertStorms") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.DesertStormParticipant", b => + { + b.HasOne("Database.Entities.DesertStorm", "DesertStorm") + .WithMany("DesertStormParticipants") + .HasForeignKey("DesertStormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("DesertStormParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("DesertStorm"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("MarshalGuards") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuardParticipant", b => + { + b.HasOne("Database.Entities.MarshalGuard", "MarshalGuard") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("MarshalGuardId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Player", "Player") + .WithMany("MarshalGuardParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("MarshalGuard"); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Note", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Notes") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Players") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.Rank", "Rank") + .WithMany("Players") + .HasForeignKey("RankId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + + b.Navigation("Rank"); + }); + + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Squads") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.SquadType", "SquadType") + .WithMany("Squads") + .HasForeignKey("SquadTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("SquadType"); + }); + + modelBuilder.Entity("Database.Entities.User", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("Users") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("VsDuels") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuelLeague", "VsDuelLeague") + .WithMany("VsDuels") + .HasForeignKey("VsDuelLeagueId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Alliance"); + + b.Navigation("VsDuelLeague"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("VsDuelParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.VsDuel", "VsDuel") + .WithMany("VsDuelParticipants") + .HasForeignKey("VsDuelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("VsDuel"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.HasOne("Database.Entities.Alliance", "Alliance") + .WithMany("ZombieSieges") + .HasForeignKey("AllianceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alliance"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiegeParticipant", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Database.Entities.ZombieSiege", "ZombieSiege") + .WithMany("ZombieSiegeParticipants") + .HasForeignKey("ZombieSiegeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("ZombieSiege"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Database.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Database.Entities.Alliance", b => + { + b.Navigation("ApiKey"); + + b.Navigation("CustomEventCategories"); + + b.Navigation("CustomEvents"); + + b.Navigation("DesertStorms"); + + b.Navigation("MarshalGuards"); + + b.Navigation("Players"); + + b.Navigation("Users"); + + b.Navigation("VsDuels"); + + b.Navigation("ZombieSieges"); + }); + + modelBuilder.Entity("Database.Entities.CustomEvent", b => + { + b.Navigation("CustomEventParticipants"); + }); + + modelBuilder.Entity("Database.Entities.CustomEventCategory", b => + { + b.Navigation("CustomEvents"); + }); + + modelBuilder.Entity("Database.Entities.DesertStorm", b => + { + b.Navigation("DesertStormParticipants"); + }); + + modelBuilder.Entity("Database.Entities.MarshalGuard", b => + { + b.Navigation("MarshalGuardParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Player", b => + { + b.Navigation("Admonitions"); + + b.Navigation("CustomEventParticipants"); + + b.Navigation("DesertStormParticipants"); + + b.Navigation("MarshalGuardParticipants"); + + b.Navigation("Notes"); + + b.Navigation("Squads"); + + b.Navigation("VsDuelParticipants"); + + b.Navigation("ZombieSiegeParticipants"); + }); + + modelBuilder.Entity("Database.Entities.Rank", b => + { + b.Navigation("Players"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Navigation("Squads"); + }); + + modelBuilder.Entity("Database.Entities.VsDuel", b => + { + b.Navigation("VsDuelParticipants"); + }); + + modelBuilder.Entity("Database.Entities.VsDuelLeague", b => + { + b.Navigation("VsDuels"); + }); + + modelBuilder.Entity("Database.Entities.ZombieSiege", b => + { + b.Navigation("ZombieSiegeParticipants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Database/Migrations/20250619075856_Change_squad_power_to_decimal.cs b/Database/Migrations/20250619075856_Change_squad_power_to_decimal.cs new file mode 100644 index 0000000..dc54d10 --- /dev/null +++ b/Database/Migrations/20250619075856_Change_squad_power_to_decimal.cs @@ -0,0 +1,43 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace Database.Migrations +{ + /// + public partial class Change_squad_power_to_decimal : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Power", + schema: "dbo", + table: "Squads", + type: "decimal(18,2)", + precision: 18, + scale: 2, + nullable: false, + oldClrType: typeof(long), + oldType: "bigint"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Power", + schema: "dbo", + table: "Squads", + type: "bigint", + nullable: false, + oldClrType: typeof(decimal), + oldType: "decimal(18,2)", + oldPrecision: 18, + oldScale: 2); + } + } +} diff --git a/Database/Migrations/ApplicationContextModelSnapshot.cs b/Database/Migrations/ApplicationContextModelSnapshot.cs index dbcd59d..ceb618e 100644 --- a/Database/Migrations/ApplicationContextModelSnapshot.cs +++ b/Database/Migrations/ApplicationContextModelSnapshot.cs @@ -510,6 +510,73 @@ namespace Database.Migrations }); }); + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdateAt") + .HasColumnType("datetime2"); + + b.Property("PlayerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Position") + .HasColumnType("int"); + + b.Property("Power") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("SquadTypeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PlayerId"); + + b.HasIndex("SquadTypeId"); + + b.ToTable("Squads", "dbo"); + }); + + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.ToTable("SquadTypes", "dbo"); + + b.HasData( + new + { + Id = new Guid("01978732-b32b-7af9-bf5f-a69585d89eb7"), + TypeName = "Tanks" + }, + new + { + Id = new Guid("01978732-b32b-7fe8-9ee5-68b0d0df44f4"), + TypeName = "Missile" + }, + new + { + Id = new Guid("01978732-b32b-780e-bef0-6bcf784ee1b4"), + TypeName = "Aircraft" + }, + new + { + Id = new Guid("01978732-b32b-79c9-adaa-19ed53157f67"), + TypeName = "Mixed" + }); + }); + modelBuilder.Entity("Database.Entities.User", b => { b.Property("Id") @@ -661,19 +728,19 @@ namespace Database.Migrations b.HasData( new { - Id = new Guid("01972f47-5fb5-7584-a312-e749206f0036"), + Id = new Guid("01978732-b32e-7aa5-8e77-507b8b20977d"), Code = 1, Name = "Silver League" }, new { - Id = new Guid("01972f47-5fb6-7dec-93aa-b62f0e167fde"), + Id = new Guid("01978732-b32e-76d6-9beb-3fd062efe9ef"), Code = 2, Name = "Gold League" }, new { - Id = new Guid("01972f47-5fb6-7f9a-8a2d-9f47fa1803e1"), + Id = new Guid("01978732-b32e-7583-9522-90dde6d778b6"), Code = 3, Name = "Diamond League" }); @@ -1078,6 +1145,25 @@ namespace Database.Migrations b.Navigation("Rank"); }); + modelBuilder.Entity("Database.Entities.Squad", b => + { + b.HasOne("Database.Entities.Player", "Player") + .WithMany("Squads") + .HasForeignKey("PlayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Database.Entities.SquadType", "SquadType") + .WithMany("Squads") + .HasForeignKey("SquadTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Player"); + + b.Navigation("SquadType"); + }); + modelBuilder.Entity("Database.Entities.User", b => { b.HasOne("Database.Entities.Alliance", "Alliance") @@ -1260,6 +1346,8 @@ namespace Database.Migrations b.Navigation("Notes"); + b.Navigation("Squads"); + b.Navigation("VsDuelParticipants"); b.Navigation("ZombieSiegeParticipants"); @@ -1270,6 +1358,11 @@ namespace Database.Migrations b.Navigation("Players"); }); + modelBuilder.Entity("Database.Entities.SquadType", b => + { + b.Navigation("Squads"); + }); + modelBuilder.Entity("Database.Entities.VsDuel", b => { b.Navigation("VsDuelParticipants"); diff --git a/README.md b/README.md index 9e32eec..4092e4a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,19 @@ This project is currently in the **Beta Phase**. --- +### **[0.11.0]** - *2025-06-19* +#### ✨ Added +- **Squad Management per Player:** You can now add up to **four squads per player**, each with: + - **Power** (in millions) + - **Position** + - **Type**: Tank, Aircraft, Missile, or Mixed +- **Visual Enhancements:** Squad types are displayed with custom icons and total power is summarized at the top of the squad card. + +🛠️ **Fixed** +- (N/A) + +--- + ### **[0.10.0]** - *2025-06-02* #### ✨ Added - **Team Selection for Desert Storm:** You can now assign **Team A** or **Team B** when creating a Desert Storm entry. diff --git a/Ui/src/app/app.module.ts b/Ui/src/app/app.module.ts index 12f20a8..3e21261 100644 --- a/Ui/src/app/app.module.ts +++ b/Ui/src/app/app.module.ts @@ -66,6 +66,8 @@ import { CustomEventLeaderboardComponent } from './pages/custom-event/custom-eve import { CustomEventEventsComponent } from './pages/custom-event/custom-event-events/custom-event-events.component'; import {NgxMaskDirective, NgxMaskPipe, provideNgxMask} from "ngx-mask"; import {CountUpModule} from "ngx-countup"; +import { PlayerSquadsComponent } from './pages/player-squads/player-squads.component'; +import { SquadEditModalComponent } from './modals/squad-edit-modal/squad-edit-modal.component'; @NgModule({ declarations: [ @@ -119,7 +121,9 @@ import {CountUpModule} from "ngx-countup"; ImprintComponent, CustomEventCategoryComponent, CustomEventLeaderboardComponent, - CustomEventEventsComponent + CustomEventEventsComponent, + PlayerSquadsComponent, + SquadEditModalComponent ], imports: [ BrowserModule, diff --git a/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.css b/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.css new file mode 100644 index 0000000..e69de29 diff --git a/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.html b/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.html new file mode 100644 index 0000000..a53c781 --- /dev/null +++ b/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.html @@ -0,0 +1,68 @@ +@if (squadForm) { + + + + + + +} diff --git a/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.ts b/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.ts new file mode 100644 index 0000000..4756e5c --- /dev/null +++ b/Ui/src/app/modals/squad-edit-modal/squad-edit-modal.component.ts @@ -0,0 +1,94 @@ +import {Component, inject, Input, OnInit} from '@angular/core'; +import {SquadTypeService} from "../../services/squad-type.service"; +import {SquadService} from "../../services/squad.service"; +import {SquadTypeModel} from "../../models/squadType.model"; +import {CreateSquadModel, SquadModel, UpdateSquadModel} from "../../models/squad.model"; +import {NgbActiveModal} from "@ng-bootstrap/ng-bootstrap"; +import {FormControl, FormGroup, Validators} from "@angular/forms"; +import {ToastrService} from "ngx-toastr"; + +@Component({ + selector: 'app-squad-edit-modal', + templateUrl: './squad-edit-modal.component.html', + styleUrl: './squad-edit-modal.component.css' +}) +export class SquadEditModalComponent implements OnInit { + + public activeModal: NgbActiveModal = inject(NgbActiveModal); + @Input({required: true}) playerId!: string; + @Input({required: true}) isUpdate!: boolean; + @Input({required: true}) currentSquad!: SquadModel; + public squadTypes: SquadTypeModel[] = []; + public positions: number[] = [1, 2, 3, 4]; + public squadForm!: FormGroup; + private readonly _squadTypeService: SquadTypeService = inject(SquadTypeService); + private readonly _squadService: SquadService = inject(SquadService); + private readonly _toaster: ToastrService = inject(ToastrService); + + get f() { + return this.squadForm.controls; + } + + ngOnInit() { + this.getSquadTypes(); + this.squadForm = new FormGroup({ + id: new FormControl(this.currentSquad.id), + playerId: new FormControl(this.currentSquad.playerId), + power: new FormControl(this.isUpdate ? this.currentSquad.power : null, [Validators.required]), + position: new FormControl(this.isUpdate ? this.currentSquad.position : null, [Validators.required]), + squadTypeId: new FormControl(this.currentSquad.squadTypeId, [Validators.required]), + }) + } + + getSquadTypes() { + this._squadTypeService.getSquadTypes().subscribe({ + next: (response: SquadTypeModel[]) => { + this.squadTypes = response; + }, + error: (error: Error) => { + console.error(error); + this._toaster.error('Could not get squad types', 'Get squad types'); + } + }); + } + + + onSubmit() { + if (this.squadForm.invalid) { + return; + } + if (this.isUpdate) { + const squad: UpdateSquadModel = this.squadForm.value as UpdateSquadModel; + this.updateSquad(squad); + } else { + const squad: CreateSquadModel = this.squadForm.value as CreateSquadModel; + this.addSquad(squad); + } + } + + private updateSquad(squad: UpdateSquadModel) { + this._squadService.updateSquad(squad.id, squad).subscribe({ + next: (_: SquadModel) => { + this._toaster.success('Squad updated successfully', 'Squad update'); + this.activeModal.close(); + }, + error: (error: Error) => { + console.error(error); + this._toaster.error('Could not update squad types', 'Squad update'); + } + }); + } + + private addSquad(squad: CreateSquadModel) { + this._squadService.createSquad(squad).subscribe({ + next: (_: SquadModel) => { + this._toaster.success('Squad created successfully', 'Squad create'); + this.activeModal.close(); + }, + error: (error: Error) => { + console.error(error); + this._toaster.error('Could not create squad', 'Squad create'); + } + }) + } +} diff --git a/Ui/src/app/models/squad.model.ts b/Ui/src/app/models/squad.model.ts new file mode 100644 index 0000000..bd6e7a6 --- /dev/null +++ b/Ui/src/app/models/squad.model.ts @@ -0,0 +1,16 @@ +export interface SquadModel extends CreateSquadModel{ + id: string; + typeName: string; + lastUpdateAt: Date; +} + +export interface CreateSquadModel { + squadTypeId: string; + playerId: string; + power: number; + position: number; +} + +export interface UpdateSquadModel extends CreateSquadModel { + id: string; +} diff --git a/Ui/src/app/models/squadType.model.ts b/Ui/src/app/models/squadType.model.ts new file mode 100644 index 0000000..43a51d1 --- /dev/null +++ b/Ui/src/app/models/squadType.model.ts @@ -0,0 +1,4 @@ +export interface SquadTypeModel { + id: string; + typeName: string; +} diff --git a/Ui/src/app/pages/player-information/player-information.component.html b/Ui/src/app/pages/player-information/player-information.component.html index 9cf70f2..ee0954a 100644 --- a/Ui/src/app/pages/player-information/player-information.component.html +++ b/Ui/src/app/pages/player-information/player-information.component.html @@ -5,40 +5,50 @@ @if (currentPlayer) { -
-
Player Information
-
-
Name: {{ currentPlayer.playerName }}
-

Rank: {{ currentPlayer.rankName }}

-

Headquarter: {{ currentPlayer.level }}

-

Created On: {{ currentPlayer.createdOn | date: 'dd.MM.yyyy HH:mm' }}

-

Created by: {{currentPlayer.createdBy}}

- @if (currentPlayer.modifiedOn) { -

Modified On: {{ currentPlayer.modifiedOn | date: 'dd.MM.yyyy HH:mm' }}

-

Modified by: {{currentPlayer.modifiedBy}}

- } -
- - + + unread messages + + +
+
- + +
+
+ + + +
diff --git a/Ui/src/app/pages/player-information/player-information.component.ts b/Ui/src/app/pages/player-information/player-information.component.ts index 448e7d9..e923484 100644 --- a/Ui/src/app/pages/player-information/player-information.component.ts +++ b/Ui/src/app/pages/player-information/player-information.component.ts @@ -64,5 +64,4 @@ export class PlayerInformationComponent implements OnInit { }) }); } - } diff --git a/Ui/src/app/pages/player-squads/player-squads.component.css b/Ui/src/app/pages/player-squads/player-squads.component.css new file mode 100644 index 0000000..6a81971 --- /dev/null +++ b/Ui/src/app/pages/player-squads/player-squads.component.css @@ -0,0 +1,7 @@ +.cursor-pointer { + cursor: pointer; +} +:host { + display: block; + width: 100%; +} diff --git a/Ui/src/app/pages/player-squads/player-squads.component.html b/Ui/src/app/pages/player-squads/player-squads.component.html new file mode 100644 index 0000000..c28be61 --- /dev/null +++ b/Ui/src/app/pages/player-squads/player-squads.component.html @@ -0,0 +1,76 @@ +
+
+ Squad Power + @if (squads.length > 0) { + + {{ totalPower | number:'1.2-2' }} million + + } +
+
+ + + @if (squads.length < 4) { +
+ +
+ } + + + + @for (squad of squads; track squad.id) { +
+ + +
{{ squad.position }}. Squad ({{ squad.typeName }})
+ + +
+ + +
+ Power: {{ squad.power | number:'1.2-2' }}M +
+ + +
+ + + + +
+ + + {{ squad.typeName }} +
+ + +
+ Last updated: {{ squad.lastUpdateAt | date:'dd.MM.yyyy' }} +
+ +
+ } + + + @if (!squads?.length) { +
+ No squads available. +
+ } + +
+
+ diff --git a/Ui/src/app/pages/player-squads/player-squads.component.ts b/Ui/src/app/pages/player-squads/player-squads.component.ts new file mode 100644 index 0000000..fed2461 --- /dev/null +++ b/Ui/src/app/pages/player-squads/player-squads.component.ts @@ -0,0 +1,103 @@ +import {Component, inject, Input, OnInit} from '@angular/core'; +import {NgbModal} from "@ng-bootstrap/ng-bootstrap"; +import {SquadEditModalComponent} from "../../modals/squad-edit-modal/squad-edit-modal.component"; +import {SquadModel} from "../../models/squad.model"; +import {SquadService} from "../../services/squad.service"; +import Swal from "sweetalert2"; +import {ToastrService} from "ngx-toastr"; + +@Component({ + selector: 'app-player-squads', + templateUrl: './player-squads.component.html', + styleUrl: './player-squads.component.css' +}) +export class PlayerSquadsComponent implements OnInit { + + @Input({required: true}) playerId!: string; + public squads: SquadModel[] = []; + private readonly _modalService: NgbModal = inject(NgbModal); + private readonly _squadService: SquadService = inject(SquadService); + private readonly _toaster: ToastrService = inject(ToastrService); + + get totalPower(): number { + return this.squads?.reduce((sum, squad) => sum + squad.power, 0) || 0; + } + + ngOnInit(): void { + this.getPlayerSquads(); + } + + getPlayerSquads(): void { + this._squadService.getPlayerSquads(this.playerId).subscribe({ + next: (result) => { + if (result) { + this.squads = result; + } + }, + error: err => { + console.log(err); + this._toaster.error('Error getting player squads', 'Getting player squads'); + } + }) + } + + editSquad(squad: SquadModel) { + this.onOpenModal(this.playerId, squad, true); + } + + deleteSquad(squad: SquadModel) { + Swal.fire({ + title: "Delete Squad ?", + text: `Do you really want to delete the ${squad.typeName} squad`, + icon: "warning", + showCancelButton: true, + confirmButtonColor: "#3085d6", + cancelButtonColor: "#d33", + confirmButtonText: "Yes, delete it!" + }).then((result) => { + if (result.isConfirmed) { + this._squadService.deleteSquad(squad.id).subscribe({ + next: ((response) => { + if (response) { + Swal.fire({ + title: "Deleted!", + text: "Squad has been deleted", + icon: "success" + }).then(_ => this.getPlayerSquads()); + } + }), + error: (error: Error) => { + console.log(error); + } + }); + } + }); + } + + addSquad() { + const squad: SquadModel = { + id: '', + playerId: this.playerId, + squadTypeId: '', + power: 0, + position: 0, + lastUpdateAt: new Date(), + typeName: '' + }; + this.onOpenModal(this.playerId, squad, false); + } + + onOpenModal(playerId: string, squad: SquadModel, isUpdate: boolean) { + const modalRef = this._modalService.open(SquadEditModalComponent, + {animation: true, backdrop: 'static', centered: true, size: 'lg'}); + modalRef.componentInstance.playerId = playerId; + modalRef.componentInstance.currentSquad = squad; + modalRef.componentInstance.isUpdate = isUpdate; + modalRef.closed.subscribe({ + next: (() => { + this.getPlayerSquads(); + }) + }); + } + +} diff --git a/Ui/src/app/services/squad-type.service.ts b/Ui/src/app/services/squad-type.service.ts new file mode 100644 index 0000000..aa61a37 --- /dev/null +++ b/Ui/src/app/services/squad-type.service.ts @@ -0,0 +1,18 @@ +import {inject, Injectable} from '@angular/core'; +import {environment} from "../../environments/environment"; +import {HttpClient} from "@angular/common/http"; +import {Observable} from "rxjs"; +import {SquadTypeModel} from "../models/squadType.model"; + +@Injectable({ + providedIn: 'root' +}) +export class SquadTypeService { + + private readonly _serviceUrl = environment.apiBaseUrl + 'SquadTypes/'; + private readonly _httpClient: HttpClient = inject(HttpClient); + + getSquadTypes(): Observable { + return this._httpClient.get(this._serviceUrl); + } +} diff --git a/Ui/src/app/services/squad.service.ts b/Ui/src/app/services/squad.service.ts new file mode 100644 index 0000000..be2b44d --- /dev/null +++ b/Ui/src/app/services/squad.service.ts @@ -0,0 +1,30 @@ +import {inject, Injectable} from '@angular/core'; +import {environment} from "../../environments/environment"; +import {HttpClient} from "@angular/common/http"; +import {Observable} from "rxjs"; +import {CreateSquadModel, SquadModel, UpdateSquadModel} from "../models/squad.model"; + +@Injectable({ + providedIn: 'root' +}) +export class SquadService { + + private readonly _serviceUrl = environment.apiBaseUrl + 'Squads/'; + private readonly _httpClient: HttpClient = inject(HttpClient); + + getPlayerSquads(playerId: string): Observable { + return this._httpClient.get(this._serviceUrl + 'player/' + playerId) + } + + createSquad(createSquad: CreateSquadModel): Observable { + return this._httpClient.post(this._serviceUrl, createSquad); + } + + updateSquad(squadId: string, updateSquad: UpdateSquadModel): Observable { + return this._httpClient.put(this._serviceUrl + squadId, updateSquad); + } + + deleteSquad(squadId: string): Observable { + return this._httpClient.delete(this._serviceUrl + squadId); + } +} diff --git a/Ui/src/assets/images/icons/Aircraft.png b/Ui/src/assets/images/icons/Aircraft.png new file mode 100644 index 0000000..4c32cce Binary files /dev/null and b/Ui/src/assets/images/icons/Aircraft.png differ diff --git a/Ui/src/assets/images/icons/Missile.png b/Ui/src/assets/images/icons/Missile.png new file mode 100644 index 0000000..cd576df Binary files /dev/null and b/Ui/src/assets/images/icons/Missile.png differ diff --git a/Ui/src/assets/images/icons/Mixed.png b/Ui/src/assets/images/icons/Mixed.png new file mode 100644 index 0000000..8701c21 Binary files /dev/null and b/Ui/src/assets/images/icons/Mixed.png differ diff --git a/Ui/src/assets/images/icons/Tanks.png b/Ui/src/assets/images/icons/Tanks.png new file mode 100644 index 0000000..9eadf60 Binary files /dev/null and b/Ui/src/assets/images/icons/Tanks.png differ