using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Musify.Domain.Abstractions; using Musify.Domain.ValueObjects; namespace Musify.Domain.Entities { [Table("Tracks")] public class Track : IAuditable, IHasLifeCycle, IOwnedEntity { [Key] public Guid Id { get; set; } = Guid.NewGuid(); [MaxLength(200)] public required string Title { get; set; } [MaxLength(200)] public required string NormalizedTitle { get; set; } public double DurationSeconds { get; set; } public required long OwnerUserId { get; set; } [ForeignKey(nameof(OwnerUserId))] public User Owner { get; set; } = null!; public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active; public bool IsExplicit { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; public TrackPictures Pictures { get; set; } = new(); public TrackAudio Audio { get; set; } = new(); public ICollection PlayListTracks { get; set; } = new List(); public ICollection AlbumTracks { get; set; } = new List(); public ICollection ListeningHistories { get; set; } = new List(); public ICollection Tags { get; set; } = new List(); } }