From fe58e5e7e7a35cdcf5db530bfece4a186d66837c Mon Sep 17 00:00:00 2001 From: Cristiano Date: Thu, 26 Mar 2026 17:23:09 +0100 Subject: [PATCH] Firs fixes like price into PDF --- .../MappingProfiles/EntityToDtoMappings.cs | 32 +- ...20251008103414_InitialDatabase.Designer.cs | 1951 ---------------- .../20251010083620_FixingDatabase.Designer.cs | 1950 ---------------- .../20251010083620_FixingDatabase.cs | 52 - ...75653_AddingEntitiesInDatabase.Designer.cs | 1963 ---------------- ...20251013175653_AddingEntitiesInDatabase.cs | 755 ------- ...51113162655_FixedNullableValue.Designer.cs | 1963 ---------------- .../20251113162655_FixedNullableValue.cs | 37 - .../20251120154429_FixTypeErrors.Designer.cs | 1966 ---------------- .../20251120154429_FixTypeErrors.cs | 68 - ...437_UpdatedDatabaseProductType.Designer.cs | 1967 ----------------- ...251126193437_UpdatedDatabaseProductType.cs | 36 - ...124107_UpdatedLengthOfPassword.Designer.cs | 1967 ----------------- .../20251127124107_UpdatedLengthOfPassword.cs | 38 - .../20251127133430_FixZipCode.Designer.cs | 1967 ----------------- .../Migrations/20251127133430_FixZipCode.cs | 52 - .../20251213103736_FixProductTypes.cs | 22 - ...04_AddSupplierToPurchaseOrder.Designer.cs} | 20 +- ...60326145104_AddSupplierToPurchaseOrder.cs} | 206 +- .../PyroFetesDbContextModelSnapshot.cs | 16 + PyroFetes/Models/PurchaseOrder.cs | 2 + PyroFetes/PyroFetes.csproj | 4 + PyroFetes/PyroFetesDbContext.cs | 10 +- .../Services/Pdf/PurchaseOrderPdfService.cs | 14 +- PyroFetes/data.sql | 615 ++++++ PyroFetes/docker-compose.yml | 33 + 26 files changed, 837 insertions(+), 16869 deletions(-) delete mode 100644 PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs delete mode 100644 PyroFetes/Migrations/20251010083620_FixingDatabase.Designer.cs delete mode 100644 PyroFetes/Migrations/20251010083620_FixingDatabase.cs delete mode 100644 PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.Designer.cs delete mode 100644 PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.cs delete mode 100644 PyroFetes/Migrations/20251113162655_FixedNullableValue.Designer.cs delete mode 100644 PyroFetes/Migrations/20251113162655_FixedNullableValue.cs delete mode 100644 PyroFetes/Migrations/20251120154429_FixTypeErrors.Designer.cs delete mode 100644 PyroFetes/Migrations/20251120154429_FixTypeErrors.cs delete mode 100644 PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.Designer.cs delete mode 100644 PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.cs delete mode 100644 PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.Designer.cs delete mode 100644 PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.cs delete mode 100644 PyroFetes/Migrations/20251127133430_FixZipCode.Designer.cs delete mode 100644 PyroFetes/Migrations/20251127133430_FixZipCode.cs delete mode 100644 PyroFetes/Migrations/20251213103736_FixProductTypes.cs rename PyroFetes/Migrations/{20251213103736_FixProductTypes.Designer.cs => 20260326145104_AddSupplierToPurchaseOrder.Designer.cs} (99%) rename PyroFetes/Migrations/{20251008103414_InitialDatabase.cs => 20260326145104_AddSupplierToPurchaseOrder.cs} (91%) create mode 100644 PyroFetes/data.sql create mode 100644 PyroFetes/docker-compose.yml diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index b1d0b85..c74e685 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -21,22 +21,22 @@ public class EntityToDtoMappings : Profile public EntityToDtoMappings() { CreateMap(); - + CreateMap(); - + CreateMap(); - + CreateMap(); - + CreateMap(); - + CreateMap(); - + // CreateMap(); // - CreateMap(); + //CreateMap(); + - CreateMap() .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.PurchaseProducts)); @@ -45,12 +45,16 @@ public class EntityToDtoMappings : Profile .ForMember(dest => dest.ProductId, opt => opt.MapFrom(src => src.ProductId)) .ForMember(dest => dest.Quantity, opt => opt.MapFrom(src => src.Quantity)) .ForMember(dest => dest.ProductName, opt => opt.MapFrom(src => src.Product.Name)) - .ForMember(dest => dest.ProductReferences, opt => opt.MapFrom(src => src.Product.Reference)); - + .ForMember(dest => dest.ProductReferences, opt => opt.MapFrom(src => src.Product.Reference)) + .ForMember(dest => dest.ProductPrice, opt => opt.MapFrom(src => src.Product.Prices + .FirstOrDefault(p => p.SupplierId == src.PurchaseOrder!.SupplierId) + .SellingPrice)); + // CreateMap(); // - // CreateMap(); - + //CreateMap(); + + CreateMap() .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.QuotationProducts)); @@ -60,9 +64,9 @@ public class EntityToDtoMappings : Profile .ForMember(dest => dest.Quantity, opt => opt.MapFrom(src => src.Quantity)) .ForMember(dest => dest.ProductName, opt => opt.MapFrom(src => src.Product.Name)) .ForMember(dest => dest.ProductReferences, opt => opt.MapFrom(src => src.Product.Reference)); - + CreateMap(); - + CreateMap(); CreateMap(); diff --git a/PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs b/PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs deleted file mode 100644 index 8e971b2..0000000 --- a/PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs +++ /dev/null @@ -1,1951 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251008103414_InitialDatabase")] - partial class InitialDatabase - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contract"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .HasColumnType("int"); - - b.Property("Caliber") - .HasColumnType("decimal(18,2)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("References") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecode"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("Providers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterial"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTruck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251010083620_FixingDatabase.Designer.cs b/PyroFetes/Migrations/20251010083620_FixingDatabase.Designer.cs deleted file mode 100644 index 7fcc4e0..0000000 --- a/PyroFetes/Migrations/20251010083620_FixingDatabase.Designer.cs +++ /dev/null @@ -1,1950 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251010083620_FixingDatabase")] - partial class FixingDatabase - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contract"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .HasColumnType("int"); - - b.Property("Caliber") - .HasColumnType("decimal(18,2)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("Reference") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecode"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("Providers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterial"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTruck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251010083620_FixingDatabase.cs b/PyroFetes/Migrations/20251010083620_FixingDatabase.cs deleted file mode 100644 index 1073d64..0000000 --- a/PyroFetes/Migrations/20251010083620_FixingDatabase.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class FixingDatabase : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "References", - table: "Products"); - - migrationBuilder.DropColumn( - name: "SellingPrice", - table: "Products"); - - migrationBuilder.AddColumn( - name: "Reference", - table: "Products", - type: "nvarchar(20)", - maxLength: 20, - nullable: false, - defaultValue: ""); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Reference", - table: "Products"); - - migrationBuilder.AddColumn( - name: "References", - table: "Products", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "SellingPrice", - table: "Products", - type: "decimal(18,2)", - nullable: false, - defaultValue: 0m); - } - } -} diff --git a/PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.Designer.cs b/PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.Designer.cs deleted file mode 100644 index e65403c..0000000 --- a/PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.Designer.cs +++ /dev/null @@ -1,1963 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251013175653_AddingEntitiesInDatabase")] - partial class AddingEntitiesInDatabase - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .HasColumnType("int"); - - b.Property("Caliber") - .HasColumnType("decimal(18,2)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("Reference") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.HasKey("Id"); - - b.ToTable("ShowServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.cs b/PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.cs deleted file mode 100644 index bad3dff..0000000 --- a/PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.cs +++ /dev/null @@ -1,755 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class AddingEntitiesInDatabase : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_ContactServiceProvider_Contacts_ContactId", - table: "ContactServiceProvider"); - - migrationBuilder.DropForeignKey( - name: "FK_ContactServiceProvider_Providers_ServiceProviderId", - table: "ContactServiceProvider"); - - migrationBuilder.DropForeignKey( - name: "FK_Contract_Providers_ServiceProviderId", - table: "Contract"); - - migrationBuilder.DropForeignKey( - name: "FK_Contract_Shows_ShowId", - table: "Contract"); - - migrationBuilder.DropForeignKey( - name: "FK_MaterialWarehouse_Materials_MaterialId", - table: "MaterialWarehouse"); - - migrationBuilder.DropForeignKey( - name: "FK_MaterialWarehouse_Warehouses_WarehouseId", - table: "MaterialWarehouse"); - - migrationBuilder.DropForeignKey( - name: "FK_ProductTimecode_Products_ProductId", - table: "ProductTimecode"); - - migrationBuilder.DropForeignKey( - name: "FK_ProductTimecode_Shows_ShowId", - table: "ProductTimecode"); - - migrationBuilder.DropForeignKey( - name: "FK_ProviderContacts_Providers_ProviderId", - table: "ProviderContacts"); - - migrationBuilder.DropForeignKey( - name: "FK_Providers_ProviderTypes_ProviderTypeId", - table: "Providers"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowMaterial_Materials_MaterialId", - table: "ShowMaterial"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowMaterial_Shows_ShowId", - table: "ShowMaterial"); - - migrationBuilder.DropForeignKey( - name: "FK_Shows_City_CityId", - table: "Shows"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowStaff_Shows_ShowId", - table: "ShowStaff"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowStaff_Staffs_StaffId", - table: "ShowStaff"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowTruck_Shows_ShowId", - table: "ShowTruck"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowTruck_Trucks_TruckId", - table: "ShowTruck"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ShowTruck", - table: "ShowTruck"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ShowStaff", - table: "ShowStaff"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ShowMaterial", - table: "ShowMaterial"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Providers", - table: "Providers"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ProductTimecode", - table: "ProductTimecode"); - - migrationBuilder.DropPrimaryKey( - name: "PK_MaterialWarehouse", - table: "MaterialWarehouse"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Contract", - table: "Contract"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ContactServiceProvider", - table: "ContactServiceProvider"); - - migrationBuilder.DropPrimaryKey( - name: "PK_City", - table: "City"); - - migrationBuilder.RenameTable( - name: "ShowTruck", - newName: "ShowTrucks"); - - migrationBuilder.RenameTable( - name: "ShowStaff", - newName: "ShowStaffs"); - - migrationBuilder.RenameTable( - name: "ShowMaterial", - newName: "ShowMaterials"); - - migrationBuilder.RenameTable( - name: "Providers", - newName: "ServiceProviders"); - - migrationBuilder.RenameTable( - name: "ProductTimecode", - newName: "ProductTimecodes"); - - migrationBuilder.RenameTable( - name: "MaterialWarehouse", - newName: "MaterialWarehouses"); - - migrationBuilder.RenameTable( - name: "Contract", - newName: "Contracts"); - - migrationBuilder.RenameTable( - name: "ContactServiceProvider", - newName: "ContactServiceProviders"); - - migrationBuilder.RenameTable( - name: "City", - newName: "Cities"); - - migrationBuilder.RenameIndex( - name: "IX_ShowTruck_TruckId", - table: "ShowTrucks", - newName: "IX_ShowTrucks_TruckId"); - - migrationBuilder.RenameIndex( - name: "IX_ShowStaff_ShowId", - table: "ShowStaffs", - newName: "IX_ShowStaffs_ShowId"); - - migrationBuilder.RenameIndex( - name: "IX_ShowMaterial_MaterialId", - table: "ShowMaterials", - newName: "IX_ShowMaterials_MaterialId"); - - migrationBuilder.RenameIndex( - name: "IX_Providers_ProviderTypeId", - table: "ServiceProviders", - newName: "IX_ServiceProviders_ProviderTypeId"); - - migrationBuilder.RenameIndex( - name: "IX_ProductTimecode_ShowId", - table: "ProductTimecodes", - newName: "IX_ProductTimecodes_ShowId"); - - migrationBuilder.RenameIndex( - name: "IX_MaterialWarehouse_WarehouseId", - table: "MaterialWarehouses", - newName: "IX_MaterialWarehouses_WarehouseId"); - - migrationBuilder.RenameIndex( - name: "IX_Contract_ServiceProviderId", - table: "Contracts", - newName: "IX_Contracts_ServiceProviderId"); - - migrationBuilder.RenameIndex( - name: "IX_ContactServiceProvider_ServiceProviderId", - table: "ContactServiceProviders", - newName: "IX_ContactServiceProviders_ServiceProviderId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_ShowTrucks", - table: "ShowTrucks", - columns: new[] { "ShowId", "TruckId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_ShowStaffs", - table: "ShowStaffs", - columns: new[] { "StaffId", "ShowId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_ShowMaterials", - table: "ShowMaterials", - columns: new[] { "ShowId", "MaterialId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_ServiceProviders", - table: "ServiceProviders", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_ProductTimecodes", - table: "ProductTimecodes", - columns: new[] { "ProductId", "ShowId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_MaterialWarehouses", - table: "MaterialWarehouses", - columns: new[] { "MaterialId", "WarehouseId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_Contracts", - table: "Contracts", - columns: new[] { "ShowId", "ServiceProviderId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_ContactServiceProviders", - table: "ContactServiceProviders", - columns: new[] { "ContactId", "ServiceProviderId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_Cities", - table: "Cities", - column: "Id"); - - migrationBuilder.CreateTable( - name: "ShowServiceProviders", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1") - }, - constraints: table => - { - table.PrimaryKey("PK_ShowServiceProviders", x => x.Id); - }); - - migrationBuilder.AddForeignKey( - name: "FK_ContactServiceProviders_Contacts_ContactId", - table: "ContactServiceProviders", - column: "ContactId", - principalTable: "Contacts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ContactServiceProviders_ServiceProviders_ServiceProviderId", - table: "ContactServiceProviders", - column: "ServiceProviderId", - principalTable: "ServiceProviders", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Contracts_ServiceProviders_ServiceProviderId", - table: "Contracts", - column: "ServiceProviderId", - principalTable: "ServiceProviders", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Contracts_Shows_ShowId", - table: "Contracts", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_MaterialWarehouses_Materials_MaterialId", - table: "MaterialWarehouses", - column: "MaterialId", - principalTable: "Materials", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_MaterialWarehouses_Warehouses_WarehouseId", - table: "MaterialWarehouses", - column: "WarehouseId", - principalTable: "Warehouses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_ProductTimecodes_Products_ProductId", - table: "ProductTimecodes", - column: "ProductId", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ProductTimecodes_Shows_ShowId", - table: "ProductTimecodes", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ProviderContacts_ServiceProviders_ProviderId", - table: "ProviderContacts", - column: "ProviderId", - principalTable: "ServiceProviders", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ServiceProviders_ProviderTypes_ProviderTypeId", - table: "ServiceProviders", - column: "ProviderTypeId", - principalTable: "ProviderTypes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowMaterials_Materials_MaterialId", - table: "ShowMaterials", - column: "MaterialId", - principalTable: "Materials", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowMaterials_Shows_ShowId", - table: "ShowMaterials", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Shows_Cities_CityId", - table: "Shows", - column: "CityId", - principalTable: "Cities", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowStaffs_Shows_ShowId", - table: "ShowStaffs", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowStaffs_Staffs_StaffId", - table: "ShowStaffs", - column: "StaffId", - principalTable: "Staffs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowTrucks_Shows_ShowId", - table: "ShowTrucks", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowTrucks_Trucks_TruckId", - table: "ShowTrucks", - column: "TruckId", - principalTable: "Trucks", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_ContactServiceProviders_Contacts_ContactId", - table: "ContactServiceProviders"); - - migrationBuilder.DropForeignKey( - name: "FK_ContactServiceProviders_ServiceProviders_ServiceProviderId", - table: "ContactServiceProviders"); - - migrationBuilder.DropForeignKey( - name: "FK_Contracts_ServiceProviders_ServiceProviderId", - table: "Contracts"); - - migrationBuilder.DropForeignKey( - name: "FK_Contracts_Shows_ShowId", - table: "Contracts"); - - migrationBuilder.DropForeignKey( - name: "FK_MaterialWarehouses_Materials_MaterialId", - table: "MaterialWarehouses"); - - migrationBuilder.DropForeignKey( - name: "FK_MaterialWarehouses_Warehouses_WarehouseId", - table: "MaterialWarehouses"); - - migrationBuilder.DropForeignKey( - name: "FK_ProductTimecodes_Products_ProductId", - table: "ProductTimecodes"); - - migrationBuilder.DropForeignKey( - name: "FK_ProductTimecodes_Shows_ShowId", - table: "ProductTimecodes"); - - migrationBuilder.DropForeignKey( - name: "FK_ProviderContacts_ServiceProviders_ProviderId", - table: "ProviderContacts"); - - migrationBuilder.DropForeignKey( - name: "FK_ServiceProviders_ProviderTypes_ProviderTypeId", - table: "ServiceProviders"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowMaterials_Materials_MaterialId", - table: "ShowMaterials"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowMaterials_Shows_ShowId", - table: "ShowMaterials"); - - migrationBuilder.DropForeignKey( - name: "FK_Shows_Cities_CityId", - table: "Shows"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowStaffs_Shows_ShowId", - table: "ShowStaffs"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowStaffs_Staffs_StaffId", - table: "ShowStaffs"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowTrucks_Shows_ShowId", - table: "ShowTrucks"); - - migrationBuilder.DropForeignKey( - name: "FK_ShowTrucks_Trucks_TruckId", - table: "ShowTrucks"); - - migrationBuilder.DropTable( - name: "ShowServiceProviders"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ShowTrucks", - table: "ShowTrucks"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ShowStaffs", - table: "ShowStaffs"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ShowMaterials", - table: "ShowMaterials"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ServiceProviders", - table: "ServiceProviders"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ProductTimecodes", - table: "ProductTimecodes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_MaterialWarehouses", - table: "MaterialWarehouses"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Contracts", - table: "Contracts"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ContactServiceProviders", - table: "ContactServiceProviders"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Cities", - table: "Cities"); - - migrationBuilder.RenameTable( - name: "ShowTrucks", - newName: "ShowTruck"); - - migrationBuilder.RenameTable( - name: "ShowStaffs", - newName: "ShowStaff"); - - migrationBuilder.RenameTable( - name: "ShowMaterials", - newName: "ShowMaterial"); - - migrationBuilder.RenameTable( - name: "ServiceProviders", - newName: "Providers"); - - migrationBuilder.RenameTable( - name: "ProductTimecodes", - newName: "ProductTimecode"); - - migrationBuilder.RenameTable( - name: "MaterialWarehouses", - newName: "MaterialWarehouse"); - - migrationBuilder.RenameTable( - name: "Contracts", - newName: "Contract"); - - migrationBuilder.RenameTable( - name: "ContactServiceProviders", - newName: "ContactServiceProvider"); - - migrationBuilder.RenameTable( - name: "Cities", - newName: "City"); - - migrationBuilder.RenameIndex( - name: "IX_ShowTrucks_TruckId", - table: "ShowTruck", - newName: "IX_ShowTruck_TruckId"); - - migrationBuilder.RenameIndex( - name: "IX_ShowStaffs_ShowId", - table: "ShowStaff", - newName: "IX_ShowStaff_ShowId"); - - migrationBuilder.RenameIndex( - name: "IX_ShowMaterials_MaterialId", - table: "ShowMaterial", - newName: "IX_ShowMaterial_MaterialId"); - - migrationBuilder.RenameIndex( - name: "IX_ServiceProviders_ProviderTypeId", - table: "Providers", - newName: "IX_Providers_ProviderTypeId"); - - migrationBuilder.RenameIndex( - name: "IX_ProductTimecodes_ShowId", - table: "ProductTimecode", - newName: "IX_ProductTimecode_ShowId"); - - migrationBuilder.RenameIndex( - name: "IX_MaterialWarehouses_WarehouseId", - table: "MaterialWarehouse", - newName: "IX_MaterialWarehouse_WarehouseId"); - - migrationBuilder.RenameIndex( - name: "IX_Contracts_ServiceProviderId", - table: "Contract", - newName: "IX_Contract_ServiceProviderId"); - - migrationBuilder.RenameIndex( - name: "IX_ContactServiceProviders_ServiceProviderId", - table: "ContactServiceProvider", - newName: "IX_ContactServiceProvider_ServiceProviderId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_ShowTruck", - table: "ShowTruck", - columns: new[] { "ShowId", "TruckId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_ShowStaff", - table: "ShowStaff", - columns: new[] { "StaffId", "ShowId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_ShowMaterial", - table: "ShowMaterial", - columns: new[] { "ShowId", "MaterialId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_Providers", - table: "Providers", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_ProductTimecode", - table: "ProductTimecode", - columns: new[] { "ProductId", "ShowId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_MaterialWarehouse", - table: "MaterialWarehouse", - columns: new[] { "MaterialId", "WarehouseId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_Contract", - table: "Contract", - columns: new[] { "ShowId", "ServiceProviderId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_ContactServiceProvider", - table: "ContactServiceProvider", - columns: new[] { "ContactId", "ServiceProviderId" }); - - migrationBuilder.AddPrimaryKey( - name: "PK_City", - table: "City", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_ContactServiceProvider_Contacts_ContactId", - table: "ContactServiceProvider", - column: "ContactId", - principalTable: "Contacts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ContactServiceProvider_Providers_ServiceProviderId", - table: "ContactServiceProvider", - column: "ServiceProviderId", - principalTable: "Providers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Contract_Providers_ServiceProviderId", - table: "Contract", - column: "ServiceProviderId", - principalTable: "Providers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Contract_Shows_ShowId", - table: "Contract", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_MaterialWarehouse_Materials_MaterialId", - table: "MaterialWarehouse", - column: "MaterialId", - principalTable: "Materials", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_MaterialWarehouse_Warehouses_WarehouseId", - table: "MaterialWarehouse", - column: "WarehouseId", - principalTable: "Warehouses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_ProductTimecode_Products_ProductId", - table: "ProductTimecode", - column: "ProductId", - principalTable: "Products", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ProductTimecode_Shows_ShowId", - table: "ProductTimecode", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ProviderContacts_Providers_ProviderId", - table: "ProviderContacts", - column: "ProviderId", - principalTable: "Providers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Providers_ProviderTypes_ProviderTypeId", - table: "Providers", - column: "ProviderTypeId", - principalTable: "ProviderTypes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowMaterial_Materials_MaterialId", - table: "ShowMaterial", - column: "MaterialId", - principalTable: "Materials", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowMaterial_Shows_ShowId", - table: "ShowMaterial", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Shows_City_CityId", - table: "Shows", - column: "CityId", - principalTable: "City", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowStaff_Shows_ShowId", - table: "ShowStaff", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowStaff_Staffs_StaffId", - table: "ShowStaff", - column: "StaffId", - principalTable: "Staffs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowTruck_Shows_ShowId", - table: "ShowTruck", - column: "ShowId", - principalTable: "Shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ShowTruck_Trucks_TruckId", - table: "ShowTruck", - column: "TruckId", - principalTable: "Trucks", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/PyroFetes/Migrations/20251113162655_FixedNullableValue.Designer.cs b/PyroFetes/Migrations/20251113162655_FixedNullableValue.Designer.cs deleted file mode 100644 index 131aa6e..0000000 --- a/PyroFetes/Migrations/20251113162655_FixedNullableValue.Designer.cs +++ /dev/null @@ -1,1963 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251113162655_FixedNullableValue")] - partial class FixedNullableValue - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .HasColumnType("int"); - - b.Property("Caliber") - .HasColumnType("decimal(18,2)"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("Reference") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.HasKey("Id"); - - b.ToTable("ShowServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251113162655_FixedNullableValue.cs b/PyroFetes/Migrations/20251113162655_FixedNullableValue.cs deleted file mode 100644 index 0fe6098..0000000 --- a/PyroFetes/Migrations/20251113162655_FixedNullableValue.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class FixedNullableValue : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "RealDeliveryDate", - table: "DeliveryNotes", - type: "date", - nullable: true, - oldClrType: typeof(DateOnly), - oldType: "date"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "RealDeliveryDate", - table: "DeliveryNotes", - type: "date", - nullable: false, - defaultValue: new DateOnly(1, 1, 1), - oldClrType: typeof(DateOnly), - oldType: "date", - oldNullable: true); - } - } -} diff --git a/PyroFetes/Migrations/20251120154429_FixTypeErrors.Designer.cs b/PyroFetes/Migrations/20251120154429_FixTypeErrors.Designer.cs deleted file mode 100644 index 323012e..0000000 --- a/PyroFetes/Migrations/20251120154429_FixTypeErrors.Designer.cs +++ /dev/null @@ -1,1966 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251120154429_FixTypeErrors")] - partial class FixTypeErrors - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Caliber") - .HasColumnType("int"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("Reference") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.HasKey("Id"); - - b.ToTable("ShowServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .IsRequired() - .HasMaxLength(5) - .HasColumnType("nvarchar(5)"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251120154429_FixTypeErrors.cs b/PyroFetes/Migrations/20251120154429_FixTypeErrors.cs deleted file mode 100644 index b8c2f9c..0000000 --- a/PyroFetes/Migrations/20251120154429_FixTypeErrors.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class FixTypeErrors : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ZipCode", - table: "Suppliers", - type: "nvarchar(5)", - maxLength: 5, - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "Caliber", - table: "Products", - type: "int", - nullable: false, - oldClrType: typeof(decimal), - oldType: "decimal(18,2)"); - - migrationBuilder.AlterColumn( - name: "ApprovalNumber", - table: "Products", - type: "nvarchar(max)", - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ZipCode", - table: "Suppliers", - type: "int", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(5)", - oldMaxLength: 5); - - migrationBuilder.AlterColumn( - name: "Caliber", - table: "Products", - type: "decimal(18,2)", - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "ApprovalNumber", - table: "Products", - type: "int", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)"); - } - } -} diff --git a/PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.Designer.cs b/PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.Designer.cs deleted file mode 100644 index 51757cb..0000000 --- a/PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.Designer.cs +++ /dev/null @@ -1,1967 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251126193437_UpdatedDatabaseProductType")] - partial class UpdatedDatabaseProductType - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Caliber") - .HasColumnType("int"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("Reference") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.HasKey("Id"); - - b.ToTable("ShowServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .IsRequired() - .HasMaxLength(5) - .HasColumnType("nvarchar(5)"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.cs b/PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.cs deleted file mode 100644 index ee74644..0000000 --- a/PyroFetes/Migrations/20251126193437_UpdatedDatabaseProductType.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class UpdatedDatabaseProductType : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ApprovalNumber", - table: "Products", - type: "nvarchar(100)", - maxLength: 100, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ApprovalNumber", - table: "Products", - type: "nvarchar(max)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(100)", - oldMaxLength: 100); - } - } -} diff --git a/PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.Designer.cs b/PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.Designer.cs deleted file mode 100644 index 1cc2af1..0000000 --- a/PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.Designer.cs +++ /dev/null @@ -1,1967 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251127124107_UpdatedLengthOfPassword")] - partial class UpdatedLengthOfPassword - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Caliber") - .HasColumnType("int"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("Reference") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.HasKey("Id"); - - b.ToTable("ShowServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .IsRequired() - .HasMaxLength(5) - .HasColumnType("nvarchar(5)"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.cs b/PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.cs deleted file mode 100644 index 23930f4..0000000 --- a/PyroFetes/Migrations/20251127124107_UpdatedLengthOfPassword.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class UpdatedLengthOfPassword : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Password", - table: "Users", - type: "nvarchar(60)", - maxLength: 60, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(50)", - oldMaxLength: 50); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Password", - table: "Users", - type: "nvarchar(50)", - maxLength: 50, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(60)", - oldMaxLength: 60); - } - } -} diff --git a/PyroFetes/Migrations/20251127133430_FixZipCode.Designer.cs b/PyroFetes/Migrations/20251127133430_FixZipCode.Designer.cs deleted file mode 100644 index adea6e9..0000000 --- a/PyroFetes/Migrations/20251127133430_FixZipCode.Designer.cs +++ /dev/null @@ -1,1967 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using PyroFetes; - -#nullable disable - -namespace PyroFetes.Migrations -{ - [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251127133430_FixZipCode")] - partial class FixZipCode - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.20") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AvailabilityDate") - .HasColumnType("date"); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.Property("RenewallDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("Availabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ProductId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProductId"); - - b.ToTable("Brands"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Classifications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Colors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Calling") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Meeting") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("ContactId"); - - b.ToTable("Communications"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Role") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("ContactServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("ServiceProviderId") - .HasColumnType("int"); - - b.Property("TermsAndConditions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("ShowId", "ServiceProviderId"); - - b.HasIndex("ServiceProviderId"); - - b.ToTable("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CustomerTypeId") - .HasColumnType("int"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerTypeId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("CustomerTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Transporter") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Deliverers"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DelivererId") - .HasColumnType("int"); - - b.Property("EstimateDeliveryDate") - .HasColumnType("date"); - - b.Property("ExpeditionDate") - .HasColumnType("date"); - - b.Property("RealDeliveryDate") - .HasColumnType("date"); - - b.Property("TrackingNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("DelivererId"); - - b.ToTable("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.ToTable("Effects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StaffId"); - - b.ToTable("ExperienceLevels"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("DeliveryDate") - .HasColumnType("date"); - - b.Property("ExpirationDate") - .HasColumnType("date"); - - b.HasKey("Id"); - - b.ToTable("HistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("WarehouseId"); - - b.ToTable("Materials"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.Property("MaterialId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.HasKey("MaterialId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("MaterialWarehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Arrival") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DestinationWarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SourceWarehouseId") - .HasColumnType("int"); - - b.Property("Start") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("DestinationWarehouseId"); - - b.HasIndex("SourceWarehouseId"); - - b.ToTable("Movements"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("SupplierId") - .HasColumnType("int"); - - b.Property("SellingPrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "SupplierId"); - - b.HasIndex("SupplierId"); - - b.ToTable("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ApprovalNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Caliber") - .HasColumnType("int"); - - b.Property("ClassificationId") - .HasColumnType("int"); - - b.Property("Duration") - .HasColumnType("decimal(18,2)"); - - b.Property("Image") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Link") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("MinimalQuantity") - .HasColumnType("int"); - - b.Property("MovementId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Nec") - .HasColumnType("decimal(18,2)"); - - b.Property("ProductCategoryId") - .HasColumnType("int"); - - b.Property("Reference") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Weight") - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("ClassificationId"); - - b.HasIndex("MovementId"); - - b.HasIndex("ProductCategoryId"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProductCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ColorId") - .HasColumnType("int"); - - b.HasKey("ProductId", "ColorId"); - - b.HasIndex("ColorId"); - - b.ToTable("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("DeliveryNoteId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "DeliveryNoteId"); - - b.HasIndex("DeliveryNoteId"); - - b.ToTable("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("EffectId") - .HasColumnType("int"); - - b.HasKey("ProductId", "EffectId"); - - b.HasIndex("EffectId"); - - b.ToTable("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ProductId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ProductTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("ProviderId") - .HasColumnType("int"); - - b.HasKey("ContactId", "ProviderId"); - - b.HasIndex("ProviderId"); - - b.ToTable("ProviderContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Label") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("ProviderTypes"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("PurchaseConditions") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.ToTable("PurchaseOrders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("PurchaseOrderId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "PurchaseOrderId"); - - b.HasIndex("PurchaseOrderId"); - - b.ToTable("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ConditionsSale") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.HasKey("Id"); - - b.HasIndex("CustomerId"); - - b.ToTable("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("QuotationId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "QuotationId"); - - b.HasIndex("QuotationId"); - - b.ToTable("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderTypeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProviderTypeId"); - - b.ToTable("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ElectronicSignature") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Logo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CityId") - .HasColumnType("int"); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Place") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("PyrotechnicImplementationPlan") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("CityId"); - - b.ToTable("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("MaterialId") - .HasColumnType("int"); - - b.HasKey("ShowId", "MaterialId"); - - b.HasIndex("MaterialId"); - - b.ToTable("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowServiceProvider", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.HasKey("Id"); - - b.ToTable("ShowServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.Property("StaffId") - .HasColumnType("int"); - - b.Property("ShowId") - .HasColumnType("int"); - - b.HasKey("StaffId", "ShowId"); - - b.HasIndex("ShowId"); - - b.ToTable("ShowStaffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("TruckId") - .HasColumnType("int"); - - b.HasKey("ShowId", "TruckId"); - - b.HasIndex("TruckId"); - - b.ToTable("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Artist") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("Duration") - .IsRequired() - .HasColumnType("int"); - - b.Property("Format") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Kind") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("SoundCategoryId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("SoundCategoryId"); - - b.ToTable("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SoundCategories"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.Property("ShowId") - .HasColumnType("int"); - - b.Property("SoundId") - .HasColumnType("int"); - - b.Property("End") - .HasColumnType("decimal(18,2)"); - - b.Property("Start") - .HasColumnType("decimal(18,2)"); - - b.HasKey("ShowId", "SoundId"); - - b.HasIndex("SoundId"); - - b.ToTable("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(120) - .HasColumnType("nvarchar(120)"); - - b.Property("F4T2ExpirationDate") - .HasColumnType("date"); - - b.Property("F4T2NumberApproval") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Profession") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Staffs"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.Property("AvailabilityId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("AvailabilityId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.Property("ContactId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("ContactId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.Property("HistoryOfApprovalId") - .HasColumnType("int"); - - b.Property("StaffId") - .HasColumnType("int"); - - b.HasKey("HistoryOfApprovalId", "StaffId"); - - b.HasIndex("StaffId"); - - b.ToTable("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("DeliveryDelay") - .HasColumnType("int"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ZipCode") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Suppliers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("MaxExplosiveCapacity") - .IsRequired() - .HasColumnType("float"); - - b.Property("Sizes") - .IsRequired() - .HasMaxLength(80) - .HasColumnType("nvarchar(80)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)"); - - b.HasKey("Id"); - - b.ToTable("Trucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Fonction") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Salt") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Current") - .HasColumnType("int"); - - b.Property("MaxWeight") - .HasColumnType("int"); - - b.Property("MinWeight") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ZipCode") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Warehouses"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.Property("ProductId") - .HasColumnType("int"); - - b.Property("WarehouseId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.HasKey("ProductId", "WarehouseId"); - - b.HasIndex("WarehouseId"); - - b.ToTable("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Brand", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Brands") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.Communication", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("Communications") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Contacts") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ContactServiceProvider", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("ContactServiceProviders") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("ContactServiceProviders") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("ServiceProvider"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contract", b => - { - b.HasOne("PyroFetes.Models.ServiceProvider", "ServiceProvider") - .WithMany("Contracts") - .HasForeignKey("ServiceProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("Contracts") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceProvider"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.HasOne("PyroFetes.Models.CustomerType", "CustomerType") - .WithMany("Customers") - .HasForeignKey("CustomerTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CustomerType"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.HasOne("PyroFetes.Models.Deliverer", "Deliverer") - .WithMany("DeliveryNotes") - .HasForeignKey("DelivererId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Deliverer"); - }); - - modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => - { - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ExperienceLevels") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany() - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.MaterialWarehouse", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("MaterialWarehouses") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("MaterialWarehouses") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.HasOne("PyroFetes.Models.Warehouse", "DestinationWarehouse") - .WithMany("MovementsDestination") - .HasForeignKey("DestinationWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("PyroFetes.Models.Warehouse", "SourceWarehouse") - .WithMany("MovementsSource") - .HasForeignKey("SourceWarehouseId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("DestinationWarehouse"); - - b.Navigation("SourceWarehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Price", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("Prices") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany("Prices") - .HasForeignKey("SupplierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Supplier"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.HasOne("PyroFetes.Models.Classification", "Classification") - .WithMany("Products") - .HasForeignKey("ClassificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Movement", "Movement") - .WithMany("Products") - .HasForeignKey("MovementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ProductCategory", "ProductCategory") - .WithMany("Products") - .HasForeignKey("ProductCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Classification"); - - b.Navigation("Movement"); - - b.Navigation("ProductCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductColor", b => - { - b.HasOne("PyroFetes.Models.Color", "Color") - .WithMany("ProductColors") - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductColors") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductDelivery", b => - { - b.HasOne("PyroFetes.Models.DeliveryNote", "DeliveryNote") - .WithMany("ProductDeliveries") - .HasForeignKey("DeliveryNoteId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductDeliveries") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeliveryNote"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductEffect", b => - { - b.HasOne("PyroFetes.Models.Effect", "Effect") - .WithMany("ProductEffects") - .HasForeignKey("EffectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductEffects") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Effect"); - - b.Navigation("Product"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductTimecode", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("ProductTimecodes") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ProductTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany() - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.ServiceProvider", "Provider") - .WithMany() - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("PurchaseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.PurchaseOrder", "PurchaseOrder") - .WithMany("PurchaseProducts") - .HasForeignKey("PurchaseOrderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("PurchaseOrder"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.HasOne("PyroFetes.Models.Customer", "Customer") - .WithMany("Quotations") - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("QuotationProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Quotation", "Quotation") - .WithMany("QuotationProducts") - .HasForeignKey("QuotationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Quotation"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.HasOne("PyroFetes.Models.ProviderType", "ProviderType") - .WithMany("ServiceProviders") - .HasForeignKey("ProviderTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProviderType"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.HasOne("PyroFetes.Models.City", "City") - .WithMany("Shows") - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("City"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowMaterial", b => - { - b.HasOne("PyroFetes.Models.Material", "Material") - .WithMany("ShowMaterials") - .HasForeignKey("MaterialId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowMaterials") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Material"); - - b.Navigation("Show"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowStaff", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowStaffs") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("ShowStaffs") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.ShowTruck", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("ShowTrucks") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Truck", "Truck") - .WithMany("ShowTrucks") - .HasForeignKey("TruckId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Truck"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.HasOne("PyroFetes.Models.SoundCategory", "SoundCategory") - .WithMany("Sounds") - .HasForeignKey("SoundCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoundCategory"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundTimecode", b => - { - b.HasOne("PyroFetes.Models.Show", "Show") - .WithMany("SoundTimecodes") - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Sound", "Sound") - .WithMany("SoundTimecodes") - .HasForeignKey("SoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Show"); - - b.Navigation("Sound"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffAvailability", b => - { - b.HasOne("PyroFetes.Models.Availability", "Availability") - .WithMany("StaffAvailabilities") - .HasForeignKey("AvailabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffAvailabilities") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Availability"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffContact", b => - { - b.HasOne("PyroFetes.Models.Contact", "Contact") - .WithMany("StaffContacts") - .HasForeignKey("ContactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffContacts") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Contact"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.StaffHistoryOfApproval", b => - { - b.HasOne("PyroFetes.Models.HistoryOfApproval", "HistoryOfApproval") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("HistoryOfApprovalId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Staff", "Staff") - .WithMany("StaffHistoryOfApprovals") - .HasForeignKey("StaffId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoryOfApproval"); - - b.Navigation("Staff"); - }); - - modelBuilder.Entity("PyroFetes.Models.WarehouseProduct", b => - { - b.HasOne("PyroFetes.Models.Product", "Product") - .WithMany("WarehouseProducts") - .HasForeignKey("ProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("PyroFetes.Models.Warehouse", "Warehouse") - .WithMany("WarehouseProducts") - .HasForeignKey("WarehouseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Product"); - - b.Navigation("Warehouse"); - }); - - modelBuilder.Entity("PyroFetes.Models.Availability", b => - { - b.Navigation("StaffAvailabilities"); - }); - - modelBuilder.Entity("PyroFetes.Models.City", b => - { - b.Navigation("Shows"); - }); - - modelBuilder.Entity("PyroFetes.Models.Classification", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Color", b => - { - b.Navigation("ProductColors"); - }); - - modelBuilder.Entity("PyroFetes.Models.Contact", b => - { - b.Navigation("Communications"); - - b.Navigation("ContactServiceProviders"); - - b.Navigation("StaffContacts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Customer", b => - { - b.Navigation("Contacts"); - - b.Navigation("Quotations"); - }); - - modelBuilder.Entity("PyroFetes.Models.CustomerType", b => - { - b.Navigation("Customers"); - }); - - modelBuilder.Entity("PyroFetes.Models.Deliverer", b => - { - b.Navigation("DeliveryNotes"); - }); - - modelBuilder.Entity("PyroFetes.Models.DeliveryNote", b => - { - b.Navigation("ProductDeliveries"); - }); - - modelBuilder.Entity("PyroFetes.Models.Effect", b => - { - b.Navigation("ProductEffects"); - }); - - modelBuilder.Entity("PyroFetes.Models.HistoryOfApproval", b => - { - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Material", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("ShowMaterials"); - }); - - modelBuilder.Entity("PyroFetes.Models.Movement", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.Product", b => - { - b.Navigation("Brands"); - - b.Navigation("Prices"); - - b.Navigation("ProductColors"); - - b.Navigation("ProductDeliveries"); - - b.Navigation("ProductEffects"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("PurchaseProducts"); - - b.Navigation("QuotationProducts"); - - b.Navigation("WarehouseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProductCategory", b => - { - b.Navigation("Products"); - }); - - modelBuilder.Entity("PyroFetes.Models.ProviderType", b => - { - b.Navigation("ServiceProviders"); - }); - - modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => - { - b.Navigation("PurchaseProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Quotation", b => - { - b.Navigation("QuotationProducts"); - }); - - modelBuilder.Entity("PyroFetes.Models.ServiceProvider", b => - { - b.Navigation("ContactServiceProviders"); - - b.Navigation("Contracts"); - }); - - modelBuilder.Entity("PyroFetes.Models.Show", b => - { - b.Navigation("Contracts"); - - b.Navigation("ProductTimecodes"); - - b.Navigation("ShowMaterials"); - - b.Navigation("ShowStaffs"); - - b.Navigation("ShowTrucks"); - - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.Sound", b => - { - b.Navigation("SoundTimecodes"); - }); - - modelBuilder.Entity("PyroFetes.Models.SoundCategory", b => - { - b.Navigation("Sounds"); - }); - - modelBuilder.Entity("PyroFetes.Models.Staff", b => - { - b.Navigation("ExperienceLevels"); - - b.Navigation("ShowStaffs"); - - b.Navigation("StaffAvailabilities"); - - b.Navigation("StaffContacts"); - - b.Navigation("StaffHistoryOfApprovals"); - }); - - modelBuilder.Entity("PyroFetes.Models.Supplier", b => - { - b.Navigation("Prices"); - }); - - modelBuilder.Entity("PyroFetes.Models.Truck", b => - { - b.Navigation("ShowTrucks"); - }); - - modelBuilder.Entity("PyroFetes.Models.Warehouse", b => - { - b.Navigation("MaterialWarehouses"); - - b.Navigation("MovementsDestination"); - - b.Navigation("MovementsSource"); - - b.Navigation("WarehouseProducts"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PyroFetes/Migrations/20251127133430_FixZipCode.cs b/PyroFetes/Migrations/20251127133430_FixZipCode.cs deleted file mode 100644 index 64c68f2..0000000 --- a/PyroFetes/Migrations/20251127133430_FixZipCode.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class FixZipCode : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ZipCode", - table: "Warehouses", - type: "nvarchar(max)", - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "ZipCode", - table: "Suppliers", - type: "nvarchar(max)", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(5)", - oldMaxLength: 5); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ZipCode", - table: "Warehouses", - type: "int", - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)"); - - migrationBuilder.AlterColumn( - name: "ZipCode", - table: "Suppliers", - type: "nvarchar(5)", - maxLength: 5, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)"); - } - } -} diff --git a/PyroFetes/Migrations/20251213103736_FixProductTypes.cs b/PyroFetes/Migrations/20251213103736_FixProductTypes.cs deleted file mode 100644 index 9100f2a..0000000 --- a/PyroFetes/Migrations/20251213103736_FixProductTypes.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PyroFetes.Migrations -{ - /// - public partial class FixProductTypes : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/PyroFetes/Migrations/20251213103736_FixProductTypes.Designer.cs b/PyroFetes/Migrations/20260326145104_AddSupplierToPurchaseOrder.Designer.cs similarity index 99% rename from PyroFetes/Migrations/20251213103736_FixProductTypes.Designer.cs rename to PyroFetes/Migrations/20260326145104_AddSupplierToPurchaseOrder.Designer.cs index f2cfbf3..64f7315 100644 --- a/PyroFetes/Migrations/20251213103736_FixProductTypes.Designer.cs +++ b/PyroFetes/Migrations/20260326145104_AddSupplierToPurchaseOrder.Designer.cs @@ -12,8 +12,8 @@ using PyroFetes; namespace PyroFetes.Migrations { [DbContext(typeof(PyroFetesDbContext))] - [Migration("20251213103736_FixProductTypes")] - partial class FixProductTypes + [Migration("20260326145104_AddSupplierToPurchaseOrder")] + partial class AddSupplierToPurchaseOrder { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -698,8 +698,13 @@ namespace PyroFetes.Migrations .HasMaxLength(300) .HasColumnType("nvarchar(300)"); + b.Property("SupplierId") + .HasColumnType("int"); + b.HasKey("Id"); + b.HasIndex("SupplierId"); + b.ToTable("PurchaseOrders"); }); @@ -1548,6 +1553,17 @@ namespace PyroFetes.Migrations b.Navigation("Provider"); }); + modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => + { + b.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany() + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Supplier"); + }); + modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => { b.HasOne("PyroFetes.Models.Product", "Product") diff --git a/PyroFetes/Migrations/20251008103414_InitialDatabase.cs b/PyroFetes/Migrations/20260326145104_AddSupplierToPurchaseOrder.cs similarity index 91% rename from PyroFetes/Migrations/20251008103414_InitialDatabase.cs rename to PyroFetes/Migrations/20260326145104_AddSupplierToPurchaseOrder.cs index 5c5dbc7..fa6d143 100644 --- a/PyroFetes/Migrations/20251008103414_InitialDatabase.cs +++ b/PyroFetes/Migrations/20260326145104_AddSupplierToPurchaseOrder.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace PyroFetes.Migrations { /// - public partial class InitialDatabase : Migration + public partial class AddSupplierToPurchaseOrder : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -28,7 +28,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "City", + name: "Cities", columns: table => new { Id = table.Column(type: "int", nullable: false) @@ -38,7 +38,7 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_City", x => x.Id); + table.PrimaryKey("PK_Cities", x => x.Id); }); migrationBuilder.CreateTable( @@ -146,19 +146,6 @@ namespace PyroFetes.Migrations table.PrimaryKey("PK_ProviderTypes", x => x.Id); }); - migrationBuilder.CreateTable( - name: "PurchaseOrders", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - PurchaseConditions = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PurchaseOrders", x => x.Id); - }); - migrationBuilder.CreateTable( name: "Settings", columns: table => new @@ -173,6 +160,18 @@ namespace PyroFetes.Migrations table.PrimaryKey("PK_Settings", x => x.Id); }); + migrationBuilder.CreateTable( + name: "ShowServiceProviders", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1") + }, + constraints: table => + { + table.PrimaryKey("PK_ShowServiceProviders", x => x.Id); + }); + migrationBuilder.CreateTable( name: "SoundCategories", columns: table => new @@ -214,7 +213,7 @@ namespace PyroFetes.Migrations Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Phone = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false), Address = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - ZipCode = table.Column(type: "int", nullable: false), + ZipCode = table.Column(type: "nvarchar(max)", nullable: false), City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), DeliveryDelay = table.Column(type: "int", nullable: false) }, @@ -246,7 +245,7 @@ namespace PyroFetes.Migrations Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Password = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Password = table.Column(type: "nvarchar(60)", maxLength: 60, nullable: false), Salt = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Fonction = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false) @@ -267,7 +266,7 @@ namespace PyroFetes.Migrations Current = table.Column(type: "int", nullable: false), MinWeight = table.Column(type: "int", nullable: false), Address = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - ZipCode = table.Column(type: "int", nullable: false), + ZipCode = table.Column(type: "nvarchar(max)", nullable: false), City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false) }, constraints: table => @@ -292,9 +291,9 @@ namespace PyroFetes.Migrations { table.PrimaryKey("PK_Shows", x => x.Id); table.ForeignKey( - name: "FK_Shows_City_CityId", + name: "FK_Shows_Cities_CityId", column: x => x.CityId, - principalTable: "City", + principalTable: "Cities", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); @@ -329,7 +328,7 @@ namespace PyroFetes.Migrations DelivererId = table.Column(type: "int", nullable: false), EstimateDeliveryDate = table.Column(type: "date", nullable: false), ExpeditionDate = table.Column(type: "date", nullable: false), - RealDeliveryDate = table.Column(type: "date", nullable: false) + RealDeliveryDate = table.Column(type: "date", nullable: true) }, constraints: table => { @@ -343,7 +342,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "Providers", + name: "ServiceProviders", columns: table => new { Id = table.Column(type: "int", nullable: false) @@ -353,9 +352,9 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_Providers", x => x.Id); + table.PrimaryKey("PK_ServiceProviders", x => x.Id); table.ForeignKey( - name: "FK_Providers_ProviderTypes_ProviderTypeId", + name: "FK_ServiceProviders_ProviderTypes_ProviderTypeId", column: x => x.ProviderTypeId, principalTable: "ProviderTypes", principalColumn: "Id", @@ -456,6 +455,26 @@ namespace PyroFetes.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "PurchaseOrders", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + PurchaseConditions = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), + SupplierId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PurchaseOrders", x => x.Id); + table.ForeignKey( + name: "FK_PurchaseOrders_Suppliers_SupplierId", + column: x => x.SupplierId, + principalTable: "Suppliers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Materials", columns: table => new @@ -508,7 +527,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "ShowStaff", + name: "ShowStaffs", columns: table => new { StaffId = table.Column(type: "int", nullable: false), @@ -516,15 +535,15 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_ShowStaff", x => new { x.StaffId, x.ShowId }); + table.PrimaryKey("PK_ShowStaffs", x => new { x.StaffId, x.ShowId }); table.ForeignKey( - name: "FK_ShowStaff_Shows_ShowId", + name: "FK_ShowStaffs_Shows_ShowId", column: x => x.ShowId, principalTable: "Shows", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_ShowStaff_Staffs_StaffId", + name: "FK_ShowStaffs_Staffs_StaffId", column: x => x.StaffId, principalTable: "Staffs", principalColumn: "Id", @@ -532,7 +551,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "ShowTruck", + name: "ShowTrucks", columns: table => new { ShowId = table.Column(type: "int", nullable: false), @@ -540,15 +559,15 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_ShowTruck", x => new { x.ShowId, x.TruckId }); + table.PrimaryKey("PK_ShowTrucks", x => new { x.ShowId, x.TruckId }); table.ForeignKey( - name: "FK_ShowTruck_Shows_ShowId", + name: "FK_ShowTrucks_Shows_ShowId", column: x => x.ShowId, principalTable: "Shows", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_ShowTruck_Trucks_TruckId", + name: "FK_ShowTrucks_Trucks_TruckId", column: x => x.TruckId, principalTable: "Trucks", principalColumn: "Id", @@ -604,7 +623,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "Contract", + name: "Contracts", columns: table => new { ShowId = table.Column(type: "int", nullable: false), @@ -613,15 +632,15 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_Contract", x => new { x.ShowId, x.ServiceProviderId }); + table.PrimaryKey("PK_Contracts", x => new { x.ShowId, x.ServiceProviderId }); table.ForeignKey( - name: "FK_Contract_Providers_ServiceProviderId", + name: "FK_Contracts_ServiceProviders_ServiceProviderId", column: x => x.ServiceProviderId, - principalTable: "Providers", + principalTable: "ServiceProviders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_Contract_Shows_ShowId", + name: "FK_Contracts_Shows_ShowId", column: x => x.ShowId, principalTable: "Shows", principalColumn: "Id", @@ -655,7 +674,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "MaterialWarehouse", + name: "MaterialWarehouses", columns: table => new { MaterialId = table.Column(type: "int", nullable: false), @@ -663,15 +682,15 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_MaterialWarehouse", x => new { x.MaterialId, x.WarehouseId }); + table.PrimaryKey("PK_MaterialWarehouses", x => new { x.MaterialId, x.WarehouseId }); table.ForeignKey( - name: "FK_MaterialWarehouse_Materials_MaterialId", + name: "FK_MaterialWarehouses_Materials_MaterialId", column: x => x.MaterialId, principalTable: "Materials", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_MaterialWarehouse_Warehouses_WarehouseId", + name: "FK_MaterialWarehouses_Warehouses_WarehouseId", column: x => x.WarehouseId, principalTable: "Warehouses", principalColumn: "Id", @@ -679,7 +698,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "ShowMaterial", + name: "ShowMaterials", columns: table => new { ShowId = table.Column(type: "int", nullable: false), @@ -687,15 +706,15 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_ShowMaterial", x => new { x.ShowId, x.MaterialId }); + table.PrimaryKey("PK_ShowMaterials", x => new { x.ShowId, x.MaterialId }); table.ForeignKey( - name: "FK_ShowMaterial_Materials_MaterialId", + name: "FK_ShowMaterials_Materials_MaterialId", column: x => x.MaterialId, principalTable: "Materials", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_ShowMaterial_Shows_ShowId", + name: "FK_ShowMaterials_Shows_ShowId", column: x => x.ShowId, principalTable: "Shows", principalColumn: "Id", @@ -708,14 +727,13 @@ namespace PyroFetes.Migrations { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), - References = table.Column(type: "int", nullable: false), + Reference = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Duration = table.Column(type: "decimal(18,2)", nullable: false), - Caliber = table.Column(type: "decimal(18,2)", nullable: false), - ApprovalNumber = table.Column(type: "int", nullable: false), + Caliber = table.Column(type: "int", nullable: false), + ApprovalNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Weight = table.Column(type: "decimal(18,2)", nullable: false), Nec = table.Column(type: "decimal(18,2)", nullable: false), - SellingPrice = table.Column(type: "decimal(18,2)", nullable: false), Image = table.Column(type: "nvarchar(max)", nullable: false), Link = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), MinimalQuantity = table.Column(type: "int", nullable: false), @@ -769,7 +787,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "ContactServiceProvider", + name: "ContactServiceProviders", columns: table => new { ContactId = table.Column(type: "int", nullable: false), @@ -777,17 +795,17 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_ContactServiceProvider", x => new { x.ContactId, x.ServiceProviderId }); + table.PrimaryKey("PK_ContactServiceProviders", x => new { x.ContactId, x.ServiceProviderId }); table.ForeignKey( - name: "FK_ContactServiceProvider_Contacts_ContactId", + name: "FK_ContactServiceProviders_Contacts_ContactId", column: x => x.ContactId, principalTable: "Contacts", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_ContactServiceProvider_Providers_ServiceProviderId", + name: "FK_ContactServiceProviders_ServiceProviders_ServiceProviderId", column: x => x.ServiceProviderId, - principalTable: "Providers", + principalTable: "ServiceProviders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); @@ -809,9 +827,9 @@ namespace PyroFetes.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_ProviderContacts_Providers_ProviderId", + name: "FK_ProviderContacts_ServiceProviders_ProviderId", column: x => x.ProviderId, - principalTable: "Providers", + principalTable: "ServiceProviders", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); @@ -959,7 +977,7 @@ namespace PyroFetes.Migrations }); migrationBuilder.CreateTable( - name: "ProductTimecode", + name: "ProductTimecodes", columns: table => new { ProductId = table.Column(type: "int", nullable: false), @@ -969,15 +987,15 @@ namespace PyroFetes.Migrations }, constraints: table => { - table.PrimaryKey("PK_ProductTimecode", x => new { x.ProductId, x.ShowId }); + table.PrimaryKey("PK_ProductTimecodes", x => new { x.ProductId, x.ShowId }); table.ForeignKey( - name: "FK_ProductTimecode_Products_ProductId", + name: "FK_ProductTimecodes_Products_ProductId", column: x => x.ProductId, principalTable: "Products", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_ProductTimecode_Shows_ShowId", + name: "FK_ProductTimecodes_Shows_ShowId", column: x => x.ShowId, principalTable: "Shows", principalColumn: "Id", @@ -1075,13 +1093,13 @@ namespace PyroFetes.Migrations column: "CustomerId"); migrationBuilder.CreateIndex( - name: "IX_ContactServiceProvider_ServiceProviderId", - table: "ContactServiceProvider", + name: "IX_ContactServiceProviders_ServiceProviderId", + table: "ContactServiceProviders", column: "ServiceProviderId"); migrationBuilder.CreateIndex( - name: "IX_Contract_ServiceProviderId", - table: "Contract", + name: "IX_Contracts_ServiceProviderId", + table: "Contracts", column: "ServiceProviderId"); migrationBuilder.CreateIndex( @@ -1105,8 +1123,8 @@ namespace PyroFetes.Migrations column: "WarehouseId"); migrationBuilder.CreateIndex( - name: "IX_MaterialWarehouse_WarehouseId", - table: "MaterialWarehouse", + name: "IX_MaterialWarehouses_WarehouseId", + table: "MaterialWarehouses", column: "WarehouseId"); migrationBuilder.CreateIndex( @@ -1155,8 +1173,8 @@ namespace PyroFetes.Migrations column: "ProductCategoryId"); migrationBuilder.CreateIndex( - name: "IX_ProductTimecode_ShowId", - table: "ProductTimecode", + name: "IX_ProductTimecodes_ShowId", + table: "ProductTimecodes", column: "ShowId"); migrationBuilder.CreateIndex( @@ -1165,9 +1183,9 @@ namespace PyroFetes.Migrations column: "ProviderId"); migrationBuilder.CreateIndex( - name: "IX_Providers_ProviderTypeId", - table: "Providers", - column: "ProviderTypeId"); + name: "IX_PurchaseOrders_SupplierId", + table: "PurchaseOrders", + column: "SupplierId"); migrationBuilder.CreateIndex( name: "IX_PurchaseProducts_PurchaseOrderId", @@ -1185,8 +1203,13 @@ namespace PyroFetes.Migrations column: "CustomerId"); migrationBuilder.CreateIndex( - name: "IX_ShowMaterial_MaterialId", - table: "ShowMaterial", + name: "IX_ServiceProviders_ProviderTypeId", + table: "ServiceProviders", + column: "ProviderTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_ShowMaterials_MaterialId", + table: "ShowMaterials", column: "MaterialId"); migrationBuilder.CreateIndex( @@ -1195,13 +1218,13 @@ namespace PyroFetes.Migrations column: "CityId"); migrationBuilder.CreateIndex( - name: "IX_ShowStaff_ShowId", - table: "ShowStaff", + name: "IX_ShowStaffs_ShowId", + table: "ShowStaffs", column: "ShowId"); migrationBuilder.CreateIndex( - name: "IX_ShowTruck_TruckId", - table: "ShowTruck", + name: "IX_ShowTrucks_TruckId", + table: "ShowTrucks", column: "TruckId"); migrationBuilder.CreateIndex( @@ -1245,16 +1268,16 @@ namespace PyroFetes.Migrations name: "Communications"); migrationBuilder.DropTable( - name: "ContactServiceProvider"); + name: "ContactServiceProviders"); migrationBuilder.DropTable( - name: "Contract"); + name: "Contracts"); migrationBuilder.DropTable( name: "ExperienceLevels"); migrationBuilder.DropTable( - name: "MaterialWarehouse"); + name: "MaterialWarehouses"); migrationBuilder.DropTable( name: "Prices"); @@ -1269,7 +1292,7 @@ namespace PyroFetes.Migrations name: "ProductEffects"); migrationBuilder.DropTable( - name: "ProductTimecode"); + name: "ProductTimecodes"); migrationBuilder.DropTable( name: "ProviderContacts"); @@ -1284,13 +1307,16 @@ namespace PyroFetes.Migrations name: "Settings"); migrationBuilder.DropTable( - name: "ShowMaterial"); + name: "ShowMaterials"); migrationBuilder.DropTable( - name: "ShowStaff"); + name: "ShowServiceProviders"); migrationBuilder.DropTable( - name: "ShowTruck"); + name: "ShowStaffs"); + + migrationBuilder.DropTable( + name: "ShowTrucks"); migrationBuilder.DropTable( name: "SoundTimecodes"); @@ -1310,9 +1336,6 @@ namespace PyroFetes.Migrations migrationBuilder.DropTable( name: "WarehouseProducts"); - migrationBuilder.DropTable( - name: "Suppliers"); - migrationBuilder.DropTable( name: "Colors"); @@ -1323,7 +1346,7 @@ namespace PyroFetes.Migrations name: "Effects"); migrationBuilder.DropTable( - name: "Providers"); + name: "ServiceProviders"); migrationBuilder.DropTable( name: "PurchaseOrders"); @@ -1365,7 +1388,10 @@ namespace PyroFetes.Migrations name: "ProviderTypes"); migrationBuilder.DropTable( - name: "City"); + name: "Suppliers"); + + migrationBuilder.DropTable( + name: "Cities"); migrationBuilder.DropTable( name: "SoundCategories"); diff --git a/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs b/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs index 4c11f87..571eef5 100644 --- a/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs +++ b/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs @@ -695,8 +695,13 @@ namespace PyroFetes.Migrations .HasMaxLength(300) .HasColumnType("nvarchar(300)"); + b.Property("SupplierId") + .HasColumnType("int"); + b.HasKey("Id"); + b.HasIndex("SupplierId"); + b.ToTable("PurchaseOrders"); }); @@ -1545,6 +1550,17 @@ namespace PyroFetes.Migrations b.Navigation("Provider"); }); + modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => + { + b.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany() + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Supplier"); + }); + modelBuilder.Entity("PyroFetes.Models.PurchaseProduct", b => { b.HasOne("PyroFetes.Models.Product", "Product") diff --git a/PyroFetes/Models/PurchaseOrder.cs b/PyroFetes/Models/PurchaseOrder.cs index 815f5a0..94a2ab6 100644 --- a/PyroFetes/Models/PurchaseOrder.cs +++ b/PyroFetes/Models/PurchaseOrder.cs @@ -7,5 +7,7 @@ public class PurchaseOrder [Key] public int Id { get; set; } [Required, MaxLength(300)] public string? PurchaseConditions { get; set; } + [Required] public int SupplierId { get; set; } + public Supplier? Supplier { get; set; } public List? PurchaseProducts { get; set; } } \ No newline at end of file diff --git a/PyroFetes/PyroFetes.csproj b/PyroFetes/PyroFetes.csproj index 3e77db0..5aa90b1 100644 --- a/PyroFetes/PyroFetes.csproj +++ b/PyroFetes/PyroFetes.csproj @@ -40,4 +40,8 @@ + + + + diff --git a/PyroFetes/PyroFetesDbContext.cs b/PyroFetes/PyroFetesDbContext.cs index 2a5f711..f8230eb 100644 --- a/PyroFetes/PyroFetesDbContext.cs +++ b/PyroFetes/PyroFetesDbContext.cs @@ -63,13 +63,15 @@ public class PyroFetesDbContext : DbContext protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { string connectionString = - "Server=romaric-thibault.fr;" + - "Database=PyroFetes;" + - "User Id=pyrofetes;" + - "Password=Crablike8-Fringe-Swimmable;" + + "Server=localhost,1433;" + + "Database=pyrofetes-db;" + + "User Id=sa;" + + "Password=AdminMotDePasse!;" + "TrustServerCertificate=true;"; optionsBuilder.UseSqlServer(connectionString); + + } // Models customization diff --git a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs index f5cfd90..6861e8b 100644 --- a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs +++ b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs @@ -17,7 +17,7 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService var logoPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "logo.jpg"); var signaturePath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "signature.png"); int totalQuantity = 0; - int total = 0; + decimal total = 0; var document = Document.Create(container => { container.Page(page => @@ -92,13 +92,17 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService foreach (var l in lignes) { + decimal price = l.Product!.Prices! + .FirstOrDefault(p => p.SupplierId == l.PurchaseOrder!.SupplierId) + ?.SellingPrice ?? 0; + table.Cell().Element(CellBody).Text(l.Product?.Name); table.Cell().Element(CellBody).AlignRight().Text(l.Quantity.ToString()); - table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity:n2} €"); - table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity * l.Quantity:n2} €"); + table.Cell().Element(CellBody).AlignRight().Text($"{price:n2} €"); + table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity * price:n2} €"); totalQuantity += l.Quantity; - total += l.Quantity * l.Quantity; + total += l.Quantity * price; } IContainer CellHeader(IContainer c) => @@ -128,7 +132,7 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService right.Item().AlignRight().Text($"Total: {totalQuantity:n2} produits"); right.Item().AlignRight().Text($"Total HT: {total:n2} €"); right.Item().AlignRight().Text("Taxe: 20 %"); - right.Item().AlignRight().Text($"Total TTC: {(total * 1.2):n2} €"); + right.Item().AlignRight().Text($"Total TTC: {(total * 1,2):n2} €"); }); }); }); diff --git a/PyroFetes/data.sql b/PyroFetes/data.sql new file mode 100644 index 0000000..6a0d4af --- /dev/null +++ b/PyroFetes/data.sql @@ -0,0 +1,615 @@ +-- ============================================================ +-- PyroFetes – Jeu de données complet +-- Compatible SQL Server / EF Core +-- Ordre d'insertion respectant les contraintes FK +-- ============================================================ + +-- ------------------------------------------------------- +-- 1. Settings +-- ------------------------------------------------------- +INSERT INTO Settings ( Logo, ElectronicSignature) VALUES + ( 'assets/logo_pyrofetes.png', 'assets/signature_direction.png'); + +-- ------------------------------------------------------- +-- 2. Cities +-- ------------------------------------------------------- +INSERT INTO Cities ( Name, ZipCode) VALUES + ( 'Paris', 75001), + ( 'Lyon', 69001), + ( 'Marseille', 13001), + ('Bordeaux', 33000), + ( 'Strasbourg', 67000), + ( 'Nantes', 44000), + ('Toulouse', 31000), + ( 'Lille', 59000), + ( 'Nice', 06000), + ('Montpellier', 34000); + +-- ------------------------------------------------------- +-- 3. Classifications +-- ------------------------------------------------------- +INSERT INTO Classifications ( Label) VALUES + ('F1 – Faible danger'), + ( 'F2 – Danger moyen'), + ( 'F3 – Danger élevé'), + ( 'F4 – Usage professionnel'), + ( 'T1 – Théâtral usage général'), + ( 'T2 – Théâtral usage professionnel'); + +-- ------------------------------------------------------- +-- 4. ProductCategories +-- ------------------------------------------------------- +INSERT INTO ProductCategories ( Label) VALUES + ( 'Bouquet final'), + ( 'Chandelle romaine'), + ( 'Fontaine'), + ( 'Fusée'), + ( 'Mine'), + ( 'Pétard'), + ( 'Torche'), + ( 'Batterie'), + ( 'Cascades'), + ( 'Lanceur électrique'); + +-- ------------------------------------------------------- +-- 5. Colors +-- ------------------------------------------------------- +INSERT INTO Colors ( Label) VALUES + ( 'Rouge'), + ( 'Vert'), + ( 'Bleu'), + ( 'Or'), + ( 'Argent'), + ( 'Blanc'), + ( 'Orange'), + ( 'Violet'), + ( 'Rose'), + ( 'Multicolore'); + +-- ------------------------------------------------------- +-- 6. Effects +-- ------------------------------------------------------- +INSERT INTO Effects ( Label) VALUES + ( 'Craquement'), + ( 'Sifflement'), + ( 'Scintillement'), + ( 'Pluie dorée'), + ( 'Bouquet étoilé'), + ( 'Palmier'), + ( 'Chrysanthème'), + ( 'Peony'), + ( 'Comet'), + ( 'Strobe'), + ( 'Nishiki Kamuro'), + ('Pistil'); + +-- ------------------------------------------------------- +-- 7. Movements (avant Products car FK) +-- ------------------------------------------------------- +INSERT INTO Movements ( Date, Start, Arrival, Quantity, SourceWarehouseId, DestinationWarehouseId) VALUES + ('2024-01-10 08:00:00', '2024-01-10 08:00:00', '2024-01-10 14:00:00', 200, NULL, 1), + ( '2024-02-15 09:00:00', '2024-02-15 09:00:00', '2024-02-15 16:30:00', 150, NULL, 2), + ('2024-03-01 07:30:00', '2024-03-01 07:30:00', '2024-03-01 12:00:00', 80, 1, 3), + ( '2024-04-20 10:00:00', '2024-04-20 10:00:00', '2024-04-20 18:00:00', 300, 2, 1), + ( '2024-05-05 08:00:00', '2024-05-05 08:00:00', '2024-05-05 15:00:00', 120, 3, 2), + ('2024-06-14 06:00:00', '2024-06-14 06:00:00', '2024-06-14 10:00:00', 500, 1, NULL), + ( '2024-07-04 07:00:00', '2024-07-04 07:00:00', '2024-07-04 11:00:00', 250, 2, NULL), + ( '2024-08-12 09:00:00', '2024-08-12 09:00:00', '2024-08-12 17:00:00', 180, NULL, 3); + +-- ------------------------------------------------------- +-- 8. Products +-- ------------------------------------------------------- +INSERT INTO Products ( Reference, Name, Duration, Caliber, ApprovalNumber, Weight, Nec, Image, Link, MinimalQuantity, ClassificationId, ProductCategoryId, MovementId) VALUES + ( 'PYR-001', 'Bouquet Tricolore 30T', 45.5, 30, 'APP-2023-001', 1.200, 0.850, 'products/bouquet_tricolore.jpg', 'https://catalogue.pyrofetes.fr/PYR-001', 10, 4, 1, 1), + ( 'PYR-002', 'Chandelle Or 25T', 30.0, 25, 'APP-2023-002', 0.800, 0.560, 'products/chandelle_or.jpg', 'https://catalogue.pyrofetes.fr/PYR-002', 20, 3, 2, 2), + ( 'PYR-003', 'Fontaine Argentée 20T', 60.0, 20, 'APP-2023-003', 0.500, 0.300, 'products/fontaine_arg.jpg', 'https://catalogue.pyrofetes.fr/PYR-003', 15, 2, 3, 3), + ( 'PYR-004', 'Fusée Palmier 50T', 25.0, 50, 'APP-2023-004', 2.500, 1.800, 'products/fusee_palmier.jpg', 'https://catalogue.pyrofetes.fr/PYR-004', 5, 4, 4, 4), + ( 'PYR-005', 'Mine Chrysanthème 75T', 15.0, 75, 'APP-2023-005', 3.200, 2.400, 'products/mine_chrysantheme.jpg', 'https://catalogue.pyrofetes.fr/PYR-005', 5, 4, 5, 5), + ( 'PYR-006', 'Batterie Festival 100T', 120.0, 100, 'APP-2023-006', 8.000, 5.600, 'products/batterie_festival.jpg', 'https://catalogue.pyrofetes.fr/PYR-006', 3, 4, 8, 6), + ( 'PYR-007', 'Torche Colorée 15T', 90.0, 15, 'APP-2023-007', 0.300, 0.180, 'products/torche_coloree.jpg', 'https://catalogue.pyrofetes.fr/PYR-007', 30, 2, 7, 7), + ( 'PYR-008', 'Cascade Dorée 40T', 75.0, 40, 'APP-2023-008', 1.800, 1.200, 'products/cascade_doree.jpg', 'https://catalogue.pyrofetes.fr/PYR-008', 10, 4, 9, 8), + ( 'PYR-009', 'Peony Multicolore 60T', 30.0, 60, 'APP-2023-009', 4.500, 3.200, 'products/peony_multi.jpg', 'https://catalogue.pyrofetes.fr/PYR-009', 5, 4, 1, 1), + ( 'PYR-010', 'Lanceur 36 Tirs EL', 0.0, 0, 'APP-2023-010', 2.100, 0.000, 'products/lanceur_36.jpg', 'https://catalogue.pyrofetes.fr/PYR-010', 2, 6, 10,2), + ( 'PYR-011', 'Strobe Blanc Intense 25T', 45.0, 25, 'APP-2023-011', 0.900, 0.650, 'products/strobe_blanc.jpg', 'https://catalogue.pyrofetes.fr/PYR-011', 10, 3, 3, 3), + ( 'PYR-012', 'Comet Violet 30T', 20.0, 30, 'APP-2023-012', 1.100, 0.800, 'products/comet_violet.jpg', 'https://catalogue.pyrofetes.fr/PYR-012', 12, 3, 4, 4); + +-- ------------------------------------------------------- +-- 9. Brands +-- ------------------------------------------------------- +INSERT INTO Brands ( Name, ProductId) VALUES + ( 'PyroMaster', 1), + ( 'GoldFlame', 1), + ( 'ArtificePlus', 2), + ( 'ArtificePlus', 3), + ( 'StarBurst', 4), + ( 'StarBurst', 5), + ( 'FestivalFire', 6), + ( 'TorchCo', 7), + ( 'GoldFlame', 8), + ( 'PyroMaster', 9), + ( 'ElecFire', 10), + ( 'PyroMaster', 11), + ( 'StarBurst', 12); + +-- ------------------------------------------------------- +-- 10. ProductColors +-- ------------------------------------------------------- +INSERT INTO ProductColors (ProductId, ColorId) VALUES + (1, 1), (1, 3), (1, 6), -- Bouquet Tricolore : rouge, bleu, blanc + (2, 4), -- Chandelle Or + (3, 5), -- Fontaine Argentée + (4, 4), (4, 2), -- Fusée Palmier : or, vert + (5, 7), (5, 4), -- Mine Chrysanthème : orange, or + (6, 10), -- Batterie Festival : multicolore + (7, 1), (7, 2), (7, 3), -- Torche : rouge, vert, bleu + (8, 4), (8, 5), -- Cascade Dorée : or, argent + (9, 10), -- Peony Multicolore + (11, 6), -- Strobe Blanc + (12, 8); -- Comet Violet + +-- ------------------------------------------------------- +-- 11. ProductEffects +-- ------------------------------------------------------- +INSERT INTO ProductEffects (ProductId, EffectId) VALUES + (1, 5), (1, 8), -- Bouquet : bouquet étoilé, peony + (2, 4), (2, 3), -- Chandelle Or : pluie dorée, scintillement + (3, 3), -- Fontaine : scintillement + (4, 6), (4, 9), -- Fusée Palmier : palmier, comet + (5, 7), (5, 1), -- Mine : chrysanthème, craquement + (6, 5), (6, 7), (6, 10), -- Batterie : bouquet, chrysanthème, strobe + (7, 3), (7, 2), -- Torche : scintillement, sifflement + (8, 4), (8, 11), -- Cascade : pluie dorée, Nishiki + (9, 8), (9, 12), -- Peony : peony, pistil + (11, 10), -- Strobe + (12, 9); -- Comet + +-- ------------------------------------------------------- +-- 12. Warehouses +-- ------------------------------------------------------- +INSERT INTO Warehouses ( Name, MaxWeight, [Current], MinWeight, Address, ZipCode, City) VALUES + ( 'Entrepôt Central Paris', 50000, 18500, 5000, '12 rue de la Pyrotechnie', '75019', 'Paris'), + ( 'Dépôt Sud Marseille', 30000, 12000, 3000, '8 avenue du Port Sec', '13016', 'Marseille'), + ( 'Stockage Est Strasbourg', 20000, 8200, 2000, '5 chemin des Entrepôts', '67200', 'Strasbourg'), + ( 'Site Ouest Nantes', 25000, 6500, 2500, '22 zone industrielle Ouest','44800', 'Nantes'); + +-- ------------------------------------------------------- +-- 13. WarehouseProducts +-- ------------------------------------------------------- +INSERT INTO WarehouseProducts (ProductId, WarehouseId, Quantity) VALUES + (1, 1, 120), (1, 2, 60), + (2, 1, 200), (2, 3, 80), + (3, 1, 150), (3, 4, 90), + (4, 1, 40), (4, 2, 25), + (5, 1, 30), (5, 2, 15), + (6, 1, 20), (6, 3, 10), + (7, 2, 300), (7, 4, 180), + (8, 1, 75), (8, 2, 50), + (9, 1, 35), + (10, 1, 18), (10, 3, 12), + (11, 2, 60), + (12, 3, 45); + +-- ------------------------------------------------------- +-- 14. Materials +-- ------------------------------------------------------- +INSERT INTO Materials ( Name, Quantity, WarehouseId) VALUES + ( 'Câble électrique 50m', 40, 1), + ( 'Détonateur électrique', 500, 1), + ( 'Bouchon sécurité rouge', 300, 1), + ( 'Trépied aluminium', 25, 2), + ( 'Tuyau métallique 1m', 80, 2), + ( 'Boitier de tir 36 sorties', 10, 1), + ( 'Rallonge 10m IP67', 60, 3), + ( 'Mortier plastique 50mm', 200, 3), + ( 'Mortier acier 75mm', 100, 1), + ('Tableau de tir 100 CH', 5, 4), + ( 'Caisse de transport étanche',30, 2), + ( 'Lunettes de protection', 50, 1); + +-- ------------------------------------------------------- +-- 15. MaterialWarehouses +-- ------------------------------------------------------- +INSERT INTO MaterialWarehouses (MaterialId, WarehouseId) VALUES + (1, 1), (1, 3), + (2, 1), (2, 2), + (3, 1), + (4, 2), (4, 4), + (5, 2), (5, 3), + (6, 1), (6, 4), + (7, 3), + (8, 3), (8, 1), + (9, 1), + (10, 4), + (11, 2), + (12, 1), (12, 2); + +-- ------------------------------------------------------- +-- 16. Suppliers +-- ------------------------------------------------------- +INSERT INTO Suppliers ( Name, Email, Phone, Address, ZipCode, City, DeliveryDelay) VALUES + ('Pyrotechnie Ruggieri', 'commandes@ruggieri.fr', '01 47 00 11 22', '14 avenue de la Fête', '75015', 'Paris', 7), + ( 'Lacroix Défense Feux', 'pro@lacroix-feux.com', '04 78 92 00 10', '3 zone industrielle Nord','69130', 'Lyon', 10), + ( 'Jorge Banus Pyro', 'info@jorgebanus-pyro.es', '+34 952 810 000','Pol. Ind. Las Maravillas', '29600', 'Marbella', 21), + ('Brother Pyro Import', 'sales@brotherpyro.com', '+1 555 010 2020','1200 Fireworks Blvd', '30301', 'Atlanta', 30), + ( 'Nico Pyrotechnie', 'achats@nico-pyro.fr', '04 91 25 36 47', '27 impasse des Artifices','13010', 'Marseille', 5), + ( 'Surex Pyrotechnie', 'contact@surex.fr', '03 90 00 12 34', '10 rue Gutenberg', '67600', 'Sélestat', 6); + +-- ------------------------------------------------------- +-- 17. Prices (Product x Supplier) +-- ------------------------------------------------------- +INSERT INTO Prices (ProductId, SupplierId, SellingPrice) VALUES + (1, 1, 12.50), (1, 2, 13.00), + (2, 1, 6.80), (2, 5, 7.20), + (3, 1, 4.50), (3, 5, 4.80), + (4, 2, 28.00), (4, 3, 26.50), + (5, 2, 35.00), (5, 3, 33.00), + (6, 1, 95.00), (6, 2, 98.50), + (7, 5, 3.20), (7, 6, 3.50), + (8, 1, 22.00), (8, 2, 23.50), + (9, 2, 42.00), (9, 4, 39.00), + (10,1, 185.00),(10,6, 190.00), + (11,5, 8.90), (11,6, 9.20), + (12,3, 14.00), (12,4, 13.50); + +-- ------------------------------------------------------- +-- 18. Deliverers +-- ------------------------------------------------------- +INSERT INTO Deliverers ( Transporter) VALUES + ( 'Chronopost Marchandises Dangereuses'), + ( 'DHL Fret Spécial'), + ( 'TNT Express ADR'), + ('Transport Pyro Interne'), + ( 'Geodis Fret'); + +-- ------------------------------------------------------- +-- 19. DeliveryNotes +-- ------------------------------------------------------- +INSERT INTO DeliveryNotes (TrackingNumber, DelivererId, EstimateDeliveryDate, ExpeditionDate, RealDeliveryDate) VALUES + ('CPM-2024-001234', 1, '2024-01-12', '2024-01-09', '2024-01-12'), + ( 'DHL-2024-005678', 2, '2024-02-18', '2024-02-14', '2024-02-17'), + ( 'TNT-2024-009012', 3, '2024-03-05', '2024-03-01', '2024-03-06'), + ('INT-2024-000001', 4, '2024-04-22', '2024-04-20', '2024-04-22'), + ( 'GEO-2024-001111', 5, '2024-05-10', '2024-05-07', NULL); + +-- ------------------------------------------------------- +-- 20. ProductDeliveries +-- ------------------------------------------------------- +INSERT INTO ProductDeliveries (ProductId, DeliveryNoteId, Quantity) VALUES + (1, 1, 60), (2, 1, 100), + (3, 2, 80), (4, 2, 20), + (5, 3, 15), (6, 3, 8), + (7, 4, 150), (8, 4, 40), + (9, 5, 30), (10,5, 6); + +-- ------------------------------------------------------- +-- 21. PurchaseOrders +-- ------------------------------------------------------- +INSERT INTO PurchaseOrders ( PurchaseConditions, SupplierId) VALUES + ('Paiement à 30 jours – transport inclus – palette EUR 80x120', 1), + ('Paiement à 60 jours – Incoterm EXW Lyon – assurance acheteur', 2), + ('Paiement anticipé -2% – transport DDP Paris – emballage ADR inclus', 5), + ('Paiement à 45 jours – transport à la charge du vendeur jusqu au dépôt', 3), + ( 'Paiement à 30 jours – transport maritime consolidé', 4); + +-- ------------------------------------------------------- +-- 22. PurchaseProducts +-- ------------------------------------------------------- +INSERT INTO PurchaseProducts (ProductId, PurchaseOrderId, Quantity) VALUES + (1, 1, 200), (2, 1, 300), (3, 1, 150), + (4, 2, 50), (5, 2, 30), (6, 2, 20), + (7, 3, 500), (8, 3, 100), + (9, 4, 40),(10, 4, 15), + (11,5, 100),(12, 5, 80); + +-- ------------------------------------------------------- +-- 23. ProviderTypes +-- ------------------------------------------------------- +INSERT INTO ProviderTypes ( Label) VALUES + ( 'Sonorisation'), + ('Éclairage scénique'), + ( 'Sécurité / Protection'), + ( 'Logistique & Transport'), + ( 'Location de matériel'), + ( 'Médical / Secours'); + +-- ------------------------------------------------------- +-- 24. ServiceProviders +-- ------------------------------------------------------- +INSERT INTO ServiceProviders ( Price, ProviderTypeId) VALUES + ( 4500.00, 1), + (3200.00, 1), + (5800.00, 2), + (2800.00, 3), + (7500.00, 3), + ( 1200.00, 4), + (73500.00, 5), + ( 900.00, 6); + +-- ------------------------------------------------------- +-- 25. CustomerTypes +-- ------------------------------------------------------- +INSERT INTO CustomerTypes ( Label) VALUES + ( 'Mairie / Collectivité'), + ( 'Association'), + ( 'Entreprise privée'), + ( 'Particulier'), + ( 'Organisateur d événements'); + +-- ------------------------------------------------------- +-- 26. Customers + + +-- ------------------------------------------------------- +-- 27. Contacts +-- ------------------------------------------------------- + + + +-- ------------------------------------------------------- +-- 31. QuotationProducts +-- ------------------------------------------------------- +INSERT INTO QuotationProducts (ProductId, QuotationId, Quantity) VALUES + (1, 1, 80), (4, 1, 30), (5, 1, 20), (6, 1, 5), (8, 1, 40), + (2, 2, 50), (3, 2, 40), (7, 2, 80), + (1, 3, 40), (6, 3, 3), (9, 3, 15), + (1, 4, 60), (4, 4, 20), (6, 4, 4), (7, 4,100), + (1, 5, 70), (5, 5, 15), (8, 5, 30), + (2, 6, 60), (3, 6, 50), (7, 6, 90); + +-- ------------------------------------------------------- +-- 32. Staff +-- ------------------------------------------------------- +INSERT INTO Staffs ( FirstName, LastName, Profession, Email, F4T2NumberApproval, F4T2ExpirationDate) VALUES + ( 'Antoine', 'Duval', 'Chef artificier', 'a.duval@pyrofetes.fr', 'F4-2021-00142', '2025-12-31'), + ( 'Camille', 'Renard', 'Artificier', 'c.renard@pyrofetes.fr', 'F4-2022-00255', '2026-06-30'), + ( 'Nicolas', 'Lefort', 'Artificier', 'n.lefort@pyrofetes.fr', 'F4-2020-00387', '2024-12-31'), + ( 'Emma', 'Vidal', 'Technicien pyrotechnie', 'e.vidal@pyrofetes.fr', 'T2-2023-00104', '2027-03-31'), + ( 'Julien', 'Moreau', 'Chef de chantier', 'j.moreau@pyrofetes.fr', 'F4-2021-00521', '2025-09-30'), + ( 'Laura', 'Blanc', 'Artificière', 'l.blanc@pyrofetes.fr', 'F4-2022-00698', '2026-12-31'), + ( 'Pierre', 'Garnier', 'Technicien électronique', 'p.garnier@pyrofetes.fr', 'T2-2021-00789', '2025-11-30'), + ( 'Marie', 'Lefebvre', 'Responsable sécurité', 'm.lefebvre@pyrofetes.fr', 'F4-2023-00901', '2027-06-30'), + ( 'Hugo', 'Simon', 'Artificier junior', 'h.simon@pyrofetes.fr', 'T1-2023-01023', '2025-06-30'), + ( 'Pauline', 'Robert', 'Coordinatrice logistique', 'p.robert@pyrofetes.fr', 'T2-2022-01145', '2026-09-30'); + +-- ------------------------------------------------------- +-- 33. ExperienceLevels +-- ------------------------------------------------------- +INSERT INTO ExperienceLevels ( Label, StaffId) VALUES + ( 'Expert – +15 ans', 1), + ( 'Confirmé – 8 ans', 2), + ( 'Confirmé – 6 ans', 3), + ( 'Intermédiaire – 3 ans', 4), + ( 'Expert – +12 ans', 5), + ( 'Confirmé – 7 ans', 6), + ( 'Intermédiaire – 4 ans', 7), + ( 'Confirmé – 5 ans', 8), + ( 'Débutant – 1 an', 9), + ( 'Intermédiaire – 3 ans', 10); + +-- ------------------------------------------------------- +-- 34. HistoryOfApprovals +-- ------------------------------------------------------- +INSERT INTO HistoryOfApprovals ( DeliveryDate, ExpirationDate) VALUES + ( '2021-03-15', '2025-12-31'), + ( '2022-06-01', '2026-06-30'), + ( '2020-09-10', '2024-12-31'), + ( '2023-01-20', '2027-03-31'), + ( '2021-09-05', '2025-09-30'), + ( '2022-12-15', '2026-12-31'), + ( '2021-11-01', '2025-11-30'), + ( '2023-06-10', '2027-06-30'), + ( '2019-03-15', '2021-03-14'), -- expirée (historique) + ('2023-09-01', '2026-09-30'); + +-- ------------------------------------------------------- +-- 35. StaffHistoryOfApprovals +-- ------------------------------------------------------- +INSERT INTO StaffHistoryOfApprovals (StaffId, HistoryOfApprovalId) VALUES + (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), + (6, 6), (7, 7), (8, 8), (9, 9), (10,10), + (3, 1); -- Nicolas a eu une précédente approbation + +-- ------------------------------------------------------- +-- 36. Availabilities +-- ------------------------------------------------------- +INSERT INTO Availabilities (AvailabilityDate, DeliveryDate, ExpirationDate, RenewallDate) VALUES + ( '2024-07-14', '2024-07-14', '2024-07-15', '2025-07-14'), + ( '2024-07-14', '2024-07-14', '2024-07-15', '2025-07-14'), + ( '2024-08-15', '2024-08-15', '2024-08-16', '2025-08-15'), + ( '2024-08-15', '2024-08-15', '2024-08-16', '2025-08-15'), + ( '2024-09-21', '2024-09-21', '2024-09-22', '2025-09-21'), + ( '2024-12-31', '2024-12-31', '2025-01-01', '2025-12-31'), + ( '2024-07-04', '2024-07-04', '2024-07-05', '2025-07-04'), + ( '2024-06-21', '2024-06-21', '2024-06-22', '2025-06-21'); + +-- ------------------------------------------------------- +-- 37. StaffAvailabilities +-- ------------------------------------------------------- +INSERT INTO StaffAvailabilities (StaffId, AvailabilityId) VALUES + (1, 1), (2, 1), (5, 1), (8, 1), -- Paris 14 juillet + (1, 3), (3, 3), (6, 3), (7, 3), -- Marseille 15 août + (2, 5), (4, 5), (9, 5), -- Bordeaux + (1, 6), (2, 6), (5, 6), (10,6), -- Nouvel an + (3, 7), (6, 7), (8, 7), -- 4 juillet Lyon + (4, 8), (7, 8), (9, 8); -- Fête musique + +-- ------------------------------------------------------- +-- 38. StaffContacts +-- ------------------------------------------------------- +INSERT INTO StaffContacts (StaffId, ContactId) VALUES + (1, 1), (1, 2), + (2, 4), + (5, 6), + (6, 3), + (8, 5), + (10,8); + +-- ------------------------------------------------------- +-- 39. Trucks +-- ------------------------------------------------------- +INSERT INTO Trucks ( Type, MaxExplosiveCapacity, Sizes, Status) VALUES + ( 'Fourgon 20m³', 500.0, '5.5m x 2.2m x 2.5m', 'Disponible'), + ( 'Semi-remorque ADR 82m³',3000.0, '13.6m x 2.4m x 2.8m','Disponible'), + ( 'Camion 40m³ frigorifié',1000.0, '7.2m x 2.4m x 2.6m', 'En maintenance'), + ( 'Fourgon 15m³', 300.0, '4.2m x 2.0m x 2.2m', 'Disponible'), + ( 'Pick-up plateau', 80.0, '2.0m x 1.8m x 0.5m', 'Disponible'); + +-- ------------------------------------------------------- +-- 40. SoundCategories +-- ------------------------------------------------------- +INSERT INTO SoundCategories (Name) VALUES + ( 'Ouverture / Intro'), + ( 'Corps de spectacle'), + ( 'Bouquet final'), + ( 'Transition'), + ( 'Ambiance'); + +-- ------------------------------------------------------- +-- 41. Sounds +-- ------------------------------------------------------- +INSERT INTO Sounds ( Name, Type, Artist, Duration, Kind, Format, CreationDate, SoundCategoryId) VALUES + ( '1812 Ouverture', 'Classique', 'Tchaïkovski', 900, 'Musique', 'WAV 48kHz 24bit', '2023-05-10', 1), + ( 'La Marseillaise Orchestrale','Hymne', 'Berlioz arr.', 210, 'Musique', 'WAV 48kHz 24bit', '2023-05-10', 1), + ( 'Also Sprach Zarathustra', 'Classique', 'Richard Strauss', 480, 'Musique', 'WAV 48kHz 24bit', '2023-06-01', 1), + ( 'Fanfare Spectacle 01', 'Fanfare', 'Studio Pyro', 60, 'Jingle', 'WAV 44.1kHz', '2024-01-15', 4), + ( 'Symphonie Feu & Lumière', 'Orchestral', 'Studio Pyro', 1200, 'Musique', 'WAV 48kHz 24bit', '2024-02-20', 2), + ( 'Rock the Fireworks', 'Rock', 'PyroRock Band', 780, 'Musique', 'MP3 320kbps', '2023-09-05', 2), + ( 'Electronic Fire Mix', 'Électronique', 'DJ Pyro', 960, 'Mix', 'WAV 44.1kHz', '2023-11-15', 2), + ( 'Finale Épique', 'Orchestral', 'Studio Pyro', 180, 'Musique', 'WAV 48kHz 24bit', '2024-01-15', 3), + ( 'Grand Finale 2024', 'Orchestral', 'Philharmonique Pyro', 240, 'Musique', 'WAV 48kHz 24bit', '2024-03-01', 3), + ( 'Ambiance Nocturne', 'Ambient', 'Sound Design Studio', 600, 'Musique', 'WAV 44.1kHz', '2023-07-20', 5); + +-- ------------------------------------------------------- +-- 42. Shows +-- ------------------------------------------------------- +INSERT INTO Shows (Name, Place, Description, Date, PyrotechnicImplementationPlan, CityId) VALUES + ( 'Feux du 14 Juillet Paris 2024', 'Trocadéro – Tour Eiffel', 'Grand spectacle national – 30 minutes – 120 000 spectateurs', '2024-07-14', 'plans/paris_14juillet_2024_v3.pdf', 1), + ( 'Festival Lumières Lyon 2024', 'Place Bellecour', 'Spectacle estival – 20 minutes – 50 000 spectateurs', '2024-08-03', 'plans/lyon_festival_2024_v2.pdf', 2), + ( 'Fête Nationale Marseille 2024', 'Vieux-Port', 'Show nautique et aérien – 25 minutes', '2024-07-14', 'plans/marseille_14juillet_2024_v1.pdf',3), + ('Gala Entreprise Paris 2024', 'Château de Versailles', 'Show privé soirée de gala – 15 minutes', '2024-09-21', 'plans/versailles_gala_2024_v2.pdf', 1), + ('Saint-Sylvestre Bordeaux 2024', 'Place de la Bourse', 'Feux du nouvel an – 20 minutes', '2024-12-31', 'plans/bordeaux_sylvestre_2024_v1.pdf', 4), + ('Fête de la Musique Nantes 2024', 'Île de Nantes', 'Show pyrotechnique de clôture – 10 minutes', '2024-06-21', 'plans/nantes_musique_2024_v1.pdf', 6), + ( 'Inauguration Parc Strasbourg 2025', 'Parc de l Orangerie', 'Feux d\inauguration – 12 minutes', '2025-04-15', 'plans/strasbourg_inaug_2025_v1.pdf', 5), + ('Feux Casino Nice 2024', 'Promenade des Anglais', 'Show prestige casino – 18 minutes', '2024-11-01', 'plans/nice_casino_2024_v2.pdf', 9); + +-- ------------------------------------------------------- +-- 43. ShowStaffs +-- ------------------------------------------------------- +INSERT INTO ShowStaffs (StaffId, ShowId) VALUES + (1,1),(2,1),(5,1),(8,1),(7,1), + (1,2),(3,2),(6,2),(10,2), + (2,3),(4,3),(6,3),(8,3), + (1,4),(5,4),(7,4), + (2,5),(3,5),(9,5),(10,5), + (4,6),(7,6),(9,6), + (1,7),(6,7),(8,7), + (2,8),(5,8),(7,8); + +-- ------------------------------------------------------- +-- 44. ShowTrucks +-- ------------------------------------------------------- +INSERT INTO ShowTrucks (ShowId, TruckId) VALUES + (1,2),(1,4), + (2,1),(2,4), + (3,2),(3,5), + (4,1), + (5,2),(5,4), + (6,4),(6,5), + (7,1), + (8,2); + +-- ------------------------------------------------------- +-- 45. ShowMaterials +-- ------------------------------------------------------- +INSERT INTO ShowMaterials (ShowId, MaterialId) VALUES + (1,1),(1,2),(1,3),(1,6),(1,9),(1,10),(1,12), + (2,1),(2,2),(2,4),(2,6),(2,8),(2,12), + (3,1),(3,2),(3,5),(3,6),(3,9), + (4,1),(4,2),(4,6),(4,7),(4,11), + (5,1),(5,2),(5,3),(5,6),(5,9), + (6,1),(6,4),(6,6),(6,8), + (7,1),(7,2),(7,6),(7,7), + (8,1),(8,2),(8,6),(8,10); + +-- ------------------------------------------------------- +-- 46. Contracts (Show x ServiceProvider) +-- ------------------------------------------------------- +INSERT INTO Contracts (ShowId, ServiceProviderId, TermsAndConditions) VALUES + (1, 1, 'Prestation sono 4h – montage J-1 inclus – démo technique 13/07'), + (1, 4, 'Sécurité périmètre – 25 agents – 12h de présence'), + (2, 2, 'Sono scène + diffusion – installation J-1'), + (2, 3, 'Éclairage scénique 200 projecteurs LED'), + (3, 5, 'Sécurité renforcée port – zone pyro – 40 agents'), + (4, 1, 'Sono de prestige – régie son Versailles'), + (4, 3, 'Éclairage château – mapping vidéo inclus'), + (5, 2, 'Sono place de la Bourse – diffusion périmètre'), + (6, 7, 'Location groupe électrogène 100kVA'), + (7, 6, 'Transport matériel Strasbourg – 2 rotations'), + (8, 1, 'Sono promenade – diffusion linéaire'), + (8, 8, 'Équipe médicale de permanence – 4h'); + +-- ------------------------------------------------------- +-- 47. SoundTimecodes (Show x Sound) +-- ------------------------------------------------------- +INSERT INTO SoundTimecodes (ShowId, SoundId, Start, [End]) VALUES + (1, 1, 0.0, 900.0), + (1, 5, 900.0, 2100.0), + (1, 9, 2100.0, 2340.0), + (2, 3, 0.0, 480.0), + (2, 7, 480.0, 1440.0), + (2, 8, 1440.0, 1620.0), + (3, 2, 0.0, 210.0), + (3, 6, 210.0, 990.0), + (3, 9, 990.0, 1230.0), + (4, 10, 0.0, 600.0), + (4, 5, 600.0, 1500.0), + (4, 8, 1500.0, 1680.0), + (5, 7, 0.0, 960.0), + (5, 9, 960.0, 1200.0), + (8, 10, 0.0, 600.0), + (8, 5, 600.0, 1320.0), + (8, 9, 1320.0, 1560.0); + +-- ------------------------------------------------------- +-- 48. ProductTimecodes (Product x Show) +-- ------------------------------------------------------- +INSERT INTO ProductTimecodes (ProductId, ShowId, Start, [End]) VALUES +-- Paris 14 juillet +(3, 1, 0.0, 60.0), +(7, 1, 30.0, 300.0), +(2, 1, 300.0, 600.0), +(1, 1, 600.0, 1200.0), +(8, 1, 1200.0, 1800.0), +(4, 1, 1800.0, 2100.0), +(5, 1, 2100.0, 2200.0), +(6, 1, 2200.0, 2340.0), +-- Lyon festival +(7, 2, 0.0, 240.0), +(2, 2, 240.0, 600.0), +(1, 2, 600.0, 1000.0), +(9, 2, 1000.0, 1200.0), +-- Marseille +(3, 3, 0.0, 90.0), +(7, 3, 60.0, 360.0), +(4, 3, 360.0, 900.0), +(6, 3, 900.0, 1230.0), +-- Gala Versailles +(10,4, 0.0, 60.0), +(2, 4, 60.0, 300.0), +(1, 4, 300.0, 700.0), +(6, 4, 700.0, 900.0), +-- Bordeaux Sylvestre +(7, 5, 0.0, 300.0), +(1, 5, 300.0, 900.0), +(5, 5, 900.0, 1000.0), +(6, 5, 1000.0, 1200.0); + +-- ------------------------------------------------------- +-- 49. Users +-- ------------------------------------------------------- +INSERT INTO Users (Name, Password, Salt, Email, Fonction) VALUES + ('admin', '$2a$12$hashed_password_admin', 'salt_admin_abc123', 'admin@pyrofetes.fr', 'Administrateur système'), + ('jean.dupuis', '$2a$12$hashed_password_jd', 'salt_jd_xyz789', 'j.dupuis@pyrofetes.fr', 'Directeur commercial'), + ('sophie.martin', '$2a$12$hashed_password_sm', 'salt_sm_qrs456', 's.martin@pyrofetes.fr', 'Responsable production'), + ('marc.leroy', '$2a$12$hashed_password_ml', 'salt_ml_tuv321', 'm.leroy@pyrofetes.fr', 'Gestionnaire stock'), + ( 'alice.henry', '$2a$12$hashed_password_ah', 'salt_ah_wxy654', 'a.henry@pyrofetes.fr', 'Chargée de projets'); \ No newline at end of file diff --git a/PyroFetes/docker-compose.yml b/PyroFetes/docker-compose.yml new file mode 100644 index 0000000..b486e83 --- /dev/null +++ b/PyroFetes/docker-compose.yml @@ -0,0 +1,33 @@ +name: 'pyrofetes-api' + +services: + sqlserver: + image: mcr.microsoft.com/mssql/server:2022-latest + container_name: ${COMPOSE_PROJECT_NAME}-sqlserver + ports: + - 127.0.0.1:1433:1433 + volumes: + - type: volume + source: sqlserver-volume + target: /var/opt/mssql + environment: + ACCEPT_EULA: "Y" + MSSQL_SA_PASSWORD: ${SA_PASSWORD} + MSSQL_PID: "Developer" + healthcheck: + test: ["CMD", "/opt/mssql-tools18/bin/sqlcmd", "-S", "localhost", "-U", "sa", "-P", "${SA_PASSWORD}", "-Q", "SELECT 1", "-No"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 30s + networks: + - network + +networks: + network: + name: ${COMPOSE_PROJECT_NAME}-network + driver: bridge + +volumes: + sqlserver-volume: + driver: local