Add BeerStyle entity and related properties; refactor BreweryDto to remove BeerPosts

This commit is contained in:
Aaron Po
2026-08-19 20:20:42 -04:00
parent 2b2df0053f
commit 0db29f431c
8 changed files with 78 additions and 51 deletions

View File

@@ -24,4 +24,6 @@ public sealed class BeerPost
// Navigation Properties
public UserAccount? PostedBy { get; set; }
public BreweryPost? BrewedBy { get; set; }
public BeerStyle? BeerStyle { get; set; }
}

View File

@@ -0,0 +1,16 @@
namespace Domain.Entities;
public sealed class BeerStyle
{
// PK
public Guid BeerStyleId { get; set; } = Guid.Empty;
// Attributes
public string BeerStyleName { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
// Audit Fields
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public byte[]? RowVersion { get; set; }
}

View File

@@ -17,40 +17,3 @@ public sealed class City
// Navigation Properties
public StateProvince? StateProvince { get; set; }
}
public sealed class StateProvince
{
// PK
public Guid StateProvinceId { get; set; }
// FK References
public Guid CountryId { get; set; }
// Attributes
public string StateProvinceName { get; set; } = string.Empty;
// this is the iso 3166-2 code for the state/province, e.g. "CA" for California, "ON" for Ontario, etc.
// and is rendered like US-CA for California, CA-ON for Ontario, etc.
public string ISO3166_2 { get; set; } = string.Empty;
// Audit Fields
public byte[]? RowVersion { get; set; }
// Navigation Properties
public Country? Country { get; set; }
}
public sealed class Country
{
// PK
public Guid CountryId { get; set; }
// Attributes
public string CountryName { get; set; } = string.Empty;
public string ISO3166_1 { get; set; } = string.Empty; // this is the iso 3166-1 alpha-2 code for the country, e.g. "US" for United States, "CA" for Canada, etc.
// Audit Fields
public byte[]? RowVersion { get; set; }
}

View File

@@ -0,0 +1,15 @@
namespace Domain.Entities;
public sealed class Country
{
// PK
public Guid CountryId { get; set; }
// Attributes
public string CountryName { get; set; } = string.Empty;
public string ISO3166_1 { get; set; } = string.Empty; // this is the iso 3166-1 alpha-2 code for the country, e.g. "US" for United States, "CA" for Canada, etc.
// Audit Fields
public byte[]? RowVersion { get; set; }
}

View File

@@ -0,0 +1,23 @@
namespace Domain.Entities;
public sealed class StateProvince
{
// PK
public Guid StateProvinceId { get; set; }
// FK References
public Guid CountryId { get; set; }
// Attributes
public string StateProvinceName { get; set; } = string.Empty;
// this is the iso 3166-2 code for the state/province, e.g. "CA" for California, "ON" for Ontario, etc.
// and is rendered like US-CA for California, CA-ON for Ontario, etc.
public string ISO3166_2 { get; set; } = string.Empty;
// Audit Fields
public byte[]? RowVersion { get; set; }
// Navigation Properties
public Country? Country { get; set; }
}