using System.ComponentModel.DataAnnotations;

namespace ASTRAIN.Shared.Models;

/// <summary>
/// Represents a single exercise item (e.g., a machine or movement).
/// </summary>
public class Exercise
{
    /// <summary>
    /// Gets or sets the database identifier.
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// Gets or sets the exercise display 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 routine associations for this exercise.
    /// </summary>
    public List<RoutineExercise> RoutineExercises { get; set; } = new();
}
