Upgrade to .NET 10 and finalize foundation scaffold

This commit is contained in:
2026-01-28 14:29:42 +01:00
parent 71f61bb122
commit 257b473253
16 changed files with 328 additions and 6 deletions

8
Domain/AppState.cs Normal file
View File

@@ -0,0 +1,8 @@
namespace GameList.Domain;
public class AppState
{
public int Id { get; set; } = 1;
public Phase CurrentPhase { get; set; } = Phase.Suggest;
public DateTimeOffset UpdatedAt { get; set; } = DateTimeOffset.UtcNow;
}

9
Domain/Phase.cs Normal file
View File

@@ -0,0 +1,9 @@
namespace GameList.Domain;
public enum Phase
{
Suggest = 0,
Reveal = 1,
Vote = 2,
Results = 3
}

16
Domain/Player.cs Normal file
View File

@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
namespace GameList.Domain;
public class Player
{
public Guid Id { get; set; } = Guid.NewGuid();
[MaxLength(64)]
public string? DisplayName { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public ICollection<Suggestion> Suggestions { get; set; } = new List<Suggestion>();
public ICollection<Vote> Votes { get; set; } = new List<Vote>();
}

32
Domain/Suggestion.cs Normal file
View File

@@ -0,0 +1,32 @@
using System.ComponentModel.DataAnnotations;
namespace GameList.Domain;
public class Suggestion
{
public int Id { get; set; }
[Required]
public Guid PlayerId { get; set; }
public Player? Player { get; set; }
[Required]
[MaxLength(100)]
public string Name { get; set; } = string.Empty;
[MaxLength(50)]
public string? Genre { get; set; }
[MaxLength(500)]
public string? Description { get; set; }
[MaxLength(2048)]
public string? ScreenshotUrl { get; set; }
[MaxLength(2048)]
public string? YoutubeUrl { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public ICollection<Vote> Votes { get; set; } = new List<Vote>();
}

21
Domain/Vote.cs Normal file
View File

@@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
namespace GameList.Domain;
public class Vote
{
public int Id { get; set; }
[Required]
public Guid PlayerId { get; set; }
public Player? Player { get; set; }
[Required]
public int SuggestionId { get; set; }
public Suggestion? Suggestion { get; set; }
[Range(0, 10)]
public int Score { get; set; }
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
}