feat: normalize release-cardinal fields out of track into a Release entity (Phase 8 §8.0)

This commit is contained in:
daniel-c-harvey
2026-06-11 12:51:21 -04:00
parent 16f356a760
commit f767d288c5
33 changed files with 1032 additions and 297 deletions
+23
View File
@@ -0,0 +1,23 @@
using DeepDrftModels.Enums;
using Models.Entities;
namespace DeepDrftModels.Entities;
// The release-cardinal half of the normalized track schema (Phase 8 §8.0). One ReleaseEntity is
// shared by every track on the same album; track-cardinal data stays on TrackEntity, which points
// back here via a nullable ReleaseId (singles and loose tracks have no release context).
//
// Inherits Id, CreatedAt, UpdatedAt, IsDeleted from BaseEntity (Cerebellum.BlazorBlocks.Models).
// BaseEntity ships the audit columns but does not declare IEntity itself, so subclasses declare it
// explicitly to satisfy the generic constraints on Repository<>/Manager<>/etc.
public class ReleaseEntity : BaseEntity, IEntity
{
public required string Title { get; set; }
public required string Artist { get; set; }
public string? Genre { get; set; }
public DateOnly? ReleaseDate { get; set; }
public string? ImagePath { get; set; }
public ReleaseType ReleaseType { get; set; } = ReleaseType.Single;
public long? CreatedByUserId { get; set; }
public ICollection<TrackEntity> Tracks { get; set; } = new List<TrackEntity>();
}