feat: implement Phase 1 — solution skeleton and domain model
Creates the 9-project .NET 8 solution (5 src + 4 test) with Marathon.Domain fully implemented: value objects (SportCode, EventId, OddsRate, OddsValue, BetScope hierarchy), enums (Side, BetType, OddsSource, AnomalyKind), and entities (Sport, Country, League, Event, Bet, OddsSnapshot, EventResult, Anomaly) with all invariants enforced in constructors. 96 domain tests pass (FluentAssertions + xUnit). Directory.Build.props and Directory.Packages.props centralise build settings and NuGet versions. Both Marathon.sln and Marathon.slnx are committed; dotnet build Marathon.sln succeeds with 0 warnings/errors.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using Marathon.Domain.ValueObjects;
|
||||
|
||||
namespace Marathon.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// A sports league or tournament within a country and sport.
|
||||
/// </summary>
|
||||
public sealed record League(
|
||||
string Id,
|
||||
SportCode Sport,
|
||||
string Country,
|
||||
string NameRu,
|
||||
string NameEn,
|
||||
string Category)
|
||||
{
|
||||
public string Id { get; } = string.IsNullOrWhiteSpace(Id)
|
||||
? throw new ArgumentException("League Id must not be empty.", nameof(Id))
|
||||
: Id;
|
||||
|
||||
public SportCode Sport { get; } = Sport ?? throw new ArgumentNullException(nameof(Sport));
|
||||
|
||||
public string Country { get; } = string.IsNullOrWhiteSpace(Country)
|
||||
? throw new ArgumentException("Country must not be empty.", nameof(Country))
|
||||
: Country;
|
||||
|
||||
public string NameRu { get; } = string.IsNullOrWhiteSpace(NameRu)
|
||||
? throw new ArgumentException("NameRu must not be empty.", nameof(NameRu))
|
||||
: NameRu;
|
||||
|
||||
public string NameEn { get; } = string.IsNullOrWhiteSpace(NameEn)
|
||||
? throw new ArgumentException("NameEn must not be empty.", nameof(NameEn))
|
||||
: NameEn;
|
||||
|
||||
public string Category { get; } = Category ?? string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user