using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace PlaylistShared.Data.Entities;

public class SharedPlaylist
{
    [Key]
    public Guid Id { get; set; }

    public string OwnerUserId { get; set; } = null!;
    [ForeignKey(nameof(OwnerUserId))]
    public ApplicationUser Owner { get; set; } = null!;

    public string YandexPlaylistId { get; set; } = null!;
    public string Title { get; set; } = null!;
    public string? Description { get; set; }

    [Required]
    public string ShareSlug { get; set; } = null!;

    public PlaylistPermissions Permissions { get; set; } = new();

    public DateTime CreatedAt { get; set; }
    public DateTime? UpdatedAt { get; set; }

    public List<PlaylistTrack> Tracks { get; set; } = new();
}