🐛 Fix bugs with date

WORK-WebAPI
Antoine PEREDERII 1 year ago
parent 416ed55640
commit b82b84b831

@ -14,17 +14,15 @@ public class ActivityEntity
[MaxLength(100)] [MaxLength(100)]
public required string Type { get; set; } public required string Type { get; set; }
[Required(ErrorMessage = "Activity Date is required")] [Required(ErrorMessage = "Activity Date is required")]
[DataType(DataType.DateTime)] // [DataType(DataType.DateTime)]
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
public DateTime Date { get; set; } public DateOnly Date { get; set; }
[Required(ErrorMessage = "Start Activity Hour is required")] [Required(ErrorMessage = "Start Activity Hour is required")]
[DataType(DataType.DateTime)]
[DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)]
public DateTime StartTime { get; set; } public TimeOnly StartTime { get; set; }
[Required(ErrorMessage = "End Activity Hour is required")] [Required(ErrorMessage = "End Activity Hour is required")]
[DataType(DataType.DateTime)]
[DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)]
public DateTime EndTime { get; set; } public TimeOnly EndTime { get; set; }
public int EffortFelt { get; set; } public int EffortFelt { get; set; }
public float Variability { get; set; } public float Variability { get; set; }
public float Variance { get; set; } public float Variance { get; set; }

@ -24,6 +24,9 @@ public class AthleteEntity
public double Lenght { get; set; } public double Lenght { get; set; }
public float Weight { get; set; } public float Weight { get; set; }
public required string Password { get; set; } public required string Password { get; set; }
public DateTime DateOfBirth { get; set; }
[Required(ErrorMessage = "Athlete Date of Birth is required")]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateOnly DateOfBirth { get; set; }
public bool IsCoach { get; set; } public bool IsCoach { get; set; }
} }

@ -11,9 +11,8 @@ public class HeartRateEntity
public int IdHeartRate { get; set; } public int IdHeartRate { get; set; }
public double Altitude { get; set; } public double Altitude { get; set; }
[Required(ErrorMessage = "HeartRate Time is required")] [Required(ErrorMessage = "HeartRate Time is required")]
[DataType(DataType.DateTime)]
[DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:HH:mm;ss}", ApplyFormatInEditMode = true)]
public DateTime Time { get; set; } public TimeOnly Time { get; set; }
public float Temperature { get; set; } public float Temperature { get; set; }
public int Bpm { get; set; } public int Bpm { get; set; }
public float Longitude { get; set; } public float Longitude { get; set; }

@ -13,8 +13,7 @@ public class NotificationEntity
[Required] // dire obligatoire dans la base de données [Required] // dire obligatoire dans la base de données
public string Message { get; set; } = null!; // pour dire pas null public string Message { get; set; } = null!; // pour dire pas null
[Required(ErrorMessage = "Notification Date is required")] [Required(ErrorMessage = "Notification Date is required")]
[DataType(DataType.DateTime)] [DisplayFormat(DataFormatString = "{0:HH.mm.ss - HH.mm.ss}", ApplyFormatInEditMode = true)]
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy - HH}", ApplyFormatInEditMode = true)]
public DateTime Date { get; set; } public DateTime Date { get; set; }
public bool Statut { get; set; } public bool Statut { get; set; }
[MaxLength(100)] [MaxLength(100)]

@ -14,7 +14,6 @@ public class StatisticEntity
public double MaximumHeartRate { get; set; } public double MaximumHeartRate { get; set; }
public double AverageCaloriesBurned { get; set; } public double AverageCaloriesBurned { get; set; }
[Required(ErrorMessage = "Satistic Date is required")] [Required(ErrorMessage = "Satistic Date is required")]
[DataType(DataType.DateTime)]
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
public DateTime Date { get; set; } public DateOnly Date { get; set; }
} }

@ -12,9 +12,8 @@ public class TrainingEntity
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdTraining { get; set; } public int IdTraining { get; set; }
[Required(ErrorMessage = "Training Date is required")] [Required(ErrorMessage = "Training Date is required")]
[DataType(DataType.DateTime)]
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
public DateTime Date { get; set; } public DateOnly Date { get; set; }
[MaxLength(300)] [MaxLength(300)]
public string? Description { get; set; } public string? Description { get; set; }
public float Latitude { get; set; } public float Latitude { get; set; }

@ -19,13 +19,13 @@ public class ActivityStubbedContext : LibraryContext
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<ActivityEntity>().HasData( modelBuilder.Entity<ActivityEntity>().HasData(
new ActivityEntity { IdActivity = 1, Type = "Running", Date = new DateTime(), StartTime = new DateTime(), EndTime = new DateTime(), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false }, new ActivityEntity { IdActivity = 1, Type = "Running", Date = new DateOnly(2023, 01, 10), StartTime = new TimeOnly(13, 00, 34), EndTime = new TimeOnly(14, 00, 22), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false },
new ActivityEntity { IdActivity = 2, Type = "Cycling", Date = new DateTime(), StartTime = new DateTime(), EndTime = new DateTime(), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false }, new ActivityEntity { IdActivity = 2, Type = "Cycling", Date = new DateOnly(2023, 01, 25), StartTime = new TimeOnly(13, 04, 34), EndTime = new TimeOnly(14, 00, 22), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false },
new ActivityEntity { IdActivity = 3, Type = "Swimming", Date = new DateTime(), StartTime = new DateTime(), EndTime = new DateTime(), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false }, new ActivityEntity { IdActivity = 3, Type = "Swimming", Date = new DateOnly(2023, 12, 10), StartTime = new TimeOnly(13, 30, 34), EndTime = new TimeOnly(15, 02, 22), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false },
new ActivityEntity { IdActivity = 4, Type = "Walking", Date = new DateTime(), StartTime = new DateTime(), EndTime = new DateTime(), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false }, new ActivityEntity { IdActivity = 4, Type = "Walking", Date = new DateOnly(2024, 01, 02), StartTime = new TimeOnly(15, 00, 00), EndTime = new TimeOnly(16, 01, 55), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false },
new ActivityEntity { IdActivity = 5, Type = "Hiking", Date = new DateTime(), StartTime = new DateTime(), EndTime = new DateTime(), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false }, new ActivityEntity { IdActivity = 5, Type = "Hiking", Date = new DateOnly(2024, 01, 12), StartTime = new TimeOnly(07, 45, 34), EndTime = new TimeOnly(09, 00, 22), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false },
new ActivityEntity { IdActivity = 6, Type = "Climbing", Date = new DateTime(), StartTime = new DateTime(), EndTime = new DateTime(), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false }, new ActivityEntity { IdActivity = 6, Type = "Climbing", Date = new DateOnly(2024, 01, 27), StartTime = new TimeOnly(13, 30, 01), EndTime = new TimeOnly(14, 00, 22), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false },
new ActivityEntity { IdActivity = 7, Type = "Yoga", Date = new DateTime(), StartTime = new DateTime(), EndTime = new DateTime(), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false } new ActivityEntity { IdActivity = 7, Type = "Yoga", Date = new DateOnly(2024, 02, 22), StartTime = new TimeOnly(22, 00, 34), EndTime = new TimeOnly(23, 50, 58), EffortFelt = 5, Variability = 0.5f, Variance = 0.5f, StandardDeviation = 0.5f, Average = 0.5f, Maximum = 0, Minimum = 0, AverageTemperature = 20.0f, HasAutoPause = false }
); );
} }
} }

