From a2ca10a8a488a3361bd5736fb6bef90826e603c6 Mon Sep 17 00:00:00 2001
From: Otabek7667a <162326551+Otabek7667a@users.noreply.github.com>
Date: Mon, 10 Jun 2024 17:55:21 +0500
Subject: [PATCH 1/3] Create all tables
---
...20240610115741_ProductCategory.Designer.cs | 350 ++++++++++++++++++
.../20240610115741_ProductCategory.cs | 229 ++++++++++++
...0240610120459_ProductInventory.Designer.cs | 350 ++++++++++++++++++
.../20240610120459_ProductInventory.cs | 22 ++
.../20240610120531_Product.Designer.cs | 350 ++++++++++++++++++
.../Data/Migrations/20240610120531_Product.cs | 22 ++
.../SupermarketDbContextModelSnapshot.cs | 347 +++++++++++++++++
.../Supermarket/Data/SupermarketDbContext.cs | 26 ++
.../Supermarket/MainWindow.xaml.cs | 11 +-
.../Supermarket/Models/Customer.cs | 22 ++
.../Supermarket/Models/CustomerAddres.cs | 21 ++
.../Supermarket/Models/OrderDetails.cs | 19 +
.../Supermarket/Models/OrderItems.cs | 21 ++
.../Supermarket/Supermarket/Models/Product.cs | 24 ++
.../Supermarket/Models/ProductCategory.cs | 19 +
.../Supermarket/Models/ProductInventory.cs | 18 +
.../Supermarket/Supermarket.csproj | 17 +
.../Supermarket/Views/HomePage.xaml | 13 +
.../Supermarket/Views/HomePage.xaml.cs | 28 ++
19 files changed, 1899 insertions(+), 10 deletions(-)
create mode 100644 Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.Designer.cs
create mode 100644 Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.cs
create mode 100644 Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.Designer.cs
create mode 100644 Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.cs
create mode 100644 Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.Designer.cs
create mode 100644 Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.cs
create mode 100644 Desktop/Supermarket/Supermarket/Data/Migrations/SupermarketDbContextModelSnapshot.cs
create mode 100644 Desktop/Supermarket/Supermarket/Data/SupermarketDbContext.cs
create mode 100644 Desktop/Supermarket/Supermarket/Models/Customer.cs
create mode 100644 Desktop/Supermarket/Supermarket/Models/CustomerAddres.cs
create mode 100644 Desktop/Supermarket/Supermarket/Models/OrderDetails.cs
create mode 100644 Desktop/Supermarket/Supermarket/Models/OrderItems.cs
create mode 100644 Desktop/Supermarket/Supermarket/Models/Product.cs
create mode 100644 Desktop/Supermarket/Supermarket/Models/ProductCategory.cs
create mode 100644 Desktop/Supermarket/Supermarket/Models/ProductInventory.cs
create mode 100644 Desktop/Supermarket/Supermarket/Views/HomePage.xaml
create mode 100644 Desktop/Supermarket/Supermarket/Views/HomePage.xaml.cs
diff --git a/Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.Designer.cs b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.Designer.cs
new file mode 100644
index 0000000..e0aaa11
--- /dev/null
+++ b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.Designer.cs
@@ -0,0 +1,350 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Supermarket.Data;
+
+#nullable disable
+
+namespace Supermarket.Data.Migrations
+{
+ [DbContext(typeof(SupermarketDbContext))]
+ [Migration("20240610115741_ProductCategory")]
+ partial class ProductCategory
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Supermarket.Models.Customer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Telephone")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Customers");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.CustomerAddres", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("AddresLine1")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AddresLine2")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Country")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("CustomerAddres");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Total")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("OrderDetails");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderItems", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("OrderDetailsId")
+ .HasColumnType("int");
+
+ b.Property("OrderId")
+ .HasColumnType("int");
+
+ b.Property("ProductId")
+ .HasColumnType("int");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrderDetailsId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CategoryId")
+ .HasColumnType("int");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InventoryId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CategoryId");
+
+ b.HasIndex("InventoryId");
+
+ b.ToTable("Products");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("ProductCategories");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductInventory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("ProductInventory");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.CustomerAddres", b =>
+ {
+ b.HasOne("Supermarket.Models.Customer", "Customer")
+ .WithMany("CustomerAddresses")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.HasOne("Supermarket.Models.Customer", "Customer")
+ .WithMany("OrderDetails")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderItems", b =>
+ {
+ b.HasOne("Supermarket.Models.OrderDetails", "OrderDetails")
+ .WithMany("OrderItems")
+ .HasForeignKey("OrderDetailsId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Supermarket.Models.Product", "Product")
+ .WithMany("OrderItems")
+ .HasForeignKey("ProductId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("OrderDetails");
+
+ b.Navigation("Product");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.HasOne("Supermarket.Models.ProductCategory", "Category")
+ .WithMany("Products")
+ .HasForeignKey("CategoryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Supermarket.Models.ProductInventory", "Inventory")
+ .WithMany("Products")
+ .HasForeignKey("InventoryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Category");
+
+ b.Navigation("Inventory");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Customer", b =>
+ {
+ b.Navigation("CustomerAddresses");
+
+ b.Navigation("OrderDetails");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductCategory", b =>
+ {
+ b.Navigation("Products");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductInventory", b =>
+ {
+ b.Navigation("Products");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.cs b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.cs
new file mode 100644
index 0000000..6fe1ed1
--- /dev/null
+++ b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610115741_ProductCategory.cs
@@ -0,0 +1,229 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Supermarket.Data.Migrations
+{
+ ///
+ public partial class ProductCategory : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Customers",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ FirstName = table.Column(type: "nvarchar(max)", nullable: false),
+ LastName = table.Column(type: "nvarchar(max)", nullable: false),
+ Telephone = table.Column(type: "nvarchar(max)", nullable: false),
+ Password = table.Column(type: "nvarchar(max)", nullable: false),
+ UserName = table.Column(type: "nvarchar(max)", nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Customers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ProductCategories",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ Name = table.Column(type: "nvarchar(max)", nullable: false),
+ Description = table.Column(type: "nvarchar(max)", nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false),
+ DeletedAt = table.Column(type: "datetime2", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ProductCategories", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ProductInventory",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ Quantity = table.Column(type: "int", nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false),
+ DeletedAt = table.Column(type: "datetime2", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ProductInventory", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "CustomerAddres",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ CustomerId = table.Column(type: "int", nullable: false),
+ AddresLine1 = table.Column(type: "nvarchar(max)", nullable: false),
+ AddresLine2 = table.Column(type: "nvarchar(max)", nullable: false),
+ Country = table.Column(type: "nvarchar(max)", nullable: false),
+ City = table.Column(type: "nvarchar(max)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CustomerAddres", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CustomerAddres_Customers_CustomerId",
+ column: x => x.CustomerId,
+ principalTable: "Customers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "OrderDetails",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ CustomerId = table.Column(type: "int", nullable: false),
+ Total = table.Column(type: "decimal(18,2)", nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_OrderDetails", x => x.Id);
+ table.ForeignKey(
+ name: "FK_OrderDetails_Customers_CustomerId",
+ column: x => x.CustomerId,
+ principalTable: "Customers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Products",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ Name = table.Column(type: "nvarchar(max)", nullable: false),
+ Description = table.Column(type: "nvarchar(max)", nullable: false),
+ CategoryId = table.Column(type: "int", nullable: false),
+ InventoryId = table.Column(type: "int", nullable: false),
+ Price = table.Column(type: "decimal(18,2)", nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false),
+ DeletedAt = table.Column(type: "datetime2", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Products", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Products_ProductCategories_CategoryId",
+ column: x => x.CategoryId,
+ principalTable: "ProductCategories",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_Products_ProductInventory_InventoryId",
+ column: x => x.InventoryId,
+ principalTable: "ProductInventory",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "OrderItems",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ OrderId = table.Column(type: "int", nullable: false),
+ ProductId = table.Column(type: "int", nullable: false),
+ Quantity = table.Column(type: "int", nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false),
+ OrderDetailsId = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_OrderItems", x => x.Id);
+ table.ForeignKey(
+ name: "FK_OrderItems_OrderDetails_OrderDetailsId",
+ column: x => x.OrderDetailsId,
+ principalTable: "OrderDetails",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_OrderItems_Products_ProductId",
+ column: x => x.ProductId,
+ principalTable: "Products",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CustomerAddres_CustomerId",
+ table: "CustomerAddres",
+ column: "CustomerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_OrderDetails_CustomerId",
+ table: "OrderDetails",
+ column: "CustomerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_OrderItems_OrderDetailsId",
+ table: "OrderItems",
+ column: "OrderDetailsId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_OrderItems_ProductId",
+ table: "OrderItems",
+ column: "ProductId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Products_CategoryId",
+ table: "Products",
+ column: "CategoryId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Products_InventoryId",
+ table: "Products",
+ column: "InventoryId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "CustomerAddres");
+
+ migrationBuilder.DropTable(
+ name: "OrderItems");
+
+ migrationBuilder.DropTable(
+ name: "OrderDetails");
+
+ migrationBuilder.DropTable(
+ name: "Products");
+
+ migrationBuilder.DropTable(
+ name: "Customers");
+
+ migrationBuilder.DropTable(
+ name: "ProductCategories");
+
+ migrationBuilder.DropTable(
+ name: "ProductInventory");
+ }
+ }
+}
diff --git a/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.Designer.cs b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.Designer.cs
new file mode 100644
index 0000000..0fac633
--- /dev/null
+++ b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.Designer.cs
@@ -0,0 +1,350 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Supermarket.Data;
+
+#nullable disable
+
+namespace Supermarket.Data.Migrations
+{
+ [DbContext(typeof(SupermarketDbContext))]
+ [Migration("20240610120459_ProductInventory")]
+ partial class ProductInventory
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Supermarket.Models.Customer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Telephone")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Customers");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.CustomerAddres", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("AddresLine1")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AddresLine2")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Country")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("CustomerAddres");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Total")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("OrderDetails");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderItems", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("OrderDetailsId")
+ .HasColumnType("int");
+
+ b.Property("OrderId")
+ .HasColumnType("int");
+
+ b.Property("ProductId")
+ .HasColumnType("int");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrderDetailsId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CategoryId")
+ .HasColumnType("int");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InventoryId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CategoryId");
+
+ b.HasIndex("InventoryId");
+
+ b.ToTable("Products");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("ProductCategories");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductInventory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("ProductInventory");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.CustomerAddres", b =>
+ {
+ b.HasOne("Supermarket.Models.Customer", "Customer")
+ .WithMany("CustomerAddresses")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.HasOne("Supermarket.Models.Customer", "Customer")
+ .WithMany("OrderDetails")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderItems", b =>
+ {
+ b.HasOne("Supermarket.Models.OrderDetails", "OrderDetails")
+ .WithMany("OrderItems")
+ .HasForeignKey("OrderDetailsId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Supermarket.Models.Product", "Product")
+ .WithMany("OrderItems")
+ .HasForeignKey("ProductId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("OrderDetails");
+
+ b.Navigation("Product");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.HasOne("Supermarket.Models.ProductCategory", "Category")
+ .WithMany("Products")
+ .HasForeignKey("CategoryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Supermarket.Models.ProductInventory", "Inventory")
+ .WithMany("Products")
+ .HasForeignKey("InventoryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Category");
+
+ b.Navigation("Inventory");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Customer", b =>
+ {
+ b.Navigation("CustomerAddresses");
+
+ b.Navigation("OrderDetails");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductCategory", b =>
+ {
+ b.Navigation("Products");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductInventory", b =>
+ {
+ b.Navigation("Products");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.cs b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.cs
new file mode 100644
index 0000000..4cb7427
--- /dev/null
+++ b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120459_ProductInventory.cs
@@ -0,0 +1,22 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Supermarket.Data.Migrations
+{
+ ///
+ public partial class ProductInventory : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.Designer.cs b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.Designer.cs
new file mode 100644
index 0000000..ee84cd1
--- /dev/null
+++ b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.Designer.cs
@@ -0,0 +1,350 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Supermarket.Data;
+
+#nullable disable
+
+namespace Supermarket.Data.Migrations
+{
+ [DbContext(typeof(SupermarketDbContext))]
+ [Migration("20240610120531_Product")]
+ partial class Product
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Supermarket.Models.Customer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Telephone")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Customers");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.CustomerAddres", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("AddresLine1")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AddresLine2")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Country")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("CustomerAddres");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Total")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("OrderDetails");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderItems", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("OrderDetailsId")
+ .HasColumnType("int");
+
+ b.Property("OrderId")
+ .HasColumnType("int");
+
+ b.Property("ProductId")
+ .HasColumnType("int");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrderDetailsId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CategoryId")
+ .HasColumnType("int");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InventoryId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CategoryId");
+
+ b.HasIndex("InventoryId");
+
+ b.ToTable("Products");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("ProductCategories");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductInventory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("ProductInventory");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.CustomerAddres", b =>
+ {
+ b.HasOne("Supermarket.Models.Customer", "Customer")
+ .WithMany("CustomerAddresses")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.HasOne("Supermarket.Models.Customer", "Customer")
+ .WithMany("OrderDetails")
+ .HasForeignKey("CustomerId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Customer");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderItems", b =>
+ {
+ b.HasOne("Supermarket.Models.OrderDetails", "OrderDetails")
+ .WithMany("OrderItems")
+ .HasForeignKey("OrderDetailsId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Supermarket.Models.Product", "Product")
+ .WithMany("OrderItems")
+ .HasForeignKey("ProductId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("OrderDetails");
+
+ b.Navigation("Product");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.HasOne("Supermarket.Models.ProductCategory", "Category")
+ .WithMany("Products")
+ .HasForeignKey("CategoryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Supermarket.Models.ProductInventory", "Inventory")
+ .WithMany("Products")
+ .HasForeignKey("InventoryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Category");
+
+ b.Navigation("Inventory");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Customer", b =>
+ {
+ b.Navigation("CustomerAddresses");
+
+ b.Navigation("OrderDetails");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductCategory", b =>
+ {
+ b.Navigation("Products");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductInventory", b =>
+ {
+ b.Navigation("Products");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.cs b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.cs
new file mode 100644
index 0000000..027969e
--- /dev/null
+++ b/Desktop/Supermarket/Supermarket/Data/Migrations/20240610120531_Product.cs
@@ -0,0 +1,22 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Supermarket.Data.Migrations
+{
+ ///
+ public partial class Product : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/Desktop/Supermarket/Supermarket/Data/Migrations/SupermarketDbContextModelSnapshot.cs b/Desktop/Supermarket/Supermarket/Data/Migrations/SupermarketDbContextModelSnapshot.cs
new file mode 100644
index 0000000..f9c2167
--- /dev/null
+++ b/Desktop/Supermarket/Supermarket/Data/Migrations/SupermarketDbContextModelSnapshot.cs
@@ -0,0 +1,347 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Supermarket.Data;
+
+#nullable disable
+
+namespace Supermarket.Data.Migrations
+{
+ [DbContext(typeof(SupermarketDbContext))]
+ partial class SupermarketDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Supermarket.Models.Customer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Telephone")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Customers");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.CustomerAddres", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("AddresLine1")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AddresLine2")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Country")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("CustomerAddres");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderDetails", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CustomerId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Total")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.ToTable("OrderDetails");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.OrderItems", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("OrderDetailsId")
+ .HasColumnType("int");
+
+ b.Property("OrderId")
+ .HasColumnType("int");
+
+ b.Property("ProductId")
+ .HasColumnType("int");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrderDetailsId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("OrderItems");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.Product", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CategoryId")
+ .HasColumnType("int");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InventoryId")
+ .HasColumnType("int");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CategoryId");
+
+ b.HasIndex("InventoryId");
+
+ b.ToTable("Products");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("DeletedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("ProductCategories");
+ });
+
+ modelBuilder.Entity("Supermarket.Models.ProductInventory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property