//----------------------------------------------------------------------- // FILENAME: AthleteEntity.cs // PROJECT: Entities // SOLUTION: HeartTrack // DATE CREATED: 22/02/2024 // AUTHOR: HeartTeam //----------------------------------------------------------------------- using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Microsoft.AspNetCore.Identity; namespace Entities { //dentityRole,int /// /// Represents an athlete entity in the database. /// [Table("Athlete")] public class AthleteEntity : IdentityUser { /// /// Gets or sets the unique identifier of the athlete. /// [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public override int Id { get; set; } /// /// Gets or sets the username of the athlete. /// [MaxLength(100)] [Required(ErrorMessage = "Athlete Username is ")] public override string UserName { get; set; } /// /// Gets or sets the last name of the athlete. /// [MaxLength(100)] [Required(ErrorMessage = "Athlete Last Name is ")] public string LastName { get; set; } /// /// Gets or sets the first name of the athlete. /// [MaxLength(150)] [Required(ErrorMessage = "Athlete First Name is ")] public string FirstName { get; set; } /// /// Gets or sets the email of the athlete. /// [MaxLength(100)] [Required(ErrorMessage = "Athlete Email is ")] public override string Email { get; set; } /// /// Gets or sets the gender of the athlete. /// [MaxLength(1)] [Required(ErrorMessage = "Athlete Sexe is ")] public char 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 PasswordHash is ")] public string PasswordHash { 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 string? ProfilPicture { get; set; } public LargeImageEntity? Image { get; set; } [ForeignKey("Image")] public Guid? ImageId { 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; } = []; } }