diff --git a/NetinaShop.Api/AppSettings/appsettings.Development.json b/NetinaShop.Api/AppSettings/appsettings.Development.json index de28cc0..1bc8273 100644 --- a/NetinaShop.Api/AppSettings/appsettings.Development.json +++ b/NetinaShop.Api/AppSettings/appsettings.Development.json @@ -1,7 +1,8 @@ { "ConnectionStrings": { "PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;", - "Postgres": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=NetinaShopDB;Load Balance Hosts=true;Target Session Attributes=primary;Application Name=iGLS" + "Postgres": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=NetinaShopDB;Load Balance Hosts=true;Target Session Attributes=primary;Application Name=iGLS", + "SettingDB": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=NetinaShopSettingDB;Load Balance Hosts=true;Target Session Attributes=primary;Application Name=iGLS" }, "Logging": { "LogLevel": { diff --git a/NetinaShop.Common/Extensions/BoolExtensions.cs b/NetinaShop.Common/Extensions/BoolExtensions.cs new file mode 100644 index 0000000..7f6231d --- /dev/null +++ b/NetinaShop.Common/Extensions/BoolExtensions.cs @@ -0,0 +1,9 @@ +namespace NetinaShop.Common.Extensions; + +public static class BoolExtensions +{ + public static string ToPersianString(this bool value) + { + return value ? "بله" : "خیر"; + } +} \ No newline at end of file diff --git a/NetinaShop.Domain/CommandQueries/Commands/ComplexCommands.cs b/NetinaShop.Domain/CommandQueries/Commands/ComplexCommands.cs new file mode 100644 index 0000000..b51621d --- /dev/null +++ b/NetinaShop.Domain/CommandQueries/Commands/ComplexCommands.cs @@ -0,0 +1,12 @@ +using NetinaShop.Domain.DocumentEntities.Complexes; + +namespace NetinaShop.Domain.CommandQueries.Commands; + +public record CreateOrUpdateComplexCommand(string Name, + string Address, + string Description, + string SupportPhone, + double Latitude, + double Longitude, + string ReturnedAddress, + string TermsAndPrivacyRules) : IRequest; \ No newline at end of file diff --git a/NetinaShop.Domain/DocumentEntities/Complexes/Complex.Aggregate.cs b/NetinaShop.Domain/DocumentEntities/Complexes/Complex.Aggregate.cs new file mode 100644 index 0000000..c0bf335 --- /dev/null +++ b/NetinaShop.Domain/DocumentEntities/Complexes/Complex.Aggregate.cs @@ -0,0 +1,9 @@ +namespace NetinaShop.Domain.DocumentEntities.Complexes; + +public partial class Complex +{ + public static Complex Create(string name, string address, string description, string supportPhone, double latitude, double longitude, string returnedAddress, string termsAndPrivacyRules) + { + return new Complex(name, address, description, supportPhone, latitude, longitude, returnedAddress,termsAndPrivacyRules); + } +} \ No newline at end of file diff --git a/NetinaShop.Domain/DocumentEntities/Complexes/Complex.cs b/NetinaShop.Domain/DocumentEntities/Complexes/Complex.cs new file mode 100644 index 0000000..9e53c35 --- /dev/null +++ b/NetinaShop.Domain/DocumentEntities/Complexes/Complex.cs @@ -0,0 +1,38 @@ +namespace NetinaShop.Domain.DocumentEntities.Complexes; + +public partial class Complex +{ + public Complex() + { + + } + public Complex(string name, + string address, + string description, + string supportPhone, + double latitude, + double longitude, + string returnedAddress, + string termsAndPrivacyRules) + { + Name = name; + Address = address; + Description = description; + SupportPhone = supportPhone; + Latitude = latitude; + Longitude = longitude; + ReturnedAddress = returnedAddress; + TermsAndPrivacyRules = termsAndPrivacyRules; + } + + public Guid Id { get; set; } + public string Name { get; internal set; } = string.Empty; + public string Address { get; internal set; } = string.Empty; + public string Description { get; internal set; } = string.Empty; + public string SupportPhone { get; internal set; } = string.Empty; + public double Latitude { get; internal set; } + public double Longitude { get; internal set; } + public string ReturnedAddress { get; internal set; } = string.Empty; + public string TermsAndPrivacyRules { get; set; } = string.Empty; + +} \ No newline at end of file diff --git a/NetinaShop.Domain/DocumentEntities/Settings/OrderingSetting.cs b/NetinaShop.Domain/DocumentEntities/Settings/OrderingSetting.cs new file mode 100644 index 0000000..ef07092 --- /dev/null +++ b/NetinaShop.Domain/DocumentEntities/Settings/OrderingSetting.cs @@ -0,0 +1,6 @@ +namespace NetinaShop.Domain.DocumentEntities.Settings; + +public class OrderingSetting +{ + public bool HasCashPayment { get; set; } +} \ No newline at end of file diff --git a/NetinaShop.Domain/Dtos/SmallDtos/ProductSDto.cs b/NetinaShop.Domain/Dtos/SmallDtos/ProductSDto.cs index 7fa62d9..4cc8046 100644 --- a/NetinaShop.Domain/Dtos/SmallDtos/ProductSDto.cs +++ b/NetinaShop.Domain/Dtos/SmallDtos/ProductSDto.cs @@ -23,4 +23,5 @@ public class ProductSDto : BaseDto public Guid BrandId { get; set; } public string BrandNames { get; set; } = string.Empty; + public string CategoryName { get; set; } = string.Empty; } \ No newline at end of file diff --git a/NetinaShop.Domain/Entities/Products/Product.Aggregate.cs b/NetinaShop.Domain/Entities/Products/Product.Aggregate.cs index 0aa2c30..f38c71c 100644 --- a/NetinaShop.Domain/Entities/Products/Product.Aggregate.cs +++ b/NetinaShop.Domain/Entities/Products/Product.Aggregate.cs @@ -2,14 +2,15 @@ public partial class Product { - public static Product Create(string persianName, string englishName, string summery, string expertCheck, string tags, string warranty, bool beDisplayed, double cost, double packingCost, - int reviewCount, - float reviewRate, - int viewed, + public static Product Create(string persianName, string englishName, string summery, string expertCheck, string tags, string warranty, bool beDisplayed, + double cost, + double packingCost, + bool hasExpressDelivery, + int maxOrderCount, Guid brandId, Guid categoryId) { - return new Product(persianName, englishName, summery, expertCheck, tags, warranty, beDisplayed,cost, packingCost, reviewCount, reviewRate, viewed, brandId,categoryId); + return new Product(persianName, englishName, summery, expertCheck, tags, warranty, beDisplayed,cost, packingCost,hasExpressDelivery,maxOrderCount, brandId,categoryId); } public void AddRate(float rate) diff --git a/NetinaShop.Domain/Entities/Products/Product.cs b/NetinaShop.Domain/Entities/Products/Product.cs index f290a9b..621a413 100644 --- a/NetinaShop.Domain/Entities/Products/Product.cs +++ b/NetinaShop.Domain/Entities/Products/Product.cs @@ -21,9 +21,8 @@ public partial class Product : ApiEntity bool beDisplayed, double cost, double packingCost, - int reviewCount, - float rate, - int viewed, + bool hasExpressDelivery, + int maxOrderCount, Guid brandId, Guid categoryId) { @@ -36,11 +35,10 @@ public partial class Product : ApiEntity BeDisplayed = beDisplayed; Cost = cost; PackingCost = packingCost; + HasExpressDelivery = hasExpressDelivery; + MaxOrderCount = maxOrderCount; BrandId = brandId; CategoryId = categoryId; - ReviewCount = reviewCount; - Rate = rate; - Viewed = viewed; } public string PersianName { get; internal set; } = string.Empty; public string EnglishName { get; internal set; } = string.Empty; @@ -55,6 +53,8 @@ public partial class Product : ApiEntity public float Rate { get; internal set; } public int ReviewCount { get; internal set; } public int Viewed { get; internal set; } + public bool HasExpressDelivery { get; set; } + public int MaxOrderCount { get; set; } public Guid BrandId { get; internal set; } diff --git a/NetinaShop.Domain/Entities/Warehouses/Shipping.cs b/NetinaShop.Domain/Entities/Warehouses/Shipping.cs index d83a339..d954aa2 100644 --- a/NetinaShop.Domain/Entities/Warehouses/Shipping.cs +++ b/NetinaShop.Domain/Entities/Warehouses/Shipping.cs @@ -9,11 +9,11 @@ public partial class Shipping : ApiEntity { } - public Shipping(string title, string warehouseName, bool isFastShipping, bool isShipBySeller, bool isOriginalWarehouse, double deliveryCost) + public Shipping(string title, string warehouseName, bool isExpressShipping, bool isShipBySeller, bool isOriginalWarehouse, double deliveryCost) { Title = title; WarehouseName = warehouseName; - IsFastShipping = isFastShipping; + IsExpressShipping = isExpressShipping; IsShipBySeller = isShipBySeller; IsOriginalWarehouse = isOriginalWarehouse; DeliveryCost = deliveryCost; @@ -21,7 +21,7 @@ public partial class Shipping : ApiEntity public string Title { get; internal set; } = string.Empty; public string WarehouseName { get; internal set; } = string.Empty; - public bool IsFastShipping { get; internal set; } + public bool IsExpressShipping { get; internal set; } public bool IsShipBySeller { get; internal set; } public bool IsOriginalWarehouse { get; internal set; } public double DeliveryCost { get; internal set; } diff --git a/NetinaShop.Repository/Handlers/Complexes/CreateOrUpdateComplexCommandHandler.cs b/NetinaShop.Repository/Handlers/Complexes/CreateOrUpdateComplexCommandHandler.cs new file mode 100644 index 0000000..c4e7bbb --- /dev/null +++ b/NetinaShop.Repository/Handlers/Complexes/CreateOrUpdateComplexCommandHandler.cs @@ -0,0 +1,12 @@ +using NetinaShop.Domain.DocumentEntities.Complexes; + +namespace NetinaShop.Repository.Handlers.Complexes; + +public class CreateOrUpdateComplexCommandHandler : IRequestHandler +{ + + public Task Handle(CreateOrUpdateComplexCommand request, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/NetinaShop.Repository/Migrations/20240109085213_Init.Designer.cs b/NetinaShop.Repository/Migrations/20240109085213_Init.Designer.cs deleted file mode 100644 index 0ab14e2..0000000 --- a/NetinaShop.Repository/Migrations/20240109085213_Init.Designer.cs +++ /dev/null @@ -1,1579 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetinaShop.Repository.Models; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace NetinaShop.Repository.Migrations -{ - [DbContext(typeof(ApplicationContext))] - [Migration("20240109085213_Init")] - partial class Init - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("public") - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - 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") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaims", "public"); - }); - - 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") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Claims", "public"); - }); - - 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") - .HasColumnType("uuid"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("Logins", "public"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("RoleId") - .HasColumnType("uuid"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRoles", "public"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("Tokens", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.Blog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("IsSuggested") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ReadingTime") - .HasColumnType("integer"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Summery") - .IsRequired() - .HasColumnType("text"); - - b.Property("Tags") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CategoryId"); - - b.ToTable("Blogs", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("BlogCategories", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("HasSpecialPage") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("PageUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Brands", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.Discount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AmountType") - .HasColumnType("integer"); - - b.Property("Code") - .IsRequired() - .HasColumnType("text"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DiscountAmount") - .HasColumnType("bigint"); - - b.Property("DiscountPercent") - .HasColumnType("integer"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("character varying(21)"); - - b.Property("ExpireDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HasCode") - .HasColumnType("boolean"); - - b.Property("HasPriceCeiling") - .HasColumnType("boolean"); - - b.Property("HasPriceFloor") - .HasColumnType("boolean"); - - b.Property("IsForInvitation") - .HasColumnType("boolean"); - - b.Property("IsInfinity") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("PriceCeiling") - .HasColumnType("bigint"); - - b.Property("PriceFloor") - .HasColumnType("bigint"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Type") - .HasColumnType("integer"); - - b.Property("UseCount") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Discounts", "public"); - - b.HasDiscriminator("Discriminator").HasValue("Discount"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DeliveryPrice") - .HasColumnType("double precision"); - - b.Property("DiscountCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("DiscountId") - .HasColumnType("uuid"); - - b.Property("DiscountPrice") - .HasColumnType("double precision"); - - b.Property("DoneAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPayed") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("OrderAt") - .HasColumnType("timestamp without time zone"); - - b.Property("OrderStatus") - .HasColumnType("integer"); - - b.Property("PackingPrice") - .HasColumnType("double precision"); - - b.Property("PayedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentMethod") - .HasColumnType("integer"); - - b.Property("PreparingMinute") - .HasColumnType("integer"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("ServicePrice") - .HasColumnType("double precision"); - - b.Property("TaxesPrice") - .HasColumnType("double precision"); - - b.Property("TotalPrice") - .HasColumnType("double precision"); - - b.Property("TotalProductsPrice") - .HasColumnType("double precision"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("DiscountId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderDelivery", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DeliveryCost") - .HasColumnType("double precision"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("uuid"); - - b.Property("PostalCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverFullName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverPhoneNumber") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("ShippingId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.HasIndex("ShippingId"); - - b.ToTable("OrderDeliveries", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("uuid"); - - b.Property("OrderProductStatus") - .HasColumnType("integer"); - - b.Property("PackingCost") - .HasColumnType("double precision"); - - b.Property("PackingFee") - .HasColumnType("double precision"); - - b.Property("ProductCategoryId") - .HasColumnType("uuid"); - - b.Property("ProductCost") - .HasColumnType("double precision"); - - b.Property("ProductFee") - .HasColumnType("double precision"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.HasIndex("ProductId"); - - b.ToTable("OrderProducts", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsMain") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ParentId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.ToTable("ProductCategories", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("BeDisplayed") - .HasColumnType("boolean"); - - b.Property("BrandId") - .HasColumnType("uuid"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.Property("Cost") - .HasColumnType("double precision"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("EnglishName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExpertCheck") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsEnable") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("PackingCost") - .HasColumnType("double precision"); - - b.Property("PersianName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Rate") - .HasColumnType("real"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("ReviewCount") - .HasColumnType("integer"); - - b.Property("Summery") - .IsRequired() - .HasColumnType("text"); - - b.Property("Tags") - .IsRequired() - .HasColumnType("text"); - - b.Property("Viewed") - .HasColumnType("integer"); - - b.Property("Warranty") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("BrandId"); - - b.HasIndex("CategoryId"); - - b.ToTable("Products", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Review", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsBuyer") - .HasColumnType("boolean"); - - b.Property("IsConfirmed") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("Rate") - .HasColumnType("real"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("UserId"); - - b.ToTable("Reviews", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Specification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsFeature") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ParentId") - .HasColumnType("uuid"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("ProductId"); - - b.ToTable("Specifications", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.StorageFiles.StorageFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(34) - .HasColumnType("character varying(34)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("text"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("text"); - - b.Property("FileType") - .HasColumnType("integer"); - - b.Property("IsHeader") - .HasColumnType("boolean"); - - b.Property("IsPrimary") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("StorageFiles", "public"); - - b.HasDiscriminator("Discriminator").HasValue("StorageFile"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("EnglishName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("PersianName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Roles", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("BirthDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Gender") - .HasColumnType("integer"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("text"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NationalId") - .IsRequired() - .HasColumnType("text"); - - 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("SignUpStatus") - .HasColumnType("integer"); - - 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", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserAddress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("LocationLat") - .HasColumnType("real"); - - b.Property("LocationLong") - .HasColumnType("real"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("PostalCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverFullName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverPhoneNumber") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserAddresses", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserFavoriteProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("UserId"); - - b.ToTable("UserFavoriteProducts", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Warehouses.Shipping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DeliveryCost") - .HasColumnType("double precision"); - - b.Property("IsFastShipping") - .HasColumnType("boolean"); - - b.Property("IsOriginalWarehouse") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("IsShipBySeller") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("WarehouseName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Shippings", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.CategoryDiscount", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.Discounts.Discount"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.HasIndex("CategoryId"); - - b.HasDiscriminator().HasValue("CategoryDiscount"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.ProductDiscount", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.Discounts.Discount"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.HasIndex("ProductId"); - - b.HasDiscriminator().HasValue("ProductDiscount"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("BlogId") - .HasColumnType("uuid"); - - b.HasIndex("BlogId"); - - b.HasDiscriminator().HasValue("BlogStorageFile"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.BrandStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("BrandId") - .HasColumnType("uuid"); - - b.HasIndex("BrandId"); - - b.HasDiscriminator().HasValue("BrandStorageFile"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategoryStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.HasIndex("CategoryId"); - - b.HasDiscriminator().HasValue("ProductCategoryStorageFile"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.ProductStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.HasIndex("ProductId"); - - b.HasDiscriminator().HasValue("ProductStorageFile"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.Blog", b => - { - b.HasOne("NetinaShop.Domain.Entities.Blogs.BlogCategory", "Category") - .WithMany("Blogs") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.Order", b => - { - b.HasOne("NetinaShop.Domain.Entities.Discounts.Discount", null) - .WithMany("Orders") - .HasForeignKey("DiscountId"); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderDelivery", b => - { - b.HasOne("NetinaShop.Domain.Entities.Orders.Order", "Order") - .WithMany("OrderDeliveries") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Warehouses.Shipping", "Shipping") - .WithMany() - .HasForeignKey("ShippingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Order"); - - b.Navigation("Shipping"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderProduct", b => - { - b.HasOne("NetinaShop.Domain.Entities.Orders.Order", "Order") - .WithMany("OrderProducts") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("OrderProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Order"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", b => - { - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Parent") - .WithMany() - .HasForeignKey("ParentId"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Product", b => - { - b.HasOne("NetinaShop.Domain.Entities.Brands.Brand", "Brand") - .WithMany("Products") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Category") - .WithMany("Products") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Brand"); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Review", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("Reviews") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Specification", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Specification", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("Specifications") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Parent"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserAddress", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany("Addresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserFavoriteProduct", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.CategoryDiscount", b => - { - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Category") - .WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.ProductDiscount", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.Blogs.Blog", "Blog") - .WithMany("Files") - .HasForeignKey("BlogId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Blog"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.BrandStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.Brands.Brand", "Brand") - .WithMany("Files") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Brand"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategoryStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Category") - .WithMany("Files") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.ProductStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("Files") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.Blog", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogCategory", b => - { - b.Navigation("Blogs"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.Brand", b => - { - b.Navigation("Files"); - - b.Navigation("Products"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.Discount", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.Order", b => - { - b.Navigation("OrderDeliveries"); - - b.Navigation("OrderProducts"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", b => - { - b.Navigation("Files"); - - b.Navigation("Products"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Product", b => - { - b.Navigation("Files"); - - b.Navigation("OrderProducts"); - - b.Navigation("Reviews"); - - b.Navigation("Specifications"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Specification", b => - { - b.Navigation("Children"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.ApplicationUser", b => - { - b.Navigation("Addresses"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/NetinaShop.Repository/Migrations/20240109085213_Init.cs b/NetinaShop.Repository/Migrations/20240109085213_Init.cs deleted file mode 100644 index c4ef512..0000000 --- a/NetinaShop.Repository/Migrations/20240109085213_Init.cs +++ /dev/null @@ -1,1027 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace NetinaShop.Repository.Migrations -{ - /// - public partial class Init : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "public"); - - migrationBuilder.CreateTable( - name: "BlogCategories", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Name = table.Column(type: "text", nullable: false), - Description = table.Column(type: "text", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BlogCategories", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Brands", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Name = table.Column(type: "text", nullable: false), - Description = table.Column(type: "text", nullable: false), - HasSpecialPage = table.Column(type: "boolean", nullable: false), - PageUrl = table.Column(type: "text", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Brands", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "ProductCategories", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Name = table.Column(type: "text", nullable: false), - Description = table.Column(type: "text", nullable: false), - IsMain = table.Column(type: "boolean", nullable: false), - ParentId = table.Column(type: "uuid", nullable: true), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProductCategories", x => x.Id); - table.ForeignKey( - name: "FK_ProductCategories_ProductCategories_ParentId", - column: x => x.ParentId, - principalSchema: "public", - principalTable: "ProductCategories", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "Roles", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Description = table.Column(type: "text", nullable: false), - EnglishName = table.Column(type: "text", nullable: false), - PersianName = 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: "Shippings", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Title = table.Column(type: "text", nullable: false), - WarehouseName = table.Column(type: "text", nullable: false), - IsFastShipping = table.Column(type: "boolean", nullable: false), - IsShipBySeller = table.Column(type: "boolean", nullable: false), - IsOriginalWarehouse = table.Column(type: "boolean", nullable: false), - DeliveryCost = table.Column(type: "double precision", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Shippings", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - FirstName = table.Column(type: "text", nullable: false), - LastName = table.Column(type: "text", nullable: false), - NationalId = table.Column(type: "text", nullable: false), - BirthDate = table.Column(type: "timestamp without time zone", nullable: false), - Gender = table.Column(type: "integer", nullable: false), - SignUpStatus = table.Column(type: "integer", 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(type: "boolean", nullable: false), - TwoFactorEnabled = table.Column(type: "boolean", nullable: false), - LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), - LockoutEnabled = table.Column(type: "boolean", nullable: false), - AccessFailedCount = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Blogs", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Title = table.Column(type: "text", nullable: false), - Content = table.Column(type: "text", nullable: false), - Tags = table.Column(type: "text", nullable: false), - ReadingTime = table.Column(type: "integer", nullable: false), - Summery = table.Column(type: "text", nullable: false), - IsSuggested = table.Column(type: "boolean", nullable: false), - CategoryId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Blogs", x => x.Id); - table.ForeignKey( - name: "FK_Blogs_BlogCategories_CategoryId", - column: x => x.CategoryId, - principalSchema: "public", - principalTable: "BlogCategories", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Products", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - PersianName = table.Column(type: "text", nullable: false), - EnglishName = table.Column(type: "text", nullable: false), - Summery = table.Column(type: "text", nullable: false), - ExpertCheck = table.Column(type: "text", nullable: false), - Tags = table.Column(type: "text", nullable: false), - Warranty = table.Column(type: "text", nullable: false), - Cost = table.Column(type: "double precision", nullable: false), - IsEnable = table.Column(type: "boolean", nullable: false), - BeDisplayed = table.Column(type: "boolean", nullable: false), - PackingCost = table.Column(type: "double precision", nullable: false), - Rate = table.Column(type: "real", nullable: false), - ReviewCount = table.Column(type: "integer", nullable: false), - Viewed = table.Column(type: "integer", nullable: false), - BrandId = table.Column(type: "uuid", nullable: false), - CategoryId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Products", x => x.Id); - table.ForeignKey( - name: "FK_Products_Brands_BrandId", - column: x => x.BrandId, - principalSchema: "public", - principalTable: "Brands", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Products_ProductCategories_CategoryId", - column: x => x.CategoryId, - principalSchema: "public", - principalTable: "ProductCategories", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "RoleClaims", - schema: "public", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - RoleId = table.Column(type: "uuid", nullable: false), - ClaimType = table.Column(type: "text", nullable: true), - ClaimValue = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_RoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_RoleClaims_Roles_RoleId", - column: x => x.RoleId, - principalSchema: "public", - principalTable: "Roles", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Claims", - schema: "public", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - UserId = table.Column(type: "uuid", nullable: false), - ClaimType = table.Column(type: "text", nullable: true), - ClaimValue = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Claims", x => x.Id); - table.ForeignKey( - name: "FK_Claims_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Logins", - schema: "public", - columns: table => new - { - LoginProvider = table.Column(type: "text", nullable: false), - ProviderKey = table.Column(type: "text", nullable: false), - ProviderDisplayName = table.Column(type: "text", nullable: true), - UserId = table.Column(type: "uuid", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Logins", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_Logins_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Tokens", - schema: "public", - columns: table => new - { - UserId = table.Column(type: "uuid", nullable: false), - LoginProvider = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - Value = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_Tokens_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "UserAddresses", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Address = table.Column(type: "text", nullable: false), - PostalCode = table.Column(type: "text", nullable: false), - ReceiverFullName = table.Column(type: "text", nullable: false), - ReceiverPhoneNumber = table.Column(type: "text", nullable: false), - LocationLat = table.Column(type: "real", nullable: false), - LocationLong = table.Column(type: "real", nullable: false), - UserId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_UserAddresses", x => x.Id); - table.ForeignKey( - name: "FK_UserAddresses_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "UserRoles", - schema: "public", - columns: table => new - { - UserId = table.Column(type: "uuid", nullable: false), - RoleId = table.Column(type: "uuid", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_UserRoles_Roles_RoleId", - column: x => x.RoleId, - principalSchema: "public", - principalTable: "Roles", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserRoles_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Discounts", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Code = table.Column(type: "text", nullable: false), - DiscountPercent = table.Column(type: "integer", nullable: false), - DiscountAmount = table.Column(type: "bigint", nullable: false), - HasCode = table.Column(type: "boolean", nullable: false), - AmountType = table.Column(type: "integer", nullable: false), - Type = table.Column(type: "integer", nullable: false), - Count = table.Column(type: "integer", nullable: false), - StartDate = table.Column(type: "timestamp without time zone", nullable: false), - ExpireDate = table.Column(type: "timestamp without time zone", nullable: false), - PriceFloor = table.Column(type: "bigint", nullable: false), - HasPriceFloor = table.Column(type: "boolean", nullable: false), - PriceCeiling = table.Column(type: "bigint", nullable: false), - HasPriceCeiling = table.Column(type: "boolean", nullable: false), - IsInfinity = table.Column(type: "boolean", nullable: false), - UseCount = table.Column(type: "bigint", nullable: false), - IsForInvitation = table.Column(type: "boolean", nullable: false), - Discriminator = table.Column(type: "character varying(21)", maxLength: 21, nullable: false), - CategoryId = table.Column(type: "uuid", nullable: true), - ProductId = table.Column(type: "uuid", nullable: true), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Discounts", x => x.Id); - table.ForeignKey( - name: "FK_Discounts_ProductCategories_CategoryId", - column: x => x.CategoryId, - principalSchema: "public", - principalTable: "ProductCategories", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Discounts_Products_ProductId", - column: x => x.ProductId, - principalSchema: "public", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Reviews", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Title = table.Column(type: "text", nullable: false), - Comment = table.Column(type: "text", nullable: false), - Rate = table.Column(type: "real", nullable: false), - IsBuyer = table.Column(type: "boolean", nullable: false), - IsConfirmed = table.Column(type: "boolean", nullable: false), - ProductId = table.Column(type: "uuid", nullable: false), - UserId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Reviews", x => x.Id); - table.ForeignKey( - name: "FK_Reviews_Products_ProductId", - column: x => x.ProductId, - principalSchema: "public", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Reviews_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Specifications", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Title = table.Column(type: "text", nullable: false), - Detail = table.Column(type: "text", nullable: false), - Value = table.Column(type: "text", nullable: false), - IsFeature = table.Column(type: "boolean", nullable: false), - ProductId = table.Column(type: "uuid", nullable: false), - ParentId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Specifications", x => x.Id); - table.ForeignKey( - name: "FK_Specifications_Products_ProductId", - column: x => x.ProductId, - principalSchema: "public", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Specifications_Specifications_ParentId", - column: x => x.ParentId, - principalSchema: "public", - principalTable: "Specifications", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "StorageFiles", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Name = table.Column(type: "text", nullable: false), - FileLocation = table.Column(type: "text", nullable: false), - FileName = table.Column(type: "text", nullable: false), - IsHeader = table.Column(type: "boolean", nullable: false), - IsPrimary = table.Column(type: "boolean", nullable: false), - FileType = table.Column(type: "integer", nullable: false), - Discriminator = table.Column(type: "character varying(34)", maxLength: 34, nullable: false), - BlogId = table.Column(type: "uuid", nullable: true), - BrandId = table.Column(type: "uuid", nullable: true), - CategoryId = table.Column(type: "uuid", nullable: true), - ProductId = table.Column(type: "uuid", nullable: true), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_StorageFiles", x => x.Id); - table.ForeignKey( - name: "FK_StorageFiles_Blogs_BlogId", - column: x => x.BlogId, - principalSchema: "public", - principalTable: "Blogs", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_StorageFiles_Brands_BrandId", - column: x => x.BrandId, - principalSchema: "public", - principalTable: "Brands", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_StorageFiles_ProductCategories_CategoryId", - column: x => x.CategoryId, - principalSchema: "public", - principalTable: "ProductCategories", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_StorageFiles_Products_ProductId", - column: x => x.ProductId, - principalSchema: "public", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "UserFavoriteProducts", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - ProductId = table.Column(type: "uuid", nullable: false), - UserId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_UserFavoriteProducts", x => x.Id); - table.ForeignKey( - name: "FK_UserFavoriteProducts_Products_ProductId", - column: x => x.ProductId, - principalSchema: "public", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserFavoriteProducts_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Orders", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - TotalProductsPrice = table.Column(type: "double precision", nullable: false), - PackingPrice = table.Column(type: "double precision", nullable: false), - ServicePrice = table.Column(type: "double precision", nullable: false), - DeliveryPrice = table.Column(type: "double precision", nullable: false), - DiscountPrice = table.Column(type: "double precision", nullable: false), - TaxesPrice = table.Column(type: "double precision", nullable: false), - TotalPrice = table.Column(type: "double precision", nullable: false), - IsPayed = table.Column(type: "boolean", nullable: false), - PayedAt = table.Column(type: "timestamp without time zone", nullable: false), - PaymentMethod = table.Column(type: "integer", nullable: false), - OrderStatus = table.Column(type: "integer", nullable: false), - DoneAt = table.Column(type: "timestamp without time zone", nullable: false), - OrderAt = table.Column(type: "timestamp without time zone", nullable: false), - PreparingMinute = table.Column(type: "integer", nullable: false), - DiscountCode = table.Column(type: "text", nullable: false), - UserId = table.Column(type: "uuid", nullable: false), - DiscountId = table.Column(type: "uuid", nullable: true), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders", x => x.Id); - table.ForeignKey( - name: "FK_Orders_Discounts_DiscountId", - column: x => x.DiscountId, - principalSchema: "public", - principalTable: "Discounts", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Orders_Users_UserId", - column: x => x.UserId, - principalSchema: "public", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "OrderDeliveries", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Address = table.Column(type: "text", nullable: false), - PostalCode = table.Column(type: "text", nullable: false), - ReceiverPhoneNumber = table.Column(type: "text", nullable: false), - ReceiverFullName = table.Column(type: "text", nullable: false), - DeliveryCost = table.Column(type: "double precision", nullable: false), - ShippingId = table.Column(type: "uuid", nullable: false), - OrderId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_OrderDeliveries", x => x.Id); - table.ForeignKey( - name: "FK_OrderDeliveries_Orders_OrderId", - column: x => x.OrderId, - principalSchema: "public", - principalTable: "Orders", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_OrderDeliveries_Shippings_ShippingId", - column: x => x.ShippingId, - principalSchema: "public", - principalTable: "Shippings", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "OrderProducts", - schema: "public", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Count = table.Column(type: "integer", nullable: false), - ProductFee = table.Column(type: "double precision", nullable: false), - ProductCost = table.Column(type: "double precision", nullable: false), - PackingFee = table.Column(type: "double precision", nullable: false), - PackingCost = table.Column(type: "double precision", nullable: false), - OrderProductStatus = table.Column(type: "integer", nullable: false), - ProductId = table.Column(type: "uuid", nullable: false), - ProductCategoryId = table.Column(type: "uuid", nullable: false), - OrderId = table.Column(type: "uuid", nullable: false), - RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), - CreatedBy = table.Column(type: "text", nullable: true), - IsRemoved = table.Column(type: "boolean", nullable: false), - RemovedBy = table.Column(type: "text", nullable: true), - ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_OrderProducts", x => x.Id); - table.ForeignKey( - name: "FK_OrderProducts_Orders_OrderId", - column: x => x.OrderId, - principalSchema: "public", - principalTable: "Orders", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_OrderProducts_Products_ProductId", - column: x => x.ProductId, - principalSchema: "public", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_Blogs_CategoryId", - schema: "public", - table: "Blogs", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_Claims_UserId", - schema: "public", - table: "Claims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Discounts_CategoryId", - schema: "public", - table: "Discounts", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_Discounts_ProductId", - schema: "public", - table: "Discounts", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Logins_UserId", - schema: "public", - table: "Logins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_OrderDeliveries_OrderId", - schema: "public", - table: "OrderDeliveries", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_OrderDeliveries_ShippingId", - schema: "public", - table: "OrderDeliveries", - column: "ShippingId"); - - migrationBuilder.CreateIndex( - name: "IX_OrderProducts_OrderId", - schema: "public", - table: "OrderProducts", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_OrderProducts_ProductId", - schema: "public", - table: "OrderProducts", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_DiscountId", - schema: "public", - table: "Orders", - column: "DiscountId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_UserId", - schema: "public", - table: "Orders", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_ProductCategories_ParentId", - schema: "public", - table: "ProductCategories", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_Products_BrandId", - schema: "public", - table: "Products", - column: "BrandId"); - - migrationBuilder.CreateIndex( - name: "IX_Products_CategoryId", - schema: "public", - table: "Products", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_Reviews_ProductId", - schema: "public", - table: "Reviews", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Reviews_UserId", - schema: "public", - table: "Reviews", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_RoleClaims_RoleId", - schema: "public", - table: "RoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - schema: "public", - table: "Roles", - column: "NormalizedName", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Specifications_ParentId", - schema: "public", - table: "Specifications", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_Specifications_ProductId", - schema: "public", - table: "Specifications", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_StorageFiles_BlogId", - schema: "public", - table: "StorageFiles", - column: "BlogId"); - - migrationBuilder.CreateIndex( - name: "IX_StorageFiles_BrandId", - schema: "public", - table: "StorageFiles", - column: "BrandId"); - - migrationBuilder.CreateIndex( - name: "IX_StorageFiles_CategoryId", - schema: "public", - table: "StorageFiles", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_StorageFiles_ProductId", - schema: "public", - table: "StorageFiles", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_UserAddresses_UserId", - schema: "public", - table: "UserAddresses", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_UserFavoriteProducts_ProductId", - schema: "public", - table: "UserFavoriteProducts", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_UserFavoriteProducts_UserId", - schema: "public", - table: "UserFavoriteProducts", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_UserRoles_RoleId", - schema: "public", - table: "UserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - schema: "public", - table: "Users", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - schema: "public", - table: "Users", - column: "NormalizedUserName", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Claims", - schema: "public"); - - migrationBuilder.DropTable( - name: "Logins", - schema: "public"); - - migrationBuilder.DropTable( - name: "OrderDeliveries", - schema: "public"); - - migrationBuilder.DropTable( - name: "OrderProducts", - schema: "public"); - - migrationBuilder.DropTable( - name: "Reviews", - schema: "public"); - - migrationBuilder.DropTable( - name: "RoleClaims", - schema: "public"); - - migrationBuilder.DropTable( - name: "Specifications", - schema: "public"); - - migrationBuilder.DropTable( - name: "StorageFiles", - schema: "public"); - - migrationBuilder.DropTable( - name: "Tokens", - schema: "public"); - - migrationBuilder.DropTable( - name: "UserAddresses", - schema: "public"); - - migrationBuilder.DropTable( - name: "UserFavoriteProducts", - schema: "public"); - - migrationBuilder.DropTable( - name: "UserRoles", - schema: "public"); - - migrationBuilder.DropTable( - name: "Shippings", - schema: "public"); - - migrationBuilder.DropTable( - name: "Orders", - schema: "public"); - - migrationBuilder.DropTable( - name: "Blogs", - schema: "public"); - - migrationBuilder.DropTable( - name: "Roles", - schema: "public"); - - migrationBuilder.DropTable( - name: "Discounts", - schema: "public"); - - migrationBuilder.DropTable( - name: "Users", - schema: "public"); - - migrationBuilder.DropTable( - name: "BlogCategories", - schema: "public"); - - migrationBuilder.DropTable( - name: "Products", - schema: "public"); - - migrationBuilder.DropTable( - name: "Brands", - schema: "public"); - - migrationBuilder.DropTable( - name: "ProductCategories", - schema: "public"); - } - } -} diff --git a/NetinaShop.Repository/Migrations/ApplicationContextModelSnapshot.cs b/NetinaShop.Repository/Migrations/ApplicationContextModelSnapshot.cs deleted file mode 100644 index a33af9f..0000000 --- a/NetinaShop.Repository/Migrations/ApplicationContextModelSnapshot.cs +++ /dev/null @@ -1,1576 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetinaShop.Repository.Models; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace NetinaShop.Repository.Migrations -{ - [DbContext(typeof(ApplicationContext))] - partial class ApplicationContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("public") - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - 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") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaims", "public"); - }); - - 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") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Claims", "public"); - }); - - 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") - .HasColumnType("uuid"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("Logins", "public"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("RoleId") - .HasColumnType("uuid"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRoles", "public"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("Tokens", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.Blog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("IsSuggested") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ReadingTime") - .HasColumnType("integer"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Summery") - .IsRequired() - .HasColumnType("text"); - - b.Property("Tags") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CategoryId"); - - b.ToTable("Blogs", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("BlogCategories", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("HasSpecialPage") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("PageUrl") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Brands", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.Discount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AmountType") - .HasColumnType("integer"); - - b.Property("Code") - .IsRequired() - .HasColumnType("text"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DiscountAmount") - .HasColumnType("bigint"); - - b.Property("DiscountPercent") - .HasColumnType("integer"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("character varying(21)"); - - b.Property("ExpireDate") - .HasColumnType("timestamp without time zone"); - - b.Property("HasCode") - .HasColumnType("boolean"); - - b.Property("HasPriceCeiling") - .HasColumnType("boolean"); - - b.Property("HasPriceFloor") - .HasColumnType("boolean"); - - b.Property("IsForInvitation") - .HasColumnType("boolean"); - - b.Property("IsInfinity") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("PriceCeiling") - .HasColumnType("bigint"); - - b.Property("PriceFloor") - .HasColumnType("bigint"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("StartDate") - .HasColumnType("timestamp without time zone"); - - b.Property("Type") - .HasColumnType("integer"); - - b.Property("UseCount") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Discounts", "public"); - - b.HasDiscriminator("Discriminator").HasValue("Discount"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DeliveryPrice") - .HasColumnType("double precision"); - - b.Property("DiscountCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("DiscountId") - .HasColumnType("uuid"); - - b.Property("DiscountPrice") - .HasColumnType("double precision"); - - b.Property("DoneAt") - .HasColumnType("timestamp without time zone"); - - b.Property("IsPayed") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("OrderAt") - .HasColumnType("timestamp without time zone"); - - b.Property("OrderStatus") - .HasColumnType("integer"); - - b.Property("PackingPrice") - .HasColumnType("double precision"); - - b.Property("PayedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("PaymentMethod") - .HasColumnType("integer"); - - b.Property("PreparingMinute") - .HasColumnType("integer"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("ServicePrice") - .HasColumnType("double precision"); - - b.Property("TaxesPrice") - .HasColumnType("double precision"); - - b.Property("TotalPrice") - .HasColumnType("double precision"); - - b.Property("TotalProductsPrice") - .HasColumnType("double precision"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("DiscountId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderDelivery", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DeliveryCost") - .HasColumnType("double precision"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("uuid"); - - b.Property("PostalCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverFullName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverPhoneNumber") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("ShippingId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.HasIndex("ShippingId"); - - b.ToTable("OrderDeliveries", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("uuid"); - - b.Property("OrderProductStatus") - .HasColumnType("integer"); - - b.Property("PackingCost") - .HasColumnType("double precision"); - - b.Property("PackingFee") - .HasColumnType("double precision"); - - b.Property("ProductCategoryId") - .HasColumnType("uuid"); - - b.Property("ProductCost") - .HasColumnType("double precision"); - - b.Property("ProductFee") - .HasColumnType("double precision"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.HasIndex("ProductId"); - - b.ToTable("OrderProducts", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsMain") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ParentId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.ToTable("ProductCategories", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("BeDisplayed") - .HasColumnType("boolean"); - - b.Property("BrandId") - .HasColumnType("uuid"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.Property("Cost") - .HasColumnType("double precision"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("EnglishName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExpertCheck") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsEnable") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("PackingCost") - .HasColumnType("double precision"); - - b.Property("PersianName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Rate") - .HasColumnType("real"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("ReviewCount") - .HasColumnType("integer"); - - b.Property("Summery") - .IsRequired() - .HasColumnType("text"); - - b.Property("Tags") - .IsRequired() - .HasColumnType("text"); - - b.Property("Viewed") - .HasColumnType("integer"); - - b.Property("Warranty") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("BrandId"); - - b.HasIndex("CategoryId"); - - b.ToTable("Products", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Review", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsBuyer") - .HasColumnType("boolean"); - - b.Property("IsConfirmed") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("Rate") - .HasColumnType("real"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("UserId"); - - b.ToTable("Reviews", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Specification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Detail") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsFeature") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ParentId") - .HasColumnType("uuid"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("ProductId"); - - b.ToTable("Specifications", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.StorageFiles.StorageFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(34) - .HasColumnType("character varying(34)"); - - b.Property("FileLocation") - .IsRequired() - .HasColumnType("text"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("text"); - - b.Property("FileType") - .HasColumnType("integer"); - - b.Property("IsHeader") - .HasColumnType("boolean"); - - b.Property("IsPrimary") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("StorageFiles", "public"); - - b.HasDiscriminator("Discriminator").HasValue("StorageFile"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("EnglishName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("PersianName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Roles", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("BirthDate") - .HasColumnType("timestamp without time zone"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Gender") - .HasColumnType("integer"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("text"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NationalId") - .IsRequired() - .HasColumnType("text"); - - 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("SignUpStatus") - .HasColumnType("integer"); - - 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", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserAddress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Address") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("LocationLat") - .HasColumnType("real"); - - b.Property("LocationLong") - .HasColumnType("real"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("PostalCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverFullName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReceiverPhoneNumber") - .IsRequired() - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserAddresses", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserFavoriteProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("UserId"); - - b.ToTable("UserFavoriteProducts", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Warehouses.Shipping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("CreatedBy") - .HasColumnType("text"); - - b.Property("DeliveryCost") - .HasColumnType("double precision"); - - b.Property("IsFastShipping") - .HasColumnType("boolean"); - - b.Property("IsOriginalWarehouse") - .HasColumnType("boolean"); - - b.Property("IsRemoved") - .HasColumnType("boolean"); - - b.Property("IsShipBySeller") - .HasColumnType("boolean"); - - b.Property("ModifiedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("text"); - - b.Property("RemovedAt") - .HasColumnType("timestamp without time zone"); - - b.Property("RemovedBy") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("WarehouseName") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Shippings", "public"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.CategoryDiscount", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.Discounts.Discount"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.HasIndex("CategoryId"); - - b.HasDiscriminator().HasValue("CategoryDiscount"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.ProductDiscount", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.Discounts.Discount"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.HasIndex("ProductId"); - - b.HasDiscriminator().HasValue("ProductDiscount"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("BlogId") - .HasColumnType("uuid"); - - b.HasIndex("BlogId"); - - b.HasDiscriminator().HasValue("BlogStorageFile"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.BrandStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("BrandId") - .HasColumnType("uuid"); - - b.HasIndex("BrandId"); - - b.HasDiscriminator().HasValue("BrandStorageFile"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategoryStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("CategoryId") - .HasColumnType("uuid"); - - b.HasIndex("CategoryId"); - - b.HasDiscriminator().HasValue("ProductCategoryStorageFile"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.ProductStorageFile", b => - { - b.HasBaseType("NetinaShop.Domain.Entities.StorageFiles.StorageFile"); - - b.Property("ProductId") - .HasColumnType("uuid"); - - b.HasIndex("ProductId"); - - b.HasDiscriminator().HasValue("ProductStorageFile"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.Blog", b => - { - b.HasOne("NetinaShop.Domain.Entities.Blogs.BlogCategory", "Category") - .WithMany("Blogs") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.Order", b => - { - b.HasOne("NetinaShop.Domain.Entities.Discounts.Discount", null) - .WithMany("Orders") - .HasForeignKey("DiscountId"); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderDelivery", b => - { - b.HasOne("NetinaShop.Domain.Entities.Orders.Order", "Order") - .WithMany("OrderDeliveries") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Warehouses.Shipping", "Shipping") - .WithMany() - .HasForeignKey("ShippingId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Order"); - - b.Navigation("Shipping"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.OrderProduct", b => - { - b.HasOne("NetinaShop.Domain.Entities.Orders.Order", "Order") - .WithMany("OrderProducts") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("OrderProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Order"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", b => - { - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Parent") - .WithMany() - .HasForeignKey("ParentId"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Product", b => - { - b.HasOne("NetinaShop.Domain.Entities.Brands.Brand", "Brand") - .WithMany("Products") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Category") - .WithMany("Products") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Brand"); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Review", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("Reviews") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Specification", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Specification", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("Specifications") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Parent"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserAddress", b => - { - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany("Addresses") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.UserFavoriteProduct", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.CategoryDiscount", b => - { - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Category") - .WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.ProductDiscount", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.Blogs.Blog", "Blog") - .WithMany("Files") - .HasForeignKey("BlogId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Blog"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.BrandStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.Brands.Brand", "Brand") - .WithMany("Files") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Brand"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategoryStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Category") - .WithMany("Files") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.ProductStorageFile", b => - { - b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") - .WithMany("Files") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.Blog", b => - { - b.Navigation("Files"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.BlogCategory", b => - { - b.Navigation("Blogs"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Brands.Brand", b => - { - b.Navigation("Files"); - - b.Navigation("Products"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Discounts.Discount", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Orders.Order", b => - { - b.Navigation("OrderDeliveries"); - - b.Navigation("OrderProducts"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", b => - { - b.Navigation("Files"); - - b.Navigation("Products"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Product", b => - { - b.Navigation("Files"); - - b.Navigation("OrderProducts"); - - b.Navigation("Reviews"); - - b.Navigation("Specifications"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Products.Specification", b => - { - b.Navigation("Children"); - }); - - modelBuilder.Entity("NetinaShop.Domain.Entities.Users.ApplicationUser", b => - { - b.Navigation("Addresses"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/NetinaShop.Repository/NetinaShop.Repository.csproj b/NetinaShop.Repository/NetinaShop.Repository.csproj index 0035102..eeb9aab 100644 --- a/NetinaShop.Repository/NetinaShop.Repository.csproj +++ b/NetinaShop.Repository/NetinaShop.Repository.csproj @@ -29,6 +29,7 @@ +