All checks were successful
Branch - test - Build and Push Backend API Docker Image / build-and-push (push) Successful in 27s
1368 lines
49 KiB
C#
1368 lines
49 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("20251107143106_row")]
|
|
partial class row
|
|
{
|
|
/// <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>("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>("HouseNumber")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
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<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CustomerId");
|
|
|
|
b.ToTable("Addresses");
|
|
});
|
|
|
|
modelBuilder.Entity("Webshop.Domain.Entities.Categorie", 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?>("ParentcategorieId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Slug")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ParentcategorieId");
|
|
|
|
b.HasIndex("Slug")
|
|
.IsUnique();
|
|
|
|
b.ToTable("categories");
|
|
});
|
|
|
|
modelBuilder.Entity("Webshop.Domain.Entities.CategorieDiscount", b =>
|
|
{
|
|
b.Property<Guid>("categorieId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("DiscountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("categorieId", "DiscountId");
|
|
|
|
b.HasIndex("DiscountId");
|
|
|
|
b.ToTable("categorieDiscounts");
|
|
});
|
|
|
|
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<int>("FeaturedDisplayOrder")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<decimal?>("Height")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsFeatured")
|
|
.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<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("bytea");
|
|
|
|
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.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.ProductImage", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsMainImage")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Url")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.ToTable("ProductImages", (string)null);
|
|
});
|
|
|
|
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.Productcategorie", b =>
|
|
{
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("categorieId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("ProductId", "categorieId");
|
|
|
|
b.HasIndex("categorieId");
|
|
|
|
b.ToTable("Productcategories");
|
|
});
|
|
|
|
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<int>("MaxDeliveryDays")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MinDeliveryDays")
|
|
.HasColumnType("integer");
|
|
|
|
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.ShopInfo", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("City")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)");
|
|
|
|
b.Property<string>("CompanyRegistrationNumber")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)");
|
|
|
|
b.Property<string>("ContactEmail")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<string>("Country")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)");
|
|
|
|
b.Property<string>("FacebookUrl")
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<string>("InstagramUrl")
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.Property<string>("PostalCode")
|
|
.HasMaxLength(20)
|
|
.HasColumnType("character varying(20)");
|
|
|
|
b.Property<string>("ShopName")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<string>("Slogan")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<string>("Street")
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<string>("TwitterUrl")
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<string>("VatNumber")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ShopInfos");
|
|
});
|
|
|
|
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.Categorie", b =>
|
|
{
|
|
b.HasOne("Webshop.Domain.Entities.Categorie", "Parentcategorie")
|
|
.WithMany("Subcategories")
|
|
.HasForeignKey("ParentcategorieId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("Parentcategorie");
|
|
});
|
|
|
|
modelBuilder.Entity("Webshop.Domain.Entities.CategorieDiscount", b =>
|
|
{
|
|
b.HasOne("Webshop.Domain.Entities.Discount", "Discount")
|
|
.WithMany("categorieDiscounts")
|
|
.HasForeignKey("DiscountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Webshop.Domain.Entities.Categorie", "categorie")
|
|
.WithMany("categorieDiscounts")
|
|
.HasForeignKey("categorieId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Discount");
|
|
|
|
b.Navigation("categorie");
|
|
});
|
|
|
|
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.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.ProductImage", b =>
|
|
{
|
|
b.HasOne("Webshop.Domain.Entities.Product", "Product")
|
|
.WithMany("Images")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
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.Productcategorie", b =>
|
|
{
|
|
b.HasOne("Webshop.Domain.Entities.Product", "Product")
|
|
.WithMany("Productcategories")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Webshop.Domain.Entities.Categorie", "categorie")
|
|
.WithMany("Productcategories")
|
|
.HasForeignKey("categorieId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Product");
|
|
|
|
b.Navigation("categorie");
|
|
});
|
|
|
|
modelBuilder.Entity("Webshop.Domain.Entities.Review", b =>
|
|
{
|
|
b.HasOne("Webshop.Domain.Entities.Customer", "Customer")
|
|
.WithMany("Reviews")
|
|
.HasForeignKey("CustomerId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
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.Categorie", b =>
|
|
{
|
|
b.Navigation("Productcategories");
|
|
|
|
b.Navigation("Subcategories");
|
|
|
|
b.Navigation("categorieDiscounts");
|
|
});
|
|
|
|
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("ProductDiscounts");
|
|
|
|
b.Navigation("categorieDiscounts");
|
|
});
|
|
|
|
modelBuilder.Entity("Webshop.Domain.Entities.Order", b =>
|
|
{
|
|
b.Navigation("OrderItems");
|
|
});
|
|
|
|
modelBuilder.Entity("Webshop.Domain.Entities.Product", b =>
|
|
{
|
|
b.Navigation("Images");
|
|
|
|
b.Navigation("ProductDiscounts");
|
|
|
|
b.Navigation("Productcategories");
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|