using System.ComponentModel.DataAnnotations;

namespace ASTRAIN.Shared.Models;

/// <summary>
/// Represents a routine consisting of ordered exercises.
/// </summary>
public class Routine
{
    /// <summary>
    /// Gets or sets the database identifier.
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// Gets or sets the routine name.
    /// </summary>
    [Required]
    [MaxLength(120)]
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// Gets or sets the owning user's identifier.
    /// </summary>
    [Required]
    [MaxLength(8)]
    public string UserId { get; set; } = string.Empty;

    /// <summary>
    /// Gets or sets the owning user.
    /// </summary>
    public User? User { get; set; }

    /// <summary>
    /// Gets or sets the ordered exercises in this routine.
    /// </summary>
    public List<RoutineExercise> Exercises { get; set; } = new();

    /// <summary>
    /// Gets or sets the run history for this routine.
    /// </summary>
    public List<RoutineRun> Runs { get; set; } = new();
}
