Phase 9 Wave 1: add ReleaseMedium discriminator + Session/Mix metadata
Add ReleaseMedium enum (Cut/Session/Mix) and two 1:1 satellite entities (SessionMetadata, MixMetadata) with EF configs and an additive migration. ReleaseDto.ReleaseType is now nullable, nulled for non-Cut at the converter. Existing releases default to Cut via column default; no data migration.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
namespace DeepDrftModels.DTOs;
|
||||
|
||||
// Mirror of MixMetadata (Phase 9). No `required` members — BlazorBlocks's Manager<> generic
|
||||
// constraint requires `new()`, which does not compose with required members. TrackConverter assigns
|
||||
// every field on the round-trip, so an empty default is never observable.
|
||||
public class MixMetadataDto
|
||||
{
|
||||
public long ReleaseId { get; set; }
|
||||
public string WaveformEntryKey { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -14,7 +14,16 @@ public class ReleaseDto : BaseModel
|
||||
public string? Genre { get; set; }
|
||||
public DateOnly? ReleaseDate { get; set; }
|
||||
public string? ImagePath { get; set; }
|
||||
public ReleaseType ReleaseType { get; set; } = ReleaseType.Single;
|
||||
public ReleaseMedium Medium { get; set; } = ReleaseMedium.Cut;
|
||||
|
||||
// Nullable: meaningful only for Cut releases. TrackConverter nulls it for Session/Mix at the
|
||||
// mapping point. One producer enforces the rule; no consumer depends on a non-null value.
|
||||
public ReleaseType? ReleaseType { get; set; }
|
||||
|
||||
// Medium-specific satellites. Populated only for the matching medium; null otherwise.
|
||||
public SessionMetadataDto? SessionMetadata { get; set; }
|
||||
public MixMetadataDto? MixMetadata { get; set; }
|
||||
|
||||
public long? CreatedByUserId { get; set; }
|
||||
|
||||
// Read-model field: count of non-deleted tracks in this release. Not on ReleaseEntity — the
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace DeepDrftModels.DTOs;
|
||||
|
||||
// Mirror of SessionMetadata (Phase 9). No `required` members — BlazorBlocks's Manager<> generic
|
||||
// constraint requires `new()`, which does not compose with required members. TrackConverter assigns
|
||||
// every field on the round-trip, so an empty default is never observable.
|
||||
public class SessionMetadataDto
|
||||
{
|
||||
public long ReleaseId { get; set; }
|
||||
public string HeroImageEntryKey { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user