From 90b9a8a38da572a745534ed1c59aca5677b8a411 Mon Sep 17 00:00:00 2001 From: Muzaffar Nurillayev <102397633+MuzaffarNurillaew@users.noreply.github.com> Date: Thu, 25 May 2023 18:07:29 +0500 Subject: [PATCH 1/2] Delete src/FleetFlow.DAL/Migrations directory --- .../20230525113310_last.Designer.cs | 1316 ----------------- .../Migrations/20230525113310_last.cs | 654 -------- .../FleetFlowDbContextModelSnapshot.cs | 1313 ---------------- 3 files changed, 3283 deletions(-) delete mode 100644 src/FleetFlow.DAL/Migrations/20230525113310_last.Designer.cs delete mode 100644 src/FleetFlow.DAL/Migrations/20230525113310_last.cs delete mode 100644 src/FleetFlow.DAL/Migrations/FleetFlowDbContextModelSnapshot.cs diff --git a/src/FleetFlow.DAL/Migrations/20230525113310_last.Designer.cs b/src/FleetFlow.DAL/Migrations/20230525113310_last.Designer.cs deleted file mode 100644 index cd9a4a92..00000000 --- a/src/FleetFlow.DAL/Migrations/20230525113310_last.Designer.cs +++ /dev/null @@ -1,1316 +0,0 @@ -// -using System; -using FleetFlow.DAL.DbContexts; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace FleetFlow.DAL.Migrations -{ - [DbContext(typeof(FleetFlowDbContext))] - [Migration("20230525113310_last")] - partial class last - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Addresses.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("City") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("District") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Latitude") - .HasColumnType("double precision"); - - b.Property("Longitude") - .HasColumnType("double precision"); - - b.Property("State") - .HasColumnType("text"); - - b.Property("Street") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("ZipCode") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Addresses"); - - b.HasData( - new - { - Id = 1L, - City = "Navoi", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5320), - District = "Nurata", - IsDeleted = false, - Latitude = 45.341200000000001, - Longitude = 32.323999999999998, - State = "Uzbekistan", - Street = "Medicals", - ZipCode = "210100" - }, - new - { - Id = 2L, - City = "Andijan", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5323), - District = "Paxtachi", - IsDeleted = false, - Latitude = 42.341200000000001, - Longitude = 20.324000000000002, - State = "Uzbekistan", - Street = "Programmers", - ZipCode = "213422" - }, - new - { - Id = 3L, - City = "Bukhara", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5325), - District = "Nurata", - IsDeleted = false, - Latitude = 44.341200000000001, - Longitude = 35.323999999999998, - State = "Uzbekistan", - Street = "Merchants", - ZipCode = "643224" - }, - new - { - Id = 4L, - City = "Kharezm", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5326), - District = "Nurata", - IsDeleted = false, - Latitude = 47.341200000000001, - Longitude = 27.324000000000002, - State = "Uzbekistan", - Street = "Policians", - ZipCode = "100250" - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Attachments.Attachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("FileName") - .HasColumnType("text"); - - b.Property("FilePath") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Attachments"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Authorizations.Role", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Role"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3654), - IsDeleted = false, - Name = "User" - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3657), - IsDeleted = false, - Name = "Admin" - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3659), - IsDeleted = false, - Name = "Merchant" - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3660), - IsDeleted = false, - Name = "Driver" - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3661), - IsDeleted = false, - Name = "Picker" - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3663), - IsDeleted = false, - Name = "Packer" - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Cart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Carts"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.CartItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CartId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CartId"); - - b.HasIndex("ProductId"); - - b.ToTable("CartItems"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("Feedbacks"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.FeedbackAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttachmentId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("FeedbackId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("AttachmentId"); - - b.HasIndex("FeedbackId"); - - b.ToTable("FeedbackAttachments"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PaymentStatus") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - - b.HasData( - new - { - Id = 1L, - AddressId = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5467), - IsDeleted = false, - PaymentStatus = 0, - Status = 1, - UserId = 1L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderAction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("OrderActions"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.HasIndex("ProductId"); - - b.ToTable("OrderItems"); - - b.HasData( - new - { - Id = 1L, - Amount = 1, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5491), - IsDeleted = false, - OrderId = 1L, - ProductId = 3L - }, - new - { - Id = 2L, - Amount = 4, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5492), - IsDeleted = false, - OrderId = 1L, - ProductId = 6L - }, - new - { - Id = 3L, - Amount = 2, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5493), - IsDeleted = false, - OrderId = 1L, - ProductId = 2L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Discount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PercentageToCheapen") - .HasColumnType("numeric"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("State") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Discounts"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CategoryId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasColumnType("numeric"); - - b.Property("Serial") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("Weight") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CategoryId"); - - b.ToTable("Products"); - - b.HasData( - new - { - Id = 1L, - CategoryId = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5372), - IsDeleted = false, - Name = "HP-Victus", - Price = 630m, - Serial = "a1B5", - Weight = 2.2m - }, - new - { - Id = 2L, - CategoryId = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5374), - IsDeleted = false, - Name = "MacBook-Pro", - Price = 2000m, - Serial = "AKJ-12445", - Weight = 1.2m - }, - new - { - Id = 3L, - CategoryId = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5376), - IsDeleted = false, - Name = "Iphone-14", - Price = 1500m, - Serial = "KLKJL-324342", - Weight = 0.1m - }, - new - { - Id = 4L, - CategoryId = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5378), - IsDeleted = false, - Name = "Spintronics", - Price = 100m, - Serial = "MMMLW-11234", - Weight = 4.2m - }, - new - { - Id = 5L, - CategoryId = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5382), - IsDeleted = false, - Name = "Trimol", - Price = 1m, - Serial = "MML-32423", - Weight = 0.002m - }, - new - { - Id = 6L, - CategoryId = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5383), - IsDeleted = false, - Name = "SmartWatch", - Price = 50m, - Serial = "JJJO-23423", - Weight = 0.1m - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3422), - IsDeleted = false, - Name = "Laptops" - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3425), - IsDeleted = false, - Name = "Accesories" - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3426), - IsDeleted = false, - Name = "Jewellery" - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3427), - IsDeleted = false, - Name = "Medicines" - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3428), - IsDeleted = false, - Name = "Telephones" - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3429), - IsDeleted = false, - Name = "Toys" - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Users.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Password") - .HasColumnType("text"); - - b.Property("Phone") - .HasColumnType("text"); - - b.Property("RoleId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 359, DateTimeKind.Utc).AddTicks(8992), - Email = "dotnetgo@icloud.com", - FirstName = "Mukhammadkarim", - IsDeleted = false, - LastName = "Tukhtaboyev", - Password = "$2a$11$ocg1IVmxYbBZ4Rgs82wm/O/DlcOrgMYea/OKIq8J4wt6AT.0xVd.i", - Phone = "+998 991239999", - RoleId = 2L - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 486, DateTimeKind.Utc).AddTicks(5424), - Email = "wonderboy1w3@gmail.com", - FirstName = "Jamshid", - IsDeleted = false, - LastName = "Ma'ruf", - Password = "$2a$11$dstnWmZ9d1InMGY9my/r6.77O8kCh/Y.dy7xRLzbQAsFpXnIOrVxK", - Phone = "+998 991231999", - RoleId = 3L - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 614, DateTimeKind.Utc).AddTicks(6077), - Email = "kabeersolutions@gmail.com", - FirstName = "Kabeer", - IsDeleted = false, - LastName = "Solutions", - Password = "$2a$11$jmJEsBqx1k6YZsL.Kjy4yO6pYYLKuzbqwe228ajObWRDMFBrbg14a", - Phone = "+998 991232999", - RoleId = 4L - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 740, DateTimeKind.Utc).AddTicks(2103), - Email = "nurillaewmuzaffar@gmail.com", - FirstName = "Muzaffar", - IsDeleted = false, - LastName = "Nurillayev", - Password = "$2a$11$DRkhHsyb/Uv9bZUGh6Hd6uSoaEmcsdkD24xZfGcJpBGdTYXckoJze", - Phone = "+998 995030110", - RoleId = 5L - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 863, DateTimeKind.Utc).AddTicks(2888), - Email = "azimochilov@icloud.com", - FirstName = "Azim", - IsDeleted = false, - LastName = "Ochilov", - Password = "$2a$11$olfwyrEvL84QO9yCZB1e4uPP8exkXMLNQpEun805ySeKBCz8IAkta", - Phone = "+998 991233999", - RoleId = 6L - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 986, DateTimeKind.Utc).AddTicks(3958), - Email = "abdulloh@icloud.com", - FirstName = "Abdulloh", - IsDeleted = false, - LastName = "Ahmadjonov", - Password = "$2a$11$0UNovYjyvib/1tJojshyC.R36VQT4VZE1/ctmTWje8pU1EQYA05/6", - Phone = "+998 991236999", - RoleId = 1L - }, - new - { - Id = 7L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 110, DateTimeKind.Utc).AddTicks(6463), - Email = "komron2052@gmail.com", - FirstName = "Komron", - IsDeleted = false, - LastName = "Rahmonov", - Password = "$2a$11$2XSJu2XaILH3AZKl6Bb1Du6j5KvF3NYAMFtFAA87CWOoCPXKJtEtG", - Phone = "+998 991234999", - RoleId = 2L - }, - new - { - Id = 8L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 236, DateTimeKind.Utc).AddTicks(9179), - Email = "nozimjon@gmail.com", - FirstName = "Nozimjon", - IsDeleted = false, - LastName = "Usmonaliyev", - Password = "$2a$11$XdUCsX2vjiGvke83zOxBhujrI9jA/MJ5aKVadUULqbg/TSH66WYB.", - Phone = "+998 991235999", - RoleId = 3L - }, - new - { - Id = 9L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 363, DateTimeKind.Utc).AddTicks(8016), - Email = "aljavhar@gmail.com", - FirstName = "AlJavhar", - IsDeleted = false, - LastName = "Boyaliyev", - Password = "$2a$11$jy7agtwyKEjtD1o55ptKJewa3R3yx1wb6px8Zx0TM5gTXrBsbUIse", - Phone = "+998 902344545", - RoleId = 4L - }, - new - { - Id = 10L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(4682), - Email = "muhammad@gmail.com", - FirstName = "Muhammad", - IsDeleted = false, - LastName = "Rahimboyev", - Password = "$2a$11$XF3QbPHPk07Nk7DjsQVN2.FndurqHaV/AUnnZpnqha/G6NRalTCVK", - Phone = "+998 937770202", - RoleId = 5L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Warehouses.Inventory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("LocationId"); - - b.HasIndex("ProductId"); - - b.ToTable("Inventories"); - - b.HasData( - new - { - Id = 1L, - Amount = 1000, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 1L, - ProductId = 6L - }, - new - { - Id = 2L, - Amount = 50, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 1L, - ProductId = 1L - }, - new - { - Id = 3L, - Amount = 100, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 2L, - ProductId = 3L - }, - new - { - Id = 4L, - Amount = 100000, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 3L, - ProductId = 5L - }, - new - { - Id = 5L, - Amount = 100, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 3L, - ProductId = 2L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Warehouses.Location", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Locations"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3621), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3626), - Description = "In the beginning of entry", - IsDeleted = false - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3627), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3628), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3629), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3630), - Description = "In the middle", - IsDeleted = false - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.CartItem", b => - { - b.HasOne("FleetFlow.Domain.Entities.Cart", "Cart") - .WithMany("Items") - .HasForeignKey("CartId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Cart"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", b => - { - b.HasOne("FleetFlow.Domain.Entities.Orders.Order", "Order") - .WithMany("Feedbacks") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.FeedbackAttachment", b => - { - b.HasOne("FleetFlow.Domain.Entities.Attachments.Attachment", "Attachment") - .WithMany() - .HasForeignKey("AttachmentId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", "Feedback") - .WithMany("Attachments") - .HasForeignKey("FeedbackId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Attachment"); - - b.Navigation("Feedback"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Order", b => - { - b.HasOne("FleetFlow.Domain.Entities.Addresses.Address", "Address") - .WithMany("Orders") - .HasForeignKey("AddressId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("FleetFlow.Domain.Entities.Users.User", "User") - .WithMany("Orders") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderAction", b => - { - b.HasOne("FleetFlow.Domain.Entities.Orders.Order", "Order") - .WithMany("Actions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderItem", b => - { - b.HasOne("FleetFlow.Domain.Entities.Orders.Order", "Order") - .WithMany("OrderItems") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany("OrderItems") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Order"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Discount", b => - { - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany("Discounts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Product", b => - { - b.HasOne("FleetFlow.Domain.Entities.Products.ProductCategory", "Category") - .WithMany("Products") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Users.User", b => - { - b.HasOne("FleetFlow.Domain.Entities.Authorizations.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Warehouses.Inventory", b => - { - b.HasOne("FleetFlow.Domain.Entities.Warehouses.Location", "Location") - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Location"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Addresses.Address", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Cart", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", b => - { - b.Navigation("Attachments"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Order", b => - { - b.Navigation("Actions"); - - b.Navigation("Feedbacks"); - - b.Navigation("OrderItems"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Product", b => - { - b.Navigation("Discounts"); - - b.Navigation("OrderItems"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Users.User", b => - { - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/FleetFlow.DAL/Migrations/20230525113310_last.cs b/src/FleetFlow.DAL/Migrations/20230525113310_last.cs deleted file mode 100644 index 7335219b..00000000 --- a/src/FleetFlow.DAL/Migrations/20230525113310_last.cs +++ /dev/null @@ -1,654 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace FleetFlow.DAL.Migrations -{ - /// - public partial class last : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Addresses", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - State = table.Column(type: "text", nullable: true), - City = table.Column(type: "text", nullable: true), - District = table.Column(type: "text", nullable: true), - Street = table.Column(type: "text", nullable: true), - ZipCode = table.Column(type: "text", nullable: true), - Latitude = table.Column(type: "double precision", nullable: false), - Longitude = table.Column(type: "double precision", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Addresses", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Attachments", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - FilePath = table.Column(type: "text", nullable: true), - FileName = table.Column(type: "text", nullable: true), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Attachments", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Carts", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - UserId = table.Column(type: "bigint", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Carts", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Locations", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Name = table.Column(type: "text", nullable: true), - Description = table.Column(type: "text", nullable: true), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Locations", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "ProductCategories", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ProductCategories", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Role", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Name = table.Column(type: "text", nullable: true), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Role", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Products", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - Serial = table.Column(type: "text", nullable: true), - Price = table.Column(type: "numeric", nullable: false), - Weight = table.Column(type: "numeric", nullable: false), - CategoryId = table.Column(type: "bigint", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Products", x => x.Id); - table.ForeignKey( - name: "FK_Products_ProductCategories_CategoryId", - column: x => x.CategoryId, - principalTable: "ProductCategories", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - FirstName = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - LastName = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - Phone = table.Column(type: "text", nullable: true), - Email = table.Column(type: "text", nullable: true), - Password = table.Column(type: "text", nullable: true), - RoleId = table.Column(type: "bigint", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - table.ForeignKey( - name: "FK_Users_Role_RoleId", - column: x => x.RoleId, - principalTable: "Role", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "CartItems", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - CartId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - Amount = table.Column(type: "integer", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_CartItems", x => x.Id); - table.ForeignKey( - name: "FK_CartItems_Carts_CartId", - column: x => x.CartId, - principalTable: "Carts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_CartItems_Products_ProductId", - column: x => x.ProductId, - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Discounts", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ProductId = table.Column(type: "bigint", nullable: false), - StartedAt = table.Column(type: "timestamp with time zone", nullable: false), - FinishedAt = table.Column(type: "timestamp with time zone", nullable: true), - PercentageToCheapen = table.Column(type: "numeric", nullable: false), - State = table.Column(type: "integer", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Discounts", x => x.Id); - table.ForeignKey( - name: "FK_Discounts_Products_ProductId", - column: x => x.ProductId, - principalTable: "Products", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "Inventories", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ProductId = table.Column(type: "bigint", nullable: false), - Amount = table.Column(type: "integer", nullable: false), - LocationId = table.Column(type: "bigint", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Inventories", x => x.Id); - table.ForeignKey( - name: "FK_Inventories_Locations_LocationId", - column: x => x.LocationId, - principalTable: "Locations", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Inventories_Products_ProductId", - column: x => x.ProductId, - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Orders", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - UserId = table.Column(type: "bigint", nullable: false), - AddressId = table.Column(type: "bigint", nullable: true), - Status = table.Column(type: "integer", nullable: false), - PaymentStatus = table.Column(type: "integer", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders", x => x.Id); - table.ForeignKey( - name: "FK_Orders_Addresses_AddressId", - column: x => x.AddressId, - principalTable: "Addresses", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Orders_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Feedbacks", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Message = table.Column(type: "text", nullable: true), - OrderId = table.Column(type: "bigint", nullable: false), - Status = table.Column(type: "integer", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Feedbacks", x => x.Id); - table.ForeignKey( - name: "FK_Feedbacks_Orders_OrderId", - column: x => x.OrderId, - principalTable: "Orders", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "OrderActions", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - OrderId = table.Column(type: "bigint", nullable: false), - Status = table.Column(type: "integer", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_OrderActions", x => x.Id); - table.ForeignKey( - name: "FK_OrderActions_Orders_OrderId", - column: x => x.OrderId, - principalTable: "Orders", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "OrderItems", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - OrderId = table.Column(type: "bigint", nullable: false), - ProductId = table.Column(type: "bigint", nullable: false), - Amount = table.Column(type: "integer", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_OrderItems", x => x.Id); - table.ForeignKey( - name: "FK_OrderItems_Orders_OrderId", - column: x => x.OrderId, - principalTable: "Orders", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_OrderItems_Products_ProductId", - column: x => x.ProductId, - principalTable: "Products", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "FeedbackAttachments", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - FeedbackId = table.Column(type: "bigint", nullable: false), - AttachmentId = table.Column(type: "bigint", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - DeletedBy = table.Column(type: "bigint", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_FeedbackAttachments", x => x.Id); - table.ForeignKey( - name: "FK_FeedbackAttachments_Attachments_AttachmentId", - column: x => x.AttachmentId, - principalTable: "Attachments", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_FeedbackAttachments_Feedbacks_FeedbackId", - column: x => x.FeedbackId, - principalTable: "Feedbacks", - principalColumn: "Id"); - }); - - migrationBuilder.InsertData( - table: "Addresses", - columns: new[] { "Id", "City", "CreatedAt", "DeletedBy", "District", "IsDeleted", "Latitude", "Longitude", "State", "Street", "UpdatedAt", "UpdatedBy", "ZipCode" }, - values: new object[,] - { - { 1L, "Navoi", new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5320), null, "Nurata", false, 45.341200000000001, 32.323999999999998, "Uzbekistan", "Medicals", null, null, "210100" }, - { 2L, "Andijan", new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5323), null, "Paxtachi", false, 42.341200000000001, 20.324000000000002, "Uzbekistan", "Programmers", null, null, "213422" }, - { 3L, "Bukhara", new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5325), null, "Nurata", false, 44.341200000000001, 35.323999999999998, "Uzbekistan", "Merchants", null, null, "643224" }, - { 4L, "Kharezm", new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5326), null, "Nurata", false, 47.341200000000001, 27.324000000000002, "Uzbekistan", "Policians", null, null, "100250" } - }); - - migrationBuilder.InsertData( - table: "Locations", - columns: new[] { "Id", "CreatedAt", "DeletedBy", "Description", "IsDeleted", "Name", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { 1L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3621), null, "In the middle", false, null, null, null }, - { 2L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3626), null, "In the beginning of entry", false, null, null, null }, - { 3L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3627), null, "In the middle", false, null, null, null }, - { 4L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3628), null, "In the middle", false, null, null, null }, - { 5L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3629), null, "In the middle", false, null, null, null }, - { 6L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3630), null, "In the middle", false, null, null, null } - }); - - migrationBuilder.InsertData( - table: "ProductCategories", - columns: new[] { "Id", "CreatedAt", "DeletedBy", "IsDeleted", "Name", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { 1L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3422), null, false, "Laptops", null, null }, - { 2L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3425), null, false, "Accesories", null, null }, - { 3L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3426), null, false, "Jewellery", null, null }, - { 4L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3427), null, false, "Medicines", null, null }, - { 5L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3428), null, false, "Telephones", null, null }, - { 6L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3429), null, false, "Toys", null, null } - }); - - migrationBuilder.InsertData( - table: "Role", - columns: new[] { "Id", "CreatedAt", "DeletedBy", "IsDeleted", "Name", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { 1L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3654), null, false, "User", null, null }, - { 2L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3657), null, false, "Admin", null, null }, - { 3L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3659), null, false, "Merchant", null, null }, - { 4L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3660), null, false, "Driver", null, null }, - { 5L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3661), null, false, "Picker", null, null }, - { 6L, new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3663), null, false, "Packer", null, null } - }); - - migrationBuilder.InsertData( - table: "Products", - columns: new[] { "Id", "CategoryId", "CreatedAt", "DeletedBy", "IsDeleted", "Name", "Price", "Serial", "UpdatedAt", "UpdatedBy", "Weight" }, - values: new object[,] - { - { 1L, 1L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5372), null, false, "HP-Victus", 630m, "a1B5", null, null, 2.2m }, - { 2L, 1L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5374), null, false, "MacBook-Pro", 2000m, "AKJ-12445", null, null, 1.2m }, - { 3L, 5L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5376), null, false, "Iphone-14", 1500m, "KLKJL-324342", null, null, 0.1m }, - { 4L, 6L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5378), null, false, "Spintronics", 100m, "MMMLW-11234", null, null, 4.2m }, - { 5L, 4L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5382), null, false, "Trimol", 1m, "MML-32423", null, null, 0.002m }, - { 6L, 2L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5383), null, false, "SmartWatch", 50m, "JJJO-23423", null, null, 0.1m } - }); - - migrationBuilder.InsertData( - table: "Users", - columns: new[] { "Id", "CreatedAt", "DeletedBy", "Email", "FirstName", "IsDeleted", "LastName", "Password", "Phone", "RoleId", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { 1L, new DateTime(2023, 5, 25, 11, 33, 9, 359, DateTimeKind.Utc).AddTicks(8992), null, "dotnetgo@icloud.com", "Mukhammadkarim", false, "Tukhtaboyev", "$2a$11$ocg1IVmxYbBZ4Rgs82wm/O/DlcOrgMYea/OKIq8J4wt6AT.0xVd.i", "+998 991239999", 2L, null, null }, - { 2L, new DateTime(2023, 5, 25, 11, 33, 9, 486, DateTimeKind.Utc).AddTicks(5424), null, "wonderboy1w3@gmail.com", "Jamshid", false, "Ma'ruf", "$2a$11$dstnWmZ9d1InMGY9my/r6.77O8kCh/Y.dy7xRLzbQAsFpXnIOrVxK", "+998 991231999", 3L, null, null }, - { 3L, new DateTime(2023, 5, 25, 11, 33, 9, 614, DateTimeKind.Utc).AddTicks(6077), null, "kabeersolutions@gmail.com", "Kabeer", false, "Solutions", "$2a$11$jmJEsBqx1k6YZsL.Kjy4yO6pYYLKuzbqwe228ajObWRDMFBrbg14a", "+998 991232999", 4L, null, null }, - { 4L, new DateTime(2023, 5, 25, 11, 33, 9, 740, DateTimeKind.Utc).AddTicks(2103), null, "nurillaewmuzaffar@gmail.com", "Muzaffar", false, "Nurillayev", "$2a$11$DRkhHsyb/Uv9bZUGh6Hd6uSoaEmcsdkD24xZfGcJpBGdTYXckoJze", "+998 995030110", 5L, null, null }, - { 5L, new DateTime(2023, 5, 25, 11, 33, 9, 863, DateTimeKind.Utc).AddTicks(2888), null, "azimochilov@icloud.com", "Azim", false, "Ochilov", "$2a$11$olfwyrEvL84QO9yCZB1e4uPP8exkXMLNQpEun805ySeKBCz8IAkta", "+998 991233999", 6L, null, null }, - { 6L, new DateTime(2023, 5, 25, 11, 33, 9, 986, DateTimeKind.Utc).AddTicks(3958), null, "abdulloh@icloud.com", "Abdulloh", false, "Ahmadjonov", "$2a$11$0UNovYjyvib/1tJojshyC.R36VQT4VZE1/ctmTWje8pU1EQYA05/6", "+998 991236999", 1L, null, null }, - { 7L, new DateTime(2023, 5, 25, 11, 33, 10, 110, DateTimeKind.Utc).AddTicks(6463), null, "komron2052@gmail.com", "Komron", false, "Rahmonov", "$2a$11$2XSJu2XaILH3AZKl6Bb1Du6j5KvF3NYAMFtFAA87CWOoCPXKJtEtG", "+998 991234999", 2L, null, null }, - { 8L, new DateTime(2023, 5, 25, 11, 33, 10, 236, DateTimeKind.Utc).AddTicks(9179), null, "nozimjon@gmail.com", "Nozimjon", false, "Usmonaliyev", "$2a$11$XdUCsX2vjiGvke83zOxBhujrI9jA/MJ5aKVadUULqbg/TSH66WYB.", "+998 991235999", 3L, null, null }, - { 9L, new DateTime(2023, 5, 25, 11, 33, 10, 363, DateTimeKind.Utc).AddTicks(8016), null, "aljavhar@gmail.com", "AlJavhar", false, "Boyaliyev", "$2a$11$jy7agtwyKEjtD1o55ptKJewa3R3yx1wb6px8Zx0TM5gTXrBsbUIse", "+998 902344545", 4L, null, null }, - { 10L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(4682), null, "muhammad@gmail.com", "Muhammad", false, "Rahimboyev", "$2a$11$XF3QbPHPk07Nk7DjsQVN2.FndurqHaV/AUnnZpnqha/G6NRalTCVK", "+998 937770202", 5L, null, null } - }); - - migrationBuilder.InsertData( - table: "Inventories", - columns: new[] { "Id", "Amount", "CreatedAt", "DeletedBy", "IsDeleted", "LocationId", "ProductId", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { 1L, 1000, new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), null, false, 1L, 6L, null, null }, - { 2L, 50, new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), null, false, 1L, 1L, null, null }, - { 3L, 100, new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), null, false, 2L, 3L, null, null }, - { 4L, 100000, new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), null, false, 3L, 5L, null, null }, - { 5L, 100, new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), null, false, 3L, 2L, null, null } - }); - - migrationBuilder.InsertData( - table: "Orders", - columns: new[] { "Id", "AddressId", "CreatedAt", "DeletedBy", "IsDeleted", "PaymentStatus", "Status", "UpdatedAt", "UpdatedBy", "UserId" }, - values: new object[] { 1L, 2L, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5467), null, false, 0, 1, null, null, 1L }); - - migrationBuilder.InsertData( - table: "OrderItems", - columns: new[] { "Id", "Amount", "CreatedAt", "DeletedBy", "IsDeleted", "OrderId", "ProductId", "UpdatedAt", "UpdatedBy" }, - values: new object[,] - { - { 1L, 1, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5491), null, false, 1L, 3L, null, null }, - { 2L, 4, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5492), null, false, 1L, 6L, null, null }, - { 3L, 2, new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5493), null, false, 1L, 2L, null, null } - }); - - migrationBuilder.CreateIndex( - name: "IX_CartItems_CartId", - table: "CartItems", - column: "CartId"); - - migrationBuilder.CreateIndex( - name: "IX_CartItems_ProductId", - table: "CartItems", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Discounts_ProductId", - table: "Discounts", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_FeedbackAttachments_AttachmentId", - table: "FeedbackAttachments", - column: "AttachmentId"); - - migrationBuilder.CreateIndex( - name: "IX_FeedbackAttachments_FeedbackId", - table: "FeedbackAttachments", - column: "FeedbackId"); - - migrationBuilder.CreateIndex( - name: "IX_Feedbacks_OrderId", - table: "Feedbacks", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventories_LocationId", - table: "Inventories", - column: "LocationId"); - - migrationBuilder.CreateIndex( - name: "IX_Inventories_ProductId", - table: "Inventories", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_OrderActions_OrderId", - table: "OrderActions", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_OrderItems_OrderId", - table: "OrderItems", - column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_OrderItems_ProductId", - table: "OrderItems", - column: "ProductId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_AddressId", - table: "Orders", - column: "AddressId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_UserId", - table: "Orders", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Products_CategoryId", - table: "Products", - column: "CategoryId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_RoleId", - table: "Users", - column: "RoleId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CartItems"); - - migrationBuilder.DropTable( - name: "Discounts"); - - migrationBuilder.DropTable( - name: "FeedbackAttachments"); - - migrationBuilder.DropTable( - name: "Inventories"); - - migrationBuilder.DropTable( - name: "OrderActions"); - - migrationBuilder.DropTable( - name: "OrderItems"); - - migrationBuilder.DropTable( - name: "Carts"); - - migrationBuilder.DropTable( - name: "Attachments"); - - migrationBuilder.DropTable( - name: "Feedbacks"); - - migrationBuilder.DropTable( - name: "Locations"); - - migrationBuilder.DropTable( - name: "Products"); - - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "ProductCategories"); - - migrationBuilder.DropTable( - name: "Addresses"); - - migrationBuilder.DropTable( - name: "Users"); - - migrationBuilder.DropTable( - name: "Role"); - } - } -} diff --git a/src/FleetFlow.DAL/Migrations/FleetFlowDbContextModelSnapshot.cs b/src/FleetFlow.DAL/Migrations/FleetFlowDbContextModelSnapshot.cs deleted file mode 100644 index ad33a01c..00000000 --- a/src/FleetFlow.DAL/Migrations/FleetFlowDbContextModelSnapshot.cs +++ /dev/null @@ -1,1313 +0,0 @@ -// -using System; -using FleetFlow.DAL.DbContexts; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace FleetFlow.DAL.Migrations -{ - [DbContext(typeof(FleetFlowDbContext))] - partial class FleetFlowDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Addresses.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("City") - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("District") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Latitude") - .HasColumnType("double precision"); - - b.Property("Longitude") - .HasColumnType("double precision"); - - b.Property("State") - .HasColumnType("text"); - - b.Property("Street") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("ZipCode") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Addresses"); - - b.HasData( - new - { - Id = 1L, - City = "Navoi", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5320), - District = "Nurata", - IsDeleted = false, - Latitude = 45.341200000000001, - Longitude = 32.323999999999998, - State = "Uzbekistan", - Street = "Medicals", - ZipCode = "210100" - }, - new - { - Id = 2L, - City = "Andijan", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5323), - District = "Paxtachi", - IsDeleted = false, - Latitude = 42.341200000000001, - Longitude = 20.324000000000002, - State = "Uzbekistan", - Street = "Programmers", - ZipCode = "213422" - }, - new - { - Id = 3L, - City = "Bukhara", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5325), - District = "Nurata", - IsDeleted = false, - Latitude = 44.341200000000001, - Longitude = 35.323999999999998, - State = "Uzbekistan", - Street = "Merchants", - ZipCode = "643224" - }, - new - { - Id = 4L, - City = "Kharezm", - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5326), - District = "Nurata", - IsDeleted = false, - Latitude = 47.341200000000001, - Longitude = 27.324000000000002, - State = "Uzbekistan", - Street = "Policians", - ZipCode = "100250" - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Attachments.Attachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("FileName") - .HasColumnType("text"); - - b.Property("FilePath") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Attachments"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Authorizations.Role", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Role"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3654), - IsDeleted = false, - Name = "User" - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3657), - IsDeleted = false, - Name = "Admin" - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3659), - IsDeleted = false, - Name = "Merchant" - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3660), - IsDeleted = false, - Name = "Driver" - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3661), - IsDeleted = false, - Name = "Picker" - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3663), - IsDeleted = false, - Name = "Packer" - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Cart", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Carts"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.CartItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CartId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CartId"); - - b.HasIndex("ProductId"); - - b.ToTable("CartItems"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("Feedbacks"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.FeedbackAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttachmentId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("FeedbackId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("AttachmentId"); - - b.HasIndex("FeedbackId"); - - b.ToTable("FeedbackAttachments"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddressId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PaymentStatus") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("AddressId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - - b.HasData( - new - { - Id = 1L, - AddressId = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5467), - IsDeleted = false, - PaymentStatus = 0, - Status = 1, - UserId = 1L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderAction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("OrderActions"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("OrderId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.HasIndex("ProductId"); - - b.ToTable("OrderItems"); - - b.HasData( - new - { - Id = 1L, - Amount = 1, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5491), - IsDeleted = false, - OrderId = 1L, - ProductId = 3L - }, - new - { - Id = 2L, - Amount = 4, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5492), - IsDeleted = false, - OrderId = 1L, - ProductId = 6L - }, - new - { - Id = 3L, - Amount = 2, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5493), - IsDeleted = false, - OrderId = 1L, - ProductId = 2L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Discount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("FinishedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PercentageToCheapen") - .HasColumnType("numeric"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("StartedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("State") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Discounts"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CategoryId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Price") - .HasColumnType("numeric"); - - b.Property("Serial") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("Weight") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CategoryId"); - - b.ToTable("Products"); - - b.HasData( - new - { - Id = 1L, - CategoryId = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5372), - IsDeleted = false, - Name = "HP-Victus", - Price = 630m, - Serial = "a1B5", - Weight = 2.2m - }, - new - { - Id = 2L, - CategoryId = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5374), - IsDeleted = false, - Name = "MacBook-Pro", - Price = 2000m, - Serial = "AKJ-12445", - Weight = 1.2m - }, - new - { - Id = 3L, - CategoryId = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5376), - IsDeleted = false, - Name = "Iphone-14", - Price = 1500m, - Serial = "KLKJL-324342", - Weight = 0.1m - }, - new - { - Id = 4L, - CategoryId = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5378), - IsDeleted = false, - Name = "Spintronics", - Price = 100m, - Serial = "MMMLW-11234", - Weight = 4.2m - }, - new - { - Id = 5L, - CategoryId = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5382), - IsDeleted = false, - Name = "Trimol", - Price = 1m, - Serial = "MML-32423", - Weight = 0.002m - }, - new - { - Id = 6L, - CategoryId = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(5383), - IsDeleted = false, - Name = "SmartWatch", - Price = 50m, - Serial = "JJJO-23423", - Weight = 0.1m - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3422), - IsDeleted = false, - Name = "Laptops" - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3425), - IsDeleted = false, - Name = "Accesories" - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3426), - IsDeleted = false, - Name = "Jewellery" - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3427), - IsDeleted = false, - Name = "Medicines" - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3428), - IsDeleted = false, - Name = "Telephones" - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3429), - IsDeleted = false, - Name = "Toys" - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Users.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("FirstName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LastName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Password") - .HasColumnType("text"); - - b.Property("Phone") - .HasColumnType("text"); - - b.Property("RoleId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 359, DateTimeKind.Utc).AddTicks(8992), - Email = "dotnetgo@icloud.com", - FirstName = "Mukhammadkarim", - IsDeleted = false, - LastName = "Tukhtaboyev", - Password = "$2a$11$ocg1IVmxYbBZ4Rgs82wm/O/DlcOrgMYea/OKIq8J4wt6AT.0xVd.i", - Phone = "+998 991239999", - RoleId = 2L - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 486, DateTimeKind.Utc).AddTicks(5424), - Email = "wonderboy1w3@gmail.com", - FirstName = "Jamshid", - IsDeleted = false, - LastName = "Ma'ruf", - Password = "$2a$11$dstnWmZ9d1InMGY9my/r6.77O8kCh/Y.dy7xRLzbQAsFpXnIOrVxK", - Phone = "+998 991231999", - RoleId = 3L - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 614, DateTimeKind.Utc).AddTicks(6077), - Email = "kabeersolutions@gmail.com", - FirstName = "Kabeer", - IsDeleted = false, - LastName = "Solutions", - Password = "$2a$11$jmJEsBqx1k6YZsL.Kjy4yO6pYYLKuzbqwe228ajObWRDMFBrbg14a", - Phone = "+998 991232999", - RoleId = 4L - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 740, DateTimeKind.Utc).AddTicks(2103), - Email = "nurillaewmuzaffar@gmail.com", - FirstName = "Muzaffar", - IsDeleted = false, - LastName = "Nurillayev", - Password = "$2a$11$DRkhHsyb/Uv9bZUGh6Hd6uSoaEmcsdkD24xZfGcJpBGdTYXckoJze", - Phone = "+998 995030110", - RoleId = 5L - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 863, DateTimeKind.Utc).AddTicks(2888), - Email = "azimochilov@icloud.com", - FirstName = "Azim", - IsDeleted = false, - LastName = "Ochilov", - Password = "$2a$11$olfwyrEvL84QO9yCZB1e4uPP8exkXMLNQpEun805ySeKBCz8IAkta", - Phone = "+998 991233999", - RoleId = 6L - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 986, DateTimeKind.Utc).AddTicks(3958), - Email = "abdulloh@icloud.com", - FirstName = "Abdulloh", - IsDeleted = false, - LastName = "Ahmadjonov", - Password = "$2a$11$0UNovYjyvib/1tJojshyC.R36VQT4VZE1/ctmTWje8pU1EQYA05/6", - Phone = "+998 991236999", - RoleId = 1L - }, - new - { - Id = 7L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 110, DateTimeKind.Utc).AddTicks(6463), - Email = "komron2052@gmail.com", - FirstName = "Komron", - IsDeleted = false, - LastName = "Rahmonov", - Password = "$2a$11$2XSJu2XaILH3AZKl6Bb1Du6j5KvF3NYAMFtFAA87CWOoCPXKJtEtG", - Phone = "+998 991234999", - RoleId = 2L - }, - new - { - Id = 8L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 236, DateTimeKind.Utc).AddTicks(9179), - Email = "nozimjon@gmail.com", - FirstName = "Nozimjon", - IsDeleted = false, - LastName = "Usmonaliyev", - Password = "$2a$11$XdUCsX2vjiGvke83zOxBhujrI9jA/MJ5aKVadUULqbg/TSH66WYB.", - Phone = "+998 991235999", - RoleId = 3L - }, - new - { - Id = 9L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 363, DateTimeKind.Utc).AddTicks(8016), - Email = "aljavhar@gmail.com", - FirstName = "AlJavhar", - IsDeleted = false, - LastName = "Boyaliyev", - Password = "$2a$11$jy7agtwyKEjtD1o55ptKJewa3R3yx1wb6px8Zx0TM5gTXrBsbUIse", - Phone = "+998 902344545", - RoleId = 4L - }, - new - { - Id = 10L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 10, 487, DateTimeKind.Utc).AddTicks(4682), - Email = "muhammad@gmail.com", - FirstName = "Muhammad", - IsDeleted = false, - LastName = "Rahimboyev", - Password = "$2a$11$XF3QbPHPk07Nk7DjsQVN2.FndurqHaV/AUnnZpnqha/G6NRalTCVK", - Phone = "+998 937770202", - RoleId = 5L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Warehouses.Inventory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("LocationId"); - - b.HasIndex("ProductId"); - - b.ToTable("Inventories"); - - b.HasData( - new - { - Id = 1L, - Amount = 1000, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 1L, - ProductId = 6L - }, - new - { - Id = 2L, - Amount = 50, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 1L, - ProductId = 1L - }, - new - { - Id = 3L, - Amount = 100, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 2L, - ProductId = 3L - }, - new - { - Id = 4L, - Amount = 100000, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 3L, - ProductId = 5L - }, - new - { - Id = 5L, - Amount = 100, - CreatedAt = new DateTime(2023, 5, 25, 0, 0, 0, 0, DateTimeKind.Utc), - IsDeleted = false, - LocationId = 3L, - ProductId = 2L - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Warehouses.Location", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("DeletedBy") - .HasColumnType("bigint"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Locations"); - - b.HasData( - new - { - Id = 1L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3621), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 2L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3626), - Description = "In the beginning of entry", - IsDeleted = false - }, - new - { - Id = 3L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3627), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 4L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3628), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 5L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3629), - Description = "In the middle", - IsDeleted = false - }, - new - { - Id = 6L, - CreatedAt = new DateTime(2023, 5, 25, 11, 33, 9, 233, DateTimeKind.Utc).AddTicks(3630), - Description = "In the middle", - IsDeleted = false - }); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.CartItem", b => - { - b.HasOne("FleetFlow.Domain.Entities.Cart", "Cart") - .WithMany("Items") - .HasForeignKey("CartId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Cart"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", b => - { - b.HasOne("FleetFlow.Domain.Entities.Orders.Order", "Order") - .WithMany("Feedbacks") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.FeedbackAttachment", b => - { - b.HasOne("FleetFlow.Domain.Entities.Attachments.Attachment", "Attachment") - .WithMany() - .HasForeignKey("AttachmentId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", "Feedback") - .WithMany("Attachments") - .HasForeignKey("FeedbackId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Attachment"); - - b.Navigation("Feedback"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Order", b => - { - b.HasOne("FleetFlow.Domain.Entities.Addresses.Address", "Address") - .WithMany("Orders") - .HasForeignKey("AddressId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("FleetFlow.Domain.Entities.Users.User", "User") - .WithMany("Orders") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderAction", b => - { - b.HasOne("FleetFlow.Domain.Entities.Orders.Order", "Order") - .WithMany("Actions") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Order"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.OrderItem", b => - { - b.HasOne("FleetFlow.Domain.Entities.Orders.Order", "Order") - .WithMany("OrderItems") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany("OrderItems") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Order"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Discount", b => - { - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany("Discounts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Product", b => - { - b.HasOne("FleetFlow.Domain.Entities.Products.ProductCategory", "Category") - .WithMany("Products") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Users.User", b => - { - b.HasOne("FleetFlow.Domain.Entities.Authorizations.Role", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Warehouses.Inventory", b => - { - b.HasOne("FleetFlow.Domain.Entities.Warehouses.Location", "Location") - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("FleetFlow.Domain.Entities.Products.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Location"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Addresses.Address", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Cart", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Feedbacks.Feedback", b => - { - b.Navigation("Attachments"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Orders.Order", b => - { - b.Navigation("Actions"); - - b.Navigation("Feedbacks"); - - b.Navigation("OrderItems"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.Product", b => - { - b.Navigation("Discounts"); - - b.Navigation("OrderItems"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Products.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("FleetFlow.Domain.Entities.Users.User", b => - { - b.Navigation("Orders"); - }); -#pragma warning restore 612, 618 - } - } -} From d450ba1a7b9808804b2e3fc3fd8b19ee698c35d3 Mon Sep 17 00:00:00 2001 From: aaaa Date: Wed, 20 Sep 2023 16:25:59 +0500 Subject: [PATCH 2/2] clean-code commit --- .../Services/Addresses/AddressService.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/FleetFlow.Service/Services/Addresses/AddressService.cs b/src/FleetFlow.Service/Services/Addresses/AddressService.cs index 3980d6bd..2a6224aa 100644 --- a/src/FleetFlow.Service/Services/Addresses/AddressService.cs +++ b/src/FleetFlow.Service/Services/Addresses/AddressService.cs @@ -1,12 +1,13 @@ using AutoMapper; using FleetFlow.DAL.IRepositories; -using FleetFlow.Domain.Congirations; -using FleetFlow.Domain.Entities.Addresses; -using FleetFlow.Service.DTOs.Address; using FleetFlow.Service.Exceptions; using FleetFlow.Service.Extentions; -using FleetFlow.Service.Interfaces.Addresses; using Microsoft.EntityFrameworkCore; +using FleetFlow.Domain.Congirations; +using FleetFlow.Service.DTOs.Address; +using FleetFlow.Domain.Entities.Addresses; +using FleetFlow.Service.Interfaces.Addresses; + namespace FleetFlow.Service.Services.Addresses; @@ -24,7 +25,7 @@ public async Task AddAsync(AddressForCreationDto address) { var mapped = mapper.Map
(address); - var insertResult = await addressRepository.InsertAsync(mapped); + var insertResult = await this.addressRepository.InsertAsync(mapped); await addressRepository.SaveAsync(); return mapper.Map(insertResult); @@ -32,20 +33,20 @@ public async Task AddAsync(AddressForCreationDto address) public async Task DeleteByIdAsync(long id) { - var CheckAddress = await addressRepository.SelectAsync(a => a.Id == id); + var CheckAddress = await this.addressRepository.SelectAsync(a => a.Id == id); - bool IsDeleted = await addressRepository.DeleteAsync(a => a.Id == id); + bool IsDeleted = await this.addressRepository.DeleteAsync(a => a.Id == id); if (!IsDeleted) throw new FleetFlowException(404, "Couldn't find product for this given Id"); - await addressRepository.SaveAsync(); + await this.addressRepository.SaveAsync(); return IsDeleted; } public async Task> GetAllAsync(PaginationParams @params) { - var addressQuery = addressRepository.SelectAll(); + var addressQuery = this.addressRepository.SelectAll(); if (addressQuery is null) throw new FleetFlowException(404, "Address not found"); @@ -56,7 +57,7 @@ public async Task> GetAllAsync(PaginationParams public async Task GetByIdAsync(long id) { - var address = await addressRepository.SelectAsync(a => a.Id == id); + var address = await this.addressRepository.SelectAsync(a => a.Id == id); if (address is null) throw new FleetFlowException(404, "Address Not Found"); @@ -68,7 +69,7 @@ public async Task GetByIdAsync(long id) public async Task UpdateByIdAsync(long id, AddressForCreationDto dto) { - var address = await addressRepository.SelectAsync(a => a.Id == id); + var address = await this.addressRepository.SelectAsync(a => a.Id == id); if (address is null) throw new FleetFlowException(404, "Couldn't find Address"); @@ -76,7 +77,7 @@ public async Task UpdateByIdAsync(long id, AddressForCreati var mapped = mapper.Map(dto, address); mapped.UpdatedAt = DateTime.UtcNow; - await addressRepository.SaveAsync(); + await this.addressRepository.SaveAsync(); return mapper.Map(mapped); }