diff --git a/NetinaShop.Domain/CommandQueries/Commands/ShippingCommands.cs b/NetinaShop.Domain/CommandQueries/Commands/ShippingCommands.cs index 9253418..bb0992a 100644 --- a/NetinaShop.Domain/CommandQueries/Commands/ShippingCommands.cs +++ b/NetinaShop.Domain/CommandQueries/Commands/ShippingCommands.cs @@ -1,18 +1,18 @@ namespace NetinaShop.Domain.CommandQueries.Commands; public sealed record CreateShippingCommand ( - string Title, + string Name, string WarehouseName, - bool IsFastShipping , + bool IsExpressShipping, bool IsShipBySeller , bool IsOriginalWarehouse, double DeliveryCost) : IRequest; public sealed record UpdateShippingCommand( Guid Id, - string Title, + string Name, string WarehouseName, - bool IsFastShipping, + bool IsExpressShipping, bool IsShipBySeller, bool IsOriginalWarehouse, double DeliveryCost) : IRequest; diff --git a/NetinaShop.Domain/Dtos/LargDtos/ProductLDto.cs b/NetinaShop.Domain/Dtos/LargDtos/ProductLDto.cs index 44c9116..5bcb05a 100644 --- a/NetinaShop.Domain/Dtos/LargDtos/ProductLDto.cs +++ b/NetinaShop.Domain/Dtos/LargDtos/ProductLDto.cs @@ -10,9 +10,9 @@ public class ProductLDto : BaseDto public string Warranty { get; set; } = string.Empty; public bool BeDisplayed { get; set; } public bool HasExpressDelivery { get; set; } - public int MaxOrderCount { get; set; } public double Cost { get; set; } public double PackingCost { get; set; } + public int MaxOrderCount { get; set; } public int Stock { get; set; } public Guid BrandId { get; set; } public string BrandName { get; set; } = string.Empty; diff --git a/NetinaShop.Domain/Dtos/SmallDtos/DiscountSDto.cs b/NetinaShop.Domain/Dtos/SmallDtos/DiscountSDto.cs index 0e9e00b..ee6afee 100644 --- a/NetinaShop.Domain/Dtos/SmallDtos/DiscountSDto.cs +++ b/NetinaShop.Domain/Dtos/SmallDtos/DiscountSDto.cs @@ -12,6 +12,8 @@ public class DiscountSDto : BaseDto public DateTime StartDate { get; set; } public DateTime ExpireDate { get; set; } public long PriceFloor { get; set; } + public int MaxOrderCount { get; set; } + public int Stock { get; set; } public bool HasPriceFloor { get; set; } public long PriceCeiling { get; set; } public bool HasPriceCeiling { get; set; } diff --git a/NetinaShop.Domain/Dtos/SmallDtos/ShippingSDto.cs b/NetinaShop.Domain/Dtos/SmallDtos/ShippingSDto.cs index a43a6b8..1255fe7 100644 --- a/NetinaShop.Domain/Dtos/SmallDtos/ShippingSDto.cs +++ b/NetinaShop.Domain/Dtos/SmallDtos/ShippingSDto.cs @@ -2,5 +2,10 @@ public class ShippingSDto : BaseDto { - + public string Name { get; set; } = string.Empty; + public string WarehouseName { get; set; } = string.Empty; + public bool IsExpressShipping { get; set; } + public bool IsShipBySeller { get; set; } + public bool IsOriginalWarehouse { get; set; } + public double DeliveryCost { get; set; } } \ No newline at end of file diff --git a/NetinaShop.Domain/Entities/Warehouses/Shipping.cs b/NetinaShop.Domain/Entities/Warehouses/Shipping.cs index d954aa2..341e96c 100644 --- a/NetinaShop.Domain/Entities/Warehouses/Shipping.cs +++ b/NetinaShop.Domain/Entities/Warehouses/Shipping.cs @@ -9,9 +9,9 @@ public partial class Shipping : ApiEntity { } - public Shipping(string title, string warehouseName, bool isExpressShipping, bool isShipBySeller, bool isOriginalWarehouse, double deliveryCost) + public Shipping(string name, string warehouseName, bool isExpressShipping, bool isShipBySeller, bool isOriginalWarehouse, double deliveryCost) { - Title = title; + Name = name; WarehouseName = warehouseName; IsExpressShipping = isExpressShipping; IsShipBySeller = isShipBySeller; @@ -19,7 +19,7 @@ public partial class Shipping : ApiEntity DeliveryCost = deliveryCost; } - public string Title { get; internal set; } = string.Empty; + public string Name { get; internal set; } = string.Empty; public string WarehouseName { get; internal set; } = string.Empty; public bool IsExpressShipping { get; internal set; } public bool IsShipBySeller { get; internal set; } diff --git a/NetinaShop.Domain/Mappers/ProductMapper.g.cs b/NetinaShop.Domain/Mappers/ProductMapper.g.cs index cd92337..58704a1 100644 --- a/NetinaShop.Domain/Mappers/ProductMapper.g.cs +++ b/NetinaShop.Domain/Mappers/ProductMapper.g.cs @@ -30,7 +30,17 @@ namespace NetinaShop.Domain.Mappers HasExpressDelivery = p1.HasExpressDelivery, MaxOrderCount = p1.MaxOrderCount, BrandId = p1.BrandId, + Brand = new Brand() + { + Name = p1.BrandName, + Id = p1.BrandId + }, CategoryId = p1.CategoryId, + Category = new ProductCategory() + { + Name = p1.CategoryName, + Id = p1.CategoryId + }, Specifications = funcMain1(p1.Specifications), Reviews = funcMain2(p1.Reviews), Files = funcMain3(p1.Files), @@ -59,318 +69,333 @@ namespace NetinaShop.Domain.Mappers result.HasExpressDelivery = p5.HasExpressDelivery; result.MaxOrderCount = p5.MaxOrderCount; result.BrandId = p5.BrandId; + result.Brand = funcMain4(new Never(), result.Brand, p5); result.CategoryId = p5.CategoryId; - result.Specifications = funcMain4(p5.Specifications, result.Specifications); - result.Reviews = funcMain5(p5.Reviews, result.Reviews); - result.Files = funcMain6(p5.Files, result.Files); + result.Category = funcMain5(new Never(), result.Category, p5); + result.Specifications = funcMain6(p5.Specifications, result.Specifications); + result.Reviews = funcMain7(p5.Reviews, result.Reviews); + result.Files = funcMain8(p5.Files, result.Files); result.Id = p5.Id; result.CreatedAt = p5.CreatedAt; return result; } - public static Expression> ProjectToProduct => p13 => new Product() + public static Expression> ProjectToProduct => p17 => new Product() { - PersianName = p13.PersianName, - EnglishName = p13.EnglishName, - Summery = p13.Summery, - ExpertCheck = p13.ExpertCheck, - Tags = p13.Tags, - Warranty = p13.Warranty, - Cost = p13.Cost, - BeDisplayed = p13.BeDisplayed, - PackingCost = p13.PackingCost, - Stock = p13.Stock, - HasExpressDelivery = p13.HasExpressDelivery, - MaxOrderCount = p13.MaxOrderCount, - BrandId = p13.BrandId, - CategoryId = p13.CategoryId, - Specifications = p13.Specifications.Select(p14 => new Specification() + PersianName = p17.PersianName, + EnglishName = p17.EnglishName, + Summery = p17.Summery, + ExpertCheck = p17.ExpertCheck, + Tags = p17.Tags, + Warranty = p17.Warranty, + Cost = p17.Cost, + BeDisplayed = p17.BeDisplayed, + PackingCost = p17.PackingCost, + Stock = p17.Stock, + HasExpressDelivery = p17.HasExpressDelivery, + MaxOrderCount = p17.MaxOrderCount, + BrandId = p17.BrandId, + Brand = new Brand() { - Title = p14.Title, - Detail = p14.Detail, - Value = p14.Value, - IsFeature = p14.IsFeature, - ProductId = p14.ProductId, - ParentId = (Guid?)p14.ParentId, - Id = p14.Id, - CreatedAt = p14.CreatedAt + Name = p17.BrandName, + Id = p17.BrandId + }, + CategoryId = p17.CategoryId, + Category = new ProductCategory() + { + Name = p17.CategoryName, + Id = p17.CategoryId + }, + Specifications = p17.Specifications.Select(p18 => new Specification() + { + Title = p18.Title, + Detail = p18.Detail, + Value = p18.Value, + IsFeature = p18.IsFeature, + ProductId = p18.ProductId, + ParentId = (Guid?)p18.ParentId, + Id = p18.Id, + CreatedAt = p18.CreatedAt }).ToList(), - Reviews = p13.Reviews.Select(p15 => new Review() + Reviews = p17.Reviews.Select(p19 => new Review() { - Title = p15.Title, - Comment = p15.Comment, - Rate = p15.Rate, - IsBuyer = p15.IsBuyer, - ProductId = p15.ProductId, - UserId = p15.UserId, - Id = p15.Id, - CreatedAt = p15.CreatedAt + Title = p19.Title, + Comment = p19.Comment, + Rate = p19.Rate, + IsBuyer = p19.IsBuyer, + ProductId = p19.ProductId, + UserId = p19.UserId, + Id = p19.Id, + CreatedAt = p19.CreatedAt }).ToList(), - Files = p13.Files.Select(p16 => new ProductStorageFile() + Files = p17.Files.Select(p20 => new ProductStorageFile() { - Name = p16.Name, - FileLocation = p16.FileLocation, - FileName = p16.FileName, - IsHeader = p16.IsHeader, - IsPrimary = p16.IsPrimary, - FileType = p16.FileType, - Id = p16.Id, - CreatedAt = p16.CreatedAt + Name = p20.Name, + FileLocation = p20.FileLocation, + FileName = p20.FileName, + IsHeader = p20.IsHeader, + IsPrimary = p20.IsPrimary, + FileType = p20.FileType, + Id = p20.Id, + CreatedAt = p20.CreatedAt }).ToList(), - Id = p13.Id, - CreatedAt = p13.CreatedAt + Id = p17.Id, + CreatedAt = p17.CreatedAt }; - public static ProductLDto AdaptToLDto(this Product p17) + public static ProductLDto AdaptToLDto(this Product p21) { - return p17 == null ? null : new ProductLDto() + return p21 == null ? null : new ProductLDto() { - PersianName = p17.PersianName, - EnglishName = p17.EnglishName, - Summery = p17.Summery, - ExpertCheck = p17.ExpertCheck, - Tags = p17.Tags, - Warranty = p17.Warranty, - BeDisplayed = p17.BeDisplayed, - HasExpressDelivery = p17.HasExpressDelivery, - MaxOrderCount = p17.MaxOrderCount, - Cost = p17.Cost, - PackingCost = p17.PackingCost, - Stock = p17.Stock, - BrandId = p17.BrandId, - BrandName = p17.Brand == null ? null : p17.Brand.Name, - CategoryId = p17.CategoryId, - CategoryName = p17.Category == null ? null : p17.Category.Name, - Specifications = funcMain7(p17.Specifications), - Reviews = funcMain8(p17.Reviews), - Files = funcMain9(p17.Files), - Id = p17.Id, - CreatedAt = p17.CreatedAt + PersianName = p21.PersianName, + EnglishName = p21.EnglishName, + Summery = p21.Summery, + ExpertCheck = p21.ExpertCheck, + Tags = p21.Tags, + Warranty = p21.Warranty, + BeDisplayed = p21.BeDisplayed, + HasExpressDelivery = p21.HasExpressDelivery, + Cost = p21.Cost, + PackingCost = p21.PackingCost, + MaxOrderCount = p21.MaxOrderCount, + Stock = p21.Stock, + BrandId = p21.BrandId, + BrandName = p21.Brand == null ? null : p21.Brand.Name, + CategoryId = p21.CategoryId, + CategoryName = p21.Category == null ? null : p21.Category.Name, + Specifications = funcMain9(p21.Specifications), + Reviews = funcMain10(p21.Reviews), + Files = funcMain11(p21.Files), + Id = p21.Id, + CreatedAt = p21.CreatedAt }; } - public static ProductLDto AdaptTo(this Product p21, ProductLDto p22) + public static ProductLDto AdaptTo(this Product p25, ProductLDto p26) { - if (p21 == null) + if (p25 == null) { return null; } - ProductLDto result = p22 ?? new ProductLDto(); + ProductLDto result = p26 ?? new ProductLDto(); - result.PersianName = p21.PersianName; - result.EnglishName = p21.EnglishName; - result.Summery = p21.Summery; - result.ExpertCheck = p21.ExpertCheck; - result.Tags = p21.Tags; - result.Warranty = p21.Warranty; - result.BeDisplayed = p21.BeDisplayed; - result.HasExpressDelivery = p21.HasExpressDelivery; - result.MaxOrderCount = p21.MaxOrderCount; - result.Cost = p21.Cost; - result.PackingCost = p21.PackingCost; - result.Stock = p21.Stock; - result.BrandId = p21.BrandId; - result.BrandName = p21.Brand == null ? null : p21.Brand.Name; - result.CategoryId = p21.CategoryId; - result.CategoryName = p21.Category == null ? null : p21.Category.Name; - result.Specifications = funcMain10(p21.Specifications, result.Specifications); - result.Reviews = funcMain11(p21.Reviews, result.Reviews); - result.Files = funcMain12(p21.Files, result.Files); - result.Id = p21.Id; - result.CreatedAt = p21.CreatedAt; + result.PersianName = p25.PersianName; + result.EnglishName = p25.EnglishName; + result.Summery = p25.Summery; + result.ExpertCheck = p25.ExpertCheck; + result.Tags = p25.Tags; + result.Warranty = p25.Warranty; + result.BeDisplayed = p25.BeDisplayed; + result.HasExpressDelivery = p25.HasExpressDelivery; + result.Cost = p25.Cost; + result.PackingCost = p25.PackingCost; + result.MaxOrderCount = p25.MaxOrderCount; + result.Stock = p25.Stock; + result.BrandId = p25.BrandId; + result.BrandName = p25.Brand == null ? null : p25.Brand.Name; + result.CategoryId = p25.CategoryId; + result.CategoryName = p25.Category == null ? null : p25.Category.Name; + result.Specifications = funcMain12(p25.Specifications, result.Specifications); + result.Reviews = funcMain13(p25.Reviews, result.Reviews); + result.Files = funcMain14(p25.Files, result.Files); + result.Id = p25.Id; + result.CreatedAt = p25.CreatedAt; return result; } - public static Expression> ProjectToLDto => p29 => new ProductLDto() + public static Expression> ProjectToLDto => p33 => new ProductLDto() { - PersianName = p29.PersianName, - EnglishName = p29.EnglishName, - Summery = p29.Summery, - ExpertCheck = p29.ExpertCheck, - Tags = p29.Tags, - Warranty = p29.Warranty, - BeDisplayed = p29.BeDisplayed, - HasExpressDelivery = p29.HasExpressDelivery, - MaxOrderCount = p29.MaxOrderCount, - Cost = p29.Cost, - PackingCost = p29.PackingCost, - Stock = p29.Stock, - BrandId = p29.BrandId, - BrandName = p29.Brand.Name, - CategoryId = p29.CategoryId, - CategoryName = p29.Category.Name, - Specifications = p29.Specifications.Select(p30 => new SpecificationSDto() + PersianName = p33.PersianName, + EnglishName = p33.EnglishName, + Summery = p33.Summery, + ExpertCheck = p33.ExpertCheck, + Tags = p33.Tags, + Warranty = p33.Warranty, + BeDisplayed = p33.BeDisplayed, + HasExpressDelivery = p33.HasExpressDelivery, + Cost = p33.Cost, + PackingCost = p33.PackingCost, + MaxOrderCount = p33.MaxOrderCount, + Stock = p33.Stock, + BrandId = p33.BrandId, + BrandName = p33.Brand == null ? null : p33.Brand.Name, + CategoryId = p33.CategoryId, + CategoryName = p33.Category == null ? null : p33.Category.Name, + Specifications = p33.Specifications.Select(p34 => new SpecificationSDto() { - Title = p30.Title, - Detail = p30.Detail, - Value = p30.Value, - IsFeature = p30.IsFeature, - ProductId = p30.ProductId, - ParentId = p30.ParentId == null ? default(Guid) : (Guid)p30.ParentId, - Id = p30.Id, - CreatedAt = p30.CreatedAt + Title = p34.Title, + Detail = p34.Detail, + Value = p34.Value, + IsFeature = p34.IsFeature, + ProductId = p34.ProductId, + ParentId = p34.ParentId == null ? default(Guid) : (Guid)p34.ParentId, + Id = p34.Id, + CreatedAt = p34.CreatedAt }).ToList(), - Reviews = p29.Reviews.Select(p31 => new ReviewSDto() + Reviews = p33.Reviews.Select(p35 => new ReviewSDto() { - Title = p31.Title, - Comment = p31.Comment, - Rate = p31.Rate, - IsBuyer = p31.IsBuyer, - ProductId = p31.ProductId, - UserId = p31.UserId, - Id = p31.Id, - CreatedAt = p31.CreatedAt + Title = p35.Title, + Comment = p35.Comment, + Rate = p35.Rate, + IsBuyer = p35.IsBuyer, + ProductId = p35.ProductId, + UserId = p35.UserId, + Id = p35.Id, + CreatedAt = p35.CreatedAt }).ToList(), - Files = p29.Files.Select(p32 => new StorageFileSDto() + Files = p33.Files.Select(p36 => new StorageFileSDto() { - Name = p32.Name, - FileLocation = p32.FileLocation, - FileName = p32.FileName, - IsHeader = p32.IsHeader, - IsPrimary = p32.IsPrimary, - FileType = p32.FileType, - Id = p32.Id + Name = p36.Name, + FileLocation = p36.FileLocation, + FileName = p36.FileName, + IsHeader = p36.IsHeader, + IsPrimary = p36.IsPrimary, + FileType = p36.FileType, + Id = p36.Id }).ToList(), - Id = p29.Id, - CreatedAt = p29.CreatedAt + Id = p33.Id, + CreatedAt = p33.CreatedAt }; - public static Product AdaptToProduct(this ProductSDto p33) + public static Product AdaptToProduct(this ProductSDto p37) { - return p33 == null ? null : new Product() + return p37 == null ? null : new Product() { - PersianName = p33.PersianName, - EnglishName = p33.EnglishName, - Summery = p33.Summery, - ExpertCheck = p33.ExpertCheck, - Tags = p33.Tags, - Warranty = p33.Warranty, - Cost = p33.Cost, - IsEnable = p33.IsEnable, - BeDisplayed = p33.BeDisplayed, - PackingCost = p33.PackingCost, - Rate = p33.Rate, - ReviewCount = p33.ReviewCount, - Viewed = p33.Viewed, - BrandId = p33.BrandId, + PersianName = p37.PersianName, + EnglishName = p37.EnglishName, + Summery = p37.Summery, + ExpertCheck = p37.ExpertCheck, + Tags = p37.Tags, + Warranty = p37.Warranty, + Cost = p37.Cost, + IsEnable = p37.IsEnable, + BeDisplayed = p37.BeDisplayed, + PackingCost = p37.PackingCost, + Rate = p37.Rate, + ReviewCount = p37.ReviewCount, + Viewed = p37.Viewed, + BrandId = p37.BrandId, Brand = new Brand() { - Name = p33.BrandName, - Id = p33.BrandId + Name = p37.BrandName, + Id = p37.BrandId }, - CategoryId = p33.CategoryId, + CategoryId = p37.CategoryId, Category = new ProductCategory() { - Name = p33.CategoryName, - Id = p33.CategoryId + Name = p37.CategoryName, + Id = p37.CategoryId }, - Id = p33.Id, - CreatedAt = p33.CreatedAt + Id = p37.Id, + CreatedAt = p37.CreatedAt }; } - public static Product AdaptTo(this ProductSDto p34, Product p35) + public static Product AdaptTo(this ProductSDto p38, Product p39) { - if (p34 == null) + if (p38 == null) { return null; } - Product result = p35 ?? new Product(); + Product result = p39 ?? new Product(); - result.PersianName = p34.PersianName; - result.EnglishName = p34.EnglishName; - result.Summery = p34.Summery; - result.ExpertCheck = p34.ExpertCheck; - result.Tags = p34.Tags; - result.Warranty = p34.Warranty; - result.Cost = p34.Cost; - result.IsEnable = p34.IsEnable; - result.BeDisplayed = p34.BeDisplayed; - result.PackingCost = p34.PackingCost; - result.Rate = p34.Rate; - result.ReviewCount = p34.ReviewCount; - result.Viewed = p34.Viewed; - result.BrandId = p34.BrandId; - result.Brand = funcMain13(new Never(), result.Brand, p34); - result.CategoryId = p34.CategoryId; - result.Category = funcMain14(new Never(), result.Category, p34); - result.Id = p34.Id; - result.CreatedAt = p34.CreatedAt; + result.PersianName = p38.PersianName; + result.EnglishName = p38.EnglishName; + result.Summery = p38.Summery; + result.ExpertCheck = p38.ExpertCheck; + result.Tags = p38.Tags; + result.Warranty = p38.Warranty; + result.Cost = p38.Cost; + result.IsEnable = p38.IsEnable; + result.BeDisplayed = p38.BeDisplayed; + result.PackingCost = p38.PackingCost; + result.Rate = p38.Rate; + result.ReviewCount = p38.ReviewCount; + result.Viewed = p38.Viewed; + result.BrandId = p38.BrandId; + result.Brand = funcMain15(new Never(), result.Brand, p38); + result.CategoryId = p38.CategoryId; + result.Category = funcMain16(new Never(), result.Category, p38); + result.Id = p38.Id; + result.CreatedAt = p38.CreatedAt; return result; } - public static ProductSDto AdaptToSDto(this Product p40) + public static ProductSDto AdaptToSDto(this Product p44) { - return p40 == null ? null : new ProductSDto() + return p44 == null ? null : new ProductSDto() { - PersianName = p40.PersianName, - EnglishName = p40.EnglishName, - Summery = p40.Summery, - ExpertCheck = p40.ExpertCheck, - Tags = p40.Tags, - Warranty = p40.Warranty, - Cost = p40.Cost, - IsEnable = p40.IsEnable, - BeDisplayed = p40.BeDisplayed, - PackingCost = p40.PackingCost, - Rate = p40.Rate, - ReviewCount = p40.ReviewCount, - Viewed = p40.Viewed, - CategoryId = p40.CategoryId, - BrandId = p40.BrandId, - BrandName = p40.Brand == null ? null : p40.Brand.Name, - CategoryName = p40.Category == null ? null : p40.Category.Name, - Id = p40.Id, - CreatedAt = p40.CreatedAt + PersianName = p44.PersianName, + EnglishName = p44.EnglishName, + Summery = p44.Summery, + ExpertCheck = p44.ExpertCheck, + Tags = p44.Tags, + Warranty = p44.Warranty, + Cost = p44.Cost, + IsEnable = p44.IsEnable, + BeDisplayed = p44.BeDisplayed, + PackingCost = p44.PackingCost, + Rate = p44.Rate, + ReviewCount = p44.ReviewCount, + Viewed = p44.Viewed, + MainImage = p44.Files.FirstOrDefault(funcMain17) != null ? p44.Files.FirstOrDefault(funcMain18).FileLocation : (p44.Files.Count > 0 ? p44.Files.FirstOrDefault().FileLocation : string.Empty), + CategoryId = p44.CategoryId, + BrandId = p44.BrandId, + BrandName = p44.Brand == null ? null : p44.Brand.Name, + CategoryName = p44.Category == null ? null : p44.Category.Name, + Id = p44.Id, + CreatedAt = p44.CreatedAt }; } - public static ProductSDto AdaptTo(this Product p41, ProductSDto p42) + public static ProductSDto AdaptTo(this Product p45, ProductSDto p46) { - if (p41 == null) + if (p45 == null) { return null; } - ProductSDto result = p42 ?? new ProductSDto(); + ProductSDto result = p46 ?? new ProductSDto(); - result.PersianName = p41.PersianName; - result.EnglishName = p41.EnglishName; - result.Summery = p41.Summery; - result.ExpertCheck = p41.ExpertCheck; - result.Tags = p41.Tags; - result.Warranty = p41.Warranty; - result.Cost = p41.Cost; - result.IsEnable = p41.IsEnable; - result.BeDisplayed = p41.BeDisplayed; - result.PackingCost = p41.PackingCost; - result.Rate = p41.Rate; - result.ReviewCount = p41.ReviewCount; - result.Viewed = p41.Viewed; - result.CategoryId = p41.CategoryId; - result.BrandId = p41.BrandId; - result.BrandName = p41.Brand == null ? null : p41.Brand.Name; - result.CategoryName = p41.Category == null ? null : p41.Category.Name; - result.Id = p41.Id; - result.CreatedAt = p41.CreatedAt; + result.PersianName = p45.PersianName; + result.EnglishName = p45.EnglishName; + result.Summery = p45.Summery; + result.ExpertCheck = p45.ExpertCheck; + result.Tags = p45.Tags; + result.Warranty = p45.Warranty; + result.Cost = p45.Cost; + result.IsEnable = p45.IsEnable; + result.BeDisplayed = p45.BeDisplayed; + result.PackingCost = p45.PackingCost; + result.Rate = p45.Rate; + result.ReviewCount = p45.ReviewCount; + result.Viewed = p45.Viewed; + result.MainImage = p45.Files.FirstOrDefault(funcMain17) != null ? p45.Files.FirstOrDefault(funcMain18).FileLocation : (p45.Files.Count > 0 ? p45.Files.FirstOrDefault().FileLocation : string.Empty); + result.CategoryId = p45.CategoryId; + result.BrandId = p45.BrandId; + result.BrandName = p45.Brand == null ? null : p45.Brand.Name; + result.CategoryName = p45.Category == null ? null : p45.Category.Name; + result.Id = p45.Id; + result.CreatedAt = p45.CreatedAt; return result; } - public static Expression> ProjectToSDto => p43 => new ProductSDto() + public static Expression> ProjectToSDto => p47 => new ProductSDto() { - PersianName = p43.PersianName, - EnglishName = p43.EnglishName, - Summery = p43.Summery, - ExpertCheck = p43.ExpertCheck, - Tags = p43.Tags, - Warranty = p43.Warranty, - Cost = p43.Cost, - IsEnable = p43.IsEnable, - BeDisplayed = p43.BeDisplayed, - PackingCost = p43.PackingCost, - Rate = p43.Rate, - ReviewCount = p43.ReviewCount, - Viewed = p43.Viewed, - CategoryId = p43.CategoryId, - BrandId = p43.BrandId, - BrandName = p43.Brand == null ? null : p43.Brand.Name, - CategoryName = p43.Category == null ? null : p43.Category.Name, - Id = p43.Id, - CreatedAt = p43.CreatedAt + PersianName = p47.PersianName, + EnglishName = p47.EnglishName, + Summery = p47.Summery, + ExpertCheck = p47.ExpertCheck, + Tags = p47.Tags, + Warranty = p47.Warranty, + Cost = p47.Cost, + IsEnable = p47.IsEnable, + BeDisplayed = p47.BeDisplayed, + PackingCost = p47.PackingCost, + Rate = p47.Rate, + ReviewCount = p47.ReviewCount, + Viewed = p47.Viewed, + MainImage = p47.Files.FirstOrDefault(f => f.IsPrimary) != null ? p47.Files.FirstOrDefault(f => f.IsPrimary).FileLocation : (p47.Files.Count > 0 ? p47.Files.FirstOrDefault().FileLocation : string.Empty), + CategoryId = p47.CategoryId, + BrandId = p47.BrandId, + BrandName = p47.Brand == null ? null : p47.Brand.Name, + CategoryName = p47.Category == null ? null : p47.Category.Name, + Id = p47.Id, + CreatedAt = p47.CreatedAt }; private static List funcMain1(List p2) @@ -466,20 +491,40 @@ namespace NetinaShop.Domain.Mappers } - private static List funcMain4(List p7, List p8) + private static Brand funcMain4(Never p7, Brand p8, ProductLDto p5) { - if (p7 == null) + Brand result = p8 ?? new Brand(); + + result.Name = p5.BrandName; + result.Id = p5.BrandId; + return result; + + } + + private static ProductCategory funcMain5(Never p9, ProductCategory p10, ProductLDto p5) + { + ProductCategory result = p10 ?? new ProductCategory(); + + result.Name = p5.CategoryName; + result.Id = p5.CategoryId; + return result; + + } + + private static List funcMain6(List p11, List p12) + { + if (p11 == null) { return null; } - List result = new List(p7.Count); + List result = new List(p11.Count); int i = 0; - int len = p7.Count; + int len = p11.Count; while (i < len) { - SpecificationSDto item = p7[i]; + SpecificationSDto item = p11[i]; result.Add(item == null ? null : new Specification() { Title = item.Title, @@ -497,20 +542,20 @@ namespace NetinaShop.Domain.Mappers } - private static List funcMain5(List p9, List p10) + private static List funcMain7(List p13, List p14) { - if (p9 == null) + if (p13 == null) { return null; } - List result = new List(p9.Count); + List result = new List(p13.Count); int i = 0; - int len = p9.Count; + int len = p13.Count; while (i < len) { - ReviewSDto item = p9[i]; + ReviewSDto item = p13[i]; result.Add(item == null ? null : new Review() { Title = item.Title, @@ -528,20 +573,20 @@ namespace NetinaShop.Domain.Mappers } - private static List funcMain6(List p11, List p12) + private static List funcMain8(List p15, List p16) { - if (p11 == null) + if (p15 == null) { return null; } - List result = new List(p11.Count); + List result = new List(p15.Count); int i = 0; - int len = p11.Count; + int len = p15.Count; while (i < len) { - StorageFileSDto item = p11[i]; + StorageFileSDto item = p15[i]; result.Add(item == null ? null : new ProductStorageFile() { Name = item.Name, @@ -559,20 +604,20 @@ namespace NetinaShop.Domain.Mappers } - private static List funcMain7(List p18) + private static List funcMain9(List p22) { - if (p18 == null) + if (p22 == null) { return null; } - List result = new List(p18.Count); + List result = new List(p22.Count); int i = 0; - int len = p18.Count; + int len = p22.Count; while (i < len) { - Specification item = p18[i]; + Specification item = p22[i]; result.Add(item == null ? null : new SpecificationSDto() { Title = item.Title, @@ -590,112 +635,20 @@ namespace NetinaShop.Domain.Mappers } - private static List funcMain8(List p19) - { - if (p19 == null) - { - return null; - } - List result = new List(p19.Count); - - int i = 0; - int len = p19.Count; - - while (i < len) - { - Review item = p19[i]; - result.Add(item == null ? null : new ReviewSDto() - { - Title = item.Title, - Comment = item.Comment, - Rate = item.Rate, - IsBuyer = item.IsBuyer, - ProductId = item.ProductId, - UserId = item.UserId, - Id = item.Id, - CreatedAt = item.CreatedAt - }); - i++; - } - return result; - - } - - private static List funcMain9(List p20) - { - if (p20 == null) - { - return null; - } - List result = new List(p20.Count); - - int i = 0; - int len = p20.Count; - - while (i < len) - { - ProductStorageFile item = p20[i]; - result.Add(item == null ? null : new StorageFileSDto() - { - Name = item.Name, - FileLocation = item.FileLocation, - FileName = item.FileName, - IsHeader = item.IsHeader, - IsPrimary = item.IsPrimary, - FileType = item.FileType, - Id = item.Id - }); - i++; - } - return result; - - } - - private static List funcMain10(List p23, List p24) + private static List funcMain10(List p23) { if (p23 == null) { return null; } - List result = new List(p23.Count); + List result = new List(p23.Count); int i = 0; int len = p23.Count; while (i < len) { - Specification item = p23[i]; - result.Add(item == null ? null : new SpecificationSDto() - { - Title = item.Title, - Detail = item.Detail, - Value = item.Value, - IsFeature = item.IsFeature, - ProductId = item.ProductId, - ParentId = item.ParentId == null ? default(Guid) : (Guid)item.ParentId, - Id = item.Id, - CreatedAt = item.CreatedAt - }); - i++; - } - return result; - - } - - private static List funcMain11(List p25, List p26) - { - if (p25 == null) - { - return null; - } - List result = new List(p25.Count); - - int i = 0; - int len = p25.Count; - - while (i < len) - { - Review item = p25[i]; + Review item = p23[i]; result.Add(item == null ? null : new ReviewSDto() { Title = item.Title, @@ -713,20 +666,20 @@ namespace NetinaShop.Domain.Mappers } - private static List funcMain12(List p27, List p28) + private static List funcMain11(List p24) { - if (p27 == null) + if (p24 == null) { return null; } - List result = new List(p27.Count); + List result = new List(p24.Count); int i = 0; - int len = p27.Count; + int len = p24.Count; while (i < len) { - ProductStorageFile item = p27[i]; + ProductStorageFile item = p24[i]; result.Add(item == null ? null : new StorageFileSDto() { Name = item.Name, @@ -743,24 +696,126 @@ namespace NetinaShop.Domain.Mappers } - private static Brand funcMain13(Never p36, Brand p37, ProductSDto p34) + private static List funcMain12(List p27, List p28) { - Brand result = p37 ?? new Brand(); + if (p27 == null) + { + return null; + } + List result = new List(p27.Count); - result.Name = p34.BrandName; - result.Id = p34.BrandId; + int i = 0; + int len = p27.Count; + + while (i < len) + { + Specification item = p27[i]; + result.Add(item == null ? null : new SpecificationSDto() + { + Title = item.Title, + Detail = item.Detail, + Value = item.Value, + IsFeature = item.IsFeature, + ProductId = item.ProductId, + ParentId = item.ParentId == null ? default(Guid) : (Guid)item.ParentId, + Id = item.Id, + CreatedAt = item.CreatedAt + }); + i++; + } return result; } - private static ProductCategory funcMain14(Never p38, ProductCategory p39, ProductSDto p34) + private static List funcMain13(List p29, List p30) { - ProductCategory result = p39 ?? new ProductCategory(); + if (p29 == null) + { + return null; + } + List result = new List(p29.Count); - result.Name = p34.CategoryName; - result.Id = p34.CategoryId; + int i = 0; + int len = p29.Count; + + while (i < len) + { + Review item = p29[i]; + result.Add(item == null ? null : new ReviewSDto() + { + Title = item.Title, + Comment = item.Comment, + Rate = item.Rate, + IsBuyer = item.IsBuyer, + ProductId = item.ProductId, + UserId = item.UserId, + Id = item.Id, + CreatedAt = item.CreatedAt + }); + i++; + } return result; } + + private static List funcMain14(List p31, List p32) + { + if (p31 == null) + { + return null; + } + List result = new List(p31.Count); + + int i = 0; + int len = p31.Count; + + while (i < len) + { + ProductStorageFile item = p31[i]; + result.Add(item == null ? null : new StorageFileSDto() + { + Name = item.Name, + FileLocation = item.FileLocation, + FileName = item.FileName, + IsHeader = item.IsHeader, + IsPrimary = item.IsPrimary, + FileType = item.FileType, + Id = item.Id + }); + i++; + } + return result; + + } + + private static Brand funcMain15(Never p40, Brand p41, ProductSDto p38) + { + Brand result = p41 ?? new Brand(); + + result.Name = p38.BrandName; + result.Id = p38.BrandId; + return result; + + } + + private static ProductCategory funcMain16(Never p42, ProductCategory p43, ProductSDto p38) + { + ProductCategory result = p43 ?? new ProductCategory(); + + result.Name = p38.CategoryName; + result.Id = p38.CategoryId; + return result; + + } + + private static bool funcMain17(ProductStorageFile f) + { + return f.IsPrimary; + } + + private static bool funcMain18(ProductStorageFile f) + { + return f.IsPrimary; + } } } \ No newline at end of file diff --git a/NetinaShop.Domain/Mappers/ShippingMapper.g.cs b/NetinaShop.Domain/Mappers/ShippingMapper.g.cs index 7f39e4c..04569e6 100644 --- a/NetinaShop.Domain/Mappers/ShippingMapper.g.cs +++ b/NetinaShop.Domain/Mappers/ShippingMapper.g.cs @@ -11,6 +11,12 @@ namespace NetinaShop.Domain.Mappers { return p1 == null ? null : new Shipping() { + Name = p1.Name, + WarehouseName = p1.WarehouseName, + IsExpressShipping = p1.IsExpressShipping, + IsShipBySeller = p1.IsShipBySeller, + IsOriginalWarehouse = p1.IsOriginalWarehouse, + DeliveryCost = p1.DeliveryCost, Id = p1.Id, CreatedAt = p1.CreatedAt }; @@ -23,6 +29,12 @@ namespace NetinaShop.Domain.Mappers } Shipping result = p3 ?? new Shipping(); + result.Name = p2.Name; + result.WarehouseName = p2.WarehouseName; + result.IsExpressShipping = p2.IsExpressShipping; + result.IsShipBySeller = p2.IsShipBySeller; + result.IsOriginalWarehouse = p2.IsOriginalWarehouse; + result.DeliveryCost = p2.DeliveryCost; result.Id = p2.Id; result.CreatedAt = p2.CreatedAt; return result; @@ -32,6 +44,12 @@ namespace NetinaShop.Domain.Mappers { return p4 == null ? null : new ShippingSDto() { + Name = p4.Name, + WarehouseName = p4.WarehouseName, + IsExpressShipping = p4.IsExpressShipping, + IsShipBySeller = p4.IsShipBySeller, + IsOriginalWarehouse = p4.IsOriginalWarehouse, + DeliveryCost = p4.DeliveryCost, Id = p4.Id, CreatedAt = p4.CreatedAt }; @@ -44,6 +62,12 @@ namespace NetinaShop.Domain.Mappers } ShippingSDto result = p6 ?? new ShippingSDto(); + result.Name = p5.Name; + result.WarehouseName = p5.WarehouseName; + result.IsExpressShipping = p5.IsExpressShipping; + result.IsShipBySeller = p5.IsShipBySeller; + result.IsOriginalWarehouse = p5.IsOriginalWarehouse; + result.DeliveryCost = p5.DeliveryCost; result.Id = p5.Id; result.CreatedAt = p5.CreatedAt; return result; @@ -51,6 +75,12 @@ namespace NetinaShop.Domain.Mappers } public static Expression> ProjectToSDto => p7 => new ShippingSDto() { + Name = p7.Name, + WarehouseName = p7.WarehouseName, + IsExpressShipping = p7.IsExpressShipping, + IsShipBySeller = p7.IsShipBySeller, + IsOriginalWarehouse = p7.IsOriginalWarehouse, + DeliveryCost = p7.DeliveryCost, Id = p7.Id, CreatedAt = p7.CreatedAt }; diff --git a/NetinaShop.Domain/MapsterRegister.cs b/NetinaShop.Domain/MapsterRegister.cs index e60844c..dcc68a9 100644 --- a/NetinaShop.Domain/MapsterRegister.cs +++ b/NetinaShop.Domain/MapsterRegister.cs @@ -17,6 +17,13 @@ public class MapsterRegister : IRegister .TwoWays(); config.NewConfig() + .Map("MainImage",o=>o.Files.FirstOrDefault(f=>f.IsPrimary) != null ? o.Files.FirstOrDefault(f => f.IsPrimary).FileLocation : o.Files.Count>0 ? o.Files.FirstOrDefault().FileLocation : string.Empty) + .Map("CategoryName", o => o.Category == null ? null : o.Category.Name) + .Map("BrandName", o => o.Brand == null ? null : o.Brand.Name) + .IgnoreNullValues(false) + .TwoWays(); + + config.NewConfig() .Map("CategoryName", o => o.Category == null ? null : o.Category.Name) .Map("BrandName", o => o.Brand == null ? null : o.Brand.Name) .IgnoreNullValues(false) diff --git a/NetinaShop.Repository/Handlers/Warehouses/CreateShippingCommandHandler.cs b/NetinaShop.Repository/Handlers/Warehouses/CreateShippingCommandHandler.cs index b24b7cf..f645acd 100644 --- a/NetinaShop.Repository/Handlers/Warehouses/CreateShippingCommandHandler.cs +++ b/NetinaShop.Repository/Handlers/Warehouses/CreateShippingCommandHandler.cs @@ -12,7 +12,7 @@ public class CreateShippingCommandHandler : IRequestHandler Handle(CreateShippingCommand request, CancellationToken cancellationToken) { - var ent = Shipping.Create(request.Title, request.WarehouseName, request.IsFastShipping, request.IsShipBySeller, + var ent = Shipping.Create(request.Name, request.WarehouseName, request.IsExpressShipping, request.IsShipBySeller, request.IsOriginalWarehouse,request.DeliveryCost); _repositoryWrapper.SetRepository().Add(ent); await _repositoryWrapper.SaveChangesAsync(cancellationToken); diff --git a/NetinaShop.Repository/Handlers/Warehouses/GetShippingsQueryHandler.cs b/NetinaShop.Repository/Handlers/Warehouses/GetShippingsQueryHandler.cs index 8a8e457..10a94a4 100644 --- a/NetinaShop.Repository/Handlers/Warehouses/GetShippingsQueryHandler.cs +++ b/NetinaShop.Repository/Handlers/Warehouses/GetShippingsQueryHandler.cs @@ -15,8 +15,8 @@ public class GetShippingsQueryHandler : IRequestHandler() .TableNoTracking.OrderByDescending(b => b.CreatedAt) - .Skip(request.Page * 10) - .Take(10) + .Skip(request.Page * 20) + .Take(20) .Select(ShippingMapper.ProjectToSDto) .ToListAsync(cancellationToken); } diff --git a/NetinaShop.Repository/Handlers/Warehouses/UpdateShippingCommandHandler.cs b/NetinaShop.Repository/Handlers/Warehouses/UpdateShippingCommandHandler.cs index 878a459..f6bb642 100644 --- a/NetinaShop.Repository/Handlers/Warehouses/UpdateShippingCommandHandler.cs +++ b/NetinaShop.Repository/Handlers/Warehouses/UpdateShippingCommandHandler.cs @@ -17,7 +17,7 @@ public class UpdateShippingCommandHandler : IRequestHandler +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("20240209170630_EditShippingName")] + partial class EditShippingName + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("public") + .HasAnnotation("ProductVersion", "8.0.1") + .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("IsSpecialOffer") + .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("HasExpressDelivery") + .HasColumnType("boolean"); + + b.Property("IsEnable") + .HasColumnType("boolean"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("MaxOrderCount") + .HasColumnType("integer"); + + 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("Stock") + .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("IsExpressShipping") + .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("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .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); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict); + }); + + modelBuilder.Entity("NetinaShop.Domain.Entities.Blogs.Blog", b => + { + b.HasOne("NetinaShop.Domain.Entities.Blogs.BlogCategory", "Category") + .WithMany("Blogs") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict); + + 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); + + 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); + + b.HasOne("NetinaShop.Domain.Entities.Warehouses.Shipping", "Shipping") + .WithMany() + .HasForeignKey("ShippingId") + .OnDelete(DeleteBehavior.Restrict); + + 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); + + b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") + .WithMany("OrderProducts") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict); + + 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); + + b.HasOne("NetinaShop.Domain.Entities.ProductCategories.ProductCategory", "Category") + .WithMany("Products") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict); + + 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); + + b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict); + + 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"); + + b.HasOne("NetinaShop.Domain.Entities.Products.Product", "Product") + .WithMany("Specifications") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict); + + 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); + + 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); + + b.HasOne("NetinaShop.Domain.Entities.Users.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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/20240209170630_EditShippingName.cs b/NetinaShop.Repository/Migrations/20240209170630_EditShippingName.cs new file mode 100644 index 0000000..e3ff14c --- /dev/null +++ b/NetinaShop.Repository/Migrations/20240209170630_EditShippingName.cs @@ -0,0 +1,930 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NetinaShop.Repository.Migrations +{ + /// + public partial class EditShippingName : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Title", + schema: "public", + table: "Shippings", + newName: "Name"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "UserFavoriteProducts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "UserFavoriteProducts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "UserFavoriteProducts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "UserAddresses", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "UserAddresses", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "UserAddresses", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "StorageFiles", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "StorageFiles", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "StorageFiles", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Specifications", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Specifications", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Specifications", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Shippings", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Shippings", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Shippings", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Reviews", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Reviews", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Reviews", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Products", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Products", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Products", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "ProductCategories", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "ProductCategories", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "ProductCategories", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Orders", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Orders", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Orders", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "OrderProducts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "OrderProducts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "OrderProducts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "OrderDeliveries", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "OrderDeliveries", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "OrderDeliveries", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Discounts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Discounts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Discounts", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Brands", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Brands", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Brands", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Blogs", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Blogs", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Blogs", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "BlogCategories", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "BlogCategories", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "BlogCategories", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Name", + schema: "public", + table: "Shippings", + newName: "Title"); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "UserFavoriteProducts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "UserFavoriteProducts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "UserFavoriteProducts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "UserAddresses", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "UserAddresses", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "UserAddresses", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "StorageFiles", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "StorageFiles", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "StorageFiles", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Specifications", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Specifications", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Specifications", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Shippings", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Shippings", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Shippings", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Reviews", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Reviews", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Reviews", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Products", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Products", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Products", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "ProductCategories", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "ProductCategories", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "ProductCategories", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Orders", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Orders", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Orders", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "OrderProducts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "OrderProducts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "OrderProducts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "OrderDeliveries", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "OrderDeliveries", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "OrderDeliveries", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Discounts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Discounts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Discounts", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Brands", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Brands", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Brands", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "Blogs", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "Blogs", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "Blogs", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RemovedBy", + schema: "public", + table: "BlogCategories", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ModifiedBy", + schema: "public", + table: "BlogCategories", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "CreatedBy", + schema: "public", + table: "BlogCategories", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + } + } +} diff --git a/NetinaShop.Repository/Migrations/ApplicationContextModelSnapshot.cs b/NetinaShop.Repository/Migrations/ApplicationContextModelSnapshot.cs index 3ecac16..9d43d05 100644 --- a/NetinaShop.Repository/Migrations/ApplicationContextModelSnapshot.cs +++ b/NetinaShop.Repository/Migrations/ApplicationContextModelSnapshot.cs @@ -143,7 +143,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("IsRemoved") @@ -156,7 +155,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("ReadingTime") @@ -166,7 +164,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("Summery") @@ -198,7 +195,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("Description") @@ -212,7 +208,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("Name") @@ -223,7 +218,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -241,7 +235,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("Description") @@ -258,7 +251,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("Name") @@ -273,7 +265,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -301,7 +292,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("DiscountAmount") @@ -343,7 +333,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("PriceCeiling") @@ -356,7 +345,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("StartDate") @@ -387,7 +375,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("DeliveryPrice") @@ -416,7 +403,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("OrderAt") @@ -441,7 +427,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("ServicePrice") @@ -482,7 +467,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("DeliveryCost") @@ -495,7 +479,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("OrderId") @@ -517,7 +500,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("ShippingId") @@ -545,7 +527,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("IsRemoved") @@ -555,7 +536,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("OrderId") @@ -586,7 +566,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -608,7 +587,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("Description") @@ -625,7 +603,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("Name") @@ -639,7 +616,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -671,7 +647,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("EnglishName") @@ -698,7 +673,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("PackingCost") @@ -715,7 +689,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("ReviewCount") @@ -762,7 +735,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("IsBuyer") @@ -778,7 +750,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("ProductId") @@ -791,7 +762,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("Title") @@ -820,7 +790,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("Detail") @@ -837,7 +806,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("ParentId") @@ -850,7 +818,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("Title") @@ -880,7 +847,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("Discriminator") @@ -912,7 +878,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("Name") @@ -923,7 +888,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -1074,7 +1038,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("IsRemoved") @@ -1090,7 +1053,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("PostalCode") @@ -1109,7 +1071,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("UserId") @@ -1132,7 +1093,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("IsRemoved") @@ -1142,7 +1102,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") - .IsRequired() .HasColumnType("text"); b.Property("ProductId") @@ -1152,7 +1111,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() .HasColumnType("text"); b.Property("UserId") @@ -1177,7 +1135,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("CreatedBy") - .IsRequired() .HasColumnType("text"); b.Property("DeliveryCost") @@ -1199,6 +1156,9 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("ModifiedBy") + .HasColumnType("text"); + + b.Property("Name") .IsRequired() .HasColumnType("text"); @@ -1206,11 +1166,6 @@ namespace NetinaShop.Repository.Migrations .HasColumnType("timestamp without time zone"); b.Property("RemovedBy") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() .HasColumnType("text"); b.Property("WarehouseName")