diff --git a/Webshop.Infrastructure/Migrations/20250723102855_AddSuppliersAndOtherEntities.Designer.cs b/Webshop.Infrastructure/Migrations/20250723102855_AddSuppliersAndOtherEntities.Designer.cs
deleted file mode 100644
index 65dee36..0000000
--- a/Webshop.Infrastructure/Migrations/20250723102855_AddSuppliersAndOtherEntities.Designer.cs
+++ /dev/null
@@ -1,1220 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-using Webshop.Infrastructure.Data;
-
-#nullable disable
-
-namespace Webshop.Infrastructure.Migrations
-{
- [DbContext(typeof(ApplicationDbContext))]
- [Migration("20250723102855_AddSuppliersAndOtherEntities")]
- partial class AddSuppliersAndOtherEntities
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.18")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("Roles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
-
- b.Property("ClaimType")
- .HasColumnType("text");
-
- b.Property("ClaimValue")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("RoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("PasswordHash")
- .HasColumnType("text");
-
- b.Property("PhoneNumber")
- .HasColumnType("text");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean");
-
- b.Property("SecurityStamp")
- .HasColumnType("text");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("Users", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
-
- b.Property("ClaimType")
- .HasColumnType("text");
-
- b.Property("ClaimValue")
- .HasColumnType("text");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasColumnType("text");
-
- b.Property("ProviderKey")
- .HasColumnType("text");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("text");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("UserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("UserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("LoginProvider")
- .HasColumnType("text");
-
- b.Property("Name")
- .HasColumnType("text");
-
- b.Property("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("UserTokens", (string)null);
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Address", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("AddressType")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("City")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("CompanyName")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("Country")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("CustomerId")
- .HasColumnType("uuid");
-
- b.Property("FirstName")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("LastName")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("PostalCode")
- .IsRequired()
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("State")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("Street")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("Street2")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("CustomerId");
-
- b.ToTable("Addresses");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Category", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("DisplayOrder")
- .HasColumnType("integer");
-
- b.Property("ImageUrl")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("ParentCategoryId")
- .HasColumnType("uuid");
-
- b.Property("Slug")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("ParentCategoryId");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("Categories");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.CategoryDiscount", b =>
- {
- b.Property("CategoryId")
- .HasColumnType("uuid");
-
- b.Property("DiscountId")
- .HasColumnType("uuid");
-
- b.HasKey("CategoryId", "DiscountId");
-
- b.HasIndex("DiscountId");
-
- b.ToTable("CategoryDiscounts");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Customer", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("AspNetUserId")
- .IsRequired()
- .HasMaxLength(450)
- .HasColumnType("character varying(450)");
-
- b.Property("CreatedDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("FirstName")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("LastLoginDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("LastName")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("PhoneNumber")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.HasKey("Id");
-
- b.ToTable("Customers");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Discount", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CouponCode")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CurrentUsageCount")
- .HasColumnType("integer");
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("DiscountType")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("DiscountValue")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("EndDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("MaximumUsageCount")
- .HasColumnType("integer");
-
- b.Property("MinimumOrderAmount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("RequiresCouponCode")
- .HasColumnType("boolean");
-
- b.Property("StartDate")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("CouponCode")
- .IsUnique()
- .HasFilter("\"CouponCode\" IS NOT NULL");
-
- b.ToTable("Discounts");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Order", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("AdminNotes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("BillingAddressId")
- .HasColumnType("uuid");
-
- b.Property("CustomerId")
- .HasColumnType("uuid");
-
- b.Property("CustomerNotes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("DiscountAmount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("GuestEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("GuestPhoneNumber")
- .HasMaxLength(20)
- .HasColumnType("character varying(20)");
-
- b.Property("OrderDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("OrderNumber")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("OrderStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("OrderTotal")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("PaymentMethod")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("PaymentMethodId")
- .HasColumnType("uuid");
-
- b.Property("PaymentStatus")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("ShippingAddressId")
- .HasColumnType("uuid");
-
- b.Property("ShippingCost")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("ShippingMethodId")
- .HasColumnType("uuid");
-
- b.Property("TaxAmount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("TransactionId")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.HasKey("Id");
-
- b.HasIndex("BillingAddressId");
-
- b.HasIndex("CustomerId");
-
- b.HasIndex("OrderNumber")
- .IsUnique();
-
- b.HasIndex("PaymentMethodId");
-
- b.HasIndex("ShippingAddressId");
-
- b.HasIndex("ShippingMethodId");
-
- b.ToTable("Orders");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.OrderItem", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("OrderId")
- .HasColumnType("uuid");
-
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("ProductName")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("ProductSKU")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("ProductVariantId")
- .HasColumnType("uuid");
-
- b.Property("Quantity")
- .HasColumnType("integer");
-
- b.Property("TotalPrice")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("UnitPrice")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.HasKey("Id");
-
- b.HasIndex("OrderId");
-
- b.HasIndex("ProductId");
-
- b.HasIndex("ProductVariantId");
-
- b.ToTable("OrderItems");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.PaymentMethod", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("PaymentGatewayType")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("ProcessingFee")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.HasKey("Id");
-
- b.ToTable("PaymentMethods");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Product", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("CreatedDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
-
- b.Property("Height")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("ImageUrl")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("IsInStock")
- .HasColumnType("boolean");
-
- b.Property("LastModifiedDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Length")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("OldPrice")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("Price")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("PurchasePrice")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("SKU")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("ShortDescription")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property("Slug")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("StockQuantity")
- .HasColumnType("integer");
-
- b.Property("SupplierId")
- .HasColumnType("uuid");
-
- b.Property("Weight")
- .HasPrecision(18, 3)
- .HasColumnType("numeric(18,3)");
-
- b.Property("Width")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.HasKey("Id");
-
- b.HasIndex("SKU")
- .IsUnique();
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.HasIndex("SupplierId");
-
- b.ToTable("Products");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.ProductCategory", b =>
- {
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("CategoryId")
- .HasColumnType("uuid");
-
- b.HasKey("ProductId", "CategoryId");
-
- b.HasIndex("CategoryId");
-
- b.ToTable("ProductCategories");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.ProductDiscount", b =>
- {
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("DiscountId")
- .HasColumnType("uuid");
-
- b.HasKey("ProductId", "DiscountId");
-
- b.HasIndex("DiscountId");
-
- b.ToTable("ProductDiscounts");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.ProductVariant", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("ImageUrl")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("PriceAdjustment")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("SKU")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("StockQuantity")
- .HasColumnType("integer");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.HasKey("Id");
-
- b.HasIndex("ProductId");
-
- b.ToTable("ProductVariants");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Review", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Comment")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("CustomerId")
- .HasColumnType("uuid");
-
- b.Property("IsApproved")
- .HasColumnType("boolean");
-
- b.Property("ProductId")
- .HasColumnType("uuid");
-
- b.Property("Rating")
- .HasColumnType("integer");
-
- b.Property("ReviewDate")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Title")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.HasKey("Id");
-
- b.HasIndex("CustomerId");
-
- b.HasIndex("ProductId");
-
- b.ToTable("Reviews");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Setting", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property("Group")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("Key")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("Value")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.HasKey("Id");
-
- b.HasIndex("Key")
- .IsUnique();
-
- b.ToTable("Settings");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.ShippingMethod", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("BaseCost")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)");
-
- b.Property("EstimatedDeliveryTime")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("IsActive")
- .HasColumnType("boolean");
-
- b.Property("MinimumOrderAmount")
- .HasPrecision(18, 2)
- .HasColumnType("numeric(18,2)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("RequiresTracking")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.ToTable("ShippingMethods");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Supplier", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
-
- b.Property("AddressId")
- .HasColumnType("uuid");
-
- b.Property("ContactPerson")
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(255)
- .HasColumnType("character varying(255)");
-
- b.Property("Notes")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("PhoneNumber")
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("Id");
-
- b.HasIndex("AddressId");
-
- b.ToTable("Suppliers");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Address", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Customer", "Customer")
- .WithMany("Addresses")
- .HasForeignKey("CustomerId");
-
- b.Navigation("Customer");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Category", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Category", "ParentCategory")
- .WithMany("SubCategories")
- .HasForeignKey("ParentCategoryId")
- .OnDelete(DeleteBehavior.Restrict);
-
- b.Navigation("ParentCategory");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.CategoryDiscount", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Category", "Category")
- .WithMany("CategoryDiscounts")
- .HasForeignKey("CategoryId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Webshop.Domain.Entities.Discount", "Discount")
- .WithMany("CategoryDiscounts")
- .HasForeignKey("DiscountId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Category");
-
- b.Navigation("Discount");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Order", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Address", "BillingAddress")
- .WithMany()
- .HasForeignKey("BillingAddressId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.HasOne("Webshop.Domain.Entities.Customer", "Customer")
- .WithMany("Orders")
- .HasForeignKey("CustomerId");
-
- b.HasOne("Webshop.Domain.Entities.PaymentMethod", "PaymentMethodInfo")
- .WithMany()
- .HasForeignKey("PaymentMethodId");
-
- b.HasOne("Webshop.Domain.Entities.Address", "ShippingAddress")
- .WithMany()
- .HasForeignKey("ShippingAddressId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.HasOne("Webshop.Domain.Entities.ShippingMethod", "ShippingMethodInfo")
- .WithMany()
- .HasForeignKey("ShippingMethodId");
-
- b.Navigation("BillingAddress");
-
- b.Navigation("Customer");
-
- b.Navigation("PaymentMethodInfo");
-
- b.Navigation("ShippingAddress");
-
- b.Navigation("ShippingMethodInfo");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.OrderItem", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Order", "Order")
- .WithMany("OrderItems")
- .HasForeignKey("OrderId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Webshop.Domain.Entities.Product", "Product")
- .WithMany()
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.HasOne("Webshop.Domain.Entities.ProductVariant", "ProductVariant")
- .WithMany()
- .HasForeignKey("ProductVariantId")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Order");
-
- b.Navigation("Product");
-
- b.Navigation("ProductVariant");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Product", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Supplier", "Supplier")
- .WithMany("Products")
- .HasForeignKey("SupplierId");
-
- b.Navigation("Supplier");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.ProductCategory", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Category", "Category")
- .WithMany("ProductCategories")
- .HasForeignKey("CategoryId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Webshop.Domain.Entities.Product", "Product")
- .WithMany("ProductCategories")
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Category");
-
- b.Navigation("Product");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.ProductDiscount", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Discount", "Discount")
- .WithMany("ProductDiscounts")
- .HasForeignKey("DiscountId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Webshop.Domain.Entities.Product", "Product")
- .WithMany("ProductDiscounts")
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Discount");
-
- b.Navigation("Product");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.ProductVariant", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Product", "Product")
- .WithMany("Variants")
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Product");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Review", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Customer", "Customer")
- .WithMany("Reviews")
- .HasForeignKey("CustomerId");
-
- b.HasOne("Webshop.Domain.Entities.Product", "Product")
- .WithMany("Reviews")
- .HasForeignKey("ProductId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Customer");
-
- b.Navigation("Product");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Supplier", b =>
- {
- b.HasOne("Webshop.Domain.Entities.Address", "Address")
- .WithMany()
- .HasForeignKey("AddressId");
-
- b.Navigation("Address");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Category", b =>
- {
- b.Navigation("CategoryDiscounts");
-
- b.Navigation("ProductCategories");
-
- b.Navigation("SubCategories");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Customer", b =>
- {
- b.Navigation("Addresses");
-
- b.Navigation("Orders");
-
- b.Navigation("Reviews");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Discount", b =>
- {
- b.Navigation("CategoryDiscounts");
-
- b.Navigation("ProductDiscounts");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Order", b =>
- {
- b.Navigation("OrderItems");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Product", b =>
- {
- b.Navigation("ProductCategories");
-
- b.Navigation("ProductDiscounts");
-
- b.Navigation("Reviews");
-
- b.Navigation("Variants");
- });
-
- modelBuilder.Entity("Webshop.Domain.Entities.Supplier", b =>
- {
- b.Navigation("Products");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Webshop.Infrastructure/Migrations/20250723102855_AddSuppliersAndOtherEntities.cs b/Webshop.Infrastructure/Migrations/20250723102855_AddSuppliersAndOtherEntities.cs
deleted file mode 100644
index 690c06e..0000000
--- a/Webshop.Infrastructure/Migrations/20250723102855_AddSuppliersAndOtherEntities.cs
+++ /dev/null
@@ -1,818 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace Webshop.Infrastructure.Migrations
-{
- ///
- public partial class AddSuppliersAndOtherEntities : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Categories",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- Name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
- Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true),
- Slug = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
- ParentCategoryId = table.Column(type: "uuid", nullable: true),
- ImageUrl = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
- IsActive = table.Column(type: "boolean", nullable: false),
- DisplayOrder = table.Column(type: "integer", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Categories", x => x.Id);
- table.ForeignKey(
- name: "FK_Categories_Categories_ParentCategoryId",
- column: x => x.ParentCategoryId,
- principalTable: "Categories",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
-
- migrationBuilder.CreateTable(
- name: "Customers",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- AspNetUserId = table.Column(type: "character varying(450)", maxLength: 450, nullable: false),
- FirstName = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- LastName = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
- PhoneNumber = table.Column(type: "character varying(20)", maxLength: 20, nullable: true),
- CreatedDate = table.Column(type: "timestamp with time zone", nullable: false),
- LastLoginDate = table.Column(type: "timestamp with time zone", nullable: true),
- IsActive = table.Column(type: "boolean", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Customers", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Discounts",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- Name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
- DiscountType = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
- DiscountValue = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
- StartDate = table.Column(type: "timestamp with time zone", nullable: false),
- EndDate = table.Column(type: "timestamp with time zone", nullable: true),
- IsActive = table.Column(type: "boolean", nullable: false),
- RequiresCouponCode = table.Column(type: "boolean", nullable: false),
- CouponCode = table.Column(type: "character varying(50)", maxLength: 50, nullable: true),
- MinimumOrderAmount = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: true),
- MaximumUsageCount = table.Column(type: "integer", nullable: true),
- CurrentUsageCount = table.Column(type: "integer", nullable: false),
- Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Discounts", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "PaymentMethods",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- Description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true),
- IsActive = table.Column(type: "boolean", nullable: false),
- PaymentGatewayType = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
- ProcessingFee = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PaymentMethods", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Roles",
- columns: table => new
- {
- Id = table.Column(type: "text", nullable: false),
- Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
- NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
- ConcurrencyStamp = table.Column(type: "text", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Roles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Settings",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- Key = table.Column(type: "character varying(255)", maxLength: 255, nullable: false),
- Value = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
- Description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true),
- IsActive = table.Column(type: "boolean", nullable: false),
- Group = table.Column(type: "character varying(100)", maxLength: 100, nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Settings", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "ShippingMethods",
- columns: table => new
- {
- Id = table.Column(type: "uuid", nullable: false),
- Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false),
- Description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true),
- BaseCost = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: false),
- MinimumOrderAmount = table.Column(type: "numeric(18,2)", precision: 18, scale: 2, nullable: true),
- IsActive = table.Column(type: "boolean", nullable: false),
- EstimatedDeliveryTime = table.Column(type: "character varying(100)", maxLength: 100, nullable: true),
- RequiresTracking = table.Column(type: "boolean", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ShippingMethods", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Users",
- columns: table => new
- {
- Id = table.Column(type: "text", nullable: false),
- UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
- NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
- Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
- NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
- EmailConfirmed = table.Column(type: "boolean", nullable: false),
- PasswordHash = table.Column(type: "text", nullable: true),
- SecurityStamp = table.Column(type: "text", nullable: true),
- ConcurrencyStamp = table.Column(type: "text", nullable: true),
- PhoneNumber = table.Column(type: "text", nullable: true),
- PhoneNumberConfirmed = table.Column