@ -19,11 +19,11 @@ public class AthleteStubbedContext : ActivityStubbedContext
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<AthleteEntity>().HasData( modelBuilder.Entity<AthleteEntity>().HasData(
new AthleteEntity { IdAthlete = 1, Username = "Doe", LastName = "Doe", FirstName = "John", Email = "john.doe@example.com", Password = "password123", Sexe = "M", Lenght = 1.80, Weight = 75, DateOfBirth = new DateTime(), IsCoach = true }, new AthleteEntity { IdAthlete = 1, Username = "Doe", LastName = "Doe", FirstName = "John", Email = "john.doe@example.com", Password = "password123", Sexe = "M", Lenght = 1.80, Weight = 75, DateOfBirth = new DateOnly(1990, 01, 01), IsCoach = true },
new AthleteEntity { IdAthlete = 2, Username = "Smith", LastName = "Smith", FirstName = "Jane", Email = "jane.smith@example.com", Password = "secure456", Sexe = "F", Lenght = 1.65, Weight = 60, DateOfBirth = new DateTime(), IsCoach = false }, new AthleteEntity { IdAthlete = 2, Username = "Smith", LastName = "Smith", FirstName = "Jane", Email = "jane.smith@exemple.com", Password = "secure456", Sexe = "F", Lenght = 1.65, Weight = 60, DateOfBirth = new DateOnly(1995, 01, 01), IsCoach = false },
new AthleteEntity { IdAthlete = 3, Username = "Martin", LastName = "Martin", FirstName = "Paul", Email = "paul.martin@example.com", Password = "super789", Sexe = "M", Lenght = 1.75, Weight = 68, DateOfBirth = new DateTime(), IsCoach = true }, new AthleteEntity { IdAthlete = 3, Username = "Martin", LastName = "Martin", FirstName = "Paul", Email = "paul.martin@example.com", Password = "super789", Sexe = "M", Lenght = 1.75, Weight = 68, DateOfBirth = new DateOnly(1992, 01, 01), IsCoach = true },
new AthleteEntity { IdAthlete = 4, Username = "Brown", LastName = "Brown", FirstName = "Anna", Email = "anna.brown@example.com", Password = "test000", Sexe = "F", Lenght = 1.70, Weight = 58, DateOfBirth = new DateTime(), IsCoach = false }, new AthleteEntity { IdAthlete = 4, Username = "Brown", LastName = "Brown", FirstName = "Anna", Email = "anna.brown@example.com", Password = "test000", Sexe = "F", Lenght = 1.70, Weight = 58, DateOfBirth = new DateOnly(1993, 01, 01), IsCoach = false },
new AthleteEntity { IdAthlete = 5, Username = "Lee", LastName = "Lee", FirstName ="Bruce", Email = "bruce.lee@example.com", Password = "hello321", Sexe = "M", Lenght = 2.0, Weight = 90, DateOfBirth = new DateTime(), IsCoach = false } new AthleteEntity { IdAthlete = 5, Username = "Lee", LastName = "Lee", FirstName ="Bruce", Email = "bruce.lee@example.com", Password = "hello321", Sexe = "M", Lenght = 2.0, Weight = 90, DateOfBirth = new DateOnly(1991, 01, 01), IsCoach = false }
); );
} }
} }

@ -19,11 +19,11 @@ public class HeartRateStubbedContext : DataSourceStubbedContext
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<HeartRateEntity>().HasData( modelBuilder.Entity<HeartRateEntity>().HasData(
new HeartRateEntity { IdHeartRate = 1, Altitude = 0.0, Time = new DateTime(), Temperature = 20.0f, Bpm = 60, Longitude = 35f, Latitude = 66f }, new HeartRateEntity { IdHeartRate = 1, Altitude = 0.0, Time = new TimeOnly(13, 00, 30), Temperature = 20.0f, Bpm = 60, Longitude = 35f, Latitude = 66f },
new HeartRateEntity { IdHeartRate = 2, Altitude = 10, Time = new DateTime(), Temperature = 20.5f, Bpm = 65, Longitude = 35f, Latitude = 67f }, new HeartRateEntity { IdHeartRate = 2, Altitude = 10, Time = new TimeOnly(13, 00, 31), Temperature = 20.5f, Bpm = 65, Longitude = 35f, Latitude = 67f },
new HeartRateEntity { IdHeartRate = 3, Altitude = 11, Time = new DateTime(), Temperature = 20.0f, Bpm = 71, Longitude = 36f, Latitude = 66f }, new HeartRateEntity { IdHeartRate = 3, Altitude = 11, Time = new TimeOnly(13, 00, 32), Temperature = 20.0f, Bpm = 71, Longitude = 36f, Latitude = 66f },
new HeartRateEntity { IdHeartRate = 4, Altitude = 12, Time = new DateTime(), Temperature = 20.5f, Bpm = 75, Longitude = 36f, Latitude = 67f }, new HeartRateEntity { IdHeartRate = 4, Altitude = 12, Time = new TimeOnly(13, 00, 33), Temperature = 20.5f, Bpm = 75, Longitude = 36f, Latitude = 67f },
new HeartRateEntity { IdHeartRate = 5, Altitude = 13, Time = new DateTime(), Temperature = 20.0f, Bpm = 80, Longitude = 37f, Latitude = 66f } new HeartRateEntity { IdHeartRate = 5, Altitude = 13, Time = new TimeOnly(13, 00, 34), Temperature = 20.0f, Bpm = 80, Longitude = 37f, Latitude = 66f }
); );
} }
} }

