Upgrade to .NET 10 and finalize foundation scaffold
This commit is contained in:
8
Domain/AppState.cs
Normal file
8
Domain/AppState.cs
Normal 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
9
Domain/Phase.cs
Normal 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
16
Domain/Player.cs
Normal 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
32
Domain/Suggestion.cs
Normal 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
21
Domain/Vote.cs
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user