diff --git a/src/Web/Features/Contents/Data/ContentDbContext.cs b/src/Web/Features/Contents/Data/ContentDbContext.cs index 42359d6..8ebc843 100644 --- a/src/Web/Features/Contents/Data/ContentDbContext.cs +++ b/src/Web/Features/Contents/Data/ContentDbContext.cs @@ -54,7 +54,7 @@ public class ContentDbContext( modelBuilder .Entity() - .OwnsOne(x => x.StoredDataUrls) - .ToTable(nameof(StoredDataUrls)); + .OwnsOne(x => x.Images) + .ToTable(nameof(Images)); } } diff --git a/src/Web/Features/Contents/Data/Creator.cs b/src/Web/Features/Contents/Data/Creator.cs index a96d484..689b1d8 100644 --- a/src/Web/Features/Contents/Data/Creator.cs +++ b/src/Web/Features/Contents/Data/Creator.cs @@ -12,7 +12,7 @@ public class Creator public About About { get; set; } = new(); public Socials Socials { get; set; } = new(); public ProfileColors ProfileColors { get; set; } = new(); - public StoredDataUrls StoredDataUrls { get; set; } = new(); + public Images Images { get; set; } = new(); } public class About @@ -41,8 +41,8 @@ public class Socials [MaxLength(255)] public string? WebsiteUrl { get; set; } } -public class StoredDataUrls +public class Images { - [MaxLength(255)] public string? BannerPictureUrl { get; set; } - [MaxLength(255)] public string? ProfilePictureUrl { get; set; } + [MaxLength(255)] public string? Banner { get; set; } + [MaxLength(255)] public string? Logo { get; set; } } diff --git a/src/Web/Features/Contents/Handlers/ChangeBanner.cs b/src/Web/Features/Contents/Handlers/ChangeBanner.cs index 9121288..0a4f8d8 100644 --- a/src/Web/Features/Contents/Handlers/ChangeBanner.cs +++ b/src/Web/Features/Contents/Handlers/ChangeBanner.cs @@ -27,7 +27,7 @@ public class ChangeBannerHandler( { var creator = await context .Creators - .Include(c => c.StoredDataUrls) + .Include(c => c.Images) .SingleOrDefaultAsync( c => c.Id == request.CreatorId, cancellationToken: ct); @@ -46,7 +46,7 @@ public class ChangeBannerHandler( request.File.ContentType, ct); - creator.StoredDataUrls.BannerPictureUrl = blobUrl; + creator.Images.Banner = blobUrl; await context.SaveChangesAsync(ct); diff --git a/src/Web/Features/Contents/Handlers/ChangeLogo.cs b/src/Web/Features/Contents/Handlers/ChangeLogo.cs index e491277..4fda059 100644 --- a/src/Web/Features/Contents/Handlers/ChangeLogo.cs +++ b/src/Web/Features/Contents/Handlers/ChangeLogo.cs @@ -27,7 +27,7 @@ public class ChangeLogoHandler( { var creator = await context .Creators - .Include(c => c.StoredDataUrls) + .Include(c => c.Images) .SingleOrDefaultAsync( c => c.Id == request.CreatorId, cancellationToken: ct); @@ -46,7 +46,7 @@ public class ChangeLogoHandler( request.File.ContentType, ct); - creator.StoredDataUrls.ProfilePictureUrl = blobUrl; + creator.Images.Logo = blobUrl; await context.SaveChangesAsync(ct); diff --git a/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs b/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs index 30ed02a..fe5d8e5 100644 --- a/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs +++ b/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs @@ -63,7 +63,7 @@ public class GetCreatorByAliasHandler( About = creator.About, Socials = creator.Socials, ProfileColors = creator.ProfileColors, - StoredDataUrls = creator.StoredDataUrls, + Images = creator.Images, SubscriberCount = subscriberCount, }; diff --git a/src/Web/Features/Contents/Handlers/GetSubscriptions.cs b/src/Web/Features/Contents/Handlers/GetSubscriptions.cs index 1f5690c..035cb87 100644 --- a/src/Web/Features/Contents/Handlers/GetSubscriptions.cs +++ b/src/Web/Features/Contents/Handlers/GetSubscriptions.cs @@ -27,7 +27,7 @@ public class GetSubscriptionsHandler( .Select(s => new SubscriptionModel( s.CreatorId, s.Creator!.Name, - s.Creator.StoredDataUrls.ProfilePictureUrl)) + s.Creator.Images.Logo)) .ToListAsync(cancellationToken: ct); await SendOkAsync(subscriptions, ct); diff --git a/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs b/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs index b43bcfe..e59db4e 100644 --- a/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs +++ b/src/Web/Features/Contents/Handlers/Models/CreatorModel.cs @@ -11,6 +11,6 @@ public class CreatorModel public About About { get; set; } public Socials Socials { get; set; } public ProfileColors ProfileColors { get; set; } - public StoredDataUrls StoredDataUrls { get; set; } + public Images Images { get; set; } public int SubscriberCount { get; set; } } diff --git a/src/Web/Features/Contents/Handlers/SubscribeToCreator.cs b/src/Web/Features/Contents/Handlers/SubscribeToCreator.cs index eb20946..9c37d3b 100644 --- a/src/Web/Features/Contents/Handlers/SubscribeToCreator.cs +++ b/src/Web/Features/Contents/Handlers/SubscribeToCreator.cs @@ -38,7 +38,7 @@ public sealed class SubscribeToCreatorHandler( .Select(c => new SubscriptionModel( req.CreatorId, c.Name, - c.StoredDataUrls.ProfilePictureUrl + c.Images.Logo )) .FirstOrDefaultAsync(cancellationToken: ct); diff --git a/src/Web/Features/Contents/Migrations/20240806041040_Initial.Designer.cs b/src/Web/Features/Contents/Migrations/20240806041040_Initial.Designer.cs deleted file mode 100644 index 154bd64..0000000 --- a/src/Web/Features/Contents/Migrations/20240806041040_Initial.Designer.cs +++ /dev/null @@ -1,258 +0,0 @@ -// -using System; -using Hutopy.Web.Features.Contents.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Hutopy.Web.Features.Contents.Migrations -{ - [DbContext(typeof(ContentDbContext))] - [Migration("20240806041040_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Content") - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("CURRENT_TIMESTAMP"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urls") - .HasColumnType("text[]"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.ToTable("Contents", "Content"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.HasKey("Id"); - - b.ToTable("Creators", "Content"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b => - { - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatorId") - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.HasKey("CreatedBy", "CreatorId"); - - b.HasIndex("CreatorId"); - - b.ToTable("Subscriptions", "Content"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b => - { - b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Creator"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b => - { - b.OwnsOne("Hutopy.Web.Features.Contents.Data.About", "About", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("Description") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b1.Property("Title") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("Creators", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.OwnsOne("Hutopy.Web.Features.Contents.Data.ProfileColors", "ProfileColors", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("Accent") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("BannerBottom") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("BannerTop") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("Menu") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("ProfileColors", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("FacebookUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("InstagramUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("LinkedInUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("RedditUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("TikTokUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("WebsiteUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("XUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("YoutubeUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("Socials", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.OwnsOne("Hutopy.Web.Features.Contents.Data.StoredDataUrls", "StoredDataUrls", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("BannerPictureUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("ProfilePictureUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("StoredDataUrls", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.Navigation("About") - .IsRequired(); - - b.Navigation("ProfileColors") - .IsRequired(); - - b.Navigation("Socials") - .IsRequired(); - - b.Navigation("StoredDataUrls") - .IsRequired(); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b => - { - b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator") - .WithMany() - .HasForeignKey("CreatorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Creator"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Web/Features/Contents/Migrations/20240806041040_Initial.cs b/src/Web/Features/Contents/Migrations/20240806041040_Initial.cs deleted file mode 100644 index ab8d098..0000000 --- a/src/Web/Features/Contents/Migrations/20240806041040_Initial.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Hutopy.Web.Features.Contents.Migrations -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "Content"); - - migrationBuilder.CreateTable( - name: "Creators", - schema: "Content", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - CreatedBy = table.Column(type: "uuid", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - Name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), - About_Title = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - About_Description = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Creators", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Contents", - schema: "Content", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - CreatedBy = table.Column(type: "uuid", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"), - Title = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), - Description = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), - Urls = table.Column(type: "text[]", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Contents", x => x.Id); - table.ForeignKey( - name: "FK_Contents_Creators_CreatedBy", - column: x => x.CreatedBy, - principalSchema: "Content", - principalTable: "Creators", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ProfileColors", - schema: "Content", - columns: table => new - { - CreatorId = table.Column(type: "uuid", nullable: false), - BannerTop = table.Column(type: "character varying(9)", maxLength: 9, nullable: true), - BannerBottom = table.Column(type: "character varying(9)", maxLength: 9, nullable: true), - Accent = table.Column(type: "character varying(9)", maxLength: 9, nullable: true), - Menu = table.Column(type: "character varying(9)", maxLength: 9, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProfileColors", x => x.CreatorId); - table.ForeignKey( - name: "FK_ProfileColors_Creators_CreatorId", - column: x => x.CreatorId, - principalSchema: "Content", - principalTable: "Creators", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Socials", - schema: "Content", - columns: table => new - { - CreatorId = table.Column(type: "uuid", nullable: false), - FacebookUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - InstagramUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - XUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - LinkedInUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - TikTokUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - YoutubeUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - RedditUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - WebsiteUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Socials", x => x.CreatorId); - table.ForeignKey( - name: "FK_Socials_Creators_CreatorId", - column: x => x.CreatorId, - principalSchema: "Content", - principalTable: "Creators", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "StoredDataUrls", - schema: "Content", - columns: table => new - { - CreatorId = table.Column(type: "uuid", nullable: false), - BannerPictureUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true), - ProfilePictureUrl = table.Column(type: "character varying(255)", maxLength: 255, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_StoredDataUrls", x => x.CreatorId); - table.ForeignKey( - name: "FK_StoredDataUrls_Creators_CreatorId", - column: x => x.CreatorId, - principalSchema: "Content", - principalTable: "Creators", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Subscriptions", - schema: "Content", - columns: table => new - { - CreatedBy = table.Column(type: "uuid", nullable: false), - CreatorId = table.Column(type: "uuid", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Subscriptions", x => new { x.CreatedBy, x.CreatorId }); - table.ForeignKey( - name: "FK_Subscriptions_Creators_CreatorId", - column: x => x.CreatorId, - principalSchema: "Content", - principalTable: "Creators", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Contents_CreatedBy", - schema: "Content", - table: "Contents", - column: "CreatedBy"); - - migrationBuilder.CreateIndex( - name: "IX_Subscriptions_CreatorId", - schema: "Content", - table: "Subscriptions", - column: "CreatorId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Contents", - schema: "Content"); - - migrationBuilder.DropTable( - name: "ProfileColors", - schema: "Content"); - - migrationBuilder.DropTable( - name: "Socials", - schema: "Content"); - - migrationBuilder.DropTable( - name: "StoredDataUrls", - schema: "Content"); - - migrationBuilder.DropTable( - name: "Subscriptions", - schema: "Content"); - - migrationBuilder.DropTable( - name: "Creators", - schema: "Content"); - } - } -} diff --git a/src/Web/Features/Contents/Migrations/ContentDbContextModelSnapshot.cs b/src/Web/Features/Contents/Migrations/ContentDbContextModelSnapshot.cs deleted file mode 100644 index 09fb617..0000000 --- a/src/Web/Features/Contents/Migrations/ContentDbContextModelSnapshot.cs +++ /dev/null @@ -1,255 +0,0 @@ -// -using System; -using Hutopy.Web.Features.Contents.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Hutopy.Web.Features.Contents.Migrations -{ - [DbContext(typeof(ContentDbContext))] - partial class ContentDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("Content") - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("CURRENT_TIMESTAMP"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Urls") - .HasColumnType("text[]"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.ToTable("Contents", "Content"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.HasKey("Id"); - - b.ToTable("Creators", "Content"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b => - { - b.Property("CreatedBy") - .HasColumnType("uuid"); - - b.Property("CreatorId") - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.HasKey("CreatedBy", "CreatorId"); - - b.HasIndex("CreatorId"); - - b.ToTable("Subscriptions", "Content"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b => - { - b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Creator"); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b => - { - b.OwnsOne("Hutopy.Web.Features.Contents.Data.About", "About", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("Description") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b1.Property("Title") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("Creators", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.OwnsOne("Hutopy.Web.Features.Contents.Data.ProfileColors", "ProfileColors", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("Accent") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("BannerBottom") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("BannerTop") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("Menu") - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("ProfileColors", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("FacebookUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("InstagramUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("LinkedInUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("RedditUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("TikTokUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("WebsiteUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("XUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("YoutubeUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("Socials", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.OwnsOne("Hutopy.Web.Features.Contents.Data.StoredDataUrls", "StoredDataUrls", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("BannerPictureUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.Property("ProfilePictureUrl") - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("StoredDataUrls", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - - b.Navigation("About") - .IsRequired(); - - b.Navigation("ProfileColors") - .IsRequired(); - - b.Navigation("Socials") - .IsRequired(); - - b.Navigation("StoredDataUrls") - .IsRequired(); - }); - - modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b => - { - b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator") - .WithMany() - .HasForeignKey("CreatorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Creator"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Web/TestDataSeeder.cs b/src/Web/TestDataSeeder.cs index 105fb29..f1b3189 100644 --- a/src/Web/TestDataSeeder.cs +++ b/src/Web/TestDataSeeder.cs @@ -43,7 +43,7 @@ internal class TestDataSeeder( { var creatorUser = await CreateUserAsync( creator.Name, - creator.StoredDataUrls.ProfilePictureUrl, + creator.Images.Logo, Roles.Creator); creator.Id = creatorUser.Id; @@ -200,10 +200,10 @@ internal class TestDataSeeder( FacebookUrl = "https://www.facebook.com/Hutopy", InstagramUrl = "https://www.instagram.com/hutopy.inc/" }, - StoredDataUrls = new() + Images = new() { - BannerPictureUrl = "/images/usersmedia/HutopyProfile/banners/banner01.png", - ProfilePictureUrl = "/images/usersmedia/HutopyProfile/profilepictures/profileHutopyProfile01.png" + Banner = "/images/usersmedia/HutopyProfile/banners/banner01.png", + Logo = "/images/usersmedia/HutopyProfile/profilepictures/profileHutopyProfile01.png" } }; @@ -227,10 +227,10 @@ internal class TestDataSeeder( LinkedInUrl = "https://www.linkedin.com/in/mickael-simard-96079a90/", WebsiteUrl = "https://www.arps.ca/" }, - StoredDataUrls = new() + Images = new() { - BannerPictureUrl = "/images/usersmedia/ARPS/banners/bannerARPS01.png", - ProfilePictureUrl = "/images/usersmedia/ARPS/profilepictures/profileARPS.png" + Banner = "/images/usersmedia/ARPS/banners/bannerARPS01.png", + Logo = "/images/usersmedia/ARPS/profilepictures/profileARPS.png" } }; @@ -252,10 +252,10 @@ internal class TestDataSeeder( FacebookUrl = "https://www.facebook.com/chloegestionmedias", InstagramUrl = "https://www.instagram.com/chloe.photo_gms", }, - StoredDataUrls = new() + Images = new() { - BannerPictureUrl = "/images/usersmedia/chloebeaugrand/banners/bannerChloeBeaugrand01.png", - ProfilePictureUrl = "/images/usersmedia/chloebeaugrand/profilepictures/profileChloeBeaugrand01.png" + Banner = "/images/usersmedia/chloebeaugrand/banners/bannerChloeBeaugrand01.png", + Logo = "/images/usersmedia/chloebeaugrand/profilepictures/profileChloeBeaugrand01.png" } }; @@ -279,10 +279,10 @@ internal class TestDataSeeder( InstagramUrl = "https://www.instagram.com/guillaumeaime/", TikTokUrl = "https://www.tiktok.com/@guillaumeaime" }, - StoredDataUrls = new() + Images = new() { - BannerPictureUrl = "/images/usersmedia/guillaumeMousseau/banners/bannerGuillaumeMousseau01.png", - ProfilePictureUrl = + Banner = "/images/usersmedia/guillaumeMousseau/banners/bannerGuillaumeMousseau01.png", + Logo = "/images/usersmedia/guillaumeMousseau/profilepictures/profileGuillaumeMousseau01.png" } }; @@ -307,10 +307,10 @@ internal class TestDataSeeder( InstagramUrl = "https://www.instagram.com/guillaumeaime/", WebsiteUrl = "https://fondationleffet.ca/" }, - StoredDataUrls = new() + Images = new() { - BannerPictureUrl = "/images/usersmedia/leffet/banners/banner02.png", - ProfilePictureUrl = "/images/usersmedia/leffet/profilepictures/leffetProfile01.png" + Banner = "/images/usersmedia/leffet/banners/banner02.png", + Logo = "/images/usersmedia/leffet/profilepictures/leffetProfile01.png" } }; @@ -333,10 +333,10 @@ internal class TestDataSeeder( FacebookUrl = "https://www.facebook.com/MathieuCaronPro/", YoutubeUrl = "https://www.youtube.com/@lesinterviewsatypiquesdema4692", }, - StoredDataUrls = new() + Images = new() { - BannerPictureUrl = "/images/usersmedia/mathieuCaron/banners/bannerMathieuCaron01.png", - ProfilePictureUrl = "/images/usersmedia/mathieuCaron/profilepictures/profileMathieuCaron01.png" + Banner = "/images/usersmedia/mathieuCaron/banners/bannerMathieuCaron01.png", + Logo = "/images/usersmedia/mathieuCaron/profilepictures/profileMathieuCaron01.png" } };