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

namespace Lactose.Models;

/// <summary>
/// Represents an album entity.
/// </summary>
public class Album {
    /// <summary>
    /// Gets or sets the unique identifier for the album.
    /// </summary>
    [Key]
    public Guid Id { get; set; }

    /// <summary>
    /// Gets or sets the title of the album.
    /// </summary>
    [Column(TypeName = "VARCHAR(255)")]
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// Gets or sets the creation date of the album.
    /// </summary>
    [Required]
    public DateTime? CreatedAt { get; set; } = DateTime.Now;

    /// <summary>
    /// Gets or sets the last updated date of the album.
    /// </summary>
    public DateTime? UpdatedAt { get; set; }

    /// <summary>
    /// Gets or sets the user owner identifier.
    /// </summary>
    [ForeignKey(nameof(UserOwner))]
    public Guid? UserOwnerId { get; set; }
    
    /// <summary>
    /// Gets or sets the person owner identifier.
    /// </summary>
    [ForeignKey(nameof(PersonOwner))]
    public Guid? PersonOwnerId { get; set; }

    #region Navigation Properties

    /// <summary>
    /// Gets or sets the user owner of the album. This is the user account who created/owns the album.
    /// </summary>
    public User? UserOwner { get; set; }
    
    /// <summary>
    /// Gets or sets the person owner of the album. This is the person/model who appears in the album.
    /// </summary>
    public Person? PersonOwner { get; set; }

    /// <summary>
    /// Gets or sets the list of assets associated with the album.
    /// </summary>
    public List<Asset>? Assets { get; set; }

    #endregion
}
