v.Beta-0.10.0

This commit is contained in:
Tomasi - Developing 2025-06-02 08:46:37 +02:00
parent 7d798476f0
commit fa3a0ec218
13 changed files with 1375 additions and 11 deletions

View File

@ -23,5 +23,9 @@ public class CreateDesertStormDto
[MaxLength(150)]
public required string OpponentName { get; set; }
[Required]
[MaxLength(1)]
public required string Team { get; set; }
public bool IsInProgress { get; set; }
}

View File

@ -25,4 +25,6 @@ public class DesertStormDto
public int Participants { get; set; }
public bool IsInProgress { get; set; }
public required string Team { get; set; }
}

View File

@ -23,4 +23,8 @@ public class UpdateDesertStormDto
[Required]
public bool IsInProgress { get; set; }
[Required]
[MaxLength(1)]
public required string Team { get; set; }
}

View File

@ -19,6 +19,7 @@ public class DesertStormConfiguration : IEntityTypeConfiguration<DesertStorm>
builder.Property(desertStorm => desertStorm.CreatedBy).IsRequired().HasMaxLength(150);
builder.Property(desertStorm => desertStorm.OpponentName).IsRequired().HasMaxLength(150);
builder.Property(desertStorm => desertStorm.ModifiedBy).IsRequired(false).HasMaxLength(150);
builder.Property(desertStorm => desertStorm.Team).IsRequired().HasMaxLength(1).HasDefaultValue("A");
builder.Property(desertStorm => desertStorm.ModifiedOn).IsRequired(false);
builder.HasOne(desertStorm => desertStorm.Alliance)

View File

@ -24,5 +24,7 @@ public class DesertStorm : BaseEntity
public bool IsInProgress { get; set; }
public required string Team { get; set; }
public ICollection<DesertStormParticipant> DesertStormParticipants { get; set; } = [];
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,35 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Database.Migrations
{
/// <inheritdoc />
public partial class AddTeamToDesertStorm : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Team",
schema: "dbo",
table: "DesertStorms",
type: "nvarchar(1)",
maxLength: 1,
nullable: false,
defaultValue: "A");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Team",
schema: "dbo",
table: "DesertStorms");
}
}
}

View File

@ -269,6 +269,13 @@ namespace Database.Migrations
b.Property<int>("OpposingParticipants")
.HasColumnType("int");
b.Property<string>("Team")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("nvarchar(1)")
.HasDefaultValue("A");
b.Property<bool>("Won")
.HasColumnType("bit");
@ -654,19 +661,19 @@ namespace Database.Migrations
b.HasData(
new
{
Id = new Guid("01964298-2d6d-7f54-8e1f-ab23ec343378"),
Id = new Guid("01972f47-5fb5-7584-a312-e749206f0036"),
Code = 1,
Name = "Silver League"
},
new
{
Id = new Guid("01964298-2d6d-7620-bcc5-08103cbfd5de"),
Id = new Guid("01972f47-5fb6-7dec-93aa-b62f0e167fde"),
Code = 2,
Name = "Gold League"
},
new
{
Id = new Guid("01964298-2d6d-7e0b-b002-532458cbe7bd"),
Id = new Guid("01972f47-5fb6-7f9a-8a2d-9f47fa1803e1"),
Code = 3,
Name = "Diamond League"
});

View File

@ -21,6 +21,16 @@ This project is currently in the **Beta Phase**.
---
### **[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.
- **Team Display in Table:** The selected team is now also shown in the Desert Storm overview table.
🛠️ **Fixed**
- (N/A)
---
### **[0.9.1]** - *2025-04-24*
#### ✨ Added
- **Number Formatting Input Mask:** Numbers are now automatically formatted for better readability (e.g., `250000``250.000`).

View File

@ -13,6 +13,7 @@ export interface DesertStormModel {
opponentName: string;
participants: number;
isInProgress: boolean;
team: string;
}
export interface DesertStormDetailModel extends DesertStormModel {
@ -27,4 +28,5 @@ export interface CreateDesertStormModel {
eventDate: string;
opponentName: string;
isInProgress: boolean;
team: string;
}

View File

@ -16,6 +16,7 @@
</h5>
<div class="card-body">
<h5 class="card-title">Opponent: <span class="text-primary">{{desertStormDetail.opponentName}}</span></h5>
<p class="card-text">Team: <span class="text-primary">{{desertStormDetail.team}}</span></p>
<p class="card-text">Server: <span class="text-primary">{{desertStormDetail.opponentServer}}</span></p>
<p class="card-text">Opponent participants: <span class="text-primary">{{desertStormDetail.opposingParticipants}}</span></p>
<p class="card-text">Allianz participants: <span class="text-primary">{{desertStormDetail.participants | number}}</span></p>

View File

@ -8,17 +8,9 @@
</div>
@if (!isCreateDessertStorm) {
@if (!currentWeekDuelExists) {
<div class="d-grid gap-2 col-6 mx-auto">
<button (click)="onCreateEvent()" class="btn btn-primary" type="button">Create new Desert storm Event</button>
</div>
} @else {
<div class="d-flex justify-content-center">
<div class="alert alert-primary text-center w-auto" role="alert">
One event has already been recorded for this week. You can edit or delete the event
</div>
</div>
}
}
@if (isCreateDessertStorm) {
@ -73,6 +65,14 @@
}
</div>
<div class="form-floating mb-3 is-invalid">
<select class="form-select" formControlName="team" id="team">
<option [ngValue]="'A'">Team A</option>
<option [ngValue]="'B'">Team B</option>
</select>
<label for="team">Team</label>
</div>
@if (f['isInProgress'].value === false) {
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" formControlName="won" id="won">
@ -122,6 +122,7 @@
<th scope="col">Opponent server</th>
<th scope="col">Opposing participants</th>
<th scope="col">Allianz participants</th>
<th scope="col">Team</th>
<th scope="col">Won</th>
<th scope="col">Action</th>
</tr>
@ -134,6 +135,7 @@
<td>{{desertStorm.opponentServer}}</td>
<td>{{desertStorm.opposingParticipants}}</td>
<td>{{desertStorm.participants}}</td>
<td>{{desertStorm.team}}</td>
<td>
@if (desertStorm.isInProgress) {
<i class="bi bi-hourglass-split"></i> In Progress

View File

@ -92,6 +92,7 @@ export class DesertStormComponent implements OnInit {
opponentName: new FormControl<string>(desertStormModel ? desertStormModel.opponentName : ''),
opponentServer: new FormControl<number | null>(desertStormModel ? desertStormModel.opponentServer : null),
OpposingParticipants: new FormControl<number | null>(desertStormModel ? desertStormModel.opposingParticipants : null),
team: new FormControl<string>(desertStormModel ? desertStormModel.team : 'A')
})
}