@ -11,7 +11,7 @@ using StubbedContextLib;
namespace StubbedContextLib.Migrations namespace StubbedContextLib.Migrations
{ {
[DbContext(typeof(TrainingStubbedContext))] [DbContext(typeof(TrainingStubbedContext))]
[Migration("20240222092302_MyMigrations")] [Migration("20240222102358_MyMigrations")]
partial class MyMigrations partial class MyMigrations
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -32,13 +32,13 @@ namespace StubbedContextLib.Migrations
b.Property<float>("AverageTemperature") b.Property<float>("AverageTemperature")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<int>("EffortFelt") b.Property<int>("EffortFelt")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<DateTime>("EndTime") b.Property<TimeOnly>("EndTime")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<bool>("HasAutoPause") b.Property<bool>("HasAutoPause")
@ -53,7 +53,7 @@ namespace StubbedContextLib.Migrations
b.Property<float>("StandardDeviation") b.Property<float>("StandardDeviation")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("StartTime") b.Property<TimeOnly>("StartTime")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Type") b.Property<string>("Type")
@ -77,14 +77,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 1, IdActivity = 1,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 1, 10),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(14, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 0, 34),
Type = "Running", Type = "Running",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -94,14 +94,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 2, IdActivity = 2,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 1, 25),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(14, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 4, 34),
Type = "Cycling", Type = "Cycling",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -111,14 +111,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 3, IdActivity = 3,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 12, 10),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(15, 2, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 30, 34),
Type = "Swimming", Type = "Swimming",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -128,14 +128,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 4, IdActivity = 4,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 2),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(16, 1, 55),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(15, 0, 0),
Type = "Walking", Type = "Walking",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -145,14 +145,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 5, IdActivity = 5,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 12),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(9, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(7, 45, 34),
Type = "Hiking", Type = "Hiking",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -162,14 +162,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 6, IdActivity = 6,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 27),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(14, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 30, 1),
Type = "Climbing", Type = "Climbing",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -179,14 +179,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 7, IdActivity = 7,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 22),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(23, 50, 58),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(22, 0, 34),
Type = "Yoga", Type = "Yoga",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -199,7 +199,7 @@ namespace StubbedContextLib.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<DateTime>("DateOfBirth") b.Property<DateOnly>("DateOfBirth")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Email") b.Property<string>("Email")
@ -248,7 +248,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 1, IdAthlete = 1,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1990, 1, 1),
Email = "john.doe@example.com", Email = "john.doe@example.com",
FirstName = "John", FirstName = "John",
IsCoach = true, IsCoach = true,
@ -262,8 +262,8 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 2, IdAthlete = 2,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1995, 1, 1),
Email = "jane.smith@example.com", Email = "jane.smith@exemple.com",
FirstName = "Jane", FirstName = "Jane",
IsCoach = false, IsCoach = false,
LastName = "Smith", LastName = "Smith",
@ -276,7 +276,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 3, IdAthlete = 3,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1992, 1, 1),
Email = "paul.martin@example.com", Email = "paul.martin@example.com",
FirstName = "Paul", FirstName = "Paul",
IsCoach = true, IsCoach = true,
@ -290,7 +290,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 4, IdAthlete = 4,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1993, 1, 1),
Email = "anna.brown@example.com", Email = "anna.brown@example.com",
FirstName = "Anna", FirstName = "Anna",
IsCoach = false, IsCoach = false,
@ -304,7 +304,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 5, IdAthlete = 5,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1991, 1, 1),
Email = "bruce.lee@example.com", Email = "bruce.lee@example.com",
FirstName = "Bruce", FirstName = "Bruce",
IsCoach = false, IsCoach = false,
@ -399,7 +399,7 @@ namespace StubbedContextLib.Migrations
b.Property<float>("Temperature") b.Property<float>("Temperature")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("Time") b.Property<TimeOnly>("Time")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasKey("IdHeartRate"); b.HasKey("IdHeartRate");
@ -415,7 +415,7 @@ namespace StubbedContextLib.Migrations
Latitude = 66f, Latitude = 66f,
Longitude = 35f, Longitude = 35f,
Temperature = 20f, Temperature = 20f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 30)
}, },
new new
{ {
@ -425,7 +425,7 @@ namespace StubbedContextLib.Migrations
Latitude = 67f, Latitude = 67f,
Longitude = 35f, Longitude = 35f,
Temperature = 20.5f, Temperature = 20.5f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 31)
}, },
new new
{ {
@ -435,7 +435,7 @@ namespace StubbedContextLib.Migrations
Latitude = 66f, Latitude = 66f,
Longitude = 36f, Longitude = 36f,
Temperature = 20f, Temperature = 20f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 32)
}, },
new new
{ {
@ -445,7 +445,7 @@ namespace StubbedContextLib.Migrations
Latitude = 67f, Latitude = 67f,
Longitude = 36f, Longitude = 36f,
Temperature = 20.5f, Temperature = 20.5f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 33)
}, },
new new
{ {
@ -455,7 +455,7 @@ namespace StubbedContextLib.Migrations
Latitude = 66f, Latitude = 66f,
Longitude = 37f, Longitude = 37f,
Temperature = 20f, Temperature = 20f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 34)
}); });
}); });
@ -489,7 +489,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 1, IdNotif = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2023, 12, 25, 13, 0, 40, 0, DateTimeKind.Unspecified),
Message = "You have a new activity to check", Message = "You have a new activity to check",
Statut = true, Statut = true,
Urgence = "A" Urgence = "A"
@ -497,7 +497,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 2, IdNotif = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2023, 12, 26, 13, 10, 40, 0, DateTimeKind.Unspecified),
Message = "You have a new athlete to check", Message = "You have a new athlete to check",
Statut = false, Statut = false,
Urgence = "3" Urgence = "3"
@ -505,7 +505,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 3, IdNotif = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2023, 12, 26, 16, 10, 4, 0, DateTimeKind.Unspecified),
Message = "You have a new heart rate to check", Message = "You have a new heart rate to check",
Statut = true, Statut = true,
Urgence = "2" Urgence = "2"
@ -513,7 +513,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 4, IdNotif = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2024, 1, 12, 9, 30, 50, 0, DateTimeKind.Unspecified),
Message = "You have a new data source to check", Message = "You have a new data source to check",
Statut = false, Statut = false,
Urgence = "1" Urgence = "1"
@ -521,7 +521,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 5, IdNotif = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2024, 2, 22, 12, 10, 0, 0, DateTimeKind.Unspecified),
Message = "You have a new notification to check", Message = "You have a new notification to check",
Statut = true, Statut = true,
Urgence = "3" Urgence = "3"
@ -540,7 +540,7 @@ namespace StubbedContextLib.Migrations
b.Property<double>("AverageHeartRate") b.Property<double>("AverageHeartRate")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<double>("MaximumHeartRate") b.Property<double>("MaximumHeartRate")
@ -559,7 +559,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 1, IdStatistic = 1,
AverageCaloriesBurned = 500.0, AverageCaloriesBurned = 500.0,
AverageHeartRate = 120.0, AverageHeartRate = 120.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2021, 12, 12),
MaximumHeartRate = 180.0, MaximumHeartRate = 180.0,
Weight = 75f Weight = 75f
}, },
@ -568,7 +568,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 2, IdStatistic = 2,
AverageCaloriesBurned = 600.0, AverageCaloriesBurned = 600.0,
AverageHeartRate = 130.0, AverageHeartRate = 130.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2021, 1, 11),
MaximumHeartRate = 190.0, MaximumHeartRate = 190.0,
Weight = 60f Weight = 60f
}, },
@ -577,7 +577,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 3, IdStatistic = 3,
AverageCaloriesBurned = 550.0, AverageCaloriesBurned = 550.0,
AverageHeartRate = 125.0, AverageHeartRate = 125.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2022, 12, 30),
MaximumHeartRate = 185.0, MaximumHeartRate = 185.0,
Weight = 68f Weight = 68f
}, },
@ -586,7 +586,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 4, IdStatistic = 4,
AverageCaloriesBurned = 650.0, AverageCaloriesBurned = 650.0,
AverageHeartRate = 135.0, AverageHeartRate = 135.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 2, 20),
MaximumHeartRate = 195.0, MaximumHeartRate = 195.0,
Weight = 58f Weight = 58f
}, },
@ -595,7 +595,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 5, IdStatistic = 5,
AverageCaloriesBurned = 450.0, AverageCaloriesBurned = 450.0,
AverageHeartRate = 110.0, AverageHeartRate = 110.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 10),
MaximumHeartRate = 170.0, MaximumHeartRate = 170.0,
Weight = 90f Weight = 90f
}); });
@ -607,7 +607,7 @@ namespace StubbedContextLib.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Description") b.Property<string>("Description")
@ -632,7 +632,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 1, IdTraining = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 19),
Description = "Running", Description = "Running",
FeedBack = "Good", FeedBack = "Good",
Latitude = 48.8566f, Latitude = 48.8566f,
@ -641,7 +641,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 2, IdTraining = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 20),
Description = "Cycling", Description = "Cycling",
Latitude = 48.8566f, Latitude = 48.8566f,
Longitude = 2.3522f Longitude = 2.3522f
@ -649,7 +649,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 3, IdTraining = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 21),
FeedBack = "Good", FeedBack = "Good",
Latitude = 48.8566f, Latitude = 48.8566f,
Longitude = 2.3522f Longitude = 2.3522f
@ -657,7 +657,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 4, IdTraining = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 22),
Description = "Running", Description = "Running",
FeedBack = "Good", FeedBack = "Good",
Latitude = 48.8566f, Latitude = 48.8566f,
@ -666,7 +666,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 5, IdTraining = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 23),
Description = "Cycling", Description = "Cycling",
Latitude = 48.8566f, Latitude = 48.8566f,
Longitude = 2.3522f Longitude = 2.3522f

