From c8a29a92601b5b9683575ab664473855444206ed Mon Sep 17 00:00:00 2001 From: Vitaliy <43200383+s04v@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:52:23 +0100 Subject: [PATCH] Code refactoring for #1090 (#1092) --- .../Views/Product/ProductDetail.cshtml | 2 +- .../Extensions/WorkContext.cs | 5 +- .../Controllers/StockApiController.cs | 9 +- ....cshtml => ProductBackInStockEmail.cshtml} | 0 .../Event/BackInStockSendEmailHandler.cs | 26 - .../{BackInStock.cs => ProductBackInStock.cs} | 2 +- .../ProductBackInStockSendEmailHandler.cs | 22 + ...n.cs => ProductBackInStockSubscription.cs} | 3 +- .../ModuleInitializer.cs | 3 +- .../Services/IStockSubscriptionService.cs | 4 +- .../Services/StockService.cs | 3 +- .../Services/StockSubscriptionService.cs | 25 +- ...ProductBackInStockSubscription.Designer.cs | 4767 +++++++++++++++++ ...57_AddedProductBackInStockSubscription.cs} | 8 +- .../Migrations/SimplDbContextModelSnapshot.cs | 4 +- 15 files changed, 4821 insertions(+), 62 deletions(-) rename src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Views/EmailTemplates/{BackInStockEmail.cshtml => ProductBackInStockEmail.cshtml} (100%) delete mode 100644 src/Modules/SimplCommerce.Module.Inventory/Event/BackInStockSendEmailHandler.cs rename src/Modules/SimplCommerce.Module.Inventory/Event/{BackInStock.cs => ProductBackInStock.cs} (82%) create mode 100644 src/Modules/SimplCommerce.Module.Inventory/Event/ProductBackInStockSendEmailHandler.cs rename src/Modules/SimplCommerce.Module.Inventory/Models/{BackInStockSubscription.cs => ProductBackInStockSubscription.cs} (83%) create mode 100644 src/SimplCommerce.WebHost/Migrations/20240311113057_AddedProductBackInStockSubscription.Designer.cs rename src/SimplCommerce.WebHost/Migrations/{20240306234328_AddedBackInStockSubscription.cs => 20240311113057_AddedProductBackInStockSubscription.cs} (75%) diff --git a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Views/Product/ProductDetail.cshtml b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Views/Product/ProductDetail.cshtml index 86c94339b..bb339674e 100644 --- a/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Views/Product/ProductDetail.cshtml +++ b/src/Modules/SimplCommerce.Module.Catalog/Areas/Catalog/Views/Product/ProductDetail.cshtml @@ -203,7 +203,7 @@
- @if (SignInManager.IsSignedIn(User)) + @if (User.Identity.IsAuthenticated) {

Subscribe and we'll notify you when the product is back in stock.

diff --git a/src/Modules/SimplCommerce.Module.Core/Extensions/WorkContext.cs b/src/Modules/SimplCommerce.Module.Core/Extensions/WorkContext.cs index de2b71d59..9829e1788 100644 --- a/src/Modules/SimplCommerce.Module.Core/Extensions/WorkContext.cs +++ b/src/Modules/SimplCommerce.Module.Core/Extensions/WorkContext.cs @@ -33,10 +33,7 @@ public class WorkContext : IWorkContext _configuration = configuration; } - public string GetCurrentHostName() - { - return _httpContext.Request.Host.Value; - } + public string GetCurrentHostName() => _httpContext.Request.Host.Value; public async Task GetCurrentUser() { diff --git a/src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Controllers/StockApiController.cs b/src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Controllers/StockApiController.cs index 1d3e60b45..0370f9635 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Controllers/StockApiController.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Controllers/StockApiController.cs @@ -24,9 +24,9 @@ public class StockApiController : Controller private readonly IWorkContext _workContext; private readonly IRepository _warehouseRepository; private readonly IRepository _stockHistoryRepository; - private readonly IRepository _backInStockSubscriptionRepository; + private readonly IRepository _backInStockSubscriptionRepository; - public StockApiController(IRepository stockRepository, IStockService stockService, IWorkContext workContext, IRepository warehouseRepository, IRepository stockHistoryRepository, IRepository backInStockSubscriptionRepository, IStockSubscriptionService stockSubscriptionService) + public StockApiController(IRepository stockRepository, IStockService stockService, IWorkContext workContext, IRepository warehouseRepository, IRepository stockHistoryRepository, IRepository backInStockSubscriptionRepository, IStockSubscriptionService stockSubscriptionService) { _stockRepository = stockRepository; _stockService = stockService; @@ -145,13 +145,12 @@ public async Task GetStockHistory(int warehouseId, int productId) public async Task BackInStockSubscribe(long productId, string customerEmail) { if (await _backInStockSubscriptionRepository.Query() - .Where(o => o.ProductId == productId && o.CustomerEmail == customerEmail) - .AnyAsync()) + .AnyAsync(o => o.ProductId == productId && o.CustomerEmail == customerEmail)) { return Conflict(); } - await _stockSubscriptionService.BackInStockSubscribeAsync(productId, customerEmail); + await _stockSubscriptionService.ProductBackInStockSubscribeAsync(productId, customerEmail); return Ok(); } diff --git a/src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Views/EmailTemplates/BackInStockEmail.cshtml b/src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Views/EmailTemplates/ProductBackInStockEmail.cshtml similarity index 100% rename from src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Views/EmailTemplates/BackInStockEmail.cshtml rename to src/Modules/SimplCommerce.Module.Inventory/Areas/Inventory/Views/EmailTemplates/ProductBackInStockEmail.cshtml diff --git a/src/Modules/SimplCommerce.Module.Inventory/Event/BackInStockSendEmailHandler.cs b/src/Modules/SimplCommerce.Module.Inventory/Event/BackInStockSendEmailHandler.cs deleted file mode 100644 index e1205dfd6..000000000 --- a/src/Modules/SimplCommerce.Module.Inventory/Event/BackInStockSendEmailHandler.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using MediatR; -using SimplCommerce.Module.Inventory.Services; - -namespace SimplCommerce.Module.Inventory.Event -{ - public class BackInStockSendEmailHandler : INotificationHandler - { - public readonly IStockSubscriptionService _stockSubscriptionService; - - public BackInStockSendEmailHandler(IStockSubscriptionService stockSubscriptionService) - { - _stockSubscriptionService = stockSubscriptionService; - } - - public async Task Handle(BackInStock notification, CancellationToken cancellationToken) - { - await _stockSubscriptionService.BackInStockSendNotificationsAsync(notification.ProductId); - } - } -} diff --git a/src/Modules/SimplCommerce.Module.Inventory/Event/BackInStock.cs b/src/Modules/SimplCommerce.Module.Inventory/Event/ProductBackInStock.cs similarity index 82% rename from src/Modules/SimplCommerce.Module.Inventory/Event/BackInStock.cs rename to src/Modules/SimplCommerce.Module.Inventory/Event/ProductBackInStock.cs index fdaef7f6e..d1bd8ffaf 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/Event/BackInStock.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/Event/ProductBackInStock.cs @@ -7,7 +7,7 @@ namespace SimplCommerce.Module.Inventory.Event { - public class BackInStock : INotification + public class ProductBackInStock : INotification { public long ProductId { get; set; } } diff --git a/src/Modules/SimplCommerce.Module.Inventory/Event/ProductBackInStockSendEmailHandler.cs b/src/Modules/SimplCommerce.Module.Inventory/Event/ProductBackInStockSendEmailHandler.cs new file mode 100644 index 000000000..e2a9c8441 --- /dev/null +++ b/src/Modules/SimplCommerce.Module.Inventory/Event/ProductBackInStockSendEmailHandler.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using MediatR; +using SimplCommerce.Module.Inventory.Services; + +namespace SimplCommerce.Module.Inventory.Event +{ + public class ProductBackInStockSendEmailHandler : INotificationHandler + { + public readonly IStockSubscriptionService _stockSubscriptionService; + + public ProductBackInStockSendEmailHandler(IStockSubscriptionService stockSubscriptionService) + => _stockSubscriptionService = stockSubscriptionService; + + public async Task Handle(ProductBackInStock notification, CancellationToken cancellationToken) + => await _stockSubscriptionService.ProductBackInStockSendNotificationsAsync(notification.ProductId); + } +} diff --git a/src/Modules/SimplCommerce.Module.Inventory/Models/BackInStockSubscription.cs b/src/Modules/SimplCommerce.Module.Inventory/Models/ProductBackInStockSubscription.cs similarity index 83% rename from src/Modules/SimplCommerce.Module.Inventory/Models/BackInStockSubscription.cs rename to src/Modules/SimplCommerce.Module.Inventory/Models/ProductBackInStockSubscription.cs index 620a50625..df745367c 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/Models/BackInStockSubscription.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/Models/ProductBackInStockSubscription.cs @@ -7,9 +7,10 @@ namespace SimplCommerce.Module.Inventory.Models { - public class BackInStockSubscription : EntityBase + public class ProductBackInStockSubscription : EntityBase { public long ProductId { get; set; } + public string CustomerEmail { get; set; } } } diff --git a/src/Modules/SimplCommerce.Module.Inventory/ModuleInitializer.cs b/src/Modules/SimplCommerce.Module.Inventory/ModuleInitializer.cs index cc07700b5..0a618743a 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/ModuleInitializer.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/ModuleInitializer.cs @@ -17,8 +17,7 @@ public void ConfigureServices(IServiceCollection serviceCollection) { serviceCollection.AddTransient(); serviceCollection.AddTransient(); - serviceCollection.AddTransient, BackInStockSendEmailHandler>(); - + serviceCollection.AddTransient, ProductBackInStockSendEmailHandler>(); GlobalConfiguration.RegisterAngularModule("simplAdmin.inventory"); } diff --git a/src/Modules/SimplCommerce.Module.Inventory/Services/IStockSubscriptionService.cs b/src/Modules/SimplCommerce.Module.Inventory/Services/IStockSubscriptionService.cs index 67b7830fa..8abf8a771 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/Services/IStockSubscriptionService.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/Services/IStockSubscriptionService.cs @@ -8,8 +8,8 @@ namespace SimplCommerce.Module.Inventory.Services { public interface IStockSubscriptionService { - Task BackInStockSubscribeAsync(long productId, string customerEmail); + Task ProductBackInStockSubscribeAsync(long productId, string customerEmail); - Task BackInStockSendNotificationsAsync(long productId); + Task ProductBackInStockSendNotificationsAsync(long productId); } } diff --git a/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs b/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs index 20561c4e2..f1356da93 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/Services/StockService.cs @@ -49,7 +49,6 @@ public async Task UpdateStock(StockUpdateRequest stockUpdateRequest) var stock = await _stockRepository.Query().FirstOrDefaultAsync(x => x.ProductId == stockUpdateRequest.ProductId && x.WarehouseId == stockUpdateRequest.WarehouseId); var prevStockQuantity = product.StockQuantity; - stock.Quantity = stock.Quantity + stockUpdateRequest.AdjustedQuantity; product.StockQuantity = product.StockQuantity + stockUpdateRequest.AdjustedQuantity; var stockHistory = new StockHistory @@ -67,7 +66,7 @@ public async Task UpdateStock(StockUpdateRequest stockUpdateRequest) if (prevStockQuantity <= 0 && product.StockQuantity > 0) { - await _mediator.Publish(new BackInStock { ProductId = product.Id }); + await _mediator.Publish(new ProductBackInStock { ProductId = product.Id }); } } } diff --git a/src/Modules/SimplCommerce.Module.Inventory/Services/StockSubscriptionService.cs b/src/Modules/SimplCommerce.Module.Inventory/Services/StockSubscriptionService.cs index 92d4733b2..46c4384fa 100644 --- a/src/Modules/SimplCommerce.Module.Inventory/Services/StockSubscriptionService.cs +++ b/src/Modules/SimplCommerce.Module.Inventory/Services/StockSubscriptionService.cs @@ -16,22 +16,22 @@ namespace SimplCommerce.Module.Inventory.Services { public class StockSubscriptionService : IStockSubscriptionService { - private readonly IRepository _backInStockSubscriptionRepository; + private readonly IRepository _productBackInStockSubscriptionRepository; private readonly IRepository _productRepository; private readonly IEmailSender _emailSender; private readonly IRazorViewRenderer _viewRender; - public StockSubscriptionService(IRepository backInStockSubscriptionRepository, IEmailSender emailSender, IRazorViewRenderer viewRender, IRepository productRepository) + public StockSubscriptionService(IRepository backInStockSubscriptionRepository, IEmailSender emailSender, IRazorViewRenderer viewRender, IRepository productRepository) { - _backInStockSubscriptionRepository = backInStockSubscriptionRepository; + _productBackInStockSubscriptionRepository = backInStockSubscriptionRepository; _emailSender = emailSender; _viewRender = viewRender; _productRepository = productRepository; } - public async Task BackInStockSendNotificationsAsync(long productId) + public async Task ProductBackInStockSendNotificationsAsync(long productId) { - var subscriptions = await _backInStockSubscriptionRepository + var subscriptions = await _productBackInStockSubscriptionRepository .Query() .Where(o => o.ProductId == productId) .ToListAsync(); @@ -42,29 +42,30 @@ public async Task BackInStockSendNotificationsAsync(long productId) .Include(o => o.ThumbnailImage) .FirstOrDefaultAsync(); - var emailBody = await _viewRender.RenderViewToStringAsync("/Areas/Inventory/Views/EmailTemplates/BackInStockEmail.cshtml", product); + var emailBody = await _viewRender.RenderViewToStringAsync("/Areas/Inventory/Views/EmailTemplates/ProductBackInStockEmail.cshtml", product); var emailSubject = $"Back in stock"; foreach (var subscription in subscriptions) { await _emailSender.SendEmailAsync(subscription.CustomerEmail, emailSubject, emailBody, true); - _backInStockSubscriptionRepository.Remove(subscription); + _productBackInStockSubscriptionRepository.Remove(subscription); } - await _backInStockSubscriptionRepository.SaveChangesAsync(); + await _productBackInStockSubscriptionRepository.SaveChangesAsync(); } - public async Task BackInStockSubscribeAsync(long productId, string customerEmail) + public async Task ProductBackInStockSubscribeAsync(long productId, string customerEmail) { - var subscription = new BackInStockSubscription + var subscription = new ProductBackInStockSubscription { ProductId = productId, CustomerEmail = customerEmail }; - _backInStockSubscriptionRepository.Add(subscription); - await _backInStockSubscriptionRepository.SaveChangesAsync(); + _productBackInStockSubscriptionRepository.Add(subscription); + + await _productBackInStockSubscriptionRepository.SaveChangesAsync(); } } } diff --git a/src/SimplCommerce.WebHost/Migrations/20240311113057_AddedProductBackInStockSubscription.Designer.cs b/src/SimplCommerce.WebHost/Migrations/20240311113057_AddedProductBackInStockSubscription.Designer.cs new file mode 100644 index 000000000..a84334823 --- /dev/null +++ b/src/SimplCommerce.WebHost/Migrations/20240311113057_AddedProductBackInStockSubscription.Designer.cs @@ -0,0 +1,4767 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SimplCommerce.Module.Core.Data; + +#nullable disable + +namespace SimplCommerce.WebHost.Migrations +{ + [DbContext(typeof(SimplDbContext))] + [Migration("20240311113057_AddedProductBackInStockSubscription")] + partial class AddedProductBackInStockSubscription + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_RoleClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserClaim", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserLogin", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("Core_UserToken", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Localization_Culture", (string)null); + + b.HasData( + new + { + Id = "en-US", + Name = "English (US)" + }); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityType") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ProperyName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_LocalizedContentProperty", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CultureId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CultureId"); + + b.ToTable("Localization_Resource", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActivityTypeId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ActivityTypeId"); + + b.ToTable("ActivityLog_Activity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.ActivityType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("ActivityLog_ActivityType", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "EntityView" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Brand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_Brand", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IncludeInMenu") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Category", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BrandId") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("Gtin") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("HasOptions") + .HasColumnType("bit"); + + b.Property("IsAllowToOrder") + .HasColumnType("bit"); + + b.Property("IsCallForPricing") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFeatured") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsVisibleIndividually") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("NormalizedName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OldPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("RatingAverage") + .HasColumnType("float"); + + b.Property("ReviewsCount") + .HasColumnType("int"); + + b.Property("ShortDescription") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Sku") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SpecialPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("datetimeoffset"); + + b.Property("SpecialPriceStart") + .HasColumnType("datetimeoffset"); + + b.Property("Specification") + .HasColumnType("nvarchar(max)"); + + b.Property("StockQuantity") + .HasColumnType("int"); + + b.Property("StockTrackingIsEnabled") + .HasColumnType("bit"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BrandId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("TaxClassId"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("Catalog_Product", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("Catalog_ProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductAttributeGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AttributeId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AttributeId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductAttributeValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsFeaturedProduct") + .HasColumnType("bit"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("LinkType") + .HasColumnType("int"); + + b.Property("LinkedProductId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("LinkedProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductLink", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("MediaId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductMedia", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductOption", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Color" + }, + new + { + Id = 2L, + Name = "Size" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("int"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionCombination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DisplayType") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OptionId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SortIndex") + .HasColumnType("int"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("OptionId"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductOptionValue", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OldPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("SpecialPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("SpecialPriceEnd") + .HasColumnType("datetimeoffset"); + + b.Property("SpecialPriceStart") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.ToTable("Catalog_ProductPriceHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Catalog_ProductTemplate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.Property("ProductTemplateId") + .HasColumnType("bigint"); + + b.Property("ProductAttributeId") + .HasColumnType("bigint"); + + b.HasKey("ProductTemplateId", "ProductAttributeId"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("Catalog_ProductTemplateProductAttribute", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.Checkout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("IsProductPriceIncludeTax") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ShippingAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ShippingData") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.ToTable("Checkouts_Checkout", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.CheckoutItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CheckoutId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CheckoutId"); + + b.HasIndex("ProductId"); + + b.ToTable("Checkouts_CheckoutItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsSystem") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Cms_Menu", (string)null); + + b.HasData( + new + { + Id = 1L, + IsPublished = true, + IsSystem = true, + Name = "Customer Services" + }, + new + { + Id = 2L, + IsPublished = true, + IsSystem = true, + Name = "Information" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomLink") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("MenuId") + .HasColumnType("bigint"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("EntityId"); + + b.HasIndex("MenuId"); + + b.HasIndex("ParentId"); + + b.ToTable("Cms_MenuItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Body") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.ToTable("Cms_Page", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CommentText") + .HasColumnType("nvarchar(max)"); + + b.Property("CommenterName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UserId"); + + b.ToTable("Comments_Comment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactAreaId") + .HasColumnType("bigint"); + + b.Property("Content") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EmailAddress") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FullName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PhoneNumber") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ContactAreaId"); + + b.ToTable("Contacts_Contact", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.ContactArea", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Contacts_ContactArea", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_Address", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressLine1 = "364 Cong Hoa", + ContactName = "Thien Nguyen", + CountryId = "VN", + StateOrProvinceId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.AppSetting", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("IsVisibleInCommonSettingPage") + .HasColumnType("bit"); + + b.Property("Module") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_AppSetting", (string)null); + + b.HasData( + new + { + Id = "Catalog.ProductPageSize", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "10" + }, + new + { + Id = "Catalog.IsProductPriceIncludeTax", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "Catalog.MinimumProductQuantityForHighlighting", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "5" + }, + new + { + Id = "Catalog.IsCommentsRequireApproval", + IsVisibleInCommonSettingPage = true, + Module = "Catalog", + Value = "true" + }, + new + { + Id = "GoogleAppKey", + IsVisibleInCommonSettingPage = false, + Module = "Contact", + Value = "" + }, + new + { + Id = "Global.AssetVersion", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "1.0" + }, + new + { + Id = "Global.AssetBundling", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "false" + }, + new + { + Id = "Theme", + IsVisibleInCommonSettingPage = false, + Module = "Core", + Value = "Generic" + }, + new + { + Id = "Global.DefaultCultureUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.DefaultCultureAdminUI", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyCulture", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "en-US" + }, + new + { + Id = "Global.CurrencyDecimalPlace", + IsVisibleInCommonSettingPage = true, + Module = "Core", + Value = "2" + }, + new + { + Id = "SmtpServer", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "smtp.gmail.com" + }, + new + { + Id = "SmtpPort", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "587" + }, + new + { + Id = "SmtpUsername", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "SmtpPassword", + IsVisibleInCommonSettingPage = false, + Module = "EmailSenderSmpt", + Value = "" + }, + new + { + Id = "Localization.LocalizedConentEnable", + IsVisibleInCommonSettingPage = true, + Module = "Localization", + Value = "true" + }, + new + { + Id = "News.PageSize", + IsVisibleInCommonSettingPage = true, + Module = "News", + Value = "10" + }, + new + { + Id = "Tax.DefaultTaxClassId", + IsVisibleInCommonSettingPage = true, + Module = "Tax", + Value = "1" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("Code3") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsBillingEnabled") + .HasColumnType("bit"); + + b.Property("IsCityEnabled") + .HasColumnType("bit"); + + b.Property("IsDistrictEnabled") + .HasColumnType("bit"); + + b.Property("IsShippingEnabled") + .HasColumnType("bit"); + + b.Property("IsZipCodeEnabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Country", (string)null); + + b.HasData( + new + { + Id = "VN", + Code3 = "VNM", + IsBillingEnabled = true, + IsCityEnabled = false, + IsDistrictEnabled = true, + IsShippingEnabled = true, + IsZipCodeEnabled = false, + Name = "Việt Nam" + }, + new + { + Id = "US", + Code3 = "USA", + IsBillingEnabled = true, + IsCityEnabled = true, + IsDistrictEnabled = false, + IsShippingEnabled = true, + IsZipCodeEnabled = true, + Name = "United States" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Core_CustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Core_CustomerGroupUser", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Location") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Core_District", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Quận 1", + StateOrProvinceId = 1L, + Type = "Quận" + }, + new + { + Id = 2L, + Name = "Quận 2", + StateOrProvinceId = 1L, + Type = "Quận" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("Core_Entity", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.EntityType", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AreaName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsMenuable") + .HasColumnType("bit"); + + b.Property("RoutingAction") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RoutingController") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_EntityType", (string)null); + + b.HasData( + new + { + Id = "Category", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "CategoryDetail", + RoutingController = "Category" + }, + new + { + Id = "Brand", + AreaName = "Catalog", + IsMenuable = true, + RoutingAction = "BrandDetail", + RoutingController = "Brand" + }, + new + { + Id = "Product", + AreaName = "Catalog", + IsMenuable = false, + RoutingAction = "ProductDetail", + RoutingController = "Product" + }, + new + { + Id = "Page", + AreaName = "Cms", + IsMenuable = true, + RoutingAction = "PageDetail", + RoutingController = "Page" + }, + new + { + Id = "Vendor", + AreaName = "Core", + IsMenuable = false, + RoutingAction = "VendorDetail", + RoutingController = "Vendor" + }, + new + { + Id = "NewsCategory", + AreaName = "News", + IsMenuable = true, + RoutingAction = "NewsCategoryDetail", + RoutingController = "NewsCategory" + }, + new + { + Id = "NewsItem", + AreaName = "News", + IsMenuable = false, + RoutingAction = "NewsItemDetail", + RoutingController = "NewsItem" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Caption") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FileName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("MediaType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Core_Media", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Core_Role", (string)null); + + b.HasData( + new + { + Id = 1L, + ConcurrencyStamp = "4776a1b2-dbe4-4056-82ec-8bed211d1454", + Name = "admin", + NormalizedName = "ADMIN" + }, + new + { + Id = 2L, + ConcurrencyStamp = "00d172be-03a0-4856-8b12-26d63fcf4374", + Name = "customer", + NormalizedName = "CUSTOMER" + }, + new + { + Id = 3L, + ConcurrencyStamp = "d4754388-8355-4018-b728-218018836817", + Name = "guest", + NormalizedName = "GUEST" + }, + new + { + Id = 4L, + ConcurrencyStamp = "71f10604-8c4d-4a7d-ac4a-ffefb11cefeb", + Name = "vendor", + NormalizedName = "VENDOR" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Code") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Type") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.ToTable("Core_StateOrProvince", (string)null); + + b.HasData( + new + { + Id = 1L, + CountryId = "VN", + Name = "Hồ Chí Minh", + Type = "Thành Phố" + }, + new + { + Id = 2L, + Code = "WA", + CountryId = "US", + Name = "Washington" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Culture") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DefaultBillingAddressId") + .HasColumnType("bigint"); + + b.Property("DefaultShippingAddressId") + .HasColumnType("bigint"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("ExtensionData") + .HasColumnType("nvarchar(max)"); + + b.Property("FullName") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("RefreshTokenHash") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserGuid") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("DefaultBillingAddressId"); + + b.HasIndex("DefaultShippingAddressId"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("VendorId"); + + b.ToTable("Core_User", (string)null); + + b.HasData( + new + { + Id = 2L, + AccessFailedCount = 0, + ConcurrencyStamp = "101cd6ae-a8ef-4a37-97fd-04ac2dd630e4", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "system@simplcommerce.com", + EmailConfirmed = false, + FullName = "System User", + IsDeleted = true, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 189, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "SYSTEM@SIMPLCOMMERCE.COM", + NormalizedUserName = "SYSTEM@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "a9565acb-cee6-425f-9833-419a793f5fba", + TwoFactorEnabled = false, + UserGuid = new Guid("5f72f83b-7436-4221-869c-1b69b2e23aae"), + UserName = "system@simplcommerce.com" + }, + new + { + Id = 10L, + AccessFailedCount = 0, + ConcurrencyStamp = "c83afcbc-312c-4589-bad7-8686bd4754c0", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + Email = "admin@simplcommerce.com", + EmailConfirmed = false, + FullName = "Shop Admin", + IsDeleted = false, + LatestUpdatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 190, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + LockoutEnabled = false, + NormalizedEmail = "ADMIN@SIMPLCOMMERCE.COM", + NormalizedUserName = "ADMIN@SIMPLCOMMERCE.COM", + PasswordHash = "AQAAAAEAACcQAAAAEAEqSCV8Bpg69irmeg8N86U503jGEAYf75fBuzvL00/mr/FGEsiUqfR0rWBbBUwqtw==", + PhoneNumberConfirmed = false, + SecurityStamp = "d6847450-47f0-4c7a-9fed-0c66234bf61f", + TwoFactorEnabled = false, + UserGuid = new Guid("ed8210c3-24b0-4823-a744-80078cf12eb4"), + UserName = "admin@simplcommerce.com" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("AddressType") + .HasColumnType("int"); + + b.Property("LastUsedOn") + .HasColumnType("datetimeoffset"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("UserId"); + + b.ToTable("Core_UserAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("Core_UserRole", (string)null); + + b.HasData( + new + { + UserId = 10L, + RoleId = 1L + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Vendor", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Widget", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("CreateUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EditUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ViewComponentName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_Widget", (string)null); + + b.HasData( + new + { + Id = "CategoryWidget", + CreateUrl = "widget-category-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 160, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-category-edit", + IsPublished = false, + Name = "Category Widget", + ViewComponentName = "CategoryWidget" + }, + new + { + Id = "ProductWidget", + CreateUrl = "widget-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-product-edit", + IsPublished = false, + Name = "Product Widget", + ViewComponentName = "ProductWidget" + }, + new + { + Id = "SimpleProductWidget", + CreateUrl = "widget-simple-product-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 163, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-simple-product-edit", + IsPublished = false, + Name = "Simple Product Widget", + ViewComponentName = "SimpleProductWidget" + }, + new + { + Id = "HtmlWidget", + CreateUrl = "widget-html-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-html-edit", + IsPublished = false, + Name = "Html Widget", + ViewComponentName = "HtmlWidget" + }, + new + { + Id = "CarouselWidget", + CreateUrl = "widget-carousel-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-carousel-edit", + IsPublished = false, + Name = "Carousel Widget", + ViewComponentName = "CarouselWidget" + }, + new + { + Id = "SpaceBarWidget", + CreateUrl = "widget-spacebar-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-spacebar-edit", + IsPublished = false, + Name = "SpaceBar Widget", + ViewComponentName = "SpaceBarWidget" + }, + new + { + Id = "RecentlyViewedWidget", + CreateUrl = "widget-recently-viewed-create", + CreatedOn = new DateTimeOffset(new DateTime(2018, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)), + EditUrl = "widget-recently-viewed-edit", + IsPublished = false, + Name = "Recently Viewed Widget", + ViewComponentName = "RecentlyViewedWidget" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Data") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("HtmlData") + .HasColumnType("nvarchar(max)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishEnd") + .HasColumnType("datetimeoffset"); + + b.Property("PublishStart") + .HasColumnType("datetimeoffset"); + + b.Property("WidgetId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("WidgetZoneId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WidgetId"); + + b.HasIndex("WidgetZoneId"); + + b.ToTable("Core_WidgetInstance", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetZone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Core_WidgetZone", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Home Featured" + }, + new + { + Id = 2L, + Name = "Home Main Content" + }, + new + { + Id = 3L, + Name = "Home After Main Content" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.ProductBackInStockSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomerEmail") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("Inventory_ProductBackInStockSubscription", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("ReservedQuantity") + .HasColumnType("int"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_Stock", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AdjustedQuantity") + .HasColumnType("bigint"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ProductId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Inventory_StockHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("VendorId"); + + b.ToTable("Inventory_Warehouse", (string)null); + + b.HasData( + new + { + Id = 1L, + AddressId = 1L, + Name = "Default warehouse" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("News_NewsCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("FullContent") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("MetaDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("MetaKeywords") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("MetaTitle") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("PublishedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ShortContent") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ThumbnailImageId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ThumbnailImageId"); + + b.ToTable("News_NewsItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("NewsItemId") + .HasColumnType("bigint"); + + b.HasKey("CategoryId", "NewsItemId"); + + b.HasIndex("NewsItemId"); + + b.ToTable("News_NewsItemCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("CouponCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CouponRuleName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("IsMasterOrder") + .HasColumnType("bit"); + + b.Property("LatestUpdatedById") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderNote") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("OrderTotal") + .HasColumnType("decimal(18,2)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("PaymentFeeAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ShippingAddressId") + .HasColumnType("bigint"); + + b.Property("ShippingFeeAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("ShippingMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("SubTotal") + .HasColumnType("decimal(18,2)"); + + b.Property("SubTotalWithDiscount") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("BillingAddressId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CustomerId"); + + b.HasIndex("LatestUpdatedById"); + + b.HasIndex("ParentId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Orders_Order", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddressLine1") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("AddressLine2") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("City") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ContactName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("Phone") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("Orders_OrderAddress", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("NewStatus") + .HasColumnType("int"); + + b.Property("Note") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OldStatus") + .HasColumnType("int"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("OrderSnapshot") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.ToTable("Orders_OrderHistory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("ProductPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("TaxAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxPercent") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("ProductId"); + + b.ToTable("Orders_OrderItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("FailureMessage") + .HasColumnType("nvarchar(max)"); + + b.Property("GatewayTransactionId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("PaymentFee") + .HasColumnType("decimal(18,2)"); + + b.Property("PaymentMethod") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("Payments_Payment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.PaymentProvider", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AdditionalSettings") + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("LandingViewComponentName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Payments_PaymentProvider", (string)null); + + b.HasData( + new + { + Id = "Braintree", + AdditionalSettings = "{\"PublicKey\": \"6j4d7qspt5n48kx4\", \"PrivateKey\" : \"bd1c26e53a6d811243fcc3eb268113e1\", \"MerchantId\" : \"ncsh7wwqvzs3cx9q\", \"IsProduction\" : \"false\"}", + ConfigureUrl = "payments-braintree-config", + IsEnabled = true, + LandingViewComponentName = "BraintreeLanding", + Name = "Braintree" + }, + new + { + Id = "CoD", + ConfigureUrl = "payments-cod-config", + IsEnabled = true, + LandingViewComponentName = "CoDLanding", + Name = "Cash On Delivery" + }, + new + { + Id = "PaypalExpress", + AdditionalSettings = "{ \"IsSandbox\":true, \"ClientId\":\"\", \"ClientSecret\":\"\" }", + ConfigureUrl = "payments-paypalExpress-config", + IsEnabled = true, + LandingViewComponentName = "PaypalExpressLanding", + Name = "Paypal Express" + }, + new + { + Id = "Stripe", + AdditionalSettings = "{\"PublicKey\": \"pk_test_6pRNASCoBOKtIshFeQd4XMUh\", \"PrivateKey\" : \"sk_test_BQokikJOvBiI2HlWgH4olfQ2\"}", + ConfigureUrl = "payments-stripe-config", + IsEnabled = true, + LandingViewComponentName = "StripeLanding", + Name = "Stripe" + }, + new + { + Id = "MomoPayment", + AdditionalSettings = "{\"IsSandbox\":true,\"PartnerCode\":\"MOMOIQA420180417\",\"AccessKey\":\"SvDmj2cOTYZmQQ3H\",\"SecretKey\":\"PPuDXq1KowPT1ftR8DvlQTHhC03aul17\",\"PaymentFee\":0.0}", + ConfigureUrl = "payments-momo-config", + IsEnabled = true, + LandingViewComponentName = "MomoLanding", + Name = "Momo Payment" + }, + new + { + Id = "NganLuong", + AdditionalSettings = "{\"IsSandbox\":true, \"MerchantId\": 47249, \"MerchantPassword\": \"e530745693dbde678f9da98a7c821a07\", \"ReceiverEmail\": \"nlqthien@gmail.com\"}", + ConfigureUrl = "payments-nganluong-config", + IsEnabled = true, + LandingViewComponentName = "NganLuongLanding", + Name = "Ngan Luong Payment" + }, + new + { + Id = "Cashfree", + AdditionalSettings = "{ \"IsSandbox\":true, \"AppId\":\"358035b02486f36ca27904540853\", \"SecretKey\":\"26f48dcd6a27f89f59f28e65849e587916dd57b9\" }", + ConfigureUrl = "payments-cashfree-config", + IsEnabled = true, + LandingViewComponentName = "CashfreeLanding", + Name = "Cashfree Payment Gateway" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("DiscountStep") + .HasColumnType("int"); + + b.Property("EndOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsCouponRequired") + .HasColumnType("bit"); + + b.Property("MaxDiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StartOn") + .HasColumnType("datetimeoffset"); + + b.Property("UsageLimitPerCoupon") + .HasColumnType("int"); + + b.Property("UsageLimitPerCustomer") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CartRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CategoryId"); + + b.HasIndex("CategoryId"); + + b.ToTable("Pricing_CartRuleCategory", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CartRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.HasKey("CartRuleId", "ProductId"); + + b.HasIndex("ProductId"); + + b.ToTable("Pricing_CartRuleProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("CouponId") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.HasIndex("CouponId"); + + b.HasIndex("UserId"); + + b.ToTable("Pricing_CartRuleUsage", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("EndOn") + .HasColumnType("datetimeoffset"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("MaxDiscountAmount") + .HasColumnType("decimal(18,2)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("RuleToApply") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("StartOn") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.ToTable("Pricing_CatalogRule", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.Property("CatalogRuleId") + .HasColumnType("bigint"); + + b.Property("CustomerGroupId") + .HasColumnType("bigint"); + + b.HasKey("CatalogRuleId", "CustomerGroupId"); + + b.HasIndex("CustomerGroupId"); + + b.ToTable("Pricing_CatalogRuleCustomerGroup", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CartRuleId") + .HasColumnType("bigint"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CartRuleId"); + + b.ToTable("Pricing_Coupon", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("UserId"); + + b.ToTable("ProductComparison_ComparingProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductRecentlyViewed.Models.RecentlyViewedProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("LatestViewedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("ProductRecentlyViewed_RecentlyViewedProduct", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ReplierName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ReviewId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ReviewId"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Reply", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("EntityTypeId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Rating") + .HasColumnType("int"); + + b.Property("ReviewerName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Reviews_Review", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Search.Models.Query", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("QueryText") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ResultsCount") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Search_Query", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("OrderId") + .HasColumnType("bigint"); + + b.Property("TrackingNumber") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.Property("WarehouseId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("OrderId"); + + b.HasIndex("WarehouseId"); + + b.ToTable("Shipments_Shipment", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("OrderItemId") + .HasColumnType("bigint"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("ShipmentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("ShipmentId"); + + b.ToTable("Shipments_ShipmentItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipping.Models.ShippingProvider", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AdditionalSettings") + .HasColumnType("nvarchar(max)"); + + b.Property("ConfigureUrl") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("OnlyCountryIdsString") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("OnlyStateOrProvinceIdsString") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("ShippingPriceServiceTypeName") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("ToAllShippingEnabledCountries") + .HasColumnType("bit"); + + b.Property("ToAllShippingEnabledStatesOrProvinces") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("Shipping_ShippingProvider", (string)null); + + b.HasData( + new + { + Id = "FreeShip", + AdditionalSettings = "{MinimumOrderAmount : 1}", + ConfigureUrl = "", + IsEnabled = true, + Name = "Free Ship", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingFree.Services.FreeShippingServiceProvider,SimplCommerce.Module.ShippingFree", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }, + new + { + Id = "TableRate", + ConfigureUrl = "shipping-table-rate-config", + IsEnabled = true, + Name = "Table Rate", + ShippingPriceServiceTypeName = "SimplCommerce.Module.ShippingTableRate.Services.TableRateShippingServiceProvider,SimplCommerce.Module.ShippingTableRate", + ToAllShippingEnabledCountries = true, + ToAllShippingEnabledStatesOrProvinces = true + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("DistrictId") + .HasColumnType("bigint"); + + b.Property("MinOrderSubtotal") + .HasColumnType("decimal(18,2)"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("DistrictId"); + + b.HasIndex("StateOrProvinceId"); + + b.ToTable("ShippingTableRate_PriceAndDestination", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("CustomerId") + .HasColumnType("bigint"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("VendorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("ProductId"); + + b.ToTable("ShoppingCart_CartItem", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.ToTable("Tax_TaxClass", (string)null); + + b.HasData( + new + { + Id = 1L, + Name = "Standard VAT" + }); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CountryId") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.Property("StateOrProvinceId") + .HasColumnType("bigint"); + + b.Property("TaxClassId") + .HasColumnType("bigint"); + + b.Property("ZipCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("StateOrProvinceId"); + + b.HasIndex("TaxClassId"); + + b.ToTable("Tax_TaxRate", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("SharingCode") + .HasMaxLength(450) + .HasColumnType("nvarchar(450)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("WishList_WishList", (string)null); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("LatestUpdatedOn") + .HasColumnType("datetimeoffset"); + + b.Property("ProductId") + .HasColumnType("bigint"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("WishListId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.HasIndex("WishListId"); + + b.ToTable("WishList_WishListItem", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.LocalizedContentProperty", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Resource", b => + { + b.HasOne("SimplCommerce.Infrastructure.Localization.Culture", "Culture") + .WithMany("Resources") + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Culture"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ActivityLog.Models.Activity", b => + { + b.HasOne("SimplCommerce.Module.ActivityLog.Models.ActivityType", "ActivityType") + .WithMany() + .HasForeignKey("ActivityTypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ActivityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Parent"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Brand", "Brand") + .WithMany() + .HasForeignKey("BrandId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Brand"); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("TaxClass"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", "Group") + .WithMany("Attributes") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "Attribute") + .WithMany() + .HasForeignKey("AttributeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("AttributeValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Attribute"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductCategory", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Categories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductLink", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "LinkedProduct") + .WithMany("LinkedProductLinks") + .HasForeignKey("LinkedProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("ProductLinks") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("LinkedProduct"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductMedia", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Media", "Media") + .WithMany() + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("Medias") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionCombination", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionCombinations") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductOptionValue", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductOption", "Option") + .WithMany() + .HasForeignKey("OptionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("OptionValues") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Option"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductPriceHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany("PriceHistories") + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplateProductAttribute", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductAttribute", "ProductAttribute") + .WithMany("ProductTemplates") + .HasForeignKey("ProductAttributeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.ProductTemplate", "ProductTemplate") + .WithMany("ProductAttributes") + .HasForeignKey("ProductTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ProductAttribute"); + + b.Navigation("ProductTemplate"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.Checkout", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.CheckoutItem", b => + { + b.HasOne("SimplCommerce.Module.Checkouts.Models.Checkout", "Checkout") + .WithMany("CheckoutItems") + .HasForeignKey("CheckoutId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Checkout"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Cms.Models.Menu", "Menu") + .WithMany("MenuItems") + .HasForeignKey("MenuId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Cms.Models.MenuItem", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Entity"); + + b.Navigation("Menu"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Page", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.HasOne("SimplCommerce.Module.Comments.Models.Comment", "Parent") + .WithMany("Replies") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Parent"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Contacts.Models.Contact", b => + { + b.HasOne("SimplCommerce.Module.Contacts.Models.ContactArea", "ContactArea") + .WithMany() + .HasForeignKey("ContactAreaId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ContactArea"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroupUser", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany("Users") + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("CustomerGroups") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomerGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.District", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Entity", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.EntityType", "EntityType") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("EntityType"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.StateOrProvince", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany("StatesOrProvinces") + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultBillingAddress") + .WithMany() + .HasForeignKey("DefaultBillingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.UserAddress", "DefaultShippingAddress") + .WithMany() + .HasForeignKey("DefaultShippingAddressId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", null) + .WithMany("Users") + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("DefaultBillingAddress"); + + b.Navigation("DefaultShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany("UserAddresses") + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("UserAddresses") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Address"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.UserRole", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.WidgetInstance", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Widget", "Widget") + .WithMany() + .HasForeignKey("WidgetId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.WidgetZone", "WidgetZone") + .WithMany() + .HasForeignKey("WidgetZoneId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Widget"); + + b.Navigation("WidgetZone"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.StockHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Product"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Warehouse", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Vendor", "Vendor") + .WithMany() + .HasForeignKey("VendorId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Address"); + + b.Navigation("Vendor"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.Media", "ThumbnailImage") + .WithMany() + .HasForeignKey("ThumbnailImageId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("CreatedBy"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("ThumbnailImage"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItemCategory", b => + { + b.HasOne("SimplCommerce.Module.News.Models.NewsCategory", "Category") + .WithMany("NewsItems") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.News.Models.NewsItem", "NewsItem") + .WithMany("Categories") + .HasForeignKey("NewsItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("NewsItem"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "BillingAddress") + .WithMany() + .HasForeignKey("BillingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "LatestUpdatedBy") + .WithMany() + .HasForeignKey("LatestUpdatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Orders.Models.OrderAddress", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("BillingAddress"); + + b.Navigation("CreatedBy"); + + b.Navigation("Customer"); + + b.Navigation("LatestUpdatedBy"); + + b.Navigation("Parent"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderAddress", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderHistory", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.OrderItem", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany("OrderItems") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Payments.Models.Payment", b => + { + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCategory", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Categories") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("CustomerGroups") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleProduct", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Products") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRuleUsage", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany() + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Pricing.Models.Coupon", "Coupon") + .WithMany() + .HasForeignKey("CouponId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CartRule"); + + b.Navigation("Coupon"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRuleCustomerGroup", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CatalogRule", "CatalogRule") + .WithMany("CustomerGroups") + .HasForeignKey("CatalogRuleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.CustomerGroup", "CustomerGroup") + .WithMany() + .HasForeignKey("CustomerGroupId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CatalogRule"); + + b.Navigation("CustomerGroup"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.Coupon", b => + { + b.HasOne("SimplCommerce.Module.Pricing.Models.CartRule", "CartRule") + .WithMany("Coupons") + .HasForeignKey("CartRuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CartRule"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ProductComparison.Models.ComparingProduct", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Reply", b => + { + b.HasOne("SimplCommerce.Module.Reviews.Models.Review", "Review") + .WithMany("Replies") + .HasForeignKey("ReviewId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Review"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Orders.Models.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Inventory.Models.Warehouse", "Warehouse") + .WithMany() + .HasForeignKey("WarehouseId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Order"); + + b.Navigation("Warehouse"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.ShipmentItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Shipments.Models.Shipment", "Shipment") + .WithMany("Items") + .HasForeignKey("ShipmentId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("Shipment"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShippingTableRate.Models.PriceAndDestination", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.District", "District") + .WithMany() + .HasForeignKey("DistrictId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Country"); + + b.Navigation("District"); + + b.Navigation("StateOrProvince"); + }); + + modelBuilder.Entity("SimplCommerce.Module.ShoppingCart.Models.CartItem", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "Customer") + .WithMany() + .HasForeignKey("CustomerId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Customer"); + + b.Navigation("Product"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Tax.Models.TaxRate", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.Country", "Country") + .WithMany() + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Core.Models.StateOrProvince", "StateOrProvince") + .WithMany() + .HasForeignKey("StateOrProvinceId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("SimplCommerce.Module.Tax.Models.TaxClass", "TaxClass") + .WithMany() + .HasForeignKey("TaxClassId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("StateOrProvince"); + + b.Navigation("TaxClass"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.HasOne("SimplCommerce.Module.Core.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishListItem", b => + { + b.HasOne("SimplCommerce.Module.Catalog.Models.Product", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("SimplCommerce.Module.WishList.Models.WishList", "WishList") + .WithMany("Items") + .HasForeignKey("WishListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Product"); + + b.Navigation("WishList"); + }); + + modelBuilder.Entity("SimplCommerce.Infrastructure.Localization.Culture", b => + { + b.Navigation("Resources"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Category", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.Product", b => + { + b.Navigation("AttributeValues"); + + b.Navigation("Categories"); + + b.Navigation("LinkedProductLinks"); + + b.Navigation("Medias"); + + b.Navigation("OptionCombinations"); + + b.Navigation("OptionValues"); + + b.Navigation("PriceHistories"); + + b.Navigation("ProductLinks"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttribute", b => + { + b.Navigation("ProductTemplates"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductAttributeGroup", b => + { + b.Navigation("Attributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Catalog.Models.ProductTemplate", b => + { + b.Navigation("ProductAttributes"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Checkouts.Models.Checkout", b => + { + b.Navigation("CheckoutItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.Menu", b => + { + b.Navigation("MenuItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Cms.Models.MenuItem", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Comments.Models.Comment", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Address", b => + { + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Country", b => + { + b.Navigation("StatesOrProvinces"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.CustomerGroup", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Role", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.User", b => + { + b.Navigation("CustomerGroups"); + + b.Navigation("Roles"); + + b.Navigation("UserAddresses"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Core.Models.Vendor", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsCategory", b => + { + b.Navigation("NewsItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.News.Models.NewsItem", b => + { + b.Navigation("Categories"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Orders.Models.Order", b => + { + b.Navigation("Children"); + + b.Navigation("OrderItems"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CartRule", b => + { + b.Navigation("Categories"); + + b.Navigation("Coupons"); + + b.Navigation("CustomerGroups"); + + b.Navigation("Products"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Pricing.Models.CatalogRule", b => + { + b.Navigation("CustomerGroups"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Reviews.Models.Review", b => + { + b.Navigation("Replies"); + }); + + modelBuilder.Entity("SimplCommerce.Module.Shipments.Models.Shipment", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("SimplCommerce.Module.WishList.Models.WishList", b => + { + b.Navigation("Items"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/SimplCommerce.WebHost/Migrations/20240306234328_AddedBackInStockSubscription.cs b/src/SimplCommerce.WebHost/Migrations/20240311113057_AddedProductBackInStockSubscription.cs similarity index 75% rename from src/SimplCommerce.WebHost/Migrations/20240306234328_AddedBackInStockSubscription.cs rename to src/SimplCommerce.WebHost/Migrations/20240311113057_AddedProductBackInStockSubscription.cs index 38be813cd..d298e90fa 100644 --- a/src/SimplCommerce.WebHost/Migrations/20240306234328_AddedBackInStockSubscription.cs +++ b/src/SimplCommerce.WebHost/Migrations/20240311113057_AddedProductBackInStockSubscription.cs @@ -5,13 +5,13 @@ namespace SimplCommerce.WebHost.Migrations { /// - public partial class AddedBackInStockSubscription : Migration + public partial class AddedProductBackInStockSubscription : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "Inventory_BackInStockSubscription", + name: "Inventory_ProductBackInStockSubscription", columns: table => new { Id = table.Column(type: "bigint", nullable: false) @@ -21,7 +21,7 @@ protected override void Up(MigrationBuilder migrationBuilder) }, constraints: table => { - table.PrimaryKey("PK_Inventory_BackInStockSubscription", x => x.Id); + table.PrimaryKey("PK_Inventory_ProductBackInStockSubscription", x => x.Id); }); } @@ -29,7 +29,7 @@ protected override void Up(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "Inventory_BackInStockSubscription"); + name: "Inventory_ProductBackInStockSubscription"); } } } diff --git a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs b/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs index 9cab7a16f..408547cbc 100644 --- a/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs +++ b/src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs @@ -2200,7 +2200,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) }); }); - modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.BackInStockSubscription", b => + modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.ProductBackInStockSubscription", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -2216,7 +2216,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("Inventory_BackInStockSubscription", (string)null); + b.ToTable("Inventory_ProductBackInStockSubscription", (string)null); }); modelBuilder.Entity("SimplCommerce.Module.Inventory.Models.Stock", b =>