Files
ShopSolution-backend/Webshop.Infrastructure/Migrations/20250731144311_addOrder.Designer.cs
Tizian.Breuch ca80016eae migration
2025-07-31 16:43:19 +02:00

1250 lines
44 KiB
C#

// <auto-generated />
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("20250731144311_addOrder")]
partial class addOrder
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("text");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("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<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("RoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("UserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("UserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<string>("RoleId")
.HasColumnType("text");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("UserTokens", (string)null);
});
modelBuilder.Entity("Webshop.Domain.Entities.Address", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AddressType")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("City")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("CompanyName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("Country")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<Guid?>("CustomerId")
.HasColumnType("uuid");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("PostalCode")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("State")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("Street")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("ImageUrl")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LastModifiedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<Guid?>("ParentCategoryId")
.HasColumnType("uuid");
b.Property<string>("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<Guid>("CategoryId")
.HasColumnType("uuid");
b.Property<Guid>("DiscountId")
.HasColumnType("uuid");
b.HasKey("CategoryId", "DiscountId");
b.HasIndex("DiscountId");
b.ToTable("CategoryDiscounts");
});
modelBuilder.Entity("Webshop.Domain.Entities.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AspNetUserId")
.IsRequired()
.HasColumnType("text");
b.Property<Guid?>("DefaultBillingAddressId")
.HasColumnType("uuid");
b.Property<Guid?>("DefaultShippingAddressId")
.HasColumnType("uuid");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.HasKey("Id");
b.HasIndex("AspNetUserId")
.IsUnique();
b.ToTable("Customers");
});
modelBuilder.Entity("Webshop.Domain.Entities.Discount", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("CouponCode")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("CurrentUsageCount")
.HasColumnType("integer");
b.Property<string>("Description")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<string>("DiscountType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<decimal>("DiscountValue")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<DateTimeOffset?>("EndDate")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<int?>("MaximumUsageCount")
.HasColumnType("integer");
b.Property<decimal?>("MinimumOrderAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<bool>("RequiresCouponCode")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AdminNotes")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<Guid>("BillingAddressId")
.HasColumnType("uuid");
b.Property<Guid?>("CustomerId")
.HasColumnType("uuid");
b.Property<string>("CustomerNotes")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<DateTimeOffset?>("DeliveredDate")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("DiscountAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("GuestEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("GuestPhoneNumber")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<DateTimeOffset>("OrderDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("OrderNumber")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("OrderStatus")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<decimal>("OrderTotal")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("PaymentMethod")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<Guid?>("PaymentMethodId")
.HasColumnType("uuid");
b.Property<string>("PaymentStatus")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTimeOffset?>("ShippedDate")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("ShippingAddressId")
.HasColumnType("uuid");
b.Property<decimal>("ShippingCost")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<Guid?>("ShippingMethodId")
.HasColumnType("uuid");
b.Property<string>("ShippingTrackingNumber")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<decimal>("TaxAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("OrderId")
.HasColumnType("uuid");
b.Property<Guid?>("ProductId")
.HasColumnType("uuid");
b.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("ProductSKU")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<Guid?>("ProductVariantId")
.HasColumnType("uuid");
b.Property<int>("Quantity")
.HasColumnType("integer");
b.Property<decimal>("TotalPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<decimal>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Configuration")
.HasColumnType("jsonb");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<int>("PaymentGatewayType")
.HasColumnType("integer");
b.Property<decimal?>("ProcessingFee")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.HasKey("Id");
b.ToTable("PaymentMethods");
});
modelBuilder.Entity("Webshop.Domain.Entities.Product", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.HasMaxLength(4000)
.HasColumnType("character varying(4000)");
b.Property<decimal?>("Height")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("ImageUrl")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<bool>("IsInStock")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LastModifiedDate")
.HasColumnType("timestamp with time zone");
b.Property<decimal?>("Length")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<decimal?>("OldPrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<decimal>("Price")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<decimal?>("PurchasePrice")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("SKU")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("ShortDescription")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<int>("StockQuantity")
.HasColumnType("integer");
b.Property<Guid?>("SupplierId")
.HasColumnType("uuid");
b.Property<decimal?>("Weight")
.HasPrecision(18, 3)
.HasColumnType("numeric(18,3)");
b.Property<decimal?>("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<Guid>("ProductId")
.HasColumnType("uuid");
b.Property<Guid>("CategoryId")
.HasColumnType("uuid");
b.HasKey("ProductId", "CategoryId");
b.HasIndex("CategoryId");
b.ToTable("ProductCategories");
});
modelBuilder.Entity("Webshop.Domain.Entities.ProductDiscount", b =>
{
b.Property<Guid>("ProductId")
.HasColumnType("uuid");
b.Property<Guid>("DiscountId")
.HasColumnType("uuid");
b.HasKey("ProductId", "DiscountId");
b.HasIndex("DiscountId");
b.ToTable("ProductDiscounts");
});
modelBuilder.Entity("Webshop.Domain.Entities.ProductVariant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ImageUrl")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<decimal>("PriceAdjustment")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<Guid>("ProductId")
.HasColumnType("uuid");
b.Property<string>("SKU")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("StockQuantity")
.HasColumnType("integer");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Comment")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)");
b.Property<Guid?>("CustomerId")
.HasColumnType("uuid");
b.Property<bool>("IsApproved")
.HasColumnType("boolean");
b.Property<Guid>("ProductId")
.HasColumnType("uuid");
b.Property<int>("Rating")
.HasColumnType("integer");
b.Property<DateTimeOffset>("ReviewDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Group")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<decimal>("BaseCost")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("EstimatedDeliveryTime")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<decimal?>("MinimumOrderAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<bool>("RequiresTracking")
.HasColumnType("boolean");
b.HasKey("Id");
b.ToTable("ShippingMethods");
});
modelBuilder.Entity("Webshop.Domain.Entities.Supplier", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid?>("AddressId")
.HasColumnType("uuid");
b.Property<string>("ContactPerson")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("Notes")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<string>("PhoneNumber")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.HasIndex("AddressId");
b.ToTable("Suppliers");
});
modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LastActive")
.HasColumnType("timestamp with time zone");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("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.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Webshop.Domain.Identity.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Webshop.Domain.Identity.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Webshop.Domain.Identity.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Webshop.Domain.Identity.ApplicationUser", 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.Customer", b =>
{
b.HasOne("Webshop.Domain.Identity.ApplicationUser", "User")
.WithOne("Customer")
.HasForeignKey("Webshop.Domain.Entities.Customer", "AspNetUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
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");
});
modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b =>
{
b.Navigation("Customer");
});
#pragma warning restore 612, 618
}
}
}