@ -20,9 +20,9 @@ namespace StubbedContextLib.Migrations
IdActivity = table.Column<int>(type: "INTEGER", nullable: false) IdActivity = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
Type = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false), Type = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
Date = table.Column<DateTime>(type: "TEXT", nullable: false), Date = table.Column<DateOnly>(type: "TEXT", nullable: false),
StartTime = table.Column<DateTime>(type: "TEXT", nullable: false), StartTime = table.Column<TimeOnly>(type: "TEXT", nullable: false),
EndTime = table.Column<DateTime>(type: "TEXT", nullable: false), EndTime = table.Column<TimeOnly>(type: "TEXT", nullable: false),
EffortFelt = table.Column<int>(type: "INTEGER", nullable: false), EffortFelt = table.Column<int>(type: "INTEGER", nullable: false),
Variability = table.Column<float>(type: "REAL", nullable: false), Variability = table.Column<float>(type: "REAL", nullable: false),
Variance = table.Column<float>(type: "REAL", nullable: false), Variance = table.Column<float>(type: "REAL", nullable: false),
@ -52,7 +52,7 @@ namespace StubbedContextLib.Migrations
Lenght = table.Column<double>(type: "REAL", nullable: false), Lenght = table.Column<double>(type: "REAL", nullable: false),
Weight = table.Column<float>(type: "REAL", nullable: false), Weight = table.Column<float>(type: "REAL", nullable: false),
Password = table.Column<string>(type: "TEXT", nullable: false), Password = table.Column<string>(type: "TEXT", nullable: false),
DateOfBirth = table.Column<DateTime>(type: "TEXT", nullable: false), DateOfBirth = table.Column<DateOnly>(type: "TEXT", nullable: false),
IsCoach = table.Column<bool>(type: "INTEGER", nullable: false) IsCoach = table.Column<bool>(type: "INTEGER", nullable: false)
}, },
constraints: table => constraints: table =>
@ -82,7 +82,7 @@ namespace StubbedContextLib.Migrations
IdHeartRate = table.Column<int>(type: "INTEGER", nullable: false) IdHeartRate = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
Altitude = table.Column<double>(type: "REAL", nullable: false), Altitude = table.Column<double>(type: "REAL", nullable: false),
Time = table.Column<DateTime>(type: "TEXT", nullable: false), Time = table.Column<TimeOnly>(type: "TEXT", nullable: false),
Temperature = table.Column<float>(type: "REAL", nullable: false), Temperature = table.Column<float>(type: "REAL", nullable: false),
Bpm = table.Column<int>(type: "INTEGER", nullable: false), Bpm = table.Column<int>(type: "INTEGER", nullable: false),
Longitude = table.Column<float>(type: "REAL", nullable: false), Longitude = table.Column<float>(type: "REAL", nullable: false),
@ -119,7 +119,7 @@ namespace StubbedContextLib.Migrations
AverageHeartRate = table.Column<double>(type: "REAL", nullable: false), AverageHeartRate = table.Column<double>(type: "REAL", nullable: false),
MaximumHeartRate = table.Column<double>(type: "REAL", nullable: false), MaximumHeartRate = table.Column<double>(type: "REAL", nullable: false),
AverageCaloriesBurned = table.Column<double>(type: "REAL", nullable: false), AverageCaloriesBurned = table.Column<double>(type: "REAL", nullable: false),
Date = table.Column<DateTime>(type: "TEXT", nullable: false) Date = table.Column<DateOnly>(type: "TEXT", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -132,7 +132,7 @@ namespace StubbedContextLib.Migrations
{ {
IdTraining = table.Column<int>(type: "INTEGER", nullable: false) IdTraining = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
Date = table.Column<DateTime>(type: "TEXT", nullable: false), Date = table.Column<DateOnly>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 300, nullable: true), Description = table.Column<string>(type: "TEXT", maxLength: 300, nullable: true),
Latitude = table.Column<float>(type: "REAL", nullable: false), Latitude = table.Column<float>(type: "REAL", nullable: false),
Longitude = table.Column<float>(type: "REAL", nullable: false), Longitude = table.Column<float>(type: "REAL", nullable: false),
@ -148,13 +148,13 @@ namespace StubbedContextLib.Migrations
columns: new[] { "IdActivity", "Average", "AverageTemperature", "Date", "EffortFelt", "EndTime", "HasAutoPause", "Maximum", "Minimum", "StandardDeviation", "StartTime", "Type", "Variability", "Variance" }, columns: new[] { "IdActivity", "Average", "AverageTemperature", "Date", "EffortFelt", "EndTime", "HasAutoPause", "Maximum", "Minimum", "StandardDeviation", "StartTime", "Type", "Variability", "Variance" },
values: new object[,] values: new object[,]
{ {
{ 1, 0.5f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, 0, 0, 0.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Running", 0.5f, 0.5f }, { 1, 0.5f, 20f, new DateOnly(2023, 1, 10), 5, new TimeOnly(14, 0, 22), false, 0, 0, 0.5f, new TimeOnly(13, 0, 34), "Running", 0.5f, 0.5f },
{ 2, 0.5f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, 0, 0, 0.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Cycling", 0.5f, 0.5f }, { 2, 0.5f, 20f, new DateOnly(2023, 1, 25), 5, new TimeOnly(14, 0, 22), false, 0, 0, 0.5f, new TimeOnly(13, 4, 34), "Cycling", 0.5f, 0.5f },
{ 3, 0.5f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, 0, 0, 0.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Swimming", 0.5f, 0.5f }, { 3, 0.5f, 20f, new DateOnly(2023, 12, 10), 5, new TimeOnly(15, 2, 22), false, 0, 0, 0.5f, new TimeOnly(13, 30, 34), "Swimming", 0.5f, 0.5f },
{ 4, 0.5f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, 0, 0, 0.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Walking", 0.5f, 0.5f }, { 4, 0.5f, 20f, new DateOnly(2024, 1, 2), 5, new TimeOnly(16, 1, 55), false, 0, 0, 0.5f, new TimeOnly(15, 0, 0), "Walking", 0.5f, 0.5f },
{ 5, 0.5f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, 0, 0, 0.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Hiking", 0.5f, 0.5f }, { 5, 0.5f, 20f, new DateOnly(2024, 1, 12), 5, new TimeOnly(9, 0, 22), false, 0, 0, 0.5f, new TimeOnly(7, 45, 34), "Hiking", 0.5f, 0.5f },
{ 6, 0.5f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, 0, 0, 0.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Climbing", 0.5f, 0.5f }, { 6, 0.5f, 20f, new DateOnly(2024, 1, 27), 5, new TimeOnly(14, 0, 22), false, 0, 0, 0.5f, new TimeOnly(13, 30, 1), "Climbing", 0.5f, 0.5f },
{ 7, 0.5f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, 0, 0, 0.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Yoga", 0.5f, 0.5f } { 7, 0.5f, 20f, new DateOnly(2024, 2, 22), 5, new TimeOnly(23, 50, 58), false, 0, 0, 0.5f, new TimeOnly(22, 0, 34), "Yoga", 0.5f, 0.5f }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -162,11 +162,11 @@ namespace StubbedContextLib.Migrations
columns: new[] { "IdAthlete", "DateOfBirth", "Email", "FirstName", "IsCoach", "LastName", "Lenght", "Password", "Sexe", "Username", "Weight" }, columns: new[] { "IdAthlete", "DateOfBirth", "Email", "FirstName", "IsCoach", "LastName", "Lenght", "Password", "Sexe", "Username", "Weight" },
values: new object[,] values: new object[,]
{ {
{ 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "john.doe@example.com", "John", true, "Doe", 1.8, "password123", "M", "Doe", 75f }, { 1, new DateOnly(1990, 1, 1), "john.doe@example.com", "John", true, "Doe", 1.8, "password123", "M", "Doe", 75f },
{ 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "jane.smith@example.com", "Jane", false, "Smith", 1.6499999999999999, "secure456", "F", "Smith", 60f }, { 2, new DateOnly(1995, 1, 1), "jane.smith@exemple.com", "Jane", false, "Smith", 1.6499999999999999, "secure456", "F", "Smith", 60f },
{ 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "paul.martin@example.com", "Paul", true, "Martin", 1.75, "super789", "M", "Martin", 68f }, { 3, new DateOnly(1992, 1, 1), "paul.martin@example.com", "Paul", true, "Martin", 1.75, "super789", "M", "Martin", 68f },
{ 4, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "anna.brown@example.com", "Anna", false, "Brown", 1.7, "test000", "F", "Brown", 58f }, { 4, new DateOnly(1993, 1, 1), "anna.brown@example.com", "Anna", false, "Brown", 1.7, "test000", "F", "Brown", 58f },
{ 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "bruce.lee@example.com", "Bruce", false, "Lee", 2.0, "hello321", "M", "Lee", 90f } { 5, new DateOnly(1991, 1, 1), "bruce.lee@example.com", "Bruce", false, "Lee", 2.0, "hello321", "M", "Lee", 90f }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -186,11 +186,11 @@ namespace StubbedContextLib.Migrations
columns: new[] { "IdHeartRate", "Altitude", "Bpm", "Latitude", "Longitude", "Temperature", "Time" }, columns: new[] { "IdHeartRate", "Altitude", "Bpm", "Latitude", "Longitude", "Temperature", "Time" },
values: new object[,] values: new object[,]
{ {
{ 1, 0.0, 60, 66f, 35f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, { 1, 0.0, 60, 66f, 35f, 20f, new TimeOnly(13, 0, 30) },
{ 2, 10.0, 65, 67f, 35f, 20.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, { 2, 10.0, 65, 67f, 35f, 20.5f, new TimeOnly(13, 0, 31) },
{ 3, 11.0, 71, 66f, 36f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, { 3, 11.0, 71, 66f, 36f, 20f, new TimeOnly(13, 0, 32) },
{ 4, 12.0, 75, 67f, 36f, 20.5f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, { 4, 12.0, 75, 67f, 36f, 20.5f, new TimeOnly(13, 0, 33) },
{ 5, 13.0, 80, 66f, 37f, 20f, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) } { 5, 13.0, 80, 66f, 37f, 20f, new TimeOnly(13, 0, 34) }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -198,11 +198,11 @@ namespace StubbedContextLib.Migrations
columns: new[] { "IdNotif", "Date", "Message", "Statut", "Urgence" }, columns: new[] { "IdNotif", "Date", "Message", "Statut", "Urgence" },
values: new object[,] values: new object[,]
{ {
{ 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "You have a new activity to check", true, "A" }, { 1, new DateTime(2023, 12, 25, 13, 0, 40, 0, DateTimeKind.Unspecified), "You have a new activity to check", true, "A" },
{ 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "You have a new athlete to check", false, "3" }, { 2, new DateTime(2023, 12, 26, 13, 10, 40, 0, DateTimeKind.Unspecified), "You have a new athlete to check", false, "3" },
{ 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "You have a new heart rate to check", true, "2" }, { 3, new DateTime(2023, 12, 26, 16, 10, 4, 0, DateTimeKind.Unspecified), "You have a new heart rate to check", true, "2" },
{ 4, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "You have a new data source to check", false, "1" }, { 4, new DateTime(2024, 1, 12, 9, 30, 50, 0, DateTimeKind.Unspecified), "You have a new data source to check", false, "1" },
{ 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "You have a new notification to check", true, "3" } { 5, new DateTime(2024, 2, 22, 12, 10, 0, 0, DateTimeKind.Unspecified), "You have a new notification to check", true, "3" }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -210,11 +210,11 @@ namespace StubbedContextLib.Migrations
columns: new[] { "IdStatistic", "AverageCaloriesBurned", "AverageHeartRate", "Date", "MaximumHeartRate", "Weight" }, columns: new[] { "IdStatistic", "AverageCaloriesBurned", "AverageHeartRate", "Date", "MaximumHeartRate", "Weight" },
values: new object[,] values: new object[,]
{ {
{ 1, 500.0, 120.0, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 180.0, 75f }, { 1, 500.0, 120.0, new DateOnly(2021, 12, 12), 180.0, 75f },
{ 2, 600.0, 130.0, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 190.0, 60f }, { 2, 600.0, 130.0, new DateOnly(2021, 1, 11), 190.0, 60f },
{ 3, 550.0, 125.0, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 185.0, 68f }, { 3, 550.0, 125.0, new DateOnly(2022, 12, 30), 185.0, 68f },
{ 4, 650.0, 135.0, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 195.0, 58f }, { 4, 650.0, 135.0, new DateOnly(2023, 2, 20), 195.0, 58f },
{ 5, 450.0, 110.0, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 170.0, 90f } { 5, 450.0, 110.0, new DateOnly(2024, 1, 10), 170.0, 90f }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -222,11 +222,11 @@ namespace StubbedContextLib.Migrations
columns: new[] { "IdTraining", "Date", "Description", "FeedBack", "Latitude", "Longitude" }, columns: new[] { "IdTraining", "Date", "Description", "FeedBack", "Latitude", "Longitude" },
values: new object[,] values: new object[,]
{ {
{ 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Running", "Good", 48.8566f, 2.3522f }, { 1, new DateOnly(2024, 1, 19), "Running", "Good", 48.8566f, 2.3522f },
{ 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Cycling", null, 48.8566f, 2.3522f }, { 2, new DateOnly(2024, 2, 20), "Cycling", null, 48.8566f, 2.3522f },
{ 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, "Good", 48.8566f, 2.3522f }, { 3, new DateOnly(2024, 2, 21), null, "Good", 48.8566f, 2.3522f },
{ 4, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Running", "Good", 48.8566f, 2.3522f }, { 4, new DateOnly(2024, 2, 22), "Running", "Good", 48.8566f, 2.3522f },
{ 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Cycling", null, 48.8566f, 2.3522f } { 5, new DateOnly(2024, 2, 23), "Cycling", null, 48.8566f, 2.3522f }
}); });
} }

@ -29,13 +29,13 @@ namespace StubbedContextLib.Migrations
b.Property<float>("AverageTemperature") b.Property<float>("AverageTemperature")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<int>("EffortFelt") b.Property<int>("EffortFelt")
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<DateTime>("EndTime") b.Property<TimeOnly>("EndTime")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<bool>("HasAutoPause") b.Property<bool>("HasAutoPause")
@ -50,7 +50,7 @@ namespace StubbedContextLib.Migrations
b.Property<float>("StandardDeviation") b.Property<float>("StandardDeviation")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("StartTime") b.Property<TimeOnly>("StartTime")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Type") b.Property<string>("Type")
@ -74,14 +74,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 1, IdActivity = 1,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 1, 10),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(14, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 0, 34),
Type = "Running", Type = "Running",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -91,14 +91,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 2, IdActivity = 2,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 1, 25),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(14, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 4, 34),
Type = "Cycling", Type = "Cycling",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -108,14 +108,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 3, IdActivity = 3,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 12, 10),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(15, 2, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 30, 34),
Type = "Swimming", Type = "Swimming",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -125,14 +125,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 4, IdActivity = 4,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 2),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(16, 1, 55),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(15, 0, 0),
Type = "Walking", Type = "Walking",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -142,14 +142,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 5, IdActivity = 5,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 12),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(9, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(7, 45, 34),
Type = "Hiking", Type = "Hiking",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -159,14 +159,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 6, IdActivity = 6,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 27),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(14, 0, 22),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(13, 30, 1),
Type = "Climbing", Type = "Climbing",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -176,14 +176,14 @@ namespace StubbedContextLib.Migrations
IdActivity = 7, IdActivity = 7,
Average = 0.5f, Average = 0.5f,
AverageTemperature = 20f, AverageTemperature = 20f,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 22),
EffortFelt = 5, EffortFelt = 5,
EndTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), EndTime = new TimeOnly(23, 50, 58),
HasAutoPause = false, HasAutoPause = false,
Maximum = 0, Maximum = 0,
Minimum = 0, Minimum = 0,
StandardDeviation = 0.5f, StandardDeviation = 0.5f,
StartTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), StartTime = new TimeOnly(22, 0, 34),
Type = "Yoga", Type = "Yoga",
Variability = 0.5f, Variability = 0.5f,
Variance = 0.5f Variance = 0.5f
@ -196,7 +196,7 @@ namespace StubbedContextLib.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<DateTime>("DateOfBirth") b.Property<DateOnly>("DateOfBirth")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Email") b.Property<string>("Email")
@ -245,7 +245,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 1, IdAthlete = 1,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1990, 1, 1),
Email = "john.doe@example.com", Email = "john.doe@example.com",
FirstName = "John", FirstName = "John",
IsCoach = true, IsCoach = true,
@ -259,8 +259,8 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 2, IdAthlete = 2,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1995, 1, 1),
Email = "jane.smith@example.com", Email = "jane.smith@exemple.com",
FirstName = "Jane", FirstName = "Jane",
IsCoach = false, IsCoach = false,
LastName = "Smith", LastName = "Smith",
@ -273,7 +273,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 3, IdAthlete = 3,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1992, 1, 1),
Email = "paul.martin@example.com", Email = "paul.martin@example.com",
FirstName = "Paul", FirstName = "Paul",
IsCoach = true, IsCoach = true,
@ -287,7 +287,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 4, IdAthlete = 4,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1993, 1, 1),
Email = "anna.brown@example.com", Email = "anna.brown@example.com",
FirstName = "Anna", FirstName = "Anna",
IsCoach = false, IsCoach = false,
@ -301,7 +301,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdAthlete = 5, IdAthlete = 5,
DateOfBirth = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DateOfBirth = new DateOnly(1991, 1, 1),
Email = "bruce.lee@example.com", Email = "bruce.lee@example.com",
FirstName = "Bruce", FirstName = "Bruce",
IsCoach = false, IsCoach = false,
@ -396,7 +396,7 @@ namespace StubbedContextLib.Migrations
b.Property<float>("Temperature") b.Property<float>("Temperature")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("Time") b.Property<TimeOnly>("Time")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasKey("IdHeartRate"); b.HasKey("IdHeartRate");
@ -412,7 +412,7 @@ namespace StubbedContextLib.Migrations
Latitude = 66f, Latitude = 66f,
Longitude = 35f, Longitude = 35f,
Temperature = 20f, Temperature = 20f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 30)
}, },
new new
{ {
@ -422,7 +422,7 @@ namespace StubbedContextLib.Migrations
Latitude = 67f, Latitude = 67f,
Longitude = 35f, Longitude = 35f,
Temperature = 20.5f, Temperature = 20.5f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 31)
}, },
new new
{ {
@ -432,7 +432,7 @@ namespace StubbedContextLib.Migrations
Latitude = 66f, Latitude = 66f,
Longitude = 36f, Longitude = 36f,
Temperature = 20f, Temperature = 20f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 32)
}, },
new new
{ {
@ -442,7 +442,7 @@ namespace StubbedContextLib.Migrations
Latitude = 67f, Latitude = 67f,
Longitude = 36f, Longitude = 36f,
Temperature = 20.5f, Temperature = 20.5f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 33)
}, },
new new
{ {
@ -452,7 +452,7 @@ namespace StubbedContextLib.Migrations
Latitude = 66f, Latitude = 66f,
Longitude = 37f, Longitude = 37f,
Temperature = 20f, Temperature = 20f,
Time = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) Time = new TimeOnly(13, 0, 34)
}); });
}); });
@ -486,7 +486,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 1, IdNotif = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2023, 12, 25, 13, 0, 40, 0, DateTimeKind.Unspecified),
Message = "You have a new activity to check", Message = "You have a new activity to check",
Statut = true, Statut = true,
Urgence = "A" Urgence = "A"
@ -494,7 +494,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 2, IdNotif = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2023, 12, 26, 13, 10, 40, 0, DateTimeKind.Unspecified),
Message = "You have a new athlete to check", Message = "You have a new athlete to check",
Statut = false, Statut = false,
Urgence = "3" Urgence = "3"
@ -502,7 +502,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 3, IdNotif = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2023, 12, 26, 16, 10, 4, 0, DateTimeKind.Unspecified),
Message = "You have a new heart rate to check", Message = "You have a new heart rate to check",
Statut = true, Statut = true,
Urgence = "2" Urgence = "2"
@ -510,7 +510,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 4, IdNotif = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2024, 1, 12, 9, 30, 50, 0, DateTimeKind.Unspecified),
Message = "You have a new data source to check", Message = "You have a new data source to check",
Statut = false, Statut = false,
Urgence = "1" Urgence = "1"
@ -518,7 +518,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdNotif = 5, IdNotif = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateTime(2024, 2, 22, 12, 10, 0, 0, DateTimeKind.Unspecified),
Message = "You have a new notification to check", Message = "You have a new notification to check",
Statut = true, Statut = true,
Urgence = "3" Urgence = "3"
@ -537,7 +537,7 @@ namespace StubbedContextLib.Migrations
b.Property<double>("AverageHeartRate") b.Property<double>("AverageHeartRate")
.HasColumnType("REAL"); .HasColumnType("REAL");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<double>("MaximumHeartRate") b.Property<double>("MaximumHeartRate")
@ -556,7 +556,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 1, IdStatistic = 1,
AverageCaloriesBurned = 500.0, AverageCaloriesBurned = 500.0,
AverageHeartRate = 120.0, AverageHeartRate = 120.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2021, 12, 12),
MaximumHeartRate = 180.0, MaximumHeartRate = 180.0,
Weight = 75f Weight = 75f
}, },
@ -565,7 +565,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 2, IdStatistic = 2,
AverageCaloriesBurned = 600.0, AverageCaloriesBurned = 600.0,
AverageHeartRate = 130.0, AverageHeartRate = 130.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2021, 1, 11),
MaximumHeartRate = 190.0, MaximumHeartRate = 190.0,
Weight = 60f Weight = 60f
}, },
@ -574,7 +574,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 3, IdStatistic = 3,
AverageCaloriesBurned = 550.0, AverageCaloriesBurned = 550.0,
AverageHeartRate = 125.0, AverageHeartRate = 125.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2022, 12, 30),
MaximumHeartRate = 185.0, MaximumHeartRate = 185.0,
Weight = 68f Weight = 68f
}, },
@ -583,7 +583,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 4, IdStatistic = 4,
AverageCaloriesBurned = 650.0, AverageCaloriesBurned = 650.0,
AverageHeartRate = 135.0, AverageHeartRate = 135.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2023, 2, 20),
MaximumHeartRate = 195.0, MaximumHeartRate = 195.0,
Weight = 58f Weight = 58f
}, },
@ -592,7 +592,7 @@ namespace StubbedContextLib.Migrations
IdStatistic = 5, IdStatistic = 5,
AverageCaloriesBurned = 450.0, AverageCaloriesBurned = 450.0,
AverageHeartRate = 110.0, AverageHeartRate = 110.0,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 10),
MaximumHeartRate = 170.0, MaximumHeartRate = 170.0,
Weight = 90f Weight = 90f
}); });
@ -604,7 +604,7 @@ namespace StubbedContextLib.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("INTEGER"); .HasColumnType("INTEGER");
b.Property<DateTime>("Date") b.Property<DateOnly>("Date")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Description") b.Property<string>("Description")
@ -629,7 +629,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 1, IdTraining = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 1, 19),
Description = "Running", Description = "Running",
FeedBack = "Good", FeedBack = "Good",
Latitude = 48.8566f, Latitude = 48.8566f,
@ -638,7 +638,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 2, IdTraining = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 20),
Description = "Cycling", Description = "Cycling",
Latitude = 48.8566f, Latitude = 48.8566f,
Longitude = 2.3522f Longitude = 2.3522f
@ -646,7 +646,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 3, IdTraining = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 21),
FeedBack = "Good", FeedBack = "Good",
Latitude = 48.8566f, Latitude = 48.8566f,
Longitude = 2.3522f Longitude = 2.3522f
@ -654,7 +654,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 4, IdTraining = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 22),
Description = "Running", Description = "Running",
FeedBack = "Good", FeedBack = "Good",
Latitude = 48.8566f, Latitude = 48.8566f,
@ -663,7 +663,7 @@ namespace StubbedContextLib.Migrations
new new
{ {
IdTraining = 5, IdTraining = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Date = new DateOnly(2024, 2, 23),
Description = "Cycling", Description = "Cycling",
Latitude = 48.8566f, Latitude = 48.8566f,
Longitude = 2.3522f Longitude = 2.3522f

@ -19,11 +19,11 @@ public class NotificationStubbedContext : HeartRateStubbedContext
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<NotificationEntity>().HasData( modelBuilder.Entity<NotificationEntity>().HasData(
new NotificationEntity { IdNotif = 1, Message = "You have a new activity to check", Date = new DateTime(), Statut = true, Urgence = "A" }, new NotificationEntity { IdNotif = 1, Message = "You have a new activity to check", Date = new DateTime(2023, 12, 25, 13, 00, 40), Statut = true, Urgence = "A" },
new NotificationEntity { IdNotif = 2, Message = "You have a new athlete to check", Date = new DateTime(), Statut = false, Urgence = "3" }, new NotificationEntity { IdNotif = 2, Message = "You have a new athlete to check", Date = new DateTime(2023, 12, 26, 13, 10, 40), Statut = false, Urgence = "3" },
new NotificationEntity { IdNotif = 3, Message = "You have a new heart rate to check", Date = new DateTime(), Statut = true, Urgence = "2" }, new NotificationEntity { IdNotif = 3, Message = "You have a new heart rate to check", Date = new DateTime(2023, 12, 26, 16, 10, 04), Statut = true, Urgence = "2" },
new NotificationEntity { IdNotif = 4, Message = "You have a new data source to check", Date = new DateTime(), Statut = false, Urgence = "1" }, new NotificationEntity { IdNotif = 4, Message = "You have a new data source to check", Date = new DateTime(2024, 01, 12, 09, 30, 50), Statut = false, Urgence = "1" },
new NotificationEntity { IdNotif = 5, Message = "You have a new notification to check", Date = new DateTime(), Statut = true, Urgence = "3" } new NotificationEntity { IdNotif = 5, Message = "You have a new notification to check", Date = new DateTime(2024, 02, 22, 12, 10, 00), Statut = true, Urgence = "3" }
); );
} }
} }

