You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
4.1 KiB
115 lines
4.1 KiB
//-----------------------------------------------------------------------
|
|
// FILENAME: AthleteEntity.cs
|
|
// PROJECT: Entities
|
|
// SOLUTION: HeartTrack
|
|
// DATE CREATED: 22/02/2024
|
|
// AUTHOR: HeartTeam
|
|
//-----------------------------------------------------------------------
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Entities
|
|
{
|
|
/// <summary>
|
|
/// Represents an athlete entity in the database.
|
|
/// </summary>
|
|
[Table("Athlete")]
|
|
public class AthleteEntity
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the unique identifier of the athlete.
|
|
/// </summary>
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int IdAthlete { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the username of the athlete.
|
|
/// </summary>
|
|
[MaxLength(100)]
|
|
[Required(ErrorMessage = "Athlete Username is ")]
|
|
public required string Username { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the last name of the athlete.
|
|
/// </summary>
|
|
[MaxLength(100)]
|
|
[Required(ErrorMessage = "Athlete Last Name is ")]
|
|
public required string LastName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the first name of the athlete.
|
|
/// </summary>
|
|
[MaxLength(150)]
|
|
[Required(ErrorMessage = "Athlete First Name is ")]
|
|
public required string FirstName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the email of the athlete.
|
|
/// </summary>
|
|
[MaxLength(100)]
|
|
[Required(ErrorMessage = "Athlete Email is ")]
|
|
public required string Email { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the gender of the athlete.
|
|
/// </summary>
|
|
[MaxLength(1)]
|
|
[Required(ErrorMessage = "Athlete Sexe is ")]
|
|
public required string Sexe { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the height of the athlete.
|
|
/// </summary>
|
|
public double Length { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the weight of the athlete.
|
|
/// </summary>
|
|
public float Weight { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the password of the athlete.
|
|
/// </summary>
|
|
[Required(ErrorMessage = "Athlete Password is ")]
|
|
public required string Password { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the date of birth of the athlete.
|
|
/// </summary>
|
|
[Required(ErrorMessage = "Athlete Date of Birth is ")]
|
|
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
|
|
public DateOnly DateOfBirth { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets whether the athlete is a coach.
|
|
/// </summary>
|
|
public bool IsCoach { get; set; }
|
|
|
|
// [TODO] [DAVE] Pourquoi c'est un byte[] ? et pas un string ? it's me so should change it to string
|
|
public string? ProfilPicture { get; set; }
|
|
|
|
public LargeImageEntity? Image { get; set; }
|
|
|
|
[ForeignKey("Image")]
|
|
public Guid? ImageId { get; set; }
|
|
|
|
public ICollection<ActivityEntity> Activities { get; set; } = new List<ActivityEntity>();
|
|
|
|
public ICollection<StatisticEntity> Statistics { get; set; } = new List<StatisticEntity>();
|
|
|
|
public ICollection<TrainingEntity> TrainingsAthlete { get; set; } = new List<TrainingEntity>();
|
|
public ICollection<TrainingEntity> TrainingsCoach { get; set; } = new List<TrainingEntity>();
|
|
|
|
public ICollection<NotificationEntity> NotificationsReceived { get; set; } = new List<NotificationEntity>();
|
|
public ICollection<NotificationEntity> NotificationsSent { get; set; } = new List<NotificationEntity>();
|
|
|
|
public int? DataSourceId { get; set; }
|
|
// [TODO] [DAVE] Pourquoi c'est un one to one ? et pas un one to many ?
|
|
public DataSourceEntity? DataSource { get; set; }
|
|
|
|
public ICollection<FriendshipEntity> Followers { get; set; } = [];
|
|
public ICollection<FriendshipEntity> Followings { get; set; } = [];
|
|
}
|
|
} |