//-----------------------------------------------------------------------
// FILENAME: ActivityEntity.cs
// PROJECT: Entities
// SOLUTION: HeartTrack
// DATE CREATED: 22/02/2024
// AUTHOR: Antoine PEREDERII
//-----------------------------------------------------------------------
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entities
{
///
/// Represents an activity entity in the database.
///
[Table("Activity")]
public class ActivityEntity
{
///
/// Gets or sets the unique identifier of the activity.
///
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdActivity { get; set; }
///
/// Gets or sets the type of the activity.
///
[Required]
[MaxLength(100)]
public string Type { get; set; } = null!;
///
/// Gets or sets the date of the activity.
///
[Required(ErrorMessage = "Activity Date is required")]
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
public DateOnly Date { get; set; }
///
/// Gets or sets the start time of the activity.
///
[Required(ErrorMessage = "Start Activity Hour is required")]
[DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)]
public TimeOnly StartTime { get; set; }
///
/// Gets or sets the end time of the activity.
///
[Required(ErrorMessage = "End Activity Hour is required")]
[DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)]
public TimeOnly EndTime { get; set; }
///
/// Gets or sets the perceived effort of the activity.
///
public int EffortFelt { get; set; }
///
/// Gets or sets the variability of the activity.
///
public float Variability { get; set; }
///
/// Gets or sets the variance of the activity.
///
public float Variance { get; set; }
///
/// Gets or sets the standard deviation of the activity.
///
public float StandardDeviation { get; set; }
///
/// Gets or sets the average of the activity.
///
public float Average { get; set; }
///
/// Gets or sets the maximum value of the activity.
///
public int Maximum { get; set; }
///
/// Gets or sets the minimum value of the activity.
///
public int Minimum { get; set; }
///
/// Gets or sets the average temperature during the activity.
///
public float AverageTemperature { get; set; }
///
/// Gets or sets whether the activity has an automatic pause feature.
///
public bool HasAutoPause { get; set; }
public ICollection HeartRates { get; set; } = new List();
public int DataSourceId { get; set; }
public DataSourceEntity DataSource { get; set; } = null!;
public int AthleteId { get; set; }
public AthleteEntity Athlete { get; set; } = null!;
}
}