@ -19,11 +19,11 @@ public class StatisticStubbedContext : NotificationStubbedContext
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<StatisticEntity>().HasData( modelBuilder.Entity<StatisticEntity>().HasData(
new StatisticEntity { IdStatistic = 1, Weight = 75, AverageHeartRate = 120, MaximumHeartRate = 180, AverageCaloriesBurned = 500, Date = new DateTime(12/12/2021) }, new StatisticEntity { IdStatistic = 1, Weight = 75, AverageHeartRate = 120, MaximumHeartRate = 180, AverageCaloriesBurned = 500, Date = new DateOnly(2021, 12, 12) },
new StatisticEntity { IdStatistic = 2, Weight = 60, AverageHeartRate = 130, MaximumHeartRate = 190, AverageCaloriesBurned = 600, Date = new DateTime(11/01/2021) }, new StatisticEntity { IdStatistic = 2, Weight = 60, AverageHeartRate = 130, MaximumHeartRate = 190, AverageCaloriesBurned = 600, Date = new DateOnly(2021, 01, 11) },
new StatisticEntity { IdStatistic = 3, Weight = 68, AverageHeartRate = 125, MaximumHeartRate = 185, AverageCaloriesBurned = 550, Date = new DateTime(30/12/2022) }, new StatisticEntity { IdStatistic = 3, Weight = 68, AverageHeartRate = 125, MaximumHeartRate = 185, AverageCaloriesBurned = 550, Date = new DateOnly(2022, 12, 30) },
new StatisticEntity { IdStatistic = 4, Weight = 58, AverageHeartRate = 135, MaximumHeartRate = 195, AverageCaloriesBurned = 650, Date = new DateTime(20/02/2023) }, new StatisticEntity { IdStatistic = 4, Weight = 58, AverageHeartRate = 135, MaximumHeartRate = 195, AverageCaloriesBurned = 650, Date = new DateOnly(2023, 02, 20) },
new StatisticEntity { IdStatistic = 5, Weight = 90, AverageHeartRate = 110, MaximumHeartRate = 170, AverageCaloriesBurned = 450, Date = new DateTime(10/01/2024) } new StatisticEntity { IdStatistic = 5, Weight = 90, AverageHeartRate = 110, MaximumHeartRate = 170, AverageCaloriesBurned = 450, Date = new DateOnly(2024, 01, 10) }
); );
} }
} }

@ -19,11 +19,11 @@ public class TrainingStubbedContext : StatisticStubbedContext
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<TrainingEntity>().HasData( modelBuilder.Entity<TrainingEntity>().HasData(
new TrainingEntity { IdTraining = 1, Date = new DateTime(19/02/2024), Description = "Running", Latitude = 48.8566f, Longitude = 2.3522f, FeedBack = "Good" }, new TrainingEntity { IdTraining = 1, Date = new DateOnly(2024, 01, 19), Description = "Running", Latitude = 48.8566f, Longitude = 2.3522f, FeedBack = "Good" },
new TrainingEntity { IdTraining = 2, Date = new DateTime(20/02/2024), Description = "Cycling", Latitude = 48.8566f, Longitude = 2.3522f }, new TrainingEntity { IdTraining = 2, Date = new DateOnly(2024, 02, 20), Description = "Cycling", Latitude = 48.8566f, Longitude = 2.3522f },
new TrainingEntity { IdTraining = 3, Date = new DateTime(21/02/2024), Latitude = 48.8566f, Longitude = 2.3522f, FeedBack = "Good" }, new TrainingEntity { IdTraining = 3, Date = new DateOnly(2024, 02, 21), Latitude = 48.8566f, Longitude = 2.3522f, FeedBack = "Good" },
new TrainingEntity { IdTraining = 4, Date = new DateTime(22/02/2024), Description = "Running", Latitude = 48.8566f, Longitude = 2.3522f, FeedBack = "Good" }, new TrainingEntity { IdTraining = 4, Date = new DateOnly(2024, 02, 22), Description = "Running", Latitude = 48.8566f, Longitude = 2.3522f, FeedBack = "Good" },
new TrainingEntity { IdTraining = 5, Date = new DateTime(23/02/2024), Description = "Cycling", Latitude = 48.8566f, Longitude = 2.3522f } new TrainingEntity { IdTraining = 5, Date = new DateOnly(2024, 02, 23), Description = "Cycling", Latitude = 48.8566f, Longitude = 2.3522f }
); );
} }
} }

@ -120,7 +120,7 @@ class Program
// ! A revoir !! // ! A revoir !!
Console.WriteLine("Accès à l'athlete de date de naissance '01/01/2000' :"); Console.WriteLine("Accès à l'athlete de date de naissance '01/01/2000' :");
Console.WriteLine("---------------------------------"); Console.WriteLine("---------------------------------");
foreach (var athlete in db.AthletesSet.Where(a => a.DateOfBirth == new DateTime())) foreach (var athlete in db.AthletesSet.Where(a => a.DateOfBirth == new DateOnly()))
{ {
Console.WriteLine($"\t{athlete.IdAthlete} - {athlete.Username}, {athlete.LastName}, {athlete.FirstName}, {athlete.Email}, {athlete.Sexe}, {athlete.Lenght}, {athlete.Weight}, {athlete.DateOfBirth}, {athlete.IsCoach}"); Console.WriteLine($"\t{athlete.IdAthlete} - {athlete.Username}, {athlete.LastName}, {athlete.FirstName}, {athlete.Email}, {athlete.Sexe}, {athlete.Lenght}, {athlete.Weight}, {athlete.DateOfBirth}, {athlete.IsCoach}");
} }
@ -201,7 +201,7 @@ class Program
Console.WriteLine("Accès à l'activité de date '01/01/2022' :"); Console.WriteLine("Accès à l'activité de date '01/01/2022' :");
Console.WriteLine("---------------------------------"); Console.WriteLine("---------------------------------");
foreach (var activity in db.ActivitiesSet.Where(a => a.Date == new DateTime(01/01/2022))) foreach (var activity in db.ActivitiesSet.Where(a => a.Date == new DateOnly(2000,01, 01)))
{ {
Console.WriteLine($"\t{activity.IdActivity} - {activity.Type}, {activity.Date}, {activity.StartTime}, {activity.EndTime}, {activity.EffortFelt}, {activity.Variability}, {activity.Variance}, {activity.StandardDeviation}, {activity.Average}, {activity.Maximum}, {activity.Minimum}, {activity.AverageTemperature}, {activity.HasAutoPause}"); Console.WriteLine($"\t{activity.IdActivity} - {activity.Type}, {activity.Date}, {activity.StartTime}, {activity.EndTime}, {activity.EffortFelt}, {activity.Variability}, {activity.Variance}, {activity.StandardDeviation}, {activity.Average}, {activity.Maximum}, {activity.Minimum}, {activity.AverageTemperature}, {activity.HasAutoPause}");
} }
@ -211,7 +211,7 @@ class Program
Console.WriteLine("Accès à l'activité de date '01/01/2022' et de type 'Running' :"); Console.WriteLine("Accès à l'activité de date '01/01/2022' et de type 'Running' :");
Console.WriteLine("---------------------------------"); Console.WriteLine("---------------------------------");
foreach (var activity in db.ActivitiesSet.Where(a => a.Date == new DateTime(01/01/2022) && a.Type == "Running")) foreach (var activity in db.ActivitiesSet.Where(a => a.Date == new DateOnly(2022, 01, 01) && a.Type == "Running"))
{ {
Console.WriteLine($"\t{activity.IdActivity} - {activity.Type}, {activity.Date}, {activity.StartTime}, {activity.EndTime}, {activity.EffortFelt}, {activity.Variability}, {activity.Variance}, {activity.StandardDeviation}, {activity.Average}, {activity.Maximum}, {activity.Minimum}, {activity.AverageTemperature}, {activity.HasAutoPause}"); Console.WriteLine($"\t{activity.IdActivity} - {activity.Type}, {activity.Date}, {activity.StartTime}, {activity.EndTime}, {activity.EffortFelt}, {activity.Variability}, {activity.Variance}, {activity.StandardDeviation}, {activity.Average}, {activity.Maximum}, {activity.Minimum}, {activity.AverageTemperature}, {activity.HasAutoPause}");
} }
@ -366,10 +366,10 @@ class Program
static void AddUpdateDeleteAthlete(LibraryContext db) static void AddUpdateDeleteAthlete(LibraryContext db)
{ {
Console.WriteLine("Test d'ajout, de modification et de suppression :"); Console.WriteLine("Test d'ajout, de modification et de suppression des athletes :");
// Ajout d'un nouveau livre // Ajout d'un nouveau livre
var newAthlete = new AthleteEntity { Username = "Doe", LastName = "Doe", FirstName = "John", Email = "essaie.example.com", Password = "TheNewPassword", Sexe = "M", Lenght = 1.80, Weight = 90, DateOfBirth = new DateTime(2000, 01, 01), IsCoach = false }; var newAthlete = new AthleteEntity { Username = "Doe", LastName = "Doe", FirstName = "John", Email = "essaie.example.com", Password = "TheNewPassword", Sexe = "M", Lenght = 1.80, Weight = 90, DateOfBirth = new DateOnly(2024, 02, 22), IsCoach = false };
db.AthletesSet.Add(newAthlete); db.AthletesSet.Add(newAthlete);
db.SaveChanges(); db.SaveChanges();
@ -405,9 +405,9 @@ class Program
static void AddUpdateDeleteActivity(LibraryContext db) static void AddUpdateDeleteActivity(LibraryContext db)
{ {
Console.WriteLine("Test d'ajout, de modification et de suppression :"); Console.WriteLine("Test d'ajout, de modification et de suppression des activités :");
var newActivity = new ActivityEntity { Type = "Running", Date = new DateTime(2022, 01, 01), StartTime = new DateTime(2022, 01, 01, 12, 00, 00), EndTime = new DateTime(2022, 01, 01, 13, 00, 00), EffortFelt = 5, Variability = 10, Variance = 20, StandardDeviation = 30, Average = 40, Maximum = 50, Minimum = 60, AverageTemperature = 70, HasAutoPause = false }; var newActivity = new ActivityEntity { Type = "Running", Date = new DateOnly(2022, 02, 22), StartTime = new TimeOnly(12, 01, 38), EndTime = new TimeOnly(13, 45, 58), EffortFelt = 5, Variability = 10, Variance = 20, StandardDeviation = 30, Average = 40, Maximum = 50, Minimum = 60, AverageTemperature = 70, HasAutoPause = false };
db.ActivitiesSet.Add(newActivity); db.ActivitiesSet.Add(newActivity);
db.SaveChanges(); db.SaveChanges();
@ -439,7 +439,7 @@ class Program
static void AddUpdateDeleteDataSource(LibraryContext db) static void AddUpdateDeleteDataSource(LibraryContext db)
{ {
Console.WriteLine("Test d'ajout, de modification et de suppression :"); Console.WriteLine("Test d'ajout, de modification et de suppression des sources de données :");
var newDataSource = new DataSourceEntity { Type = "Polar", Modele = "Polar Vantage V2", Precision = 0.5F }; var newDataSource = new DataSourceEntity { Type = "Polar", Modele = "Polar Vantage V2", Precision = 0.5F };
db.DataSourcesSet.Add(newDataSource); db.DataSourcesSet.Add(newDataSource);
@ -472,9 +472,9 @@ class Program
static void AddUpdateDeleteHeartRate(LibraryContext db) static void AddUpdateDeleteHeartRate(LibraryContext db)
{ {
Console.WriteLine("Test d'ajout, de modification et de suppression :"); Console.WriteLine("Test d'ajout, de modification et de suppression des fréquences cardiaques :");
var newHeartRate = new HeartRateEntity { Altitude = 100, Time = new DateTime(2022, 01, 01, 12, 00, 00), Temperature = 20, Bpm = 150, Longitude = 0, Latitude = 0 }; var newHeartRate = new HeartRateEntity { Altitude = 100, Time = new TimeOnly(12, 00, 00), Temperature = 20, Bpm = 150, Longitude = 0, Latitude = 0 };
db.HeartRatesSet.Add(newHeartRate); db.HeartRatesSet.Add(newHeartRate);
db.SaveChanges(); db.SaveChanges();
@ -505,7 +505,7 @@ class Program
static void AddUpdateDeleteNotification(LibraryContext db) static void AddUpdateDeleteNotification(LibraryContext db)
{ {
Console.WriteLine("Test d'ajout, de modification et de suppression :"); Console.WriteLine("Test d'ajout, de modification et de suppression des notifications :");
var newNotification = new NotificationEntity { Message = "Message de test", Date = new DateTime(2022, 01, 01), Statut = false, Urgence = "Urgent" }; var newNotification = new NotificationEntity { Message = "Message de test", Date = new DateTime(2022, 01, 01), Statut = false, Urgence = "Urgent" };
db.NotificationsSet.Add(newNotification); db.NotificationsSet.Add(newNotification);
@ -538,9 +538,9 @@ class Program
static void AddUpdateDeleteStatistic(LibraryContext db) static void AddUpdateDeleteStatistic(LibraryContext db)
{ {
Console.WriteLine("Test d'ajout, de modification et de suppression :"); Console.WriteLine("Test d'ajout, de modification et de suppression des statistiques :");
var newStatistic = new StatisticEntity { Weight = 80, AverageHeartRate = 150, MaximumHeartRate = 180, AverageCaloriesBurned = 500, Date = new DateTime(2022, 01, 01) }; var newStatistic = new StatisticEntity { Weight = 80, AverageHeartRate = 150, MaximumHeartRate = 180, AverageCaloriesBurned = 500, Date = new DateOnly(2022, 01, 01) };
db.StatisticsSet.Add(newStatistic); db.StatisticsSet.Add(newStatistic);
db.SaveChanges(); db.SaveChanges();
@ -571,9 +571,9 @@ class Program
static void AddUpdateDeleteTraining(LibraryContext db) static void AddUpdateDeleteTraining(LibraryContext db)
{ {
Console.WriteLine("Test d'ajout, de modification et de suppression :"); Console.WriteLine("Test d'ajout, de modification et de suppression des entrainements :");
var newTraining = new TrainingEntity { Date = new DateTime(2022, 01, 01), Description = "Entrainement de test", Latitude = 0, Longitude = 0, FeedBack = "Bon entrainement" }; var newTraining = new TrainingEntity { Date = new DateOnly(2022, 01, 01), Description = "Entrainement de test", Latitude = 0, Longitude = 0, FeedBack = "Bon entrainement" };
db.TrainingsSet.Add(newTraining); db.TrainingsSet.Add(newTraining);
db.SaveChanges(); db.SaveChanges();

Loading…
Cancel
Save