Changes
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Musify.Domain.Abstractions;
|
||||
using Musify.Domain.ValueObjects;
|
||||
|
||||
namespace Musify.Domain.Entities
|
||||
{
|
||||
#pragma warning disable CS8618
|
||||
public class Track : IAuditable
|
||||
public abstract class Track : IAuditable
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
@@ -22,14 +21,6 @@ namespace Musify.Domain.Entities
|
||||
[Required]
|
||||
public int DurationSeconds { get; set; }
|
||||
|
||||
public long? OwnerUserId { get; set; }
|
||||
|
||||
[Required]
|
||||
public TrackSource Source { get; set; } = TrackSource.Local;
|
||||
|
||||
[MaxLength(16)]
|
||||
public string? ExternalId { get; set; }
|
||||
|
||||
[Required]
|
||||
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
|
||||
|
||||
@@ -43,18 +34,10 @@ namespace Musify.Domain.Entities
|
||||
|
||||
public TrackAudio Audio { get; set; } = new();
|
||||
|
||||
[ForeignKey(nameof(OwnerUserId)) ]
|
||||
public User? Owner { get; set; }
|
||||
|
||||
public ICollection<UserHasTrack> UserTracks { get; set; } = new List<UserHasTrack>();
|
||||
|
||||
public ICollection<PlayListHasTrack> PlayListTracks { get; set; } = new List<PlayListHasTrack>();
|
||||
|
||||
public ICollection<ListeningHistory> ListeningHistories { get; set; } = new List<ListeningHistory>();
|
||||
|
||||
public ICollection<TrackArtist> TrackArtists { get; set; } = new List<TrackArtist>();
|
||||
|
||||
[NotMapped]
|
||||
public bool IsExternal => Source != TrackSource.Local;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user