diff --git a/src/Web/Features/Contents/Data/ContentDbContext.cs b/src/Web/Features/Contents/Data/ContentDbContext.cs index 29860e4..42359d6 100644 --- a/src/Web/Features/Contents/Data/ContentDbContext.cs +++ b/src/Web/Features/Contents/Data/ContentDbContext.cs @@ -44,8 +44,8 @@ public class ContentDbContext( modelBuilder .Entity() - .OwnsOne(x => x.SocialNetworks) - .ToTable(nameof(SocialNetworks)); + .OwnsOne(x => x.Socials) + .ToTable(nameof(Socials)); modelBuilder .Entity() diff --git a/src/Web/Features/Contents/Data/Creator.cs b/src/Web/Features/Contents/Data/Creator.cs index d0b0b37..a96d484 100644 --- a/src/Web/Features/Contents/Data/Creator.cs +++ b/src/Web/Features/Contents/Data/Creator.cs @@ -10,7 +10,7 @@ public class Creator [MaxLength(255)] public string Name { get; set; } = null!; public About About { get; set; } = new(); - public SocialNetworks SocialNetworks { get; set; } = new(); + public Socials Socials { get; set; } = new(); public ProfileColors ProfileColors { get; set; } = new(); public StoredDataUrls StoredDataUrls { get; set; } = new(); } @@ -29,7 +29,7 @@ public class ProfileColors [MaxLength(9)] public string? Menu { get; set; } } -public class SocialNetworks +public class Socials { [MaxLength(255)] public string? FacebookUrl { get; set; } [MaxLength(255)] public string? InstagramUrl { get; set; } diff --git a/src/Web/Features/Contents/Handlers/ChangeSocials.cs b/src/Web/Features/Contents/Handlers/ChangeSocials.cs index cbb7bf0..62d6848 100644 --- a/src/Web/Features/Contents/Handlers/ChangeSocials.cs +++ b/src/Web/Features/Contents/Handlers/ChangeSocials.cs @@ -34,14 +34,14 @@ public class ChangeSocialsHandler( c => c.Id == request.CreatorId, cancellationToken: ct); - creator.SocialNetworks.FacebookUrl = request.FacebookUrl; - creator.SocialNetworks.InstagramUrl = request.InstagramUrl; - creator.SocialNetworks.XUrl = request.XUrl; - creator.SocialNetworks.LinkedInUrl = request.LinkedInUrl; - creator.SocialNetworks.TikTokUrl = request.TikTokUrl; - creator.SocialNetworks.YoutubeUrl = request.YoutubeUrl; - creator.SocialNetworks.RedditUrl = request.RedditUrl; - creator.SocialNetworks.WebsiteUrl = request.WebsiteUrl; + creator.Socials.FacebookUrl = request.FacebookUrl; + creator.Socials.InstagramUrl = request.InstagramUrl; + creator.Socials.XUrl = request.XUrl; + creator.Socials.LinkedInUrl = request.LinkedInUrl; + creator.Socials.TikTokUrl = request.TikTokUrl; + creator.Socials.YoutubeUrl = request.YoutubeUrl; + creator.Socials.RedditUrl = request.RedditUrl; + creator.Socials.WebsiteUrl = request.WebsiteUrl; await context.SaveChangesAsync(ct); diff --git a/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs b/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs index cc3a677..30ed02a 100644 --- a/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs +++ b/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs @@ -61,7 +61,7 @@ public class GetCreatorByAliasHandler( CreatedAt = creator.CreatedAt, Name = creator.Name, About = creator.About, - SocialNetworks = creator.SocialNetworks, + Socials = creator.Socials, ProfileColors = creator.ProfileColors, StoredDataUrls = creator.StoredDataUrls, SubscriberCount = subscriberCount, diff --git a/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs b/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs index 90492e5..b43bcfe 100644 --- a/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs +++ b/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs @@ -9,7 +9,7 @@ public class CreatorModel public DateTimeOffset CreatedAt { get; set; } public string Name { get; set; } public About About { get; set; } - public SocialNetworks SocialNetworks { get; set; } + public Socials Socials { get; set; } public ProfileColors ProfileColors { get; set; } public StoredDataUrls StoredDataUrls { get; set; } public int SubscriberCount { get; set; } diff --git a/src/Web/Features/Contents/Migrations/20240805012309_Initial.Designer.cs b/src/Web/Features/Contents/Migrations/20240806041040_Initial.Designer.cs similarity index 97% rename from src/Web/Features/Contents/Migrations/20240805012309_Initial.Designer.cs rename to src/Web/Features/Contents/Migrations/20240806041040_Initial.Designer.cs index 25a08d7..154bd64 100644 --- a/src/Web/Features/Contents/Migrations/20240805012309_Initial.Designer.cs +++ b/src/Web/Features/Contents/Migrations/20240806041040_Initial.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Hutopy.Web.Features.Contents.Migrations { [DbContext(typeof(ContentDbContext))] - [Migration("20240805012309_Initial")] + [Migration("20240806041040_Initial")] partial class Initial { /// @@ -163,7 +163,7 @@ namespace Hutopy.Web.Features.Contents.Migrations .HasForeignKey("CreatorId"); }); - b.OwnsOne("Hutopy.Web.Features.Contents.Data.SocialNetworks", "SocialNetworks", b1 => + b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 => { b1.Property("CreatorId") .HasColumnType("uuid"); @@ -202,7 +202,7 @@ namespace Hutopy.Web.Features.Contents.Migrations b1.HasKey("CreatorId"); - b1.ToTable("SocialNetworks", "Content"); + b1.ToTable("Socials", "Content"); b1.WithOwner() .HasForeignKey("CreatorId"); @@ -235,7 +235,7 @@ namespace Hutopy.Web.Features.Contents.Migrations b.Navigation("ProfileColors") .IsRequired(); - b.Navigation("SocialNetworks") + b.Navigation("Socials") .IsRequired(); b.Navigation("StoredDataUrls") diff --git a/src/Web/Features/Contents/Migrations/20240805012309_Initial.cs b/src/Web/Features/Contents/Migrations/20240806041040_Initial.cs similarity index 97% rename from src/Web/Features/Contents/Migrations/20240805012309_Initial.cs rename to src/Web/Features/Contents/Migrations/20240806041040_Initial.cs index bb3198d..ab8d098 100644 --- a/src/Web/Features/Contents/Migrations/20240805012309_Initial.cs +++ b/src/Web/Features/Contents/Migrations/20240806041040_Initial.cs @@ -79,7 +79,7 @@ namespace Hutopy.Web.Features.Contents.Migrations }); migrationBuilder.CreateTable( - name: "SocialNetworks", + name: "Socials", schema: "Content", columns: table => new { @@ -95,9 +95,9 @@ namespace Hutopy.Web.Features.Contents.Migrations }, constraints: table => { - table.PrimaryKey("PK_SocialNetworks", x => x.CreatorId); + table.PrimaryKey("PK_Socials", x => x.CreatorId); table.ForeignKey( - name: "FK_SocialNetworks_Creators_CreatorId", + name: "FK_Socials_Creators_CreatorId", column: x => x.CreatorId, principalSchema: "Content", principalTable: "Creators", @@ -172,7 +172,7 @@ namespace Hutopy.Web.Features.Contents.Migrations schema: "Content"); migrationBuilder.DropTable( - name: "SocialNetworks", + name: "Socials", schema: "Content"); migrationBuilder.DropTable( diff --git a/src/Web/Features/Contents/Migrations/ContentDbContextModelSnapshot.cs b/src/Web/Features/Contents/Migrations/ContentDbContextModelSnapshot.cs index 2904a21..09fb617 100644 --- a/src/Web/Features/Contents/Migrations/ContentDbContextModelSnapshot.cs +++ b/src/Web/Features/Contents/Migrations/ContentDbContextModelSnapshot.cs @@ -160,7 +160,7 @@ namespace Hutopy.Web.Features.Contents.Migrations .HasForeignKey("CreatorId"); }); - b.OwnsOne("Hutopy.Web.Features.Contents.Data.SocialNetworks", "SocialNetworks", b1 => + b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 => { b1.Property("CreatorId") .HasColumnType("uuid"); @@ -199,7 +199,7 @@ namespace Hutopy.Web.Features.Contents.Migrations b1.HasKey("CreatorId"); - b1.ToTable("SocialNetworks", "Content"); + b1.ToTable("Socials", "Content"); b1.WithOwner() .HasForeignKey("CreatorId"); @@ -232,7 +232,7 @@ namespace Hutopy.Web.Features.Contents.Migrations b.Navigation("ProfileColors") .IsRequired(); - b.Navigation("SocialNetworks") + b.Navigation("Socials") .IsRequired(); b.Navigation("StoredDataUrls") diff --git a/src/Web/TestDataSeeder.cs b/src/Web/TestDataSeeder.cs index 1b23093..105fb29 100644 --- a/src/Web/TestDataSeeder.cs +++ b/src/Web/TestDataSeeder.cs @@ -193,7 +193,7 @@ internal class TestDataSeeder( { BannerTop = "#A30E79", BannerBottom = "#6B0065", Accent = "#23393B", Menu = "#53B93B", }, - SocialNetworks = + Socials = new() { XUrl = "https://twitter.com/Hutopyinc", @@ -218,7 +218,7 @@ internal class TestDataSeeder( }, ProfileColors = new() { BannerTop = "#231F20", BannerBottom = "#231F20", Accent = "#272526", Menu = "#FFFFFF" }, - SocialNetworks = new() + Socials = new() { FacebookUrl = "https://www.facebook.com/arps.company", InstagramUrl = "https://www.instagram.com/arps.co/", @@ -246,7 +246,7 @@ internal class TestDataSeeder( { BannerTop = "#231F20", BannerBottom = "#272526", Accent = "#231F20", Menu = "#231F20", }, - SocialNetworks = + Socials = new() { FacebookUrl = "https://www.facebook.com/chloegestionmedias", @@ -272,7 +272,7 @@ internal class TestDataSeeder( { BannerTop = "#0BAAB2", BannerBottom = "#006D77", Accent = "#CC6F91", Menu = "#CC6F91", }, - SocialNetworks = + Socials = new() { FacebookUrl = "https://www.facebook.com/GuillaumeMousseau222", @@ -300,7 +300,7 @@ internal class TestDataSeeder( { BannerTop = "#CC6F91", BannerBottom = "#FBC702", Accent = "#FBC702", Menu = "#FBC702", }, - SocialNetworks = + Socials = new() { FacebookUrl = "https://www.facebook.com/Hutopy", @@ -327,7 +327,7 @@ internal class TestDataSeeder( { BannerTop = "#101B49", BannerBottom = "#698FE7", Accent = "#1D1D1B", Menu = "#1D1D1B", }, - SocialNetworks = + Socials = new() { FacebookUrl = "https://www.facebook.com/MathieuCaronPro/",