//-----------------------------------------------------------------------
// FILENAME: AthleteEntity.cs
// PROJECT: Entities
// SOLUTION: HeartTrack
// DATE CREATED: 22/02/2024
// AUTHOR: Antoine PEREDERII
//-----------------------------------------------------------------------
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Identity;
namespace Entities
{
///
/// Represents an athlete entity in the database.
///
[Table("Athlete")]
public class AthleteEntity
{
public AthleteEntity() : base() { }
///
/// Gets or sets the unique identifier of the athlete.
///
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdAthlete { get; set; }
///
/// Gets or sets the username of the athlete.
///
[MaxLength(100)]
[Required(ErrorMessage = "Athlete Username is ")]
public required string Username { get; set; }
///
/// Gets or sets the last name of the athlete.
///
[MaxLength(100)]
[Required(ErrorMessage = "Athlete Last Name is ")]
public required string LastName { get; set; }
///
/// Gets or sets the first name of the athlete.
///
[MaxLength(150)]
[Required(ErrorMessage = "Athlete First Name is ")]
public required string FirstName { get; set; }
///
/// Gets or sets the email of the athlete.
///
[MaxLength(100)]
[Required(ErrorMessage = "Athlete Email is ")]
public required string Email { get; set; }
///
/// Gets or sets the gender of the athlete.
///
[MaxLength(1)]
[Required(ErrorMessage = "Athlete Sexe is ")]
public required string Sexe { get; set; }
///
/// Gets or sets the height of the athlete.
///
public double Length { get; set; }
///
/// Gets or sets the weight of the athlete.
///
public float Weight { get; set; }
///
/// Gets or sets the password of the athlete.
///
[Required(ErrorMessage = "Athlete Password is ")]
public required string Password { get; set; }
///
/// Gets or sets the date of birth of the athlete.
///
[Required(ErrorMessage = "Athlete Date of Birth is ")]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateOnly DateOfBirth { get; set; }
///
/// Gets or sets whether the athlete is a coach.
///
public bool IsCoach { get; set; }
public byte[] ProfilPicture { get; set; }
public ICollection Activities { get; set; } = new List();
public ICollection Statistics { get; set; } = new List();
public ICollection TrainingsAthlete { get; set; } = new List();
public ICollection TrainingsCoach { get; set; } = new List();
public ICollection NotificationsReceived { get; set; } = new List();
public ICollection NotificationsSent { get; set; } = new List();
public int? DataSourceId { get; set; }
public DataSourceEntity? DataSource { get; set; }
public ICollection Followers { get; set; } = [];
public ICollection Followings { get; set; } = [];
}
}