diff --git a/src/backend/DeLong.Application/DTOs/Prices/PriceResultDto.cs b/src/backend/DeLong.Application/DTOs/Prices/PriceResultDto.cs index 1c98bc4..75a17cd 100644 --- a/src/backend/DeLong.Application/DTOs/Prices/PriceResultDto.cs +++ b/src/backend/DeLong.Application/DTOs/Prices/PriceResultDto.cs @@ -19,4 +19,5 @@ public class PriceResultDto public decimal SellingPrice { get; set; } // Sotish narxi public string UnitOfMeasure { get; set; } = string.Empty; // kg,dona,karobka,litr public decimal Quantity { get; set; } // miqdori + public DateTimeOffset CreatedAt { get; set; } } diff --git a/src/backend/DeLong.Infrastructure/Migrations/20250412171304_Initial.Designer.cs b/src/backend/DeLong.Infrastructure/Migrations/20250412171304_Initial.Designer.cs deleted file mode 100644 index 3ad6a85..0000000 --- a/src/backend/DeLong.Infrastructure/Migrations/20250412171304_Initial.Designer.cs +++ /dev/null @@ -1,1405 +0,0 @@ -// -using System; -using DeLong.Infrastructure.Contexts; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace DeLong.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250412171304_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DeLong.Domain.Entities.Asset", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("text"); - - b.Property("FilePath") - .IsRequired() - .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("Assets"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Branch", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Location") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Branches"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashRegister", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CashWarehouseId") - .HasColumnType("bigint"); - - b.Property("ClosedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("OpenedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UsdBalance") - .HasColumnType("numeric"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.Property("UzpBalance") - .HasColumnType("numeric"); - - b.Property("UzsBalance") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CashWarehouseId"); - - b.HasIndex("UserId"); - - b.ToTable("CashRegisters"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashTransfer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CashRegisterId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("Currency") - .IsRequired() - .HasColumnType("text"); - - b.Property("From") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Note") - .IsRequired() - .HasColumnType("text"); - - b.Property("To") - .HasColumnType("text"); - - b.Property("TransferDate") - .HasColumnType("timestamp with time zone"); - - b.Property("TransferType") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CashRegisterId"); - - b.ToTable("CashTransfers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashWarehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UsdBalance") - .HasColumnType("numeric"); - - b.Property("UzpBalance") - .HasColumnType("numeric"); - - b.Property("UzsBalance") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.ToTable("CashWarehouses"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Category", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Categories"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.ChangeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChangeType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("EntityName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("NewValues") - .HasColumnType("text"); - - b.Property("OldValues") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("ChangeHistories"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BankAccount") - .HasColumnType("text"); - - b.Property("BankName") - .HasColumnType("text"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CompanyName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("EmployeeName") - .HasColumnType("text"); - - b.Property("EmployeePhone") - .HasColumnType("text"); - - b.Property("INN") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MFO") - .HasColumnType("text"); - - b.Property("ManagerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ManagerPhone") - .IsRequired() - .HasColumnType("text"); - - b.Property("OKONX") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("YurAddress") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Debt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("DueDate") - .HasColumnType("timestamp with time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsSettled") - .HasColumnType("boolean"); - - b.Property("RemainingAmount") - .HasColumnType("numeric"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("SaleId"); - - b.ToTable("Debts"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.DebtPayment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("DebtId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PaymentDate") - .HasColumnType("timestamp with time zone"); - - b.Property("PaymentMethod") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("DebtId"); - - b.ToTable("DebtPayments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Discount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("SaleId"); - - b.ToTable("Discounts"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("FullName") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.Property("Phone") - .IsRequired() - .HasColumnType("text"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("Username") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("BranchId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.KursDollar", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdmissionDollar") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("SellingDollar") - .HasColumnType("numeric"); - - b.Property("TodayDate") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("KursDollars"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Payment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("Type") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("SaleId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Price", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CostPrice") - .HasColumnType("numeric"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("SellingPrice") - .HasColumnType("numeric"); - - b.Property("SupplierId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CategoryId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MinStockLevel") - .HasColumnType("numeric"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProductSign") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiryDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Token") - .IsRequired() - .HasColumnType("text"); - - b.Property("Username") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Token") - .IsUnique(); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.ReturnProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("CustomerId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReturnSumma") - .HasColumnType("numeric"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.HasIndex("UserId"); - - b.ToTable("ReturnProducts"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Sale", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("CustomerId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("TotalAmount") - .HasColumnType("numeric"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.HasIndex("UserId"); - - b.ToTable("Sales"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.SaleItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UnitPrice") - .HasColumnType("numeric"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("SaleId"); - - b.ToTable("SaleItems"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("ContactInfo") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("BranchIdTo") - .HasColumnType("bigint"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("SupplierIdFrom") - .HasColumnType("bigint"); - - b.Property("TransactionType") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("BranchId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.TransactionItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PriceProduct") - .HasColumnType("numeric"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("TransactionId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("TransactionId"); - - b.ToTable("TransactionItems"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("text"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("DateOfBirth") - .HasColumnType("timestamp with time zone"); - - b.Property("DateOfExpiry") - .HasColumnType("timestamp with time zone"); - - b.Property("DateOfIssue") - .HasColumnType("timestamp with time zone"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Gender") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JSHSHIR") - .HasColumnType("text"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.Property("Patronomyc") - .HasColumnType("text"); - - b.Property("Phone") - .IsRequired() - .HasColumnType("text"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("SeriaPasport") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("Username") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashRegister", b => - { - b.HasOne("DeLong.Domain.Entities.CashWarehouse", null) - .WithMany("CashRegisters") - .HasForeignKey("CashWarehouseId"); - - b.HasOne("DeLong.Domain.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashTransfer", b => - { - b.HasOne("DeLong.Domain.Entities.CashRegister", "CashRegister") - .WithMany("Transfers") - .HasForeignKey("CashRegisterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CashRegister"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Debt", b => - { - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany("Debts") - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.DebtPayment", b => - { - b.HasOne("DeLong.Domain.Entities.Debt", "Debt") - .WithMany("DebtPayments") - .HasForeignKey("DebtId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Debt"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Discount", b => - { - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany() - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Employee", b => - { - b.HasOne("DeLong.Domain.Entities.Branch", "Branch") - .WithMany() - .HasForeignKey("BranchId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Branch"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Payment", b => - { - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany("Payments") - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Price", b => - { - b.HasOne("DeLong.Domain.Entities.Product", null) - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DeLong.Domain.Entities.Supplier", "Supplier") - .WithMany() - .HasForeignKey("SupplierId"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Product", b => - { - b.HasOne("DeLong.Domain.Entities.Category", "Category") - .WithMany("Products") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.ReturnProduct", b => - { - b.HasOne("DeLong.Domain.Entities.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId"); - - b.HasOne("DeLong.Domain.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Customer"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Sale", b => - { - b.HasOne("DeLong.Domain.Entities.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("DeLong.Domain.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Customer"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.SaleItem", b => - { - b.HasOne("DeLong.Domain.Entities.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany() - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Transaction", b => - { - b.HasOne("DeLong.Domain.Entities.Branch", "BranchTo") - .WithMany() - .HasForeignKey("BranchId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BranchTo"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.TransactionItem", b => - { - b.HasOne("DeLong.Domain.Entities.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DeLong.Domain.Entities.Transaction", null) - .WithMany("Items") - .HasForeignKey("TransactionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashRegister", b => - { - b.Navigation("Transfers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashWarehouse", b => - { - b.Navigation("CashRegisters"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Category", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Debt", b => - { - b.Navigation("DebtPayments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Product", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Sale", b => - { - b.Navigation("Debts"); - - b.Navigation("Payments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Transaction", b => - { - b.Navigation("Items"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/backend/DeLong.Infrastructure/Migrations/20250417055952_AddGuidPropertyToTransactionEntity.Designer.cs b/src/backend/DeLong.Infrastructure/Migrations/20250417055952_AddGuidPropertyToTransactionEntity.Designer.cs deleted file mode 100644 index f5d64e4..0000000 --- a/src/backend/DeLong.Infrastructure/Migrations/20250417055952_AddGuidPropertyToTransactionEntity.Designer.cs +++ /dev/null @@ -1,1528 +0,0 @@ -// -using System; -using DeLong.Infrastructure.Contexts; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace DeLong.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250417055952_AddGuidPropertyToTransactionEntity")] - partial class AddGuidPropertyToTransactionEntity - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DeLong.Domain.Entities.Asset", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("text"); - - b.Property("FilePath") - .IsRequired() - .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("Assets"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Branch", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Location") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Branches"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashRegister", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CashWarehouseId") - .HasColumnType("bigint"); - - b.Property("ClosedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("OpenedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UsdBalance") - .HasColumnType("numeric"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.Property("UzpBalance") - .HasColumnType("numeric"); - - b.Property("UzsBalance") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("CashWarehouseId"); - - b.HasIndex("UserId"); - - b.ToTable("CashRegisters"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashTransfer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CashRegisterId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("Currency") - .IsRequired() - .HasColumnType("text"); - - b.Property("From") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Note") - .IsRequired() - .HasColumnType("text"); - - b.Property("To") - .HasColumnType("text"); - - b.Property("TransferDate") - .HasColumnType("timestamp with time zone"); - - b.Property("TransferType") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CashRegisterId"); - - b.ToTable("CashTransfers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashWarehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UsdBalance") - .HasColumnType("numeric"); - - b.Property("UzpBalance") - .HasColumnType("numeric"); - - b.Property("UzsBalance") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.ToTable("CashWarehouses"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Category", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Categories"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.ChangeHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChangeType") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("EntityId") - .HasColumnType("bigint"); - - b.Property("EntityName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("NewValues") - .HasColumnType("text"); - - b.Property("OldValues") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("ChangeHistories"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CreditorDebt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("Date") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsSettled") - .HasColumnType("boolean"); - - b.Property("RemainingAmount") - .HasColumnType("numeric"); - - b.Property("SupplierId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("SupplierId"); - - b.ToTable("CreditorDebts"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CreditorDebtPayment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("CreditorDebtId") - .HasColumnType("bigint"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PaymentDate") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CreditorDebtId"); - - b.ToTable("CreditorDebtPayments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BankAccount") - .HasColumnType("text"); - - b.Property("BankName") - .HasColumnType("text"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CompanyName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("EmployeeName") - .HasColumnType("text"); - - b.Property("EmployeePhone") - .HasColumnType("text"); - - b.Property("INN") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MFO") - .HasColumnType("text"); - - b.Property("ManagerName") - .IsRequired() - .HasColumnType("text"); - - b.Property("ManagerPhone") - .IsRequired() - .HasColumnType("text"); - - b.Property("OKONX") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("YurAddress") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Debt", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("DueDate") - .HasColumnType("timestamp with time zone"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsSettled") - .HasColumnType("boolean"); - - b.Property("RemainingAmount") - .HasColumnType("numeric"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("SaleId"); - - b.ToTable("Debts"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.DebtPayment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("DebtId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PaymentDate") - .HasColumnType("timestamp with time zone"); - - b.Property("PaymentMethod") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("DebtId"); - - b.ToTable("DebtPayments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Discount", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("SaleId"); - - b.ToTable("Discounts"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("FullName") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.Property("Phone") - .IsRequired() - .HasColumnType("text"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("Username") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("BranchId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.KursDollar", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdmissionDollar") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("SellingDollar") - .HasColumnType("numeric"); - - b.Property("TodayDate") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("KursDollars"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Payment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("numeric"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("Type") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("SaleId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Price", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CostPrice") - .HasColumnType("numeric"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("SellingPrice") - .HasColumnType("numeric"); - - b.Property("SupplierId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CategoryId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MinStockLevel") - .HasColumnType("numeric"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProductSign") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ExpiryDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Token") - .IsRequired() - .HasColumnType("text"); - - b.Property("Username") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Token") - .IsUnique(); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.ReturnProduct", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("CustomerId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("ProductName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("ReturnSumma") - .HasColumnType("numeric"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.HasIndex("UserId"); - - b.ToTable("ReturnProducts"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Sale", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("CustomerId") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("TotalAmount") - .HasColumnType("numeric"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.HasIndex("UserId"); - - b.ToTable("Sales"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.SaleItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("SaleId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UnitPrice") - .HasColumnType("numeric"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("SaleId"); - - b.ToTable("SaleItems"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("ContactInfo") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Transaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("BranchIdTo") - .HasColumnType("bigint"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("RequestId") - .HasColumnType("uuid"); - - b.Property("SupplierIdFrom") - .HasColumnType("bigint"); - - b.Property("TransactionType") - .HasColumnType("integer"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("BranchId"); - - b.ToTable("Transactions"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.TransactionItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("PriceProduct") - .HasColumnType("numeric"); - - b.Property("ProductId") - .HasColumnType("bigint"); - - b.Property("Quantity") - .HasColumnType("numeric"); - - b.Property("TransactionId") - .HasColumnType("bigint"); - - b.Property("UnitOfMeasure") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.HasIndex("TransactionId"); - - b.ToTable("TransactionItems"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("text"); - - b.Property("BranchId") - .HasColumnType("bigint"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedBy") - .HasColumnType("bigint"); - - b.Property("DateOfBirth") - .HasColumnType("timestamp with time zone"); - - b.Property("DateOfExpiry") - .HasColumnType("timestamp with time zone"); - - b.Property("DateOfIssue") - .HasColumnType("timestamp with time zone"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Gender") - .HasColumnType("integer"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("JSHSHIR") - .HasColumnType("text"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("text"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.Property("Patronomyc") - .HasColumnType("text"); - - b.Property("Phone") - .IsRequired() - .HasColumnType("text"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("SeriaPasport") - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("UpdatedBy") - .HasColumnType("bigint"); - - b.Property("Username") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashRegister", b => - { - b.HasOne("DeLong.Domain.Entities.CashWarehouse", null) - .WithMany("CashRegisters") - .HasForeignKey("CashWarehouseId"); - - b.HasOne("DeLong.Domain.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashTransfer", b => - { - b.HasOne("DeLong.Domain.Entities.CashRegister", "CashRegister") - .WithMany("Transfers") - .HasForeignKey("CashRegisterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CashRegister"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CreditorDebt", b => - { - b.HasOne("DeLong.Domain.Entities.Supplier", "Supplier") - .WithMany() - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CreditorDebtPayment", b => - { - b.HasOne("DeLong.Domain.Entities.CreditorDebt", "CreditorDebt") - .WithMany("CreditorDebtPayments") - .HasForeignKey("CreditorDebtId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreditorDebt"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Debt", b => - { - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany("Debts") - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.DebtPayment", b => - { - b.HasOne("DeLong.Domain.Entities.Debt", "Debt") - .WithMany("DebtPayments") - .HasForeignKey("DebtId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Debt"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Discount", b => - { - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany() - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Employee", b => - { - b.HasOne("DeLong.Domain.Entities.Branch", "Branch") - .WithMany() - .HasForeignKey("BranchId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Branch"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Payment", b => - { - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany("Payments") - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Price", b => - { - b.HasOne("DeLong.Domain.Entities.Product", null) - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DeLong.Domain.Entities.Supplier", "Supplier") - .WithMany() - .HasForeignKey("SupplierId"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Product", b => - { - b.HasOne("DeLong.Domain.Entities.Category", "Category") - .WithMany("Products") - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Category"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.ReturnProduct", b => - { - b.HasOne("DeLong.Domain.Entities.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId"); - - b.HasOne("DeLong.Domain.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Customer"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Sale", b => - { - b.HasOne("DeLong.Domain.Entities.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("DeLong.Domain.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Customer"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.SaleItem", b => - { - b.HasOne("DeLong.Domain.Entities.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DeLong.Domain.Entities.Sale", "Sale") - .WithMany() - .HasForeignKey("SaleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Sale"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Transaction", b => - { - b.HasOne("DeLong.Domain.Entities.Branch", "BranchTo") - .WithMany() - .HasForeignKey("BranchId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BranchTo"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.TransactionItem", b => - { - b.HasOne("DeLong.Domain.Entities.Product", "Product") - .WithMany() - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DeLong.Domain.Entities.Transaction", null) - .WithMany("Items") - .HasForeignKey("TransactionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashRegister", b => - { - b.Navigation("Transfers"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CashWarehouse", b => - { - b.Navigation("CashRegisters"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Category", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.CreditorDebt", b => - { - b.Navigation("CreditorDebtPayments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Debt", b => - { - b.Navigation("DebtPayments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Product", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Sale", b => - { - b.Navigation("Debts"); - - b.Navigation("Payments"); - }); - - modelBuilder.Entity("DeLong.Domain.Entities.Transaction", b => - { - b.Navigation("Items"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/backend/DeLong.Infrastructure/Migrations/20250417055952_AddGuidPropertyToTransactionEntity.cs b/src/backend/DeLong.Infrastructure/Migrations/20250417055952_AddGuidPropertyToTransactionEntity.cs deleted file mode 100644 index f2de228..0000000 --- a/src/backend/DeLong.Infrastructure/Migrations/20250417055952_AddGuidPropertyToTransactionEntity.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace DeLong.Data.Migrations -{ - /// - public partial class AddGuidPropertyToTransactionEntity : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "RequestId", - table: "Transactions", - type: "uuid", - nullable: true); - - migrationBuilder.CreateTable( - name: "CreditorDebts", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - SupplierId = table.Column(type: "bigint", nullable: false), - Date = table.Column(type: "timestamp with time zone", nullable: false), - RemainingAmount = table.Column(type: "numeric", nullable: false), - Description = table.Column(type: "text", nullable: true), - IsSettled = table.Column(type: "boolean", nullable: false), - BranchId = table.Column(type: "bigint", nullable: false), - CreatedBy = table.Column(type: "bigint", nullable: true), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CreditorDebts", x => x.Id); - table.ForeignKey( - name: "FK_CreditorDebts_Suppliers_SupplierId", - column: x => x.SupplierId, - principalTable: "Suppliers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "CreditorDebtPayments", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - CreditorDebtId = table.Column(type: "bigint", nullable: false), - Amount = table.Column(type: "numeric", nullable: false), - PaymentDate = table.Column(type: "timestamp with time zone", nullable: false), - Description = table.Column(type: "text", nullable: true), - BranchId = table.Column(type: "bigint", nullable: false), - CreatedBy = table.Column(type: "bigint", nullable: true), - CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), - UpdatedBy = table.Column(type: "bigint", nullable: true), - UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true), - IsDeleted = table.Column(type: "boolean", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CreditorDebtPayments", x => x.Id); - table.ForeignKey( - name: "FK_CreditorDebtPayments_CreditorDebts_CreditorDebtId", - column: x => x.CreditorDebtId, - principalTable: "CreditorDebts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_CreditorDebtPayments_CreditorDebtId", - table: "CreditorDebtPayments", - column: "CreditorDebtId"); - - migrationBuilder.CreateIndex( - name: "IX_CreditorDebts_SupplierId", - table: "CreditorDebts", - column: "SupplierId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CreditorDebtPayments"); - - migrationBuilder.DropTable( - name: "CreditorDebts"); - - migrationBuilder.DropColumn( - name: "RequestId", - table: "Transactions"); - } - } -} diff --git a/src/backend/DeLong.Infrastructure/Migrations/20250419052002_AddTransactionIdPropertyToCreditorDebtEntity.cs b/src/backend/DeLong.Infrastructure/Migrations/20250419052002_AddTransactionIdPropertyToCreditorDebtEntity.cs deleted file mode 100644 index 0a17b65..0000000 --- a/src/backend/DeLong.Infrastructure/Migrations/20250419052002_AddTransactionIdPropertyToCreditorDebtEntity.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DeLong.Data.Migrations -{ - /// - public partial class AddTransactionIdPropertyToCreditorDebtEntity : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TransactionId", - table: "CreditorDebts", - type: "bigint", - nullable: false, - defaultValue: 0L); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "TransactionId", - table: "CreditorDebts"); - } - } -} diff --git a/src/backend/DeLong.Infrastructure/Migrations/20250419052002_AddTransactionIdPropertyToCreditorDebtEntity.Designer.cs b/src/backend/DeLong.Infrastructure/Migrations/20250420095120_Initial.Designer.cs similarity index 99% rename from src/backend/DeLong.Infrastructure/Migrations/20250419052002_AddTransactionIdPropertyToCreditorDebtEntity.Designer.cs rename to src/backend/DeLong.Infrastructure/Migrations/20250420095120_Initial.Designer.cs index b3a8f27..65e1851 100644 --- a/src/backend/DeLong.Infrastructure/Migrations/20250419052002_AddTransactionIdPropertyToCreditorDebtEntity.Designer.cs +++ b/src/backend/DeLong.Infrastructure/Migrations/20250420095120_Initial.Designer.cs @@ -12,8 +12,8 @@ namespace DeLong.Data.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20250419052002_AddTransactionIdPropertyToCreditorDebtEntity")] - partial class AddTransactionIdPropertyToCreditorDebtEntity + [Migration("20250420095120_Initial")] + partial class Initial { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/src/backend/DeLong.Infrastructure/Migrations/20250412171304_Initial.cs b/src/backend/DeLong.Infrastructure/Migrations/20250420095120_Initial.cs similarity index 91% rename from src/backend/DeLong.Infrastructure/Migrations/20250412171304_Initial.cs rename to src/backend/DeLong.Infrastructure/Migrations/20250420095120_Initial.cs index 33a240a..4867eba 100644 --- a/src/backend/DeLong.Infrastructure/Migrations/20250412171304_Initial.cs +++ b/src/backend/DeLong.Infrastructure/Migrations/20250420095120_Initial.cs @@ -271,6 +271,7 @@ protected override void Up(MigrationBuilder migrationBuilder) BranchIdTo = table.Column(type: "bigint", nullable: true), TransactionType = table.Column(type: "integer", nullable: false), Comment = table.Column(type: "text", nullable: false), + RequestId = table.Column(type: "uuid", nullable: true), CreatedBy = table.Column(type: "bigint", nullable: true), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), UpdatedBy = table.Column(type: "bigint", nullable: true), @@ -317,6 +318,36 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "CreditorDebts", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + SupplierId = table.Column(type: "bigint", nullable: false), + TransactionId = table.Column(type: "bigint", nullable: false), + Date = table.Column(type: "timestamp with time zone", nullable: false), + RemainingAmount = table.Column(type: "numeric", nullable: false), + Description = table.Column(type: "text", nullable: true), + IsSettled = table.Column(type: "boolean", nullable: false), + BranchId = table.Column(type: "bigint", nullable: false), + CreatedBy = table.Column(type: "bigint", nullable: true), + CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedBy = table.Column(type: "bigint", nullable: true), + UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CreditorDebts", x => x.Id); + table.ForeignKey( + name: "FK_CreditorDebts_Suppliers_SupplierId", + column: x => x.SupplierId, + principalTable: "Suppliers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "CashRegisters", columns: table => new @@ -492,6 +523,34 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "CreditorDebtPayments", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CreditorDebtId = table.Column(type: "bigint", nullable: false), + Amount = table.Column(type: "numeric", nullable: false), + PaymentDate = table.Column(type: "timestamp with time zone", nullable: false), + Description = table.Column(type: "text", nullable: true), + BranchId = table.Column(type: "bigint", nullable: false), + CreatedBy = table.Column(type: "bigint", nullable: true), + CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedBy = table.Column(type: "bigint", nullable: true), + UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CreditorDebtPayments", x => x.Id); + table.ForeignKey( + name: "FK_CreditorDebtPayments_CreditorDebts_CreditorDebtId", + column: x => x.CreditorDebtId, + principalTable: "CreditorDebts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "CashTransfers", columns: table => new @@ -683,6 +742,16 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "CashTransfers", column: "CashRegisterId"); + migrationBuilder.CreateIndex( + name: "IX_CreditorDebtPayments_CreditorDebtId", + table: "CreditorDebtPayments", + column: "CreditorDebtId"); + + migrationBuilder.CreateIndex( + name: "IX_CreditorDebts_SupplierId", + table: "CreditorDebts", + column: "SupplierId"); + migrationBuilder.CreateIndex( name: "IX_DebtPayments_DebtId", table: "DebtPayments", @@ -787,6 +856,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "ChangeHistories"); + migrationBuilder.DropTable( + name: "CreditorDebtPayments"); + migrationBuilder.DropTable( name: "DebtPayments"); @@ -821,10 +893,10 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "CashRegisters"); migrationBuilder.DropTable( - name: "Debts"); + name: "CreditorDebts"); migrationBuilder.DropTable( - name: "Suppliers"); + name: "Debts"); migrationBuilder.DropTable( name: "Products"); @@ -835,6 +907,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "CashWarehouses"); + migrationBuilder.DropTable( + name: "Suppliers"); + migrationBuilder.DropTable( name: "Sales");