From 1e751fe540112884c1e19486cc8925a16ec4dbba Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 7 Mar 2024 11:02:01 +0100 Subject: [PATCH] add DataManager --- .gitignore | 4 +- ...LibraryContext.cs => HeartTrackContext.cs} | 440 ++++---- src/HeartTrack.sln | 12 + src/Model2Entities/ActivityRepository.cs | 46 + src/Model2Entities/DbDataManager.cs | 28 + src/Model2Entities/Model2Entities.csproj | 14 + src/Model2Entities/UserRepository.cs | 46 + src/SharedEF/Activity.cs | 6 + src/SharedEF/IActivityRepository.cs | 6 + src/SharedEF/IDataManager.cs | 7 + src/SharedEF/IGenericRepository.cs | 12 + src/SharedEF/IUserRepository.cs | 6 + src/SharedEF/SharedEF.csproj | 9 + src/SharedEF/User.cs | 6 + .../ActivityStubbedContext.cs | 4 +- .../AthleteStubbedContext.cs | 15 +- .../DataSourceStubbedContext.cs | 2 +- .../FriendshipStubbedContext.cs | 2 +- .../HeartRateStubbedContext.cs | 2 +- .../20240307081406_MyMigrations.Designer.cs | 977 ------------------ .../Migrations/20240307081406_MyMigrations.cs | 491 --------- .../TrainingStubbedContextModelSnapshot.cs | 974 ----------------- .../NotificationStubbedContext.cs | 2 +- .../StatisticStubbedContext.cs | 2 +- .../TrainingStubbedContext.cs | 2 +- src/Tests/ConsoleTestEntities/Program.cs | 36 +- .../ConsoleTestEntities/uca.HeartTrack.db | Bin 45056 -> 0 bytes src/Tests/ConsoleTestRelationships/Program.cs | 17 +- .../uca.HeartTrack.db | Bin 118784 -> 0 bytes 29 files changed, 468 insertions(+), 2700 deletions(-) rename src/DbContextLib/{LibraryContext.cs => HeartTrackContext.cs} (93%) create mode 100644 src/Model2Entities/ActivityRepository.cs create mode 100644 src/Model2Entities/DbDataManager.cs create mode 100644 src/Model2Entities/Model2Entities.csproj create mode 100644 src/Model2Entities/UserRepository.cs create mode 100644 src/SharedEF/Activity.cs create mode 100644 src/SharedEF/IActivityRepository.cs create mode 100644 src/SharedEF/IDataManager.cs create mode 100644 src/SharedEF/IGenericRepository.cs create mode 100644 src/SharedEF/IUserRepository.cs create mode 100644 src/SharedEF/SharedEF.csproj create mode 100644 src/SharedEF/User.cs delete mode 100644 src/StubbedContextLib/Migrations/20240307081406_MyMigrations.Designer.cs delete mode 100644 src/StubbedContextLib/Migrations/20240307081406_MyMigrations.cs delete mode 100644 src/StubbedContextLib/Migrations/TrainingStubbedContextModelSnapshot.cs delete mode 100644 src/Tests/ConsoleTestEntities/uca.HeartTrack.db delete mode 100644 src/Tests/ConsoleTestRelationships/uca.HeartTrack.db diff --git a/.gitignore b/.gitignore index 6d8621c..85546c5 100644 --- a/.gitignore +++ b/.gitignore @@ -498,7 +498,8 @@ fabric.properties .LSOverride # Icon must end with two \r -Icon +Icon + # Thumbnails ._* @@ -548,3 +549,4 @@ xcuserdata/ *.xcscmblueprint *.xccheckout +Migration/ \ No newline at end of file diff --git a/src/DbContextLib/LibraryContext.cs b/src/DbContextLib/HeartTrackContext.cs similarity index 93% rename from src/DbContextLib/LibraryContext.cs rename to src/DbContextLib/HeartTrackContext.cs index c326091..919007b 100644 --- a/src/DbContextLib/LibraryContext.cs +++ b/src/DbContextLib/HeartTrackContext.cs @@ -1,221 +1,221 @@ -//----------------------------------------------------------------------- -// FILENAME: LibraryContext.cs -// PROJECT: DbContextLib -// SOLUTION: FitnessApp -// DATE CREATED: 22/02/2024 -// AUTHOR: Antoine PEREDERII -//----------------------------------------------------------------------- - -using Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Migrations.Operations; - -namespace DbContextLib -{ - /// - /// Represents the database context for the FitnessApp. - /// - public class LibraryContext : DbContext - { - /// - /// Gets or sets the set of athletes. - /// - public DbSet AthletesSet { get; set; } - - /// - /// Gets or sets the set of activities. - /// - public DbSet ActivitiesSet { get; set; } - - /// - /// Gets or sets the set of data sources. - /// - public DbSet DataSourcesSet { get; set; } - - /// - /// Gets or sets the set of heart rates. - /// - public DbSet HeartRatesSet { get; set; } - - /// - /// Gets or sets the set of notifications. - /// - public DbSet NotificationsSet { get; set; } - - /// - /// Gets or sets the set of statistics. - /// - public DbSet StatisticsSet { get; set; } - - /// - /// Gets or sets the set of trainings. - /// - public DbSet TrainingsSet { get; set; } - - /// - /// Initializes a new instance of the class. - /// - public LibraryContext() : base() { } - - /// - /// Initializes a new instance of the class with the specified options. - /// - /// The options for the context. - public LibraryContext(DbContextOptions options) : base(options) { } - - /// - /// Configures the database options if they are not already configured. - /// - /// The options builder instance. - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - if (!optionsBuilder.IsConfigured) - { - optionsBuilder.UseSqlite($"Data Source=uca.HeartTrack.db"); - } - } - - /// - /// Configures the model for the library context. - /// - /// The model builder instance. - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.Entity() - .HasKey(a => a.IdActivity); - //generation mode (at insertion) - modelBuilder.Entity() - .Property(a => a.IdActivity) - .ValueGeneratedOnAdd(); - - //primary key of HeartRateEntity - modelBuilder.Entity() - .HasKey(h => h.IdHeartRate); - //generation mode (at insertion) - modelBuilder.Entity() - .Property(h => h.IdHeartRate) - .ValueGeneratedOnAdd(); - - //primary key of DataSourceEntity - modelBuilder.Entity() - .HasKey(d => d.IdSource); - //generation mode (at insertion) - modelBuilder.Entity() - .Property(d => d.IdSource) - .ValueGeneratedOnAdd(); - - //primary key of AthleteEntity - modelBuilder.Entity() - .HasKey(at => at.IdAthlete); - //generation mode (at insertion) - modelBuilder.Entity() - .Property(at => at.IdAthlete) - .ValueGeneratedOnAdd(); - // add image column type - // modelBuilder.Entity() - // .Property(at => at.ProfilPicture) - // .HasColumnType("image"); - - - //primary key of StatisticEntity - modelBuilder.Entity() - .HasKey(s => s.IdStatistic); - //generation mode (at insertion) - modelBuilder.Entity() - .Property(s => s.IdStatistic) - .ValueGeneratedOnAdd(); - - //primary key of TrainingEntity - modelBuilder.Entity() - .HasKey(t => t.IdTraining); - //generation mode (at insertion) - modelBuilder.Entity() - .Property(t => t.IdTraining) - .ValueGeneratedOnAdd(); - - //primary key of NotificationEntity - modelBuilder.Entity() - .HasKey(n => n.IdNotif); - //generation mode (at insertion) - modelBuilder.Entity() - .Property(n => n.IdNotif) - .ValueGeneratedOnAdd(); - - modelBuilder.Entity() - .HasKey(f => new { f.FollowingId, f.FollowerId }); - - modelBuilder.Entity() - .HasOne(fing => fing.Following) - .WithMany(fings => fings.Followings) - .HasForeignKey(fing => fing.FollowingId); - - modelBuilder.Entity() - .HasOne(fer => fer.Follower) - .WithMany(fers => fers.Followers) - .HasForeignKey(fing => fing.FollowerId); - - // ! - // ? Plusieurs questions sur les required ou non, différence difficile à comprendre - - modelBuilder.Entity() - .HasMany(at => at.TrainingsCoach) - .WithOne(tc => tc.Coach) - .HasForeignKey(tc => tc.CoachId); - - modelBuilder.Entity() - .HasMany(at => at.TrainingsAthlete) - .WithMany(ta => ta.Athletes); - - modelBuilder.Entity() - .HasMany(at => at.NotificationsReceived) - .WithMany(nr => nr.Receivers); - - modelBuilder.Entity() - .HasMany(at => at.NotificationsSent) - .WithOne(ns => ns.Sender) - .HasForeignKey(ns => ns.SenderId); - // required car on veut toujours savoir le receveur et l'envoyeur de la notification meme admin ou systeme - - modelBuilder.Entity() - .HasMany(at => at.Statistics) - .WithOne(s => s.Athlete) - .HasForeignKey(s => s.AthleteId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(at => at.Activities) - .WithOne(a => a.Athlete) - .HasForeignKey(a => a.AthleteId) - .IsRequired(false); - - modelBuilder.Entity() - .HasMany(a => a.HeartRates) - .WithOne(h => h.Activity) - .HasForeignKey(h => h.ActivityId) - .IsRequired(); - - modelBuilder.Entity() - .HasMany(d => d.Activities) - .WithOne(a => a.DataSource) - .HasForeignKey(a => a.DataSourceId) - .IsRequired(); - - modelBuilder.Entity() - .HasMany(ds => ds.Activities) - .WithOne(at => at.DataSource) - .HasForeignKey(at => at.DataSourceId) - .IsRequired(false); - - // modelBuilder.Entity() - // .HasMany(fer => fer.Followers) - // .WithMany(fing => fing.Followings) - // .UsingEntity( - // l => l.HasOne().WithMany().HasForeignKey(fer => fer.FollowerId), - // r => r.HasOne().WithMany().HasForeignKey(fing => fing.FollowingId), - // j => j.Property(f => f.StartDate).HasDefaultValueSql("CURRENT_TIMESTAMP") - // ); - } - } +//----------------------------------------------------------------------- +// FILENAME: HeartTrackContextLibraryContext.cs +// PROJECT: DbContextLib +// SOLUTION: FitnessApp +// DATE CREATED: 22/02/2024 +// AUTHOR: Antoine PEREDERII +//----------------------------------------------------------------------- + +using Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Migrations.Operations; + +namespace DbContextLib +{ + /// + /// Represents the database context for the FitnessApp. + /// + public class HeartTrackContext : DbContext + { + /// + /// Gets or sets the set of athletes. + /// + public DbSet AthletesSet { get; set; } + + /// + /// Gets or sets the set of activities. + /// + public DbSet ActivitiesSet { get; set; } + + /// + /// Gets or sets the set of data sources. + /// + public DbSet DataSourcesSet { get; set; } + + /// + /// Gets or sets the set of heart rates. + /// + public DbSet HeartRatesSet { get; set; } + + /// + /// Gets or sets the set of notifications. + /// + public DbSet NotificationsSet { get; set; } + + /// + /// Gets or sets the set of statistics. + /// + public DbSet StatisticsSet { get; set; } + + /// + /// Gets or sets the set of trainings. + /// + public DbSet TrainingsSet { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public HeartTrackContext() : base() { } + + /// + /// Initializes a new instance of the class with the specified options. + /// + /// The options for the context. + public HeartTrackContext(DbContextOptions options) : base(options) { } + + /// + /// Configures the database options if they are not already configured. + /// + /// The options builder instance. + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + { + optionsBuilder.UseSqlite($"Data Source=uca.HeartTrack.db"); + } + } + + /// + /// Configures the model for the library context. + /// + /// The model builder instance. + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.Entity() + .HasKey(a => a.IdActivity); + //generation mode (at insertion) + modelBuilder.Entity() + .Property(a => a.IdActivity) + .ValueGeneratedOnAdd(); + + //primary key of HeartRateEntity + modelBuilder.Entity() + .HasKey(h => h.IdHeartRate); + //generation mode (at insertion) + modelBuilder.Entity() + .Property(h => h.IdHeartRate) + .ValueGeneratedOnAdd(); + + //primary key of DataSourceEntity + modelBuilder.Entity() + .HasKey(d => d.IdSource); + //generation mode (at insertion) + modelBuilder.Entity() + .Property(d => d.IdSource) + .ValueGeneratedOnAdd(); + + //primary key of AthleteEntity + modelBuilder.Entity() + .HasKey(at => at.IdAthlete); + //generation mode (at insertion) + modelBuilder.Entity() + .Property(at => at.IdAthlete) + .ValueGeneratedOnAdd(); + // add image column type + // modelBuilder.Entity() + // .Property(at => at.ProfilPicture) + // .HasColumnType("image"); + + + //primary key of StatisticEntity + modelBuilder.Entity() + .HasKey(s => s.IdStatistic); + //generation mode (at insertion) + modelBuilder.Entity() + .Property(s => s.IdStatistic) + .ValueGeneratedOnAdd(); + + //primary key of TrainingEntity + modelBuilder.Entity() + .HasKey(t => t.IdTraining); + //generation mode (at insertion) + modelBuilder.Entity() + .Property(t => t.IdTraining) + .ValueGeneratedOnAdd(); + + //primary key of NotificationEntity + modelBuilder.Entity() + .HasKey(n => n.IdNotif); + //generation mode (at insertion) + modelBuilder.Entity() + .Property(n => n.IdNotif) + .ValueGeneratedOnAdd(); + + modelBuilder.Entity() + .HasKey(f => new { f.FollowingId, f.FollowerId }); + + modelBuilder.Entity() + .HasOne(fing => fing.Following) + .WithMany(fings => fings.Followings) + .HasForeignKey(fing => fing.FollowingId); + + modelBuilder.Entity() + .HasOne(fer => fer.Follower) + .WithMany(fers => fers.Followers) + .HasForeignKey(fing => fing.FollowerId); + + // ! + // ? Plusieurs questions sur les required ou non, différence difficile à comprendre + + modelBuilder.Entity() + .HasMany(at => at.TrainingsCoach) + .WithOne(tc => tc.Coach) + .HasForeignKey(tc => tc.CoachId); + + modelBuilder.Entity() + .HasMany(at => at.TrainingsAthlete) + .WithMany(ta => ta.Athletes); + + modelBuilder.Entity() + .HasMany(at => at.NotificationsReceived) + .WithMany(nr => nr.Receivers); + + modelBuilder.Entity() + .HasMany(at => at.NotificationsSent) + .WithOne(ns => ns.Sender) + .HasForeignKey(ns => ns.SenderId); + // required car on veut toujours savoir le receveur et l'envoyeur de la notification meme admin ou systeme + + modelBuilder.Entity() + .HasMany(at => at.Statistics) + .WithOne(s => s.Athlete) + .HasForeignKey(s => s.AthleteId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(at => at.Activities) + .WithOne(a => a.Athlete) + .HasForeignKey(a => a.AthleteId) + .IsRequired(false); + + modelBuilder.Entity() + .HasMany(a => a.HeartRates) + .WithOne(h => h.Activity) + .HasForeignKey(h => h.ActivityId) + .IsRequired(); + + modelBuilder.Entity() + .HasMany(d => d.Activities) + .WithOne(a => a.DataSource) + .HasForeignKey(a => a.DataSourceId) + .IsRequired(); + + modelBuilder.Entity() + .HasMany(ds => ds.Activities) + .WithOne(at => at.DataSource) + .HasForeignKey(at => at.DataSourceId) + .IsRequired(false); + + // modelBuilder.Entity() + // .HasMany(fer => fer.Followers) + // .WithMany(fing => fing.Followings) + // .UsingEntity( + // l => l.HasOne().WithMany().HasForeignKey(fer => fer.FollowerId), + // r => r.HasOne().WithMany().HasForeignKey(fing => fing.FollowingId), + // j => j.Property(f => f.StartDate).HasDefaultValueSql("CURRENT_TIMESTAMP") + // ); + } + } } \ No newline at end of file diff --git a/src/HeartTrack.sln b/src/HeartTrack.sln index f0c2d3d..0ae03f5 100644 --- a/src/HeartTrack.sln +++ b/src/HeartTrack.sln @@ -17,6 +17,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTestRelationships", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestsEntities", "Tests\UnitTestsEntities\UnitTestsEntities.csproj", "{31FA8E5E-D642-4C43-A2B2-02B9832B2CEC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedEF", "SharedEF\SharedEF.csproj", "{55478079-0AA0-47C1-97FF-A048091FD930}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model2Entities", "Model2Entities\Model2Entities.csproj", "{FA329DEF-4756-4A8B-84E9-5A625FF94CBF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -50,6 +54,14 @@ Global {31FA8E5E-D642-4C43-A2B2-02B9832B2CEC}.Debug|Any CPU.Build.0 = Debug|Any CPU {31FA8E5E-D642-4C43-A2B2-02B9832B2CEC}.Release|Any CPU.ActiveCfg = Release|Any CPU {31FA8E5E-D642-4C43-A2B2-02B9832B2CEC}.Release|Any CPU.Build.0 = Release|Any CPU + {55478079-0AA0-47C1-97FF-A048091FD930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55478079-0AA0-47C1-97FF-A048091FD930}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55478079-0AA0-47C1-97FF-A048091FD930}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55478079-0AA0-47C1-97FF-A048091FD930}.Release|Any CPU.Build.0 = Release|Any CPU + {FA329DEF-4756-4A8B-84E9-5A625FF94CBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA329DEF-4756-4A8B-84E9-5A625FF94CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA329DEF-4756-4A8B-84E9-5A625FF94CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA329DEF-4756-4A8B-84E9-5A625FF94CBF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {477D2129-A6C9-4FF8-8BE9-5E9E8E5282F8} = {2B227C67-3BEC-4A83-BDA0-F3918FBC0D18} diff --git a/src/Model2Entities/ActivityRepository.cs b/src/Model2Entities/ActivityRepository.cs new file mode 100644 index 0000000..7d1b1a4 --- /dev/null +++ b/src/Model2Entities/ActivityRepository.cs @@ -0,0 +1,46 @@ +using SharedEF; + +namespace Model2Entities; + +public partial class DbDataManager +{ + public class ActivityRepository : IActivityRepository + { + private readonly DbDataManager _dataManager; + + public ActivityRepository(DbDataManager dataManager) + { + _dataManager = dataManager; + } + + public async Task> GetItems(int index, int count, Enum? orderingProperty = null, bool descending = false) + { + throw new NotImplementedException(); + } + + public async Task GetItemById(int id) + { + throw new NotImplementedException(); + } + + public async Task UpdateItem(int oldItem, Activity newItem) + { + throw new NotImplementedException(); + } + + public async Task AddItem(Activity item) + { + throw new NotImplementedException(); + } + + public async Task DeleteItem(Activity item) + { + throw new NotImplementedException(); + } + + public async Task GetNbItems() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/src/Model2Entities/DbDataManager.cs b/src/Model2Entities/DbDataManager.cs new file mode 100644 index 0000000..fbecaa2 --- /dev/null +++ b/src/Model2Entities/DbDataManager.cs @@ -0,0 +1,28 @@ +using DbContextLib; +using SharedEF; + +namespace Model2Entities; + +public partial class DbDataManager: IDataManager +{ + public IActivityRepository ActivityRepo { get; } + public IUserRepository UserRepo { get; } + + protected HeartTrackContext DbContext { get; } + + +public DbDataManager(HeartTrackContext dbContext) + { + DbContext = dbContext; + ActivityRepo = new ActivityRepository(this); + UserRepo = new UserRepository(this); + } + + public DbDataManager() + { + DbContext = new HeartTrackContext(); + ActivityRepo = new ActivityRepository(this); + UserRepo= new UserRepository(this); + } + +} diff --git a/src/Model2Entities/Model2Entities.csproj b/src/Model2Entities/Model2Entities.csproj new file mode 100644 index 0000000..8380302 --- /dev/null +++ b/src/Model2Entities/Model2Entities.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/src/Model2Entities/UserRepository.cs b/src/Model2Entities/UserRepository.cs new file mode 100644 index 0000000..3acd0da --- /dev/null +++ b/src/Model2Entities/UserRepository.cs @@ -0,0 +1,46 @@ +using SharedEF; + +namespace Model2Entities; + +public partial class DbDataManager +{ + public class UserRepository : IUserRepository + { + private readonly DbDataManager _dataManager; + + public UserRepository(DbDataManager dataManager) + { + _dataManager = dataManager; + } + + public async Task> GetItems(int index, int count, Enum? orderingProperty = null, bool descending = false) + { + throw new NotImplementedException(); + } + + public async Task GetItemById(int id) + { + throw new NotImplementedException(); + } + + public async Task UpdateItem(int oldItem, User newItem) + { + throw new NotImplementedException(); + } + + public async Task AddItem(User item) + { + throw new NotImplementedException(); + } + + public async Task DeleteItem(User item) + { + throw new NotImplementedException(); + } + + public async Task GetNbItems() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/src/SharedEF/Activity.cs b/src/SharedEF/Activity.cs new file mode 100644 index 0000000..14357fb --- /dev/null +++ b/src/SharedEF/Activity.cs @@ -0,0 +1,6 @@ +namespace SharedEF; + +public class Activity +{ + +} \ No newline at end of file diff --git a/src/SharedEF/IActivityRepository.cs b/src/SharedEF/IActivityRepository.cs new file mode 100644 index 0000000..0842f1b --- /dev/null +++ b/src/SharedEF/IActivityRepository.cs @@ -0,0 +1,6 @@ +namespace SharedEF; + +public interface IActivityRepository : IGenericRepository +{ + +} \ No newline at end of file diff --git a/src/SharedEF/IDataManager.cs b/src/SharedEF/IDataManager.cs new file mode 100644 index 0000000..a1d0e35 --- /dev/null +++ b/src/SharedEF/IDataManager.cs @@ -0,0 +1,7 @@ +namespace SharedEF; + +public interface IDataManager +{ + IUserRepository UserRepo { get; } + IActivityRepository ActivityRepo { get; } +} diff --git a/src/SharedEF/IGenericRepository.cs b/src/SharedEF/IGenericRepository.cs new file mode 100644 index 0000000..8849c70 --- /dev/null +++ b/src/SharedEF/IGenericRepository.cs @@ -0,0 +1,12 @@ +namespace SharedEF; + +public interface IGenericRepository +{ + Task> GetItems(int index, int count, Enum? orderingProperty = null, bool descending = false); + Task GetItemById(int id); + Task UpdateItem(int oldItem, T newItem); + Task AddItem(T item); + Task DeleteItem(T item); + Task GetNbItems(); + +} \ No newline at end of file diff --git a/src/SharedEF/IUserRepository.cs b/src/SharedEF/IUserRepository.cs new file mode 100644 index 0000000..aacc5d2 --- /dev/null +++ b/src/SharedEF/IUserRepository.cs @@ -0,0 +1,6 @@ +namespace SharedEF; + +public interface IUserRepository: IGenericRepository +{ + +} \ No newline at end of file diff --git a/src/SharedEF/SharedEF.csproj b/src/SharedEF/SharedEF.csproj new file mode 100644 index 0000000..3a63532 --- /dev/null +++ b/src/SharedEF/SharedEF.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/src/SharedEF/User.cs b/src/SharedEF/User.cs new file mode 100644 index 0000000..5e92f92 --- /dev/null +++ b/src/SharedEF/User.cs @@ -0,0 +1,6 @@ +namespace SharedEF; + +public class User +{ + +} \ No newline at end of file diff --git a/src/StubbedContextLib/ActivityStubbedContext.cs b/src/StubbedContextLib/ActivityStubbedContext.cs index e5379f6..7506778 100644 --- a/src/StubbedContextLib/ActivityStubbedContext.cs +++ b/src/StubbedContextLib/ActivityStubbedContext.cs @@ -15,7 +15,7 @@ namespace StubbedContextLib /// /// Represents a stubbed context for activities. /// - public class ActivityStubbedContext : LibraryContext + public class ActivityStubbedContext : HeartTrackContext { /// /// Initializes a new instance of the class. @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public ActivityStubbedContext(DbContextOptions options) : base(options) { } + public ActivityStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the activity context. diff --git a/src/StubbedContextLib/AthleteStubbedContext.cs b/src/StubbedContextLib/AthleteStubbedContext.cs index 24cbfaf..c7890bb 100644 --- a/src/StubbedContextLib/AthleteStubbedContext.cs +++ b/src/StubbedContextLib/AthleteStubbedContext.cs @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public AthleteStubbedContext(DbContextOptions options) : base(options) { } + public AthleteStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the athlete stubbed context. @@ -35,13 +35,14 @@ namespace StubbedContextLib protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); - + var picture = System.Text.Encoding.UTF8.GetBytes( + "\"UklGRtwDAABXRUJQVlA4INADAAAwEACdASoqACoAAMASJZgCdMoSCz655ndU4XXAP2yXIge5neM/Qd6WCfO8evoj2S0A/p7+f0An85cBxlLDgPC8jO/0nsl/13/O8vvzj7Af8s/p3/H4FU6td4MCwq23z1H2uzoKIXaqJniPI/bRMf8qzv0Zp+HE1RCBw5WQ1j/JovdM1FS52+QcaAAA/v/+NxU4DpPk3+xQPW7tcmURSo9vC4qc+XMxNVBzEM5E8actDz98gmwTXgD62e9EmG/ervdd2ovFFSuxYppWl/wtaX3rkn0xrt8qOql/5I2jfLOnCU0kALLcW4F/wTjU10qsxZXW9fxauC6OPVRF28sc94V9ocmoSWy+sf6jW3vYkVOh+gE/RE0L6b2d3oFyHmkRJnfYwG8o3p6fv9pivNF5aopIBzFnjzwb/VqSq3/b+MWKFmjr8T1qe4/fITo2vBWEqDyogV3ZVGnDVi2DbiEFVSUr2eXTNZQ9V/D9QC/+vCR5TGyX9QOVBgtAYtm/ZTIwzPEYB9NrV1NeO1/sAz78u0tW59r0I+SO5Jgm3B9i1toRurzHv9EZJ9yZL8nafb/T1FaoPDkuJfM+iPs0j8xnS7TaU/gEK0wCxeDYRYtJx9j4hUQq7pAu/T2yWy0vjcUHki952ZNbXnXxB8m8pV5x9E1sfLj5MZEgpU2XV8RHrVvWniCjsf6vgxmR7+KtwIbMjahitUGtHet1WdL+8MmdL29iQJC37pDXirir1NibxKKhFYRuJ3xW9O0r9+Vnh8diqbBuXqDbYR/MSoHvscOCm2t95dN5WBdRUoD7YCG/ZHWc7Ypv/x/al4fkB2lZlYhVWHxjaoeF9jEPI0gAN5XsvUI6hbzEzWMsNW/1orkNOnlskalgmpI4B2rm4Gc7LNui+MuMBrpnBvLkbYX9exe9g8tu7wLt7ScOjDcL99oOyR89Mh9L8rd4+43+JQyR6tsIfcPJo6T6FxHf11d/MGayJi+SWct/uhvvua0oOh+zXNIaUzgoBmu1XULjkpuA0Ghzctf30jbY1AOM49qbMZRYS9A+0S1HrHPnwRvpQY/Sj4xKPn0gdpv/+iTbKJb8zkPC4/9af0Jvesa+GDG0/iw3TswenMhqlh7BM9MW5txpeblsByx4WnJ/oHv6cc0dmM7tsV36lYkCTUXEf/0eKlnfivnN0g1g+j/Lk9et/uoa6TFCW0HgwFOIVFumEYdT675PfuTrYO5o8ZrWEIHtv2Ctlrv9J3TrslD/iKEwtipGHtn0Vak8B9wLL+kz+CIQ/VG4KJpXjx88CeCC4XaGitEdjAAA\""); modelBuilder.Entity().HasData( - new AthleteEntity { IdAthlete = 1, Username = "Doe", LastName = "Doe", FirstName = "John", Email = "john.doe@example.com", Password = "password123", Sexe = "M", Length = 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@exemple.com", Password = "secure456", Sexe = "F", Length = 1.65, Weight = 60, DateOfBirth = new DateOnly(1995, 01, 01), IsCoach = false, DataSourceId = 1 }, - new AthleteEntity { IdAthlete = 3, Username = "Martin", LastName = "Martin", FirstName = "Paul", Email = "paul.martin@example.com", Password = "super789", Sexe = "M", Length = 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", Length = 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", Length = 2.0, Weight = 90, DateOfBirth = new DateOnly(1991, 01, 01), IsCoach = false, DataSourceId = 3 } + new AthleteEntity { IdAthlete = 1, Username = "Doe",ProfilPicture = picture, LastName = "Doe", FirstName = "John", Email = "john.doe@example.com", Password = "password123", Sexe = "M", Length = 1.80, Weight = 75, DateOfBirth = new DateOnly(1990, 01, 01), IsCoach = true }, + new AthleteEntity { IdAthlete = 2, Username = "Smith",ProfilPicture = picture, LastName = "Smith", FirstName = "Jane", Email = "jane.smith@exemple.com", Password = "secure456", Sexe = "F", Length = 1.65, Weight = 60, DateOfBirth = new DateOnly(1995, 01, 01), IsCoach = false, DataSourceId = 1 }, + new AthleteEntity { IdAthlete = 3, Username = "Martin",ProfilPicture = picture, LastName = "Martin", FirstName = "Paul", Email = "paul.martin@example.com", Password = "super789", Sexe = "M", Length = 1.75, Weight = 68, DateOfBirth = new DateOnly(1992, 01, 01), IsCoach = true }, + new AthleteEntity { IdAthlete = 4, Username = "Brown",ProfilPicture = picture, LastName = "Brown", FirstName = "Anna", Email = "anna.brown@example.com", Password = "test000", Sexe = "F", Length = 1.70, Weight = 58, DateOfBirth = new DateOnly(1993, 01, 01), IsCoach = false }, + new AthleteEntity { IdAthlete = 5, Username = "Lee", ProfilPicture = picture,LastName = "Lee", FirstName = "Bruce", Email = "bruce.lee@example.com", Password = "hello321", Sexe = "M", Length = 2.0, Weight = 90, DateOfBirth = new DateOnly(1991, 01, 01), IsCoach = false, DataSourceId = 3 } ); } } diff --git a/src/StubbedContextLib/DataSourceStubbedContext.cs b/src/StubbedContextLib/DataSourceStubbedContext.cs index a34a80a..734cc5b 100644 --- a/src/StubbedContextLib/DataSourceStubbedContext.cs +++ b/src/StubbedContextLib/DataSourceStubbedContext.cs @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public DataSourceStubbedContext(DbContextOptions options) : base(options) { } + public DataSourceStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the data source stubbed context. diff --git a/src/StubbedContextLib/FriendshipStubbedContext.cs b/src/StubbedContextLib/FriendshipStubbedContext.cs index 43eff80..70eb76f 100644 --- a/src/StubbedContextLib/FriendshipStubbedContext.cs +++ b/src/StubbedContextLib/FriendshipStubbedContext.cs @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public FriendshipStubbedContext(DbContextOptions options) : base(options) { } + public FriendshipStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the heart rate stubbed context. diff --git a/src/StubbedContextLib/HeartRateStubbedContext.cs b/src/StubbedContextLib/HeartRateStubbedContext.cs index 8441665..a80ca57 100644 --- a/src/StubbedContextLib/HeartRateStubbedContext.cs +++ b/src/StubbedContextLib/HeartRateStubbedContext.cs @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public HeartRateStubbedContext(DbContextOptions options) : base(options) { } + public HeartRateStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the heart rate stubbed context. diff --git a/src/StubbedContextLib/Migrations/20240307081406_MyMigrations.Designer.cs b/src/StubbedContextLib/Migrations/20240307081406_MyMigrations.Designer.cs deleted file mode 100644 index 82a4cb8..0000000 --- a/src/StubbedContextLib/Migrations/20240307081406_MyMigrations.Designer.cs +++ /dev/null @@ -1,977 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using StubbedContextLib; - -#nullable disable - -namespace StubbedContextLib.Migrations -{ - [DbContext(typeof(TrainingStubbedContext))] - [Migration("20240307081406_MyMigrations")] - partial class MyMigrations - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.2"); - - modelBuilder.Entity("AthleteEntityNotificationEntity", b => - { - b.Property("NotificationsReceivedIdNotif") - .HasColumnType("INTEGER"); - - b.Property("ReceiversIdAthlete") - .HasColumnType("INTEGER"); - - b.HasKey("NotificationsReceivedIdNotif", "ReceiversIdAthlete"); - - b.HasIndex("ReceiversIdAthlete"); - - b.ToTable("AthleteEntityNotificationEntity"); - }); - - modelBuilder.Entity("AthleteEntityTrainingEntity", b => - { - b.Property("AthletesIdAthlete") - .HasColumnType("INTEGER"); - - b.Property("TrainingsAthleteIdTraining") - .HasColumnType("INTEGER"); - - b.HasKey("AthletesIdAthlete", "TrainingsAthleteIdTraining"); - - b.HasIndex("TrainingsAthleteIdTraining"); - - b.ToTable("AthleteEntityTrainingEntity"); - }); - - modelBuilder.Entity("Entities.ActivityEntity", b => - { - b.Property("IdActivity") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AthleteId") - .HasColumnType("INTEGER"); - - b.Property("Average") - .HasColumnType("REAL"); - - b.Property("AverageTemperature") - .HasColumnType("REAL"); - - b.Property("DataSourceId") - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("EffortFelt") - .HasColumnType("INTEGER"); - - b.Property("EndTime") - .HasColumnType("TEXT"); - - b.Property("HasAutoPause") - .HasColumnType("INTEGER"); - - b.Property("Maximum") - .HasColumnType("INTEGER"); - - b.Property("Minimum") - .HasColumnType("INTEGER"); - - b.Property("StandardDeviation") - .HasColumnType("REAL"); - - b.Property("StartTime") - .HasColumnType("TEXT"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Variability") - .HasColumnType("REAL"); - - b.Property("Variance") - .HasColumnType("REAL"); - - b.HasKey("IdActivity"); - - b.HasIndex("AthleteId"); - - b.HasIndex("DataSourceId"); - - b.ToTable("Activity"); - - b.HasData( - new - { - IdActivity = 1, - AthleteId = 1, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 1, - Date = new DateOnly(2023, 1, 10), - EffortFelt = 5, - EndTime = new TimeOnly(14, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 0, 34), - Type = "Running", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 2, - AthleteId = 2, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 2, - Date = new DateOnly(2023, 1, 25), - EffortFelt = 5, - EndTime = new TimeOnly(14, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 4, 34), - Type = "Cycling", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 3, - AthleteId = 1, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 1, - Date = new DateOnly(2023, 12, 10), - EffortFelt = 5, - EndTime = new TimeOnly(15, 2, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 30, 34), - Type = "Swimming", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 4, - AthleteId = 5, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 3, - Date = new DateOnly(2024, 1, 2), - EffortFelt = 5, - EndTime = new TimeOnly(16, 1, 55), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(15, 0, 0), - Type = "Walking", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 5, - AthleteId = 4, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 4, - Date = new DateOnly(2024, 1, 12), - EffortFelt = 5, - EndTime = new TimeOnly(9, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(7, 45, 34), - Type = "Hiking", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 6, - AthleteId = 4, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 4, - Date = new DateOnly(2024, 1, 27), - EffortFelt = 5, - EndTime = new TimeOnly(14, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 30, 1), - Type = "Climbing", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 7, - AthleteId = 3, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 5, - Date = new DateOnly(2024, 2, 22), - EffortFelt = 5, - EndTime = new TimeOnly(23, 50, 58), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(22, 0, 34), - Type = "Yoga", - Variability = 0.5f, - Variance = 0.5f - }); - }); - - modelBuilder.Entity("Entities.AthleteEntity", b => - { - b.Property("IdAthlete") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DataSourceId") - .HasColumnType("INTEGER"); - - b.Property("DateOfBirth") - .HasColumnType("TEXT"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("TEXT"); - - b.Property("IsCoach") - .HasColumnType("INTEGER"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Length") - .HasColumnType("REAL"); - - b.Property("Password") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Sexe") - .IsRequired() - .HasMaxLength(1) - .HasColumnType("TEXT"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("IdAthlete"); - - b.HasIndex("DataSourceId"); - - b.ToTable("Athlete"); - - b.HasData( - new - { - IdAthlete = 1, - DateOfBirth = new DateOnly(1990, 1, 1), - Email = "john.doe@example.com", - FirstName = "John", - IsCoach = true, - LastName = "Doe", - Length = 1.8, - Password = "password123", - Sexe = "M", - Username = "Doe", - Weight = 75f - }, - new - { - IdAthlete = 2, - DataSourceId = 1, - DateOfBirth = new DateOnly(1995, 1, 1), - Email = "jane.smith@exemple.com", - FirstName = "Jane", - IsCoach = false, - LastName = "Smith", - Length = 1.6499999999999999, - Password = "secure456", - Sexe = "F", - Username = "Smith", - Weight = 60f - }, - new - { - IdAthlete = 3, - DateOfBirth = new DateOnly(1992, 1, 1), - Email = "paul.martin@example.com", - FirstName = "Paul", - IsCoach = true, - LastName = "Martin", - Length = 1.75, - Password = "super789", - Sexe = "M", - Username = "Martin", - Weight = 68f - }, - new - { - IdAthlete = 4, - DateOfBirth = new DateOnly(1993, 1, 1), - Email = "anna.brown@example.com", - FirstName = "Anna", - IsCoach = false, - LastName = "Brown", - Length = 1.7, - Password = "test000", - Sexe = "F", - Username = "Brown", - Weight = 58f - }, - new - { - IdAthlete = 5, - DataSourceId = 3, - DateOfBirth = new DateOnly(1991, 1, 1), - Email = "bruce.lee@example.com", - FirstName = "Bruce", - IsCoach = false, - LastName = "Lee", - Length = 2.0, - Password = "hello321", - Sexe = "M", - Username = "Lee", - Weight = 90f - }); - }); - - modelBuilder.Entity("Entities.DataSourceEntity", b => - { - b.Property("IdSource") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Model") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Precision") - .HasColumnType("REAL"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.HasKey("IdSource"); - - b.ToTable("DataSource"); - - b.HasData( - new - { - IdSource = 1, - Model = "Garmin", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 2, - Model = "Polar", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 3, - Model = "Suunto", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 4, - Model = "Fitbit", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 5, - Model = "Apple Watch", - Precision = 0.5f, - Type = "Smartwatch" - }); - }); - - modelBuilder.Entity("Entities.FriendshipEntity", b => - { - b.Property("FollowingId") - .HasColumnType("INTEGER"); - - b.Property("FollowerId") - .HasColumnType("INTEGER"); - - b.Property("StartDate") - .HasColumnType("TEXT"); - - b.HasKey("FollowingId", "FollowerId"); - - b.HasIndex("FollowerId"); - - b.ToTable("FriendshipEntity"); - - b.HasData( - new - { - FollowingId = 2, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 3, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 4, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 5, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 1, - FollowerId = 2, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 3, - FollowerId = 2, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Entities.HeartRateEntity", b => - { - b.Property("IdHeartRate") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ActivityId") - .HasColumnType("INTEGER"); - - b.Property("Altitude") - .HasColumnType("REAL"); - - b.Property("Bpm") - .HasColumnType("INTEGER"); - - b.Property("Latitude") - .HasColumnType("REAL"); - - b.Property("Longitude") - .HasColumnType("REAL"); - - b.Property("Temperature") - .HasColumnType("REAL"); - - b.Property("Time") - .HasColumnType("TEXT"); - - b.HasKey("IdHeartRate"); - - b.HasIndex("ActivityId"); - - b.ToTable("HeartRate"); - - b.HasData( - new - { - IdHeartRate = 1, - ActivityId = 1, - Altitude = 0.0, - Bpm = 60, - Latitude = 66f, - Longitude = 35f, - Temperature = 20f, - Time = new TimeOnly(13, 0, 30) - }, - new - { - IdHeartRate = 2, - ActivityId = 2, - Altitude = 10.0, - Bpm = 65, - Latitude = 67f, - Longitude = 35f, - Temperature = 20.5f, - Time = new TimeOnly(13, 0, 31) - }, - new - { - IdHeartRate = 3, - ActivityId = 1, - Altitude = 11.0, - Bpm = 71, - Latitude = 66f, - Longitude = 36f, - Temperature = 20f, - Time = new TimeOnly(13, 0, 32) - }, - new - { - IdHeartRate = 4, - ActivityId = 2, - Altitude = 12.0, - Bpm = 75, - Latitude = 67f, - Longitude = 36f, - Temperature = 20.5f, - Time = new TimeOnly(13, 0, 33) - }, - new - { - IdHeartRate = 5, - ActivityId = 4, - Altitude = 13.0, - Bpm = 80, - Latitude = 66f, - Longitude = 37f, - Temperature = 20f, - Time = new TimeOnly(13, 0, 34) - }); - }); - - modelBuilder.Entity("Entities.NotificationEntity", b => - { - b.Property("IdNotif") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("SenderId") - .HasColumnType("INTEGER"); - - b.Property("Statut") - .HasColumnType("INTEGER"); - - b.Property("Urgence") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.HasKey("IdNotif"); - - b.HasIndex("SenderId"); - - b.ToTable("Notification"); - - b.HasData( - new - { - IdNotif = 1, - Date = new DateTime(2023, 12, 25, 13, 0, 40, 0, DateTimeKind.Unspecified), - Message = "You have a new activity to check", - SenderId = 1, - Statut = true, - Urgence = "A" - }, - new - { - IdNotif = 2, - Date = new DateTime(2023, 12, 26, 13, 10, 40, 0, DateTimeKind.Unspecified), - Message = "You have a new athlete to check", - SenderId = 2, - Statut = false, - Urgence = "3" - }, - new - { - IdNotif = 3, - Date = new DateTime(2023, 12, 26, 16, 10, 4, 0, DateTimeKind.Unspecified), - Message = "You have a new heart rate to check", - SenderId = 3, - Statut = true, - Urgence = "2" - }, - new - { - IdNotif = 4, - Date = new DateTime(2024, 1, 12, 9, 30, 50, 0, DateTimeKind.Unspecified), - Message = "You have a new data source to check", - SenderId = 4, - Statut = false, - Urgence = "1" - }, - new - { - IdNotif = 5, - Date = new DateTime(2024, 2, 22, 12, 10, 0, 0, DateTimeKind.Unspecified), - Message = "You have a new notification to check", - SenderId = 5, - Statut = true, - Urgence = "3" - }); - }); - - modelBuilder.Entity("Entities.StatisticEntity", b => - { - b.Property("IdStatistic") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AthleteId") - .HasColumnType("INTEGER"); - - b.Property("AverageCaloriesBurned") - .HasColumnType("REAL"); - - b.Property("AverageHeartRate") - .HasColumnType("REAL"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("MaximumHeartRate") - .HasColumnType("REAL"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("IdStatistic"); - - b.HasIndex("AthleteId"); - - b.ToTable("Statistic"); - - b.HasData( - new - { - IdStatistic = 1, - AthleteId = 1, - AverageCaloriesBurned = 500.0, - AverageHeartRate = 120.0, - Date = new DateOnly(2021, 12, 12), - MaximumHeartRate = 180.0, - Weight = 75f - }, - new - { - IdStatistic = 2, - AthleteId = 2, - AverageCaloriesBurned = 600.0, - AverageHeartRate = 130.0, - Date = new DateOnly(2021, 1, 11), - MaximumHeartRate = 190.0, - Weight = 60f - }, - new - { - IdStatistic = 3, - AthleteId = 1, - AverageCaloriesBurned = 550.0, - AverageHeartRate = 125.0, - Date = new DateOnly(2022, 12, 30), - MaximumHeartRate = 185.0, - Weight = 68f - }, - new - { - IdStatistic = 4, - AthleteId = 3, - AverageCaloriesBurned = 650.0, - AverageHeartRate = 135.0, - Date = new DateOnly(2023, 2, 20), - MaximumHeartRate = 195.0, - Weight = 58f - }, - new - { - IdStatistic = 5, - AthleteId = 4, - AverageCaloriesBurned = 450.0, - AverageHeartRate = 110.0, - Date = new DateOnly(2024, 1, 10), - MaximumHeartRate = 170.0, - Weight = 90f - }); - }); - - modelBuilder.Entity("Entities.TrainingEntity", b => - { - b.Property("IdTraining") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CoachId") - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasMaxLength(300) - .HasColumnType("TEXT"); - - b.Property("FeedBack") - .HasMaxLength(300) - .HasColumnType("TEXT"); - - b.Property("Latitude") - .HasColumnType("REAL"); - - b.Property("Longitude") - .HasColumnType("REAL"); - - b.HasKey("IdTraining"); - - b.HasIndex("CoachId"); - - b.ToTable("Training"); - - b.HasData( - new - { - IdTraining = 1, - CoachId = 1, - Date = new DateOnly(2024, 1, 19), - Description = "Running", - FeedBack = "Good", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 2, - CoachId = 5, - Date = new DateOnly(2024, 2, 20), - Description = "Cycling", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 3, - CoachId = 4, - Date = new DateOnly(2024, 2, 21), - FeedBack = "Good", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 4, - CoachId = 3, - Date = new DateOnly(2024, 2, 22), - Description = "Running", - FeedBack = "Good", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 5, - CoachId = 1, - Date = new DateOnly(2024, 2, 23), - Description = "Cycling", - Latitude = 48.8566f, - Longitude = 2.3522f - }); - }); - - modelBuilder.Entity("AthleteEntityNotificationEntity", b => - { - b.HasOne("Entities.NotificationEntity", null) - .WithMany() - .HasForeignKey("NotificationsReceivedIdNotif") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.AthleteEntity", null) - .WithMany() - .HasForeignKey("ReceiversIdAthlete") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("AthleteEntityTrainingEntity", b => - { - b.HasOne("Entities.AthleteEntity", null) - .WithMany() - .HasForeignKey("AthletesIdAthlete") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.TrainingEntity", null) - .WithMany() - .HasForeignKey("TrainingsAthleteIdTraining") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Entities.ActivityEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Athlete") - .WithMany("Activities") - .HasForeignKey("AthleteId"); - - b.HasOne("Entities.DataSourceEntity", "DataSource") - .WithMany("Activities") - .HasForeignKey("DataSourceId"); - - b.Navigation("Athlete"); - - b.Navigation("DataSource"); - }); - - modelBuilder.Entity("Entities.AthleteEntity", b => - { - b.HasOne("Entities.DataSourceEntity", "DataSource") - .WithMany("Athletes") - .HasForeignKey("DataSourceId"); - - b.Navigation("DataSource"); - }); - - modelBuilder.Entity("Entities.FriendshipEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Follower") - .WithMany("Followers") - .HasForeignKey("FollowerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.AthleteEntity", "Following") - .WithMany("Followings") - .HasForeignKey("FollowingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Follower"); - - b.Navigation("Following"); - }); - - modelBuilder.Entity("Entities.HeartRateEntity", b => - { - b.HasOne("Entities.ActivityEntity", "Activity") - .WithMany("HeartRates") - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Activity"); - }); - - modelBuilder.Entity("Entities.NotificationEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Sender") - .WithMany("NotificationsSent") - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("Entities.StatisticEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Athlete") - .WithMany("Statistics") - .HasForeignKey("AthleteId"); - - b.Navigation("Athlete"); - }); - - modelBuilder.Entity("Entities.TrainingEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Coach") - .WithMany("TrainingsCoach") - .HasForeignKey("CoachId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Coach"); - }); - - modelBuilder.Entity("Entities.ActivityEntity", b => - { - b.Navigation("HeartRates"); - }); - - modelBuilder.Entity("Entities.AthleteEntity", b => - { - b.Navigation("Activities"); - - b.Navigation("Followers"); - - b.Navigation("Followings"); - - b.Navigation("NotificationsSent"); - - b.Navigation("Statistics"); - - b.Navigation("TrainingsCoach"); - }); - - modelBuilder.Entity("Entities.DataSourceEntity", b => - { - b.Navigation("Activities"); - - b.Navigation("Athletes"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/StubbedContextLib/Migrations/20240307081406_MyMigrations.cs b/src/StubbedContextLib/Migrations/20240307081406_MyMigrations.cs deleted file mode 100644 index c4ebbca..0000000 --- a/src/StubbedContextLib/Migrations/20240307081406_MyMigrations.cs +++ /dev/null @@ -1,491 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace StubbedContextLib.Migrations -{ - /// - public partial class MyMigrations : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "DataSource", - columns: table => new - { - IdSource = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Type = table.Column(type: "TEXT", maxLength: 100, nullable: false), - Model = table.Column(type: "TEXT", maxLength: 100, nullable: false), - Precision = table.Column(type: "REAL", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DataSource", x => x.IdSource); - }); - - migrationBuilder.CreateTable( - name: "Athlete", - columns: table => new - { - IdAthlete = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Username = table.Column(type: "TEXT", maxLength: 100, nullable: false), - LastName = table.Column(type: "TEXT", maxLength: 100, nullable: false), - FirstName = table.Column(type: "TEXT", maxLength: 150, nullable: false), - Email = table.Column(type: "TEXT", maxLength: 100, nullable: false), - Sexe = table.Column(type: "TEXT", maxLength: 1, nullable: false), - Length = table.Column(type: "REAL", nullable: false), - Weight = table.Column(type: "REAL", nullable: false), - Password = table.Column(type: "TEXT", nullable: false), - DateOfBirth = table.Column(type: "TEXT", nullable: false), - IsCoach = table.Column(type: "INTEGER", nullable: false), - DataSourceId = table.Column(type: "INTEGER", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Athlete", x => x.IdAthlete); - table.ForeignKey( - name: "FK_Athlete_DataSource_DataSourceId", - column: x => x.DataSourceId, - principalTable: "DataSource", - principalColumn: "IdSource"); - }); - - migrationBuilder.CreateTable( - name: "Activity", - columns: table => new - { - IdActivity = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Type = table.Column(type: "TEXT", maxLength: 100, nullable: false), - Date = table.Column(type: "TEXT", nullable: false), - StartTime = table.Column(type: "TEXT", nullable: false), - EndTime = table.Column(type: "TEXT", nullable: false), - EffortFelt = table.Column(type: "INTEGER", nullable: false), - Variability = table.Column(type: "REAL", nullable: false), - Variance = table.Column(type: "REAL", nullable: false), - StandardDeviation = table.Column(type: "REAL", nullable: false), - Average = table.Column(type: "REAL", nullable: false), - Maximum = table.Column(type: "INTEGER", nullable: false), - Minimum = table.Column(type: "INTEGER", nullable: false), - AverageTemperature = table.Column(type: "REAL", nullable: false), - HasAutoPause = table.Column(type: "INTEGER", nullable: false), - DataSourceId = table.Column(type: "INTEGER", nullable: false), - AthleteId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Activity", x => x.IdActivity); - table.ForeignKey( - name: "FK_Activity_Athlete_AthleteId", - column: x => x.AthleteId, - principalTable: "Athlete", - principalColumn: "IdAthlete"); - table.ForeignKey( - name: "FK_Activity_DataSource_DataSourceId", - column: x => x.DataSourceId, - principalTable: "DataSource", - principalColumn: "IdSource"); - }); - - migrationBuilder.CreateTable( - name: "FriendshipEntity", - columns: table => new - { - FollowingId = table.Column(type: "INTEGER", nullable: false), - FollowerId = table.Column(type: "INTEGER", nullable: false), - StartDate = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FriendshipEntity", x => new { x.FollowingId, x.FollowerId }); - table.ForeignKey( - name: "FK_FriendshipEntity_Athlete_FollowerId", - column: x => x.FollowerId, - principalTable: "Athlete", - principalColumn: "IdAthlete", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_FriendshipEntity_Athlete_FollowingId", - column: x => x.FollowingId, - principalTable: "Athlete", - principalColumn: "IdAthlete", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Notification", - columns: table => new - { - IdNotif = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Message = table.Column(type: "TEXT", maxLength: 100, nullable: false), - Date = table.Column(type: "TEXT", nullable: false), - Statut = table.Column(type: "INTEGER", nullable: false), - Urgence = table.Column(type: "TEXT", maxLength: 100, nullable: false), - SenderId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Notification", x => x.IdNotif); - table.ForeignKey( - name: "FK_Notification_Athlete_SenderId", - column: x => x.SenderId, - principalTable: "Athlete", - principalColumn: "IdAthlete", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Statistic", - columns: table => new - { - IdStatistic = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Weight = table.Column(type: "REAL", nullable: false), - AverageHeartRate = table.Column(type: "REAL", nullable: false), - MaximumHeartRate = table.Column(type: "REAL", nullable: false), - AverageCaloriesBurned = table.Column(type: "REAL", nullable: false), - Date = table.Column(type: "TEXT", nullable: false), - AthleteId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Statistic", x => x.IdStatistic); - table.ForeignKey( - name: "FK_Statistic_Athlete_AthleteId", - column: x => x.AthleteId, - principalTable: "Athlete", - principalColumn: "IdAthlete"); - }); - - migrationBuilder.CreateTable( - name: "Training", - columns: table => new - { - IdTraining = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Date = table.Column(type: "TEXT", nullable: false), - Description = table.Column(type: "TEXT", maxLength: 300, nullable: true), - Latitude = table.Column(type: "REAL", nullable: false), - Longitude = table.Column(type: "REAL", nullable: false), - FeedBack = table.Column(type: "TEXT", maxLength: 300, nullable: true), - CoachId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Training", x => x.IdTraining); - table.ForeignKey( - name: "FK_Training_Athlete_CoachId", - column: x => x.CoachId, - principalTable: "Athlete", - principalColumn: "IdAthlete", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "HeartRate", - columns: table => new - { - IdHeartRate = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Altitude = table.Column(type: "REAL", nullable: false), - Time = table.Column(type: "TEXT", nullable: false), - Temperature = table.Column(type: "REAL", nullable: false), - Bpm = table.Column(type: "INTEGER", nullable: false), - Longitude = table.Column(type: "REAL", nullable: false), - Latitude = table.Column(type: "REAL", nullable: false), - ActivityId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_HeartRate", x => x.IdHeartRate); - table.ForeignKey( - name: "FK_HeartRate_Activity_ActivityId", - column: x => x.ActivityId, - principalTable: "Activity", - principalColumn: "IdActivity", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AthleteEntityNotificationEntity", - columns: table => new - { - NotificationsReceivedIdNotif = table.Column(type: "INTEGER", nullable: false), - ReceiversIdAthlete = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AthleteEntityNotificationEntity", x => new { x.NotificationsReceivedIdNotif, x.ReceiversIdAthlete }); - table.ForeignKey( - name: "FK_AthleteEntityNotificationEntity_Athlete_ReceiversIdAthlete", - column: x => x.ReceiversIdAthlete, - principalTable: "Athlete", - principalColumn: "IdAthlete", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AthleteEntityNotificationEntity_Notification_NotificationsReceivedIdNotif", - column: x => x.NotificationsReceivedIdNotif, - principalTable: "Notification", - principalColumn: "IdNotif", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AthleteEntityTrainingEntity", - columns: table => new - { - AthletesIdAthlete = table.Column(type: "INTEGER", nullable: false), - TrainingsAthleteIdTraining = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AthleteEntityTrainingEntity", x => new { x.AthletesIdAthlete, x.TrainingsAthleteIdTraining }); - table.ForeignKey( - name: "FK_AthleteEntityTrainingEntity_Athlete_AthletesIdAthlete", - column: x => x.AthletesIdAthlete, - principalTable: "Athlete", - principalColumn: "IdAthlete", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AthleteEntityTrainingEntity_Training_TrainingsAthleteIdTraining", - column: x => x.TrainingsAthleteIdTraining, - principalTable: "Training", - principalColumn: "IdTraining", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.InsertData( - table: "Athlete", - columns: new[] { "IdAthlete", "DataSourceId", "DateOfBirth", "Email", "FirstName", "IsCoach", "LastName", "Length", "Password", "Sexe", "Username", "Weight" }, - values: new object[,] - { - { 1, null, new DateOnly(1990, 1, 1), "john.doe@example.com", "John", true, "Doe", 1.8, "password123", "M", "Doe", 75f }, - { 3, null, new DateOnly(1992, 1, 1), "paul.martin@example.com", "Paul", true, "Martin", 1.75, "super789", "M", "Martin", 68f }, - { 4, null, new DateOnly(1993, 1, 1), "anna.brown@example.com", "Anna", false, "Brown", 1.7, "test000", "F", "Brown", 58f } - }); - - migrationBuilder.InsertData( - table: "DataSource", - columns: new[] { "IdSource", "Model", "Precision", "Type" }, - values: new object[,] - { - { 1, "Garmin", 0.5f, "Smartwatch" }, - { 2, "Polar", 0.5f, "Smartwatch" }, - { 3, "Suunto", 0.5f, "Smartwatch" }, - { 4, "Fitbit", 0.5f, "Smartwatch" }, - { 5, "Apple Watch", 0.5f, "Smartwatch" } - }); - - migrationBuilder.InsertData( - table: "Activity", - columns: new[] { "IdActivity", "AthleteId", "Average", "AverageTemperature", "DataSourceId", "Date", "EffortFelt", "EndTime", "HasAutoPause", "Maximum", "Minimum", "StandardDeviation", "StartTime", "Type", "Variability", "Variance" }, - values: new object[,] - { - { 1, 1, 0.5f, 20f, 1, 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 }, - { 3, 1, 0.5f, 20f, 1, 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 }, - { 5, 4, 0.5f, 20f, 4, 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, 4, 0.5f, 20f, 4, 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, 3, 0.5f, 20f, 5, 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( - table: "Athlete", - columns: new[] { "IdAthlete", "DataSourceId", "DateOfBirth", "Email", "FirstName", "IsCoach", "LastName", "Length", "Password", "Sexe", "Username", "Weight" }, - values: new object[,] - { - { 2, 1, new DateOnly(1995, 1, 1), "jane.smith@exemple.com", "Jane", false, "Smith", 1.6499999999999999, "secure456", "F", "Smith", 60f }, - { 5, 3, new DateOnly(1991, 1, 1), "bruce.lee@example.com", "Bruce", false, "Lee", 2.0, "hello321", "M", "Lee", 90f } - }); - - migrationBuilder.InsertData( - table: "FriendshipEntity", - columns: new[] { "FollowerId", "FollowingId", "StartDate" }, - values: new object[,] - { - { 1, 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, - { 1, 4, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) } - }); - - migrationBuilder.InsertData( - table: "Notification", - columns: new[] { "IdNotif", "Date", "Message", "SenderId", "Statut", "Urgence" }, - values: new object[,] - { - { 1, new DateTime(2023, 12, 25, 13, 0, 40, 0, DateTimeKind.Unspecified), "You have a new activity to check", 1, true, "A" }, - { 3, new DateTime(2023, 12, 26, 16, 10, 4, 0, DateTimeKind.Unspecified), "You have a new heart rate to check", 3, true, "2" }, - { 4, new DateTime(2024, 1, 12, 9, 30, 50, 0, DateTimeKind.Unspecified), "You have a new data source to check", 4, false, "1" } - }); - - migrationBuilder.InsertData( - table: "Statistic", - columns: new[] { "IdStatistic", "AthleteId", "AverageCaloriesBurned", "AverageHeartRate", "Date", "MaximumHeartRate", "Weight" }, - values: new object[,] - { - { 1, 1, 500.0, 120.0, new DateOnly(2021, 12, 12), 180.0, 75f }, - { 3, 1, 550.0, 125.0, new DateOnly(2022, 12, 30), 185.0, 68f }, - { 4, 3, 650.0, 135.0, new DateOnly(2023, 2, 20), 195.0, 58f }, - { 5, 4, 450.0, 110.0, new DateOnly(2024, 1, 10), 170.0, 90f } - }); - - migrationBuilder.InsertData( - table: "Training", - columns: new[] { "IdTraining", "CoachId", "Date", "Description", "FeedBack", "Latitude", "Longitude" }, - values: new object[,] - { - { 1, 1, new DateOnly(2024, 1, 19), "Running", "Good", 48.8566f, 2.3522f }, - { 3, 4, new DateOnly(2024, 2, 21), null, "Good", 48.8566f, 2.3522f }, - { 4, 3, new DateOnly(2024, 2, 22), "Running", "Good", 48.8566f, 2.3522f }, - { 5, 1, new DateOnly(2024, 2, 23), "Cycling", null, 48.8566f, 2.3522f } - }); - - migrationBuilder.InsertData( - table: "Activity", - columns: new[] { "IdActivity", "AthleteId", "Average", "AverageTemperature", "DataSourceId", "Date", "EffortFelt", "EndTime", "HasAutoPause", "Maximum", "Minimum", "StandardDeviation", "StartTime", "Type", "Variability", "Variance" }, - values: new object[,] - { - { 2, 2, 0.5f, 20f, 2, 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 }, - { 4, 5, 0.5f, 20f, 3, 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 } - }); - - migrationBuilder.InsertData( - table: "FriendshipEntity", - columns: new[] { "FollowerId", "FollowingId", "StartDate" }, - values: new object[,] - { - { 2, 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, - { 1, 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, - { 2, 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }, - { 1, 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) } - }); - - migrationBuilder.InsertData( - table: "HeartRate", - columns: new[] { "IdHeartRate", "ActivityId", "Altitude", "Bpm", "Latitude", "Longitude", "Temperature", "Time" }, - values: new object[,] - { - { 1, 1, 0.0, 60, 66f, 35f, 20f, new TimeOnly(13, 0, 30) }, - { 3, 1, 11.0, 71, 66f, 36f, 20f, new TimeOnly(13, 0, 32) } - }); - - migrationBuilder.InsertData( - table: "Notification", - columns: new[] { "IdNotif", "Date", "Message", "SenderId", "Statut", "Urgence" }, - values: new object[,] - { - { 2, new DateTime(2023, 12, 26, 13, 10, 40, 0, DateTimeKind.Unspecified), "You have a new athlete to check", 2, false, "3" }, - { 5, new DateTime(2024, 2, 22, 12, 10, 0, 0, DateTimeKind.Unspecified), "You have a new notification to check", 5, true, "3" } - }); - - migrationBuilder.InsertData( - table: "Statistic", - columns: new[] { "IdStatistic", "AthleteId", "AverageCaloriesBurned", "AverageHeartRate", "Date", "MaximumHeartRate", "Weight" }, - values: new object[] { 2, 2, 600.0, 130.0, new DateOnly(2021, 1, 11), 190.0, 60f }); - - migrationBuilder.InsertData( - table: "Training", - columns: new[] { "IdTraining", "CoachId", "Date", "Description", "FeedBack", "Latitude", "Longitude" }, - values: new object[] { 2, 5, new DateOnly(2024, 2, 20), "Cycling", null, 48.8566f, 2.3522f }); - - migrationBuilder.InsertData( - table: "HeartRate", - columns: new[] { "IdHeartRate", "ActivityId", "Altitude", "Bpm", "Latitude", "Longitude", "Temperature", "Time" }, - values: new object[,] - { - { 2, 2, 10.0, 65, 67f, 35f, 20.5f, new TimeOnly(13, 0, 31) }, - { 4, 2, 12.0, 75, 67f, 36f, 20.5f, new TimeOnly(13, 0, 33) }, - { 5, 4, 13.0, 80, 66f, 37f, 20f, new TimeOnly(13, 0, 34) } - }); - - migrationBuilder.CreateIndex( - name: "IX_Activity_AthleteId", - table: "Activity", - column: "AthleteId"); - - migrationBuilder.CreateIndex( - name: "IX_Activity_DataSourceId", - table: "Activity", - column: "DataSourceId"); - - migrationBuilder.CreateIndex( - name: "IX_Athlete_DataSourceId", - table: "Athlete", - column: "DataSourceId"); - - migrationBuilder.CreateIndex( - name: "IX_AthleteEntityNotificationEntity_ReceiversIdAthlete", - table: "AthleteEntityNotificationEntity", - column: "ReceiversIdAthlete"); - - migrationBuilder.CreateIndex( - name: "IX_AthleteEntityTrainingEntity_TrainingsAthleteIdTraining", - table: "AthleteEntityTrainingEntity", - column: "TrainingsAthleteIdTraining"); - - migrationBuilder.CreateIndex( - name: "IX_FriendshipEntity_FollowerId", - table: "FriendshipEntity", - column: "FollowerId"); - - migrationBuilder.CreateIndex( - name: "IX_HeartRate_ActivityId", - table: "HeartRate", - column: "ActivityId"); - - migrationBuilder.CreateIndex( - name: "IX_Notification_SenderId", - table: "Notification", - column: "SenderId"); - - migrationBuilder.CreateIndex( - name: "IX_Statistic_AthleteId", - table: "Statistic", - column: "AthleteId"); - - migrationBuilder.CreateIndex( - name: "IX_Training_CoachId", - table: "Training", - column: "CoachId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AthleteEntityNotificationEntity"); - - migrationBuilder.DropTable( - name: "AthleteEntityTrainingEntity"); - - migrationBuilder.DropTable( - name: "FriendshipEntity"); - - migrationBuilder.DropTable( - name: "HeartRate"); - - migrationBuilder.DropTable( - name: "Statistic"); - - migrationBuilder.DropTable( - name: "Notification"); - - migrationBuilder.DropTable( - name: "Training"); - - migrationBuilder.DropTable( - name: "Activity"); - - migrationBuilder.DropTable( - name: "Athlete"); - - migrationBuilder.DropTable( - name: "DataSource"); - } - } -} diff --git a/src/StubbedContextLib/Migrations/TrainingStubbedContextModelSnapshot.cs b/src/StubbedContextLib/Migrations/TrainingStubbedContextModelSnapshot.cs deleted file mode 100644 index 93bd1a3..0000000 --- a/src/StubbedContextLib/Migrations/TrainingStubbedContextModelSnapshot.cs +++ /dev/null @@ -1,974 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using StubbedContextLib; - -#nullable disable - -namespace StubbedContextLib.Migrations -{ - [DbContext(typeof(TrainingStubbedContext))] - partial class TrainingStubbedContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.2"); - - modelBuilder.Entity("AthleteEntityNotificationEntity", b => - { - b.Property("NotificationsReceivedIdNotif") - .HasColumnType("INTEGER"); - - b.Property("ReceiversIdAthlete") - .HasColumnType("INTEGER"); - - b.HasKey("NotificationsReceivedIdNotif", "ReceiversIdAthlete"); - - b.HasIndex("ReceiversIdAthlete"); - - b.ToTable("AthleteEntityNotificationEntity"); - }); - - modelBuilder.Entity("AthleteEntityTrainingEntity", b => - { - b.Property("AthletesIdAthlete") - .HasColumnType("INTEGER"); - - b.Property("TrainingsAthleteIdTraining") - .HasColumnType("INTEGER"); - - b.HasKey("AthletesIdAthlete", "TrainingsAthleteIdTraining"); - - b.HasIndex("TrainingsAthleteIdTraining"); - - b.ToTable("AthleteEntityTrainingEntity"); - }); - - modelBuilder.Entity("Entities.ActivityEntity", b => - { - b.Property("IdActivity") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AthleteId") - .HasColumnType("INTEGER"); - - b.Property("Average") - .HasColumnType("REAL"); - - b.Property("AverageTemperature") - .HasColumnType("REAL"); - - b.Property("DataSourceId") - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("EffortFelt") - .HasColumnType("INTEGER"); - - b.Property("EndTime") - .HasColumnType("TEXT"); - - b.Property("HasAutoPause") - .HasColumnType("INTEGER"); - - b.Property("Maximum") - .HasColumnType("INTEGER"); - - b.Property("Minimum") - .HasColumnType("INTEGER"); - - b.Property("StandardDeviation") - .HasColumnType("REAL"); - - b.Property("StartTime") - .HasColumnType("TEXT"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Variability") - .HasColumnType("REAL"); - - b.Property("Variance") - .HasColumnType("REAL"); - - b.HasKey("IdActivity"); - - b.HasIndex("AthleteId"); - - b.HasIndex("DataSourceId"); - - b.ToTable("Activity"); - - b.HasData( - new - { - IdActivity = 1, - AthleteId = 1, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 1, - Date = new DateOnly(2023, 1, 10), - EffortFelt = 5, - EndTime = new TimeOnly(14, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 0, 34), - Type = "Running", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 2, - AthleteId = 2, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 2, - Date = new DateOnly(2023, 1, 25), - EffortFelt = 5, - EndTime = new TimeOnly(14, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 4, 34), - Type = "Cycling", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 3, - AthleteId = 1, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 1, - Date = new DateOnly(2023, 12, 10), - EffortFelt = 5, - EndTime = new TimeOnly(15, 2, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 30, 34), - Type = "Swimming", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 4, - AthleteId = 5, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 3, - Date = new DateOnly(2024, 1, 2), - EffortFelt = 5, - EndTime = new TimeOnly(16, 1, 55), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(15, 0, 0), - Type = "Walking", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 5, - AthleteId = 4, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 4, - Date = new DateOnly(2024, 1, 12), - EffortFelt = 5, - EndTime = new TimeOnly(9, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(7, 45, 34), - Type = "Hiking", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 6, - AthleteId = 4, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 4, - Date = new DateOnly(2024, 1, 27), - EffortFelt = 5, - EndTime = new TimeOnly(14, 0, 22), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(13, 30, 1), - Type = "Climbing", - Variability = 0.5f, - Variance = 0.5f - }, - new - { - IdActivity = 7, - AthleteId = 3, - Average = 0.5f, - AverageTemperature = 20f, - DataSourceId = 5, - Date = new DateOnly(2024, 2, 22), - EffortFelt = 5, - EndTime = new TimeOnly(23, 50, 58), - HasAutoPause = false, - Maximum = 0, - Minimum = 0, - StandardDeviation = 0.5f, - StartTime = new TimeOnly(22, 0, 34), - Type = "Yoga", - Variability = 0.5f, - Variance = 0.5f - }); - }); - - modelBuilder.Entity("Entities.AthleteEntity", b => - { - b.Property("IdAthlete") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DataSourceId") - .HasColumnType("INTEGER"); - - b.Property("DateOfBirth") - .HasColumnType("TEXT"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("TEXT"); - - b.Property("IsCoach") - .HasColumnType("INTEGER"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Length") - .HasColumnType("REAL"); - - b.Property("Password") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Sexe") - .IsRequired() - .HasMaxLength(1) - .HasColumnType("TEXT"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("IdAthlete"); - - b.HasIndex("DataSourceId"); - - b.ToTable("Athlete"); - - b.HasData( - new - { - IdAthlete = 1, - DateOfBirth = new DateOnly(1990, 1, 1), - Email = "john.doe@example.com", - FirstName = "John", - IsCoach = true, - LastName = "Doe", - Length = 1.8, - Password = "password123", - Sexe = "M", - Username = "Doe", - Weight = 75f - }, - new - { - IdAthlete = 2, - DataSourceId = 1, - DateOfBirth = new DateOnly(1995, 1, 1), - Email = "jane.smith@exemple.com", - FirstName = "Jane", - IsCoach = false, - LastName = "Smith", - Length = 1.6499999999999999, - Password = "secure456", - Sexe = "F", - Username = "Smith", - Weight = 60f - }, - new - { - IdAthlete = 3, - DateOfBirth = new DateOnly(1992, 1, 1), - Email = "paul.martin@example.com", - FirstName = "Paul", - IsCoach = true, - LastName = "Martin", - Length = 1.75, - Password = "super789", - Sexe = "M", - Username = "Martin", - Weight = 68f - }, - new - { - IdAthlete = 4, - DateOfBirth = new DateOnly(1993, 1, 1), - Email = "anna.brown@example.com", - FirstName = "Anna", - IsCoach = false, - LastName = "Brown", - Length = 1.7, - Password = "test000", - Sexe = "F", - Username = "Brown", - Weight = 58f - }, - new - { - IdAthlete = 5, - DataSourceId = 3, - DateOfBirth = new DateOnly(1991, 1, 1), - Email = "bruce.lee@example.com", - FirstName = "Bruce", - IsCoach = false, - LastName = "Lee", - Length = 2.0, - Password = "hello321", - Sexe = "M", - Username = "Lee", - Weight = 90f - }); - }); - - modelBuilder.Entity("Entities.DataSourceEntity", b => - { - b.Property("IdSource") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Model") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Precision") - .HasColumnType("REAL"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.HasKey("IdSource"); - - b.ToTable("DataSource"); - - b.HasData( - new - { - IdSource = 1, - Model = "Garmin", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 2, - Model = "Polar", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 3, - Model = "Suunto", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 4, - Model = "Fitbit", - Precision = 0.5f, - Type = "Smartwatch" - }, - new - { - IdSource = 5, - Model = "Apple Watch", - Precision = 0.5f, - Type = "Smartwatch" - }); - }); - - modelBuilder.Entity("Entities.FriendshipEntity", b => - { - b.Property("FollowingId") - .HasColumnType("INTEGER"); - - b.Property("FollowerId") - .HasColumnType("INTEGER"); - - b.Property("StartDate") - .HasColumnType("TEXT"); - - b.HasKey("FollowingId", "FollowerId"); - - b.HasIndex("FollowerId"); - - b.ToTable("FriendshipEntity"); - - b.HasData( - new - { - FollowingId = 2, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 3, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 4, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 5, - FollowerId = 1, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 1, - FollowerId = 2, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }, - new - { - FollowingId = 3, - FollowerId = 2, - StartDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Entities.HeartRateEntity", b => - { - b.Property("IdHeartRate") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ActivityId") - .HasColumnType("INTEGER"); - - b.Property("Altitude") - .HasColumnType("REAL"); - - b.Property("Bpm") - .HasColumnType("INTEGER"); - - b.Property("Latitude") - .HasColumnType("REAL"); - - b.Property("Longitude") - .HasColumnType("REAL"); - - b.Property("Temperature") - .HasColumnType("REAL"); - - b.Property("Time") - .HasColumnType("TEXT"); - - b.HasKey("IdHeartRate"); - - b.HasIndex("ActivityId"); - - b.ToTable("HeartRate"); - - b.HasData( - new - { - IdHeartRate = 1, - ActivityId = 1, - Altitude = 0.0, - Bpm = 60, - Latitude = 66f, - Longitude = 35f, - Temperature = 20f, - Time = new TimeOnly(13, 0, 30) - }, - new - { - IdHeartRate = 2, - ActivityId = 2, - Altitude = 10.0, - Bpm = 65, - Latitude = 67f, - Longitude = 35f, - Temperature = 20.5f, - Time = new TimeOnly(13, 0, 31) - }, - new - { - IdHeartRate = 3, - ActivityId = 1, - Altitude = 11.0, - Bpm = 71, - Latitude = 66f, - Longitude = 36f, - Temperature = 20f, - Time = new TimeOnly(13, 0, 32) - }, - new - { - IdHeartRate = 4, - ActivityId = 2, - Altitude = 12.0, - Bpm = 75, - Latitude = 67f, - Longitude = 36f, - Temperature = 20.5f, - Time = new TimeOnly(13, 0, 33) - }, - new - { - IdHeartRate = 5, - ActivityId = 4, - Altitude = 13.0, - Bpm = 80, - Latitude = 66f, - Longitude = 37f, - Temperature = 20f, - Time = new TimeOnly(13, 0, 34) - }); - }); - - modelBuilder.Entity("Entities.NotificationEntity", b => - { - b.Property("IdNotif") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("SenderId") - .HasColumnType("INTEGER"); - - b.Property("Statut") - .HasColumnType("INTEGER"); - - b.Property("Urgence") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.HasKey("IdNotif"); - - b.HasIndex("SenderId"); - - b.ToTable("Notification"); - - b.HasData( - new - { - IdNotif = 1, - Date = new DateTime(2023, 12, 25, 13, 0, 40, 0, DateTimeKind.Unspecified), - Message = "You have a new activity to check", - SenderId = 1, - Statut = true, - Urgence = "A" - }, - new - { - IdNotif = 2, - Date = new DateTime(2023, 12, 26, 13, 10, 40, 0, DateTimeKind.Unspecified), - Message = "You have a new athlete to check", - SenderId = 2, - Statut = false, - Urgence = "3" - }, - new - { - IdNotif = 3, - Date = new DateTime(2023, 12, 26, 16, 10, 4, 0, DateTimeKind.Unspecified), - Message = "You have a new heart rate to check", - SenderId = 3, - Statut = true, - Urgence = "2" - }, - new - { - IdNotif = 4, - Date = new DateTime(2024, 1, 12, 9, 30, 50, 0, DateTimeKind.Unspecified), - Message = "You have a new data source to check", - SenderId = 4, - Statut = false, - Urgence = "1" - }, - new - { - IdNotif = 5, - Date = new DateTime(2024, 2, 22, 12, 10, 0, 0, DateTimeKind.Unspecified), - Message = "You have a new notification to check", - SenderId = 5, - Statut = true, - Urgence = "3" - }); - }); - - modelBuilder.Entity("Entities.StatisticEntity", b => - { - b.Property("IdStatistic") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AthleteId") - .HasColumnType("INTEGER"); - - b.Property("AverageCaloriesBurned") - .HasColumnType("REAL"); - - b.Property("AverageHeartRate") - .HasColumnType("REAL"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("MaximumHeartRate") - .HasColumnType("REAL"); - - b.Property("Weight") - .HasColumnType("REAL"); - - b.HasKey("IdStatistic"); - - b.HasIndex("AthleteId"); - - b.ToTable("Statistic"); - - b.HasData( - new - { - IdStatistic = 1, - AthleteId = 1, - AverageCaloriesBurned = 500.0, - AverageHeartRate = 120.0, - Date = new DateOnly(2021, 12, 12), - MaximumHeartRate = 180.0, - Weight = 75f - }, - new - { - IdStatistic = 2, - AthleteId = 2, - AverageCaloriesBurned = 600.0, - AverageHeartRate = 130.0, - Date = new DateOnly(2021, 1, 11), - MaximumHeartRate = 190.0, - Weight = 60f - }, - new - { - IdStatistic = 3, - AthleteId = 1, - AverageCaloriesBurned = 550.0, - AverageHeartRate = 125.0, - Date = new DateOnly(2022, 12, 30), - MaximumHeartRate = 185.0, - Weight = 68f - }, - new - { - IdStatistic = 4, - AthleteId = 3, - AverageCaloriesBurned = 650.0, - AverageHeartRate = 135.0, - Date = new DateOnly(2023, 2, 20), - MaximumHeartRate = 195.0, - Weight = 58f - }, - new - { - IdStatistic = 5, - AthleteId = 4, - AverageCaloriesBurned = 450.0, - AverageHeartRate = 110.0, - Date = new DateOnly(2024, 1, 10), - MaximumHeartRate = 170.0, - Weight = 90f - }); - }); - - modelBuilder.Entity("Entities.TrainingEntity", b => - { - b.Property("IdTraining") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CoachId") - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasMaxLength(300) - .HasColumnType("TEXT"); - - b.Property("FeedBack") - .HasMaxLength(300) - .HasColumnType("TEXT"); - - b.Property("Latitude") - .HasColumnType("REAL"); - - b.Property("Longitude") - .HasColumnType("REAL"); - - b.HasKey("IdTraining"); - - b.HasIndex("CoachId"); - - b.ToTable("Training"); - - b.HasData( - new - { - IdTraining = 1, - CoachId = 1, - Date = new DateOnly(2024, 1, 19), - Description = "Running", - FeedBack = "Good", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 2, - CoachId = 5, - Date = new DateOnly(2024, 2, 20), - Description = "Cycling", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 3, - CoachId = 4, - Date = new DateOnly(2024, 2, 21), - FeedBack = "Good", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 4, - CoachId = 3, - Date = new DateOnly(2024, 2, 22), - Description = "Running", - FeedBack = "Good", - Latitude = 48.8566f, - Longitude = 2.3522f - }, - new - { - IdTraining = 5, - CoachId = 1, - Date = new DateOnly(2024, 2, 23), - Description = "Cycling", - Latitude = 48.8566f, - Longitude = 2.3522f - }); - }); - - modelBuilder.Entity("AthleteEntityNotificationEntity", b => - { - b.HasOne("Entities.NotificationEntity", null) - .WithMany() - .HasForeignKey("NotificationsReceivedIdNotif") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.AthleteEntity", null) - .WithMany() - .HasForeignKey("ReceiversIdAthlete") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("AthleteEntityTrainingEntity", b => - { - b.HasOne("Entities.AthleteEntity", null) - .WithMany() - .HasForeignKey("AthletesIdAthlete") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.TrainingEntity", null) - .WithMany() - .HasForeignKey("TrainingsAthleteIdTraining") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Entities.ActivityEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Athlete") - .WithMany("Activities") - .HasForeignKey("AthleteId"); - - b.HasOne("Entities.DataSourceEntity", "DataSource") - .WithMany("Activities") - .HasForeignKey("DataSourceId"); - - b.Navigation("Athlete"); - - b.Navigation("DataSource"); - }); - - modelBuilder.Entity("Entities.AthleteEntity", b => - { - b.HasOne("Entities.DataSourceEntity", "DataSource") - .WithMany("Athletes") - .HasForeignKey("DataSourceId"); - - b.Navigation("DataSource"); - }); - - modelBuilder.Entity("Entities.FriendshipEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Follower") - .WithMany("Followers") - .HasForeignKey("FollowerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.AthleteEntity", "Following") - .WithMany("Followings") - .HasForeignKey("FollowingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Follower"); - - b.Navigation("Following"); - }); - - modelBuilder.Entity("Entities.HeartRateEntity", b => - { - b.HasOne("Entities.ActivityEntity", "Activity") - .WithMany("HeartRates") - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Activity"); - }); - - modelBuilder.Entity("Entities.NotificationEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Sender") - .WithMany("NotificationsSent") - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("Entities.StatisticEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Athlete") - .WithMany("Statistics") - .HasForeignKey("AthleteId"); - - b.Navigation("Athlete"); - }); - - modelBuilder.Entity("Entities.TrainingEntity", b => - { - b.HasOne("Entities.AthleteEntity", "Coach") - .WithMany("TrainingsCoach") - .HasForeignKey("CoachId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Coach"); - }); - - modelBuilder.Entity("Entities.ActivityEntity", b => - { - b.Navigation("HeartRates"); - }); - - modelBuilder.Entity("Entities.AthleteEntity", b => - { - b.Navigation("Activities"); - - b.Navigation("Followers"); - - b.Navigation("Followings"); - - b.Navigation("NotificationsSent"); - - b.Navigation("Statistics"); - - b.Navigation("TrainingsCoach"); - }); - - modelBuilder.Entity("Entities.DataSourceEntity", b => - { - b.Navigation("Activities"); - - b.Navigation("Athletes"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/StubbedContextLib/NotificationStubbedContext.cs b/src/StubbedContextLib/NotificationStubbedContext.cs index 91ff31d..2c5e0d2 100644 --- a/src/StubbedContextLib/NotificationStubbedContext.cs +++ b/src/StubbedContextLib/NotificationStubbedContext.cs @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public NotificationStubbedContext(DbContextOptions options) : base(options) { } + public NotificationStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the notification stubbed context. diff --git a/src/StubbedContextLib/StatisticStubbedContext.cs b/src/StubbedContextLib/StatisticStubbedContext.cs index a1733c9..1b72aff 100644 --- a/src/StubbedContextLib/StatisticStubbedContext.cs +++ b/src/StubbedContextLib/StatisticStubbedContext.cs @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public StatisticStubbedContext(DbContextOptions options) : base(options) { } + public StatisticStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the statistic stubbed context. diff --git a/src/StubbedContextLib/TrainingStubbedContext.cs b/src/StubbedContextLib/TrainingStubbedContext.cs index 76a5820..0916024 100644 --- a/src/StubbedContextLib/TrainingStubbedContext.cs +++ b/src/StubbedContextLib/TrainingStubbedContext.cs @@ -26,7 +26,7 @@ namespace StubbedContextLib /// Initializes a new instance of the class with the specified options. /// /// The options for the context. - public TrainingStubbedContext(DbContextOptions options) : base(options) { } + public TrainingStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the training stubbed context. diff --git a/src/Tests/ConsoleTestEntities/Program.cs b/src/Tests/ConsoleTestEntities/Program.cs index ccbe0d2..4019745 100644 --- a/src/Tests/ConsoleTestEntities/Program.cs +++ b/src/Tests/ConsoleTestEntities/Program.cs @@ -9,7 +9,7 @@ class Program { try { - using (LibraryContext db = new TrainingStubbedContext()) + using (HeartTrackContext db = new TrainingStubbedContext()) { AthletesTests(db); @@ -46,7 +46,7 @@ class Program } } - static void AthletesTests(LibraryContext db) + static void AthletesTests(HeartTrackContext db) { Console.WriteLine("Accès à tous les athletes :"); @@ -161,7 +161,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void ActivityTests(LibraryContext db) + static void ActivityTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les activités :"); @@ -276,7 +276,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void DataSourceTests(LibraryContext db) + static void DataSourceTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les sources de données :"); @@ -341,7 +341,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void HeartRateTests(LibraryContext db) + static void HeartRateTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les fréquences cardiaques :"); @@ -426,7 +426,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void NotificationTests(LibraryContext db) + static void NotificationTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les notifications :"); @@ -501,7 +501,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void StatisticTests(LibraryContext db) + static void StatisticTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les statistiques :"); @@ -635,7 +635,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void TrainingTests(LibraryContext db) + static void TrainingTests(HeartTrackContext db) { Console.WriteLine("Accès à tout les entrainements :"); @@ -750,12 +750,14 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void AddUpdateDeleteAthlete(LibraryContext db) + static void AddUpdateDeleteAthlete(HeartTrackContext db) { Console.WriteLine("Test d'ajout, de modification et de suppression des athletes :"); - + var picture = System.Text.Encoding.UTF8.GetBytes( + "\"UklGRtwDAABXRUJQVlA4INADAAAwEACdASoqACoAAMASJZgCdMoSCz655ndU4XXAP2yXIge5neM/Qd6WCfO8evoj2S0A/p7+f0An85cBxlLDgPC8jO/0nsl/13/O8vvzj7Af8s/p3/H4FU6td4MCwq23z1H2uzoKIXaqJniPI/bRMf8qzv0Zp+HE1RCBw5WQ1j/JovdM1FS52+QcaAAA/v/+NxU4DpPk3+xQPW7tcmURSo9vC4qc+XMxNVBzEM5E8actDz98gmwTXgD62e9EmG/ervdd2ovFFSuxYppWl/wtaX3rkn0xrt8qOql/5I2jfLOnCU0kALLcW4F/wTjU10qsxZXW9fxauC6OPVRF28sc94V9ocmoSWy+sf6jW3vYkVOh+gE/RE0L6b2d3oFyHmkRJnfYwG8o3p6fv9pivNF5aopIBzFnjzwb/VqSq3/b+MWKFmjr8T1qe4/fITo2vBWEqDyogV3ZVGnDVi2DbiEFVSUr2eXTNZQ9V/D9QC/+vCR5TGyX9QOVBgtAYtm/ZTIwzPEYB9NrV1NeO1/sAz78u0tW59r0I+SO5Jgm3B9i1toRurzHv9EZJ9yZL8nafb/T1FaoPDkuJfM+iPs0j8xnS7TaU/gEK0wCxeDYRYtJx9j4hUQq7pAu/T2yWy0vjcUHki952ZNbXnXxB8m8pV5x9E1sfLj5MZEgpU2XV8RHrVvWniCjsf6vgxmR7+KtwIbMjahitUGtHet1WdL+8MmdL29iQJC37pDXirir1NibxKKhFYRuJ3xW9O0r9+Vnh8diqbBuXqDbYR/MSoHvscOCm2t95dN5WBdRUoD7YCG/ZHWc7Ypv/x/al4fkB2lZlYhVWHxjaoeF9jEPI0gAN5XsvUI6hbzEzWMsNW/1orkNOnlskalgmpI4B2rm4Gc7LNui+MuMBrpnBvLkbYX9exe9g8tu7wLt7ScOjDcL99oOyR89Mh9L8rd4+43+JQyR6tsIfcPJo6T6FxHf11d/MGayJi+SWct/uhvvua0oOh+zXNIaUzgoBmu1XULjkpuA0Ghzctf30jbY1AOM49qbMZRYS9A+0S1HrHPnwRvpQY/Sj4xKPn0gdpv/+iTbKJb8zkPC4/9af0Jvesa+GDG0/iw3TswenMhqlh7BM9MW5txpeblsByx4WnJ/oHv6cc0dmM7tsV36lYkCTUXEf/0eKlnfivnN0g1g+j/Lk9et/uoa6TFCW0HgwFOIVFumEYdT675PfuTrYO5o8ZrWEIHtv2Ctlrv9J3TrslD/iKEwtipGHtn0Vak8B9wLL+kz+CIQ/VG4KJpXjx88CeCC4XaGitEdjAAA\""); + // Ajout d'un nouveau livre - var newAthlete = new AthleteEntity { Username = "Doe", LastName = "Doe", FirstName = "John", Email = "essaie.example.com", Password = "TheNewPassword", Sexe = "M", Length = 1.80, Weight = 90, DateOfBirth = new DateOnly(2024, 02, 22), IsCoach = false }; + var newAthlete = new AthleteEntity { Username = "Doe", LastName = "Doe",ProfilPicture = picture,FirstName = "John", Email = "essaie.example.com", Password = "TheNewPassword", Sexe = "M", Length = 1.80, Weight = 90, DateOfBirth = new DateOnly(2024, 02, 22), IsCoach = false }; db.AthletesSet.Add(newAthlete); db.SaveChanges(); @@ -789,7 +791,7 @@ class Program } } - static void AddUpdateDeleteActivity(LibraryContext db) + static void AddUpdateDeleteActivity(HeartTrackContext db) { Console.WriteLine("Test d'ajout, de modification et de suppression des activités :"); @@ -823,7 +825,7 @@ class Program } - static void AddUpdateDeleteDataSource(LibraryContext db) + static void AddUpdateDeleteDataSource(HeartTrackContext db) { Console.WriteLine("Test d'ajout, de modification et de suppression des sources de données :"); @@ -856,7 +858,7 @@ class Program } } - static void AddUpdateDeleteHeartRate(LibraryContext db) + static void AddUpdateDeleteHeartRate(HeartTrackContext db) { Console.WriteLine("Test d'ajout, de modification et de suppression des fréquences cardiaques :"); @@ -889,7 +891,7 @@ class Program } } - static void AddUpdateDeleteNotification(LibraryContext db) + static void AddUpdateDeleteNotification(HeartTrackContext db) { Console.WriteLine("Test d'ajout, de modification et de suppression des notifications :"); @@ -922,7 +924,7 @@ class Program } } - static void AddUpdateDeleteStatistic(LibraryContext db) + static void AddUpdateDeleteStatistic(HeartTrackContext db) { Console.WriteLine("Test d'ajout, de modification et de suppression des statistiques :"); @@ -955,7 +957,7 @@ class Program } } - static void AddUpdateDeleteTraining(LibraryContext db) + static void AddUpdateDeleteTraining(HeartTrackContext db) { Console.WriteLine("Test d'ajout, de modification et de suppression des entrainements :"); diff --git a/src/Tests/ConsoleTestEntities/uca.HeartTrack.db b/src/Tests/ConsoleTestEntities/uca.HeartTrack.db deleted file mode 100644 index 0065538f1912775182326dd3ea03bbc49fb377ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45056 zcmeI5No*U}8Gzpm#YMElNnr_$Dk~n!QDGsLItyu8vKpD%EJdOuiLooC1=3s5L(v83KMScLMT)*8 zwSs@Z;SAsZ{{OxAy=C}j`6qjAS+yv?ts7;<;$`v*VOes8=LsP!tfyeDE)m%2sQ!R0 zf#C{lbKt|U2v_=Di$5& zb8|PrkY}tap=RDtcP&-dsu3V1Pq?gDs#Pg~Dr9=OQFU3@c8(FxQ(Bl-@^^h^qr(rU zI>Yg^XPL(thfdal6iiFa*LI@yd}`r7K)$ecgnUukA-X};oubver0G3sC_8k4Du%W0 zplrq?quf)=m2#U{o~;?Bq#G(Vrz?g=3(b>lQfol4I}(l$4Ka`II0RR8OWjuUfKk`{ z` zqHZ`mYV>P6k$Mufa32O=SYzsqea;uP9fx%3xZaaf%Z-KcN}8kPU1)Ds#c0v-rgzIN zF}3NGEqZix_`yyn98V;eM|}=PXnIOkuNZlHxEHPmc_{FabajsAt`VbOxgE#c!EOsu z8NEPD&D+_ULG!BVjB0g#H9Gw0tHE%*zn}S5$|-5uDwe24y-ldTj9#d(fVGfz4W$;b zUGX+dYG_KU#;~lI)=Eq1ylNaLo+~SA3qDzTuLaa)s_j_C<|EQ^gXEfGn)|u|V_DPV z4D|ce?P=ApO*f0MXwK+L9)yixqr+<*q4*nbFt?ogGT$k|_w*0O3Q7aRLgW4mf$$JfX_Kx>9xsN}8d z)NqHxy3Q9JUSvb@J7Ww{wF158br=OeIKMZWrm`tE4GzHHZF@dXx?yFwKN0xgf&`EN z5L~m z!~L1S2NxuO1dsp{Kmter2_OL^fCP{L5IYQb+PCBIEU5>vJsEGnrog67l-2oA5?rx&7Kp?>!x^0P`Vgvn*=j0^X#enIm zr;9Fo{vV7zA>1#yZLT-=QS3=f`s|B`DIftPfCP{L5@fX`_;-TlUvziQ4uYyN*5fc9E7!x-5y}__%0aO&7$ajxG|9 z_l`rZ`V*09L*Lh&ue7Eq3aq1Bc97r9{M5f?XPL05X$f%0!1%ax8C?)p16`!AulF(- z8%T6!z-^S&u(S*7XxRz$+k;}dl{afvz$fh3rExF__i@;{%doZFolQitWz{M= zUvDWIeH+$M(+=`Oo1gmEwzEu{G!Ncolc|efF6EkAWNco&DahZsMCV}@ybaYbTF~oh zRp~G7dQLw@Nd{AbYs#7ba|%5F&wa@KgnPm%+~kR9gP2JqfCP{L5cj3GU zf5YCb#u?~r+$9;FeM~_1dsp{Kmter2_OL^fCP{L5u5YnLIb`-v9rMaKGce%PnzTv1hUGfAPp;iI4yiKmter z2_OL^fCP{L59QQ@ThS|fRH^V~YMS;%^#bMXTlHP{i1uyuyfcf2S@VXm zLpAHoV2EtUo!l+G!WWf2$}7A^_jygX)NM5nPtWTbZ|Qu#Nb`3OA3oq=HZIz;artW< zA(E9Njrs+}Qg~CZ7ySN*8%> zQ)nlil*ZW*Svs1yViilYg{o|;CIxwd36advgq6Id?y1&+KhtiqDc(H=kQCDH_5TNi z`z!YxeEX}DRyAATO@>52Yun1HtXnnl@rrQel>^7~)<;U{}n*gvdXexCZ^0!-ZPn7y@_ rlJ}y%#+X-iy)Xom`2_LD7Mn#o4^#X4() + .UseSqlite("Data Source=uca.HeartTrack.db") + .Options; + + using (HeartTrackContext db = new TrainingStubbedContext(options)) { + db.Database.EnsureCreated(); ActivityTests(db); DataSourceTests(db); @@ -25,7 +32,7 @@ class Program Console.WriteLine($"Une erreur s'est produite : {ex.Message}"); } } - static void ActivityTests(LibraryContext db) + static void ActivityTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les activités avec leurs fréquences cardiaques :"); @@ -64,7 +71,7 @@ class Program } } - static void DataSourceTests(LibraryContext db) + static void DataSourceTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les sources de données avec leurs activités :"); @@ -121,7 +128,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void AthleteTests(LibraryContext db) + static void AthleteTests(HeartTrackContext db) { Console.WriteLine("Accès à tous les athlètes avec leurs statistiques :"); @@ -252,7 +259,7 @@ class Program Console.WriteLine("---------------------------------\n"); } - static void FriendshipTests(LibraryContext db) + static void FriendshipTests(HeartTrackContext db) { Console.WriteLine("Accès à toutes les amitiés :"); diff --git a/src/Tests/ConsoleTestRelationships/uca.HeartTrack.db b/src/Tests/ConsoleTestRelationships/uca.HeartTrack.db deleted file mode 100644 index 8625b454be3624c5c5fa7eac2746af23e068bcc2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118784 zcmeI5U2GiJb;oD+Yq%?sW7(2dw8Ch(juLGxD*Hi-7Ufi0E|=1pV$R?Cc~pzczpusN`S(Y^ePoq;FZu@eX84^D&;Kgu zRD}N)2s~I#aLLoB*@xSzc(Wx{RZ*3@s@$-5juh8Rg<46d73P;qLdp(L31<@mZK-n8 z5mv6$N>@wkLS?lkR5q5Eh2m~sym{tt(R8{>o!K?8$66705)VD15Rxyn^Lb#+`{l$CJz7>0>B}RrWOa&VWb)tL?(G)!-F302cJ$)` z-1V#%Sp4CaV_b4#g8jx3-MI=4RlY+`WqosQXR?BAC!(gsJY%rpd0T;gOsCQP+VcYw~u$iKTXPi0~F&@2HDXE4cZ%E-JEkQzpQB{*AvLL2qFEdL*hP?WU+S z7o~$$d zKyyll5UZV@(iqaIS$$A&1LJHSsN1tV#IDBu&h0nq^?a+Womjsp_5QAwXLogV$=vm| zFEYAY1B}+&zIrvvB~P7Vzh<=EW_ir7n5S|XUA?nzSs`8{3{)*E;(j%2qbn(GF{qL( zi(R!6C|#75VdB!ZD7XAO?W(jJP%W3G_NKb!?}x*#@Ycj`_ijfaBL!U~tlpZJ6-~8Y zgmSmo5gR1*f;FpB-=Hqvr7Ko{S28cs`lo&Lp0pN;C7*eQy`eYLW=r3dZuhi{8qZpJ_H@9#xino@m%!%0nNA3*8#QRm6~xoL0*u+nKt z0baJINDaA5*RdXVN~G^?uv~I>mc3urOIoj&7FXm=Y6B^9_ZkgoI?A4JV8~s5-#9i3 zTczeRF0b>V2+-r8V*25l(rNY@>UBvm%H`6UNS8ygN`huj3v=KrI- zNaKJ0ZT?UB*Ju|T2!H?xfB*=900@8p2!H?xfB*=9z=tJ}ibk2qr@87jJvMn)R2y4` zot>5>yrAt~{;8pDB0_P-9dQpA(V zsBFt^ORSCmIsTgr|KI#S^FOA00B`YsPKVe)00ck)1V8`;KmY_l00ck)1V8`;{{IP# za^cgg{id?$(O7tbttleC@uj^P9gULEesx;(u}Js~>wHC3^k|r(TkkvJ#zNsqw*NMU z=n*!2iZx$J64mGb$G*z&Z;kyOf0I8>yVyVg1V8`;KmY_l00ck)1V8`;K;WY$P^1Cq z6Hg>(d6u1+9ATFwiT>u5UPHR6eVlJe(iLe}+@>k>^Nr5-O6W^l61~PapUY-1Ud&Eq zw7+mAG|D8CCob|FdwOytUfq_}E&bzpu`Rt!|L40}5GkTpp&E)7FaP?MzCG8K8uVt= z>6r_paK=!$9I^GCnjB%~mCoI^{!wVRMUno`-_(Mf8C$&keqP_^RH>_GG8xjAH?*yV zN15^Q6PGA=6O(afh1LPcZR3+(x!T&H|MS}70NJH*xFKQUf(+V>_yU;Gc-QW zYS2#1kjAG;<3dNGzvnw!?U(8Qe6!<5cKL%JXxk5$cFcEZW^;Mcl`(Yb^Z%pYVfgQj z{*teberN21u|FBBeAH%!J`ex_5C8!X009sH0T2KI5CDPU1g=MpF{dW!=UO=0Mn>2X zmVH5Ny+V_~+9Tci2rieMnagD8FMDAwlbxHHiCRm$gT9Z4qt`r#33q;PbT&mJv$?4pZJM(DbS^(PlbM@&c7LVO@C&hH z%!FHMu_bTcbWq66Qf~7^A$#!LMj{*0W6Zc)@io~AH=E1M&P~ryelr&j3W3yyJ^78t zt9RvXT6C{jEkBjbO=UAieu*wwFLxliHP&OZcznIr))oZlTIp7Zu2si-a0=S^KgKs0 z{$KbX@PEyJi~kB8U;_aV009sH0T2KI5C8!X009sH0TB4G1Wv{xY&;*;76lk{?t*^5 zhHfZ~MDU z@RJW)K*R?D5C8!X009sH0T2KI5C8!X009vAZ4l7zIIz(eN4FQ)a44!Dh9WV#alnSc z`cWiA_a5SLdNzUH|3CINLvQ|z@(=iV+QkL}AOHd&00JNY0w4eaAOHd&00JLJ0#~9O zvyqSU?2S%O*b?tZf+)15yF$C8%D3c(sLGwTpmv1DmehEq|0sfx&CO-C2Pg8;OCgR~ z%8v|a5Y?@gq)N_{_2v7y3j(d*r<12M`OxJE$5eezZi=cXbUQtz;ZmSKwUNyU^h5zY zurQO!Mt(QUF<;L!Y34p)k|LEgrV&n+~KmY_l00ck)1V8`;KmY_l00a&xfu}+v3>ylC zCfVnh`^?{lUZgt{`tt$VY-l`6G7?U*UurYoW4~|Qw9p>#k31EzPMc$1XWkC|zVYxs zy;~s@J{dMoi!XeI`J2#ZNkp$2$W7%lCs|9fw9CB3{*RuP_8x+qG5()q_#g3;{CD|X ze&vwzM7BWy1V8`;KmY_l00ck)1V8`;K;Sna@H;e4pFG8J3~P+SwUM^@uEZXzs z`h_IDw({X+RlM1ftY0p)zK<5yONClVs1@dyOG3&DP6=ld0&S^svmaEh)Jj)N>q2F< zCR8?-mxbbLrCM7rP`Hp3hOt7rP2+duu)qrS16g4Ql)mz&`LjnD5Zp2 z=|xgxDzhX~x1q>8+CmX40;OaMmuUfs+H2COl<8&fsmq=A<`D6sBsJ&7#w&wriyg7C zRc@vPZvl;Douyptm$GjDZe!g(eQ|ZYRK8l#OMNzF1*a*qi>38arC6#8Df1-aOK7cw zw6Izc7D~${GDNXZEfy9^iS&cj1eZL0ntiyf8_xcbNqgsr+jMrg!*-4^Z`r)Yb41<)Sd4sZHcVpXZv7>G8rG( zyfz2hz77p;3-<*Fu`yZn^KmYD<_!CAQn#q{cS4=}3AbIHB8O@9;6a!5n$>;wewJO4 zx?QrKRYg2iGqBQX%zESyULP~7?S`@`wHpCit5UluDF-%>vplwi`a0YOvcnHzAHO>I z>Nv+Gr>5A~CEa3+6)?4h*59i#a*Tn`GJ7vTfMkYnr z6*bWFoy`_C&V!k8I>T8rJtI%&1ZVPT-)7LO&o+iL<8E^}B#&m0N6Cmu*)J!C=+Uy0 zNM9a_C96{`Ba{E`c5k<2RjP|UwWA*o;I3!Az~T?T9OJZ}`5Q-c=dykz*!t$&&SVAK zPDI^@xvFrm;(1$veoUv){d(rw-cCS84Rkca4{P#vz=@@HbBOTPt&XBDO0D4Lmb9Cq(p-@4$oc|QeZwgT3Y#!*U#_|xm8aouY z>rP*AkecILW$ncJMXC39wNkm0bjjSQ_C-`N=#t6+lS(JjuU?IE$y2A;uNiH(nQikc z=BZr9>SAZzvO>H@7^qrS#Qkd4MpshWVo)Vn7Q1RCP`W59!^EX+QEvHn+Ex0cHGj#n z)ZSFL{QYp)72cZp+hzV*$sW?`t$A6|RQp}vm%I9f@rU(pdl2CDTLZtteH^krQ1F2qQ-L=b@`P?cvdt2IXW|aZ!^p#Cnwnl!rmN zd6U{eirl>>ch!!v=NlMum)|#zjlx!`S={AyUK9a(98}CEeNE{!dkyuvq!{ILX-%Zd zp;+>z*`VIvH5wf?nDVS8FFaigJsGwX$B&ru-0`cQnLokCnGrp~xEY)|{@l~^qa%O7JjTp3iTfjO zMCFllq21`?p`+|K+0Qcb{PD3@$BvDDYxL~V@B0+N47w*C=aP4q*!!dUBt-c|>u#7yMw>TCgU(2rw`Izeh0=?(Jm681NNH1T)=YR%LfY-z!Q7?N zohP{DrBm#^6P_ZvZu^;qcrqxnuE?(JXvy|(m(lH{boX&C`GpDg-ngBhIql+7V%^d{ zF_@%ZbTdtR0>_)^%g5-h870~`q@~3yT7UNEcyNk#+`;7fqV#J?o=X;s?AK?Ec_`zK zs$myvNr!P{p5!Nb+{}f!j$}wo`=*^4r|)`!_k^unbnRSQAwj1&?-JAG=g{mp?){PR z2XjTUp;mG}8StMS9g?7x8SC3we)qJ;U{>67AEsP$S-bkCeAbfq&%p$n*q717AGedLqvM0(?~SW+$q-DDlcI6Fl6#A{bZx#ZFk`}Mnn4nNpNx-<=n z9~ZYa65Msb8Dk)GR2}@<<-v5d zSw*LlIkg(;T5_Lm$U6n-m!!+D%%nbo%HWevXHeaFFhIvsEr!N**Jfu_qZE3GUxiMj zUmA-gZ!aCFW;pel*xj{bFv78;my9Wi2d$&}8no9xr`HsFy_UT*=JtL&-1hTw(-F4c zT&g3g(;@xVDHK}6mI4N^H`sRyetsu-8h@V^hQpU9T2~0#6qOf*Z{@LRI40-KtAN3Y zO^0^3TUi3LVpvxkzU}RU3rF-7DOf9d$kvL|_5bT1gSDc~r?_OEu3DqkrLxt%TWe&k z*~v;n}~lQaN0;}`%q8_c@3#?TpfY9LXk)IP;X)+y3bwiKq)x05u~p@P~& zoxv8t(Y!u2kf>jDBTZYP7q#E0r0N|8xTY8wh{^2!H?xfB*=900@8p2!H?xfWRl1Ktd}U#{ZvS3!`Wt00JNY0w4ea zAOHd&00JNY0w7>K|BvxMJOKni00ck)1V8`;KmY_l00ck)1U}gWF#rF_wl7Kt0w4ea zAOHd&00JNY0w4eaAOHdy0d4%x@qf?oAMpRn|0n+o{$2i`=nxwSfB*=900@8p2!H?x zfB*=900@A51V8`;KmY_l00ck)1V8`;K)@uR-2;di_W=Cg|MxR({Qpb-J^ttX&p-_XKmY_l z00ck)1V8`;KmY_l00cnbFcQ#z3P2zJNA%%;IIJ%U!2JJVG$!&40w4eaAOHd&00JNY z0w4eaAOHeE1p4#;VgLDmtp5)}hj0)80T2KI5C8!X009sH0T2KI5I8gh^aTJR{Vsq$ O^&i%s|Bq_V|NkHM{7